diff options
author | June McEnroe <june@causal.agency> | 2018-04-09 01:00:54 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2018-04-09 01:00:54 -0400 |
commit | 99e3c574a02fdb779e97186119891fbe46390d72 (patch) | |
tree | 639e659dd91b6e9259f55f59ca91d6bf9ae46e12 /help.c | |
parent | Link against ncurses (diff) | |
download | torus-99e3c574a02fdb779e97186119891fbe46390d72.tar.gz torus-99e3c574a02fdb779e97186119891fbe46390d72.zip |
Replace #define with enum or const where possible
Diffstat (limited to '')
-rw-r--r-- | help.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/help.c b/help.c index 4415065..d997bde 100644 --- a/help.c +++ b/help.c @@ -46,16 +46,18 @@ static void clientPut(uint8_t color, char cell) { clientMessage(msg); } -#define DELAY (50000) - -#define R (COLOR_RED) -#define G (COLOR_GREEN) -#define Y (COLOR_YELLOW) -#define B (COLOR_BLUE) -#define M (COLOR_MAGENTA) -#define C (COLOR_CYAN) -#define W (COLOR_WHITE) -#define I (COLOR_BRIGHT | COLOR_WHITE) +static const useconds_t DELAY = 50000; + +enum { + R = COLOR_RED, + G = COLOR_GREEN, + Y = COLOR_YELLOW, + B = COLOR_BLUE, + M = COLOR_MAGENTA, + C = COLOR_CYAN, + W = COLOR_WHITE, + I = COLOR_BRIGHT | COLOR_WHITE, +}; static void h(void) { clientMove(-1, 0); usleep(DELAY); } static void j(void) { clientMove( 0, 1); usleep(DELAY); } |