From: Ulya Trofimovich Date: Sun, 9 Aug 2015 19:31:00 +0000 (+0100) Subject: Use 32 bits insted of 8 for warning status. X-Git-Tag: 0.15~150 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f9fbcdde7b203493bcd9948783b0eef7ffbe9645;p=re2c 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. --- 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: