aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2024-04-07 05:14:47 -0700
committerMichael Forney <mforney@mforney.org>2024-04-07 13:29:14 -0700
commitbf28b11e50f287f1b32c4828b0ea1b5d9b9fd0e2 (patch)
tree2767dce29f7f9cc7c518769511acc5b0f9e8f08a
parenta4a041b34cf96421a52fca155f65701beab926b4 (diff)
eval: Use enum instead of define for float/signed flags
-rw-r--r--eval.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/eval.c b/eval.c
index 8de1316..3e83085 100644
--- a/eval.c
+++ b/eval.c
@@ -4,8 +4,11 @@
#include "util.h"
#include "cc.h"
-#define F (1<<8)
-#define S (2<<8)
+enum {
+ F = 1<<8,
+ S = 2<<8
+};
+
static void
cast(struct expr *expr)
{
@@ -96,8 +99,6 @@ binary(struct expr *expr, enum tokenkind op, struct expr *l, struct expr *r)
}
cast(expr);
}
-#undef F
-#undef S
struct expr *
eval(struct expr *expr)