From ddb6eee18dc85da452bf796da11af2b2d161c2ce Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 16 Jul 2014 22:12:20 +0100 Subject: [PATCH] Use constants for flags --- src/ui/window.c | 8 ++++---- src/ui/window.h | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui/window.c b/src/ui/window.c index 2d88fcec..23d701ae 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -376,18 +376,18 @@ win_print(ProfWin *window, const char show_char, const char * const date_fmt, int offset = 0; int colour = COLOUR_ME; - if ((flags & 2) == 0) { + if ((flags & NO_DATE) == 0) { wattron(window->win, COLOUR_TIME); wprintw(window->win, "%s %c ", date_fmt, show_char); wattroff(window->win, COLOUR_TIME); } if (strlen(from) > 0) { - if ((flags & 1) != 0) { + if ((flags & NO_ME) != 0) { colour = COLOUR_THEM; } - if((flags & 8) != 0) { + if ((flags & NO_COLOUR_FROM) != 0) { colour = 0; } @@ -404,7 +404,7 @@ win_print(ProfWin *window, const char show_char, const char * const date_fmt, wattron(window->win, attrs); - if ((flags & 4) == 0) { + if ((flags & NO_EOL) == 0) { wprintw(window->win, "%s\n", message+offset); } else { wprintw(window->win, "%s", message+offset); diff --git a/src/ui/window.h b/src/ui/window.h index f3e26495..0694dee5 100644 --- a/src/ui/window.h +++ b/src/ui/window.h @@ -35,8 +35,10 @@ #include "ui/buffer.h" #define NO_ME 1 -#define NO_EOL 4 #define NO_DATE 2 +#define NO_EOL 4 +#define NO_COLOUR_FROM 8 + #define NO_EOL_DATE 6 #define PAD_SIZE 1000