commit c6519ffd66ea5c6acff1ea890be6cf6adc53a8b3
parent 99fc143b4b307573d7262f75757828e79e7bf508
Author: Drew DeVault <sir@cmpwn.com>
Date: Wed, 20 Jan 2021 16:39:13 -0500
enum decl_type: style
Diffstat:
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/include/check.h b/include/check.h
@@ -37,10 +37,10 @@ struct global_decl {
};
enum declaration_type {
+ DECL_CONSTANT,
DECL_FUNC,
- DECL_TYPE,
DECL_GLOBAL,
- DECL_CONSTANT,
+ DECL_TYPE,
};
struct declaration {
diff --git a/src/gen.c b/src/gen.c
@@ -1912,6 +1912,9 @@ static void
gen_decl(struct gen_context *ctx, const struct declaration *decl)
{
switch (decl->type) {
+ case DECL_CONSTANT:
+ // Nothing to do
+ break;
case DECL_FUNC:
gen_function_decl(ctx, decl);
break;
@@ -1919,7 +1922,6 @@ gen_decl(struct gen_context *ctx, const struct declaration *decl)
gen_global_decl(ctx, decl);
break;
case DECL_TYPE:
- case DECL_CONSTANT:
// Nothing to do
break;
}
diff --git a/src/typedef.c b/src/typedef.c
@@ -108,17 +108,17 @@ emit_typedefs(struct unit *unit, FILE *out)
}
switch (decl->type) {
+ case DECL_CONSTANT:
+ assert(0); // TODO
case DECL_FUNC:
emit_func(decl, out);
break;
- case DECL_TYPE:
- emit_type_decl(decl, out);
- break;
case DECL_GLOBAL:
emit_global(decl, out);
break;
- case DECL_CONSTANT:
- assert(0); // TODO
+ case DECL_TYPE:
+ emit_type_decl(decl, out);
+ break;
}
}
}