X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=warning.h;h=1d3acf8b7237829487778b0333fbd416f4bf2431;hb=e628f683385763274b551d468107872a058b31d7;hp=68ba6dd8c03140e0e85401129c2581bfcf19d7dc;hpb=bb8544d38aaa4c716603a5d565c3ff3840454ffc;p=cparser diff --git a/warning.h b/warning.h index 68ba6dd..1d3acf8 100644 --- a/warning.h +++ b/warning.h @@ -114,14 +114,15 @@ typedef enum warning_t { WARN_WRITE_STRINGS, /**< Give string constants the type 'const char[LENGTH]' so that copying the address of one into a 'char *' pointer will get a warning */ } warning_t; -typedef enum warn_level_t { - WARN_LEVEL_OFF, - WARN_LEVEL_ON, - WARN_LEVEL_ERROR -} warn_level_t; +typedef enum warn_state_t { + WARN_STATE_NONE = 0, + WARN_STATE_ON = 1U << 0, + WARN_STATE_ERROR = 1U << 1, + WARN_STATE_NO_ERROR = 1U << 2 +} warn_state_t; typedef struct warning_switch_t { - warn_level_t level; + warn_state_t state; char const* const name; } warning_switch_t; @@ -129,7 +130,7 @@ warning_switch_t const *get_warn_switch(warning_t); static inline bool is_warn_on(warning_t const warn) { - return get_warn_switch(warn)->level != WARN_LEVEL_OFF; + return get_warn_switch(warn)->state & WARN_STATE_ON; } #endif