summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-04-09 00:41:52 -0400
committerJune McEnroe <june@causal.agency>2018-04-09 00:41:52 -0400
commite3187c579eb69335ed42c7cd7ec30000e0dc3fe1 (patch)
treeff89477fde29bbc276f9e8b920f1d6f356ac6559 /bin
parentstatic_assert PNG header size in pngo and glitch (diff)
downloadsrc-e3187c579eb69335ed42c7cd7ec30000e0dc3fe1.tar.gz
src-e3187c579eb69335ed42c7cd7ec30000e0dc3fe1.zip
Use enum instead of #define for some constants
Diffstat (limited to 'bin')
-rw-r--r--bin/glitch.c2
-rw-r--r--bin/klon.c12
-rw-r--r--bin/pngo.c2
3 files changed, 9 insertions, 7 deletions
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;
r 15June McEnroe 2024-09-24Add photos from September 14June McEnroe 2024-09-24Add photos from September 12June McEnroe 2024-09-24Add photos from September 7June McEnroe 2024-09-24Allow not having descriptionsJune McEnroe I'm sorry, I can't keep writing descriptions. It makes posting photos take too long, I often don't know the words for what I'm looking at, and a good description is an entirely different work of art than the photo I took, and I'm just a photographer. It's visual art. 2024-09-23Automatically select the last used lens for a bodyJune McEnroe 2024-09-19Add photos from September 5June McEnroe Had to prefix the folder number onto these file names manually because they must have come out of a different scanner or something. 2024-09-15Add some more film stocks to the listJune McEnroe 2024-09-13Add photos from September 2June McEnroe 2024-09-13Add Fomapan 200 to films listJune McEnroe 2024-09-10Add August 29 picnic photosJune McEnroe 2024-09-08Apply some bold to trips renderingJune McEnroe This seems easier to visually scan. The only other thing I'd like is a nicer date rendering but JavaScript is useless for that. 2024-09-08Render trips hopefully more efficientlyJune McEnroe 2024-09-08Allow removing bodies and lensesJune McEnroe 2024-09-08Limit body width so it looks less silly on desktopJune McEnroe 2024-09-07Handle no film being loadedJune McEnroe 2024-09-07Fancy up the text a littleJune McEnroe