diff options
author | James Booth <boothj5@gmail.com> | 2014-07-16 22:12:20 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-07-16 22:12:20 +0100 |
commit | ddb6eee18dc85da452bf796da11af2b2d161c2ce (patch) | |
tree | ef474717a284a81911a889502223b797450bb94d | |
parent | 2cbe7e4ccbd1e4fdf55724a8308963596afcd6df (diff) | |
download | profani-tty-ddb6eee18dc85da452bf796da11af2b2d161c2ce.tar.gz |
Use constants for flags
-rw-r--r-- | src/ui/window.c | 8 | ||||
-rw-r--r-- | 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 |