]> granicus.if.org Git - re2c/commitdiff
Use 32 bits insted of 8 for warning status.
authorUlya Trofimovich <skvadrik@gmail.com>
Sun, 9 Aug 2015 19:31:00 +0000 (20:31 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Sun, 9 Aug 2015 19:31:00 +0000 (20:31 +0100)
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
re2c/src/conf/warn.h

index 88e5896aa1cd456761be4fc6428ec936821d2664..f73456983fad891b834f5f513f1e74dbbef4f4ea 100644 (file)
@@ -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] =
 {
index 7d819b1356ab1c9c19f41fdaf4b4ed34b62d0e45..8e97d8cb3dfddef173f0b5c8fa11fa4ac48a18f0 100644 (file)
@@ -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: