diff options
| author | Craig Barnes <craigbarnes@protonmail.com> | 2021-01-15 16:07:51 +0000 |
|---|---|---|
| committer | Craig Barnes <craigbarnes@protonmail.com> | 2021-01-15 16:07:51 +0000 |
| commit | dad0549f2e7387076a03f37f67ac31ef362837cb (patch) | |
| tree | 65eea695b5e740d9bb3eeee90bc02c9947705406 | |
| parent | Merge branch 'xsnprintf' (diff) | |
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.
| -rw-r--r-- | box-drawing.c | 14 |
1 files 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 */ |
