From dad0549f2e7387076a03f37f67ac31ef362837cb Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Fri, 15 Jan 2021 16:07:51 +0000 Subject: [PATCH] box-drawing: use enum constants in draw_sextant() instead of #define Both are functionally equivalent here, but the former is also properly scoped, can be naturally indented and has a less repetitive syntax. --- box-drawing.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/box-drawing.c b/box-drawing.c index d0ae454d..f10d267b 100644 --- a/box-drawing.c +++ b/box-drawing.c @@ -1765,12 +1765,14 @@ draw_sextant(wchar_t wc, struct buf *buf) * 4 middle right * 5 lower right */ -#define UPPER_LEFT (1 << 0) -#define MIDDLE_LEFT (1 << 1) -#define LOWER_LEFT (1 << 2) -#define UPPER_RIGHT (1 << 3) -#define MIDDLE_RIGHT (1 << 4) -#define LOWER_RIGHT (1 << 5) + enum { + UPPER_LEFT = 1 << 0, + MIDDLE_LEFT = 1 << 1, + LOWER_LEFT = 1 << 2, + UPPER_RIGHT = 1 << 3, + MIDDLE_RIGHT = 1 << 4, + LOWER_RIGHT = 1 << 5, + }; static const uint8_t matrix[60] = { /* U+1fb00 - U+1fb0f */