summaryrefslogtreecommitdiff
path: root/cgen.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-01-11 12:51:25 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-01-11 12:51:25 -0500
commit44166ec379d325982ebb3f116e56df89dc8aefb4 (patch)
tree57dea613e1a5146da57247df8c5ffbe5c783647f /cgen.c
parentd85514452aeb9c8d322ad2b82366ca910d96ba19 (diff)
changed the way struct names work
Diffstat (limited to 'cgen.c')
-rw-r--r--cgen.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/cgen.c b/cgen.c
index e2fc85c..941f988 100644
--- a/cgen.c
+++ b/cgen.c
@@ -153,32 +153,32 @@ static bool cgen_defs_decl(CGenerator *g, Declaration *d);
}
-#define cgen_recurse_subtypes(f, g, type, extra) \
+#define cgen_recurse_subtypes(f, g, type) \
switch (type->kind) { \
case TYPE_STRUCT: \
/* don't descend into fields */ \
break; \
case TYPE_FN: \
arr_foreach(type->fn.types, Type, sub) { \
- if (!f(g, sub, extra)) \
+ if (!f(g, sub)) \
return false; \
} \
break; \
case TYPE_TUPLE: \
arr_foreach(type->tuple, Type, sub) \
- if (!f(g, sub, extra)) \
+ if (!f(g, sub)) \
return false; \
break; \
case TYPE_ARR: \
- if (!f(g, type->arr.of, extra)) \
+ if (!f(g, type->arr.of)) \
return false; \
break; \
case TYPE_SLICE: \
- if (!f(g, type->slice, extra)) \
+ if (!f(g, type->slice)) \
return false; \
break; \
case TYPE_PTR: \
- if (!f(g, type->ptr, extra)) \
+ if (!f(g, type->ptr)) \
return false; \
break; \
case TYPE_VOID: \
@@ -356,8 +356,8 @@ static bool cgen_type_pre(CGenerator *g, Type *t, Location where) {
return false;
case TYPE_STRUCT:
cgen_write(g, "struct ");
- if (t->struc->c.name) {
- cgen_ident(g, t->struc->c.name);
+ if (t->struc->name) {
+ cgen_ident(g, t->struc->name);
} else if (t->struc->c.id) {
cgen_ident_id(g, t->struc->c.id);
} else {