From e3187c579eb69335ed42c7cd7ec30000e0dc3fe1 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Mon, 9 Apr 2018 00:41:52 -0400 Subject: Use enum instead of #define for some constants --- bin/glitch.c | 2 +- bin/klon.c | 12 +++++++----- bin/pngo.c | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/glitch.c b/bin/glitch.c index 3a3bfde5..98be3b82 100644 --- a/bin/glitch.c +++ b/bin/glitch.c @@ -261,8 +261,8 @@ enum PACKED Filter { UP, AVERAGE, PAETH, + FILTER_COUNT, }; -#define FILTER_COUNT (PAETH + 1) static struct { bool brokenPaeth; diff --git a/bin/klon.c b/bin/klon.c index 40469290..9d82d88c 100644 --- a/bin/klon.c +++ b/bin/klon.c @@ -25,11 +25,13 @@ typedef uint8_t Card; -#define MASK_RANK (0x0F) -#define MASK_SUIT (0x30) -#define MASK_COLOR (0x10) -#define MASK_UP (0x40) -#define MASK_SELECT (0x80) +enum { + MASK_RANK = 0x0F, + MASK_SUIT = 0x30, + MASK_COLOR = 0x10, + MASK_UP = 0x40, + MASK_SELECT = 0x80, +}; enum { SUIT_CLUB = 0x00, diff --git a/bin/pngo.c b/bin/pngo.c index eada7e01..286c7e4a 100644 --- a/bin/pngo.c +++ b/bin/pngo.c @@ -358,8 +358,8 @@ enum PACKED Filter { UP, AVERAGE, PAETH, + FILTER_COUNT, }; -#define FILTER_COUNT (PAETH + 1) struct Bytes { uint8_t x; -- cgit 1.4.1