From f9fbcdde7b203493bcd9948783b0eef7ffbe9645 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sun, 9 Aug 2015 20:31:00 +0100 Subject: [PATCH] Use 32 bits insted of 8 for warning status. Warning status can be in fact represented with only 2 bits, but since it's engaged in arithmetic operations it gets promoted and special precautions are needed. Much easier to ure 32 bits: warnings are nowhere near performance/memory bottleneck. --- re2c/src/conf/warn.cc | 6 +++--- re2c/src/conf/warn.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/re2c/src/conf/warn.cc b/re2c/src/conf/warn.cc index 88e5896a..f7345698 100644 --- a/re2c/src/conf/warn.cc +++ b/re2c/src/conf/warn.cc @@ -9,9 +9,9 @@ namespace re2c { Warn warn; -const uint8_t Warn::SILENT = 0; -const uint8_t Warn::WARNING = 1u << 0; -const uint8_t Warn::ERROR = 1u << 1; +const uint32_t Warn::SILENT = 0; +const uint32_t Warn::WARNING = 1u << 0; +const uint32_t Warn::ERROR = 1u << 1; const char * Warn::names [TYPES] = { diff --git a/re2c/src/conf/warn.h b/re2c/src/conf/warn.h index 7d819b13..8e97d8cb 100644 --- a/re2c/src/conf/warn.h +++ b/re2c/src/conf/warn.h @@ -31,11 +31,11 @@ public: }; private: - static const uint8_t SILENT; - static const uint8_t WARNING; - static const uint8_t ERROR; + static const uint32_t SILENT; + static const uint32_t WARNING; + static const uint32_t ERROR; static const char * names [TYPES]; - uint8_t mask[TYPES]; + uint32_t mask[TYPES]; bool error_accuml; public: -- 2.40.0