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 | b2ad77d0be34b7cbfd5dd9dcc55c3c93811edbc6 (patch) | |
tree | 348179099ee109c1bedc0e4f7b40eb06e5306dfa /help.c | |
parent | Link against ncurses (diff) | |
download | torus-b2ad77d0be34b7cbfd5dd9dcc55c3c93811edbc6.tar.gz torus-b2ad77d0be34b7cbfd5dd9dcc55c3c93811edbc6.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 43a03bc..f82cd5d 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); } |