Check against MARKUP_NULL when checking if markup is set

Setting markup_mode to -1 might not work since in some implementations
enum might not be signed. For convenience, add a new enum value
`MARKUP_NULL` to serve the same purpose.
This commit is contained in:
Nikos Tsipinakis 2017-02-05 11:45:21 +02:00
parent 51d5e57967
commit 4d55ccb0ee
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ void rule_apply(rule_t * r, notification * n)
n->timeout = r->timeout; n->timeout = r->timeout;
if (r->urgency != -1) if (r->urgency != -1)
n->urgency = r->urgency; n->urgency = r->urgency;
if (r->markup != -1) if (r->markup != MARKUP_NULL)
n->markup = r->markup; n->markup = r->markup;
if (r->new_icon) { if (r->new_icon) {
if(n->icon) if(n->icon)
@ -59,7 +59,7 @@ void rule_init(rule_t * r)
r->msg_urgency = -1; r->msg_urgency = -1;
r->timeout = -1; r->timeout = -1;
r->urgency = -1; r->urgency = -1;
r->markup = -1; r->markup = MARKUP_NULL;
r->new_icon = NULL; r->new_icon = NULL;
r->fg = NULL; r->fg = NULL;
r->bg = NULL; r->bg = NULL;

View File

@ -6,7 +6,7 @@ enum alignment { left, center, right };
enum icon_position_t { icons_left, icons_right, icons_off }; enum icon_position_t { icons_left, icons_right, icons_off };
enum separator_color { FOREGROUND, AUTO, FRAME, CUSTOM }; enum separator_color { FOREGROUND, AUTO, FRAME, CUSTOM };
enum follow_mode { FOLLOW_NONE, FOLLOW_MOUSE, FOLLOW_KEYBOARD }; enum follow_mode { FOLLOW_NONE, FOLLOW_MOUSE, FOLLOW_KEYBOARD };
enum markup_mode { MARKUP_NO, MARKUP_STRIP, MARKUP_FULL }; enum markup_mode { MARKUP_NULL, MARKUP_NO, MARKUP_STRIP, MARKUP_FULL };
typedef struct _settings { typedef struct _settings {
bool print_notifications; bool print_notifications;