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.
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] =
{
};
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: