From 240dd55fd9496bcb4da9f9d09bd573cab695c3f3 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 8 Jul 1991 16:49:04 +0000 Subject: [PATCH] Removed the id_enum macro and replaced id_struct by id_tag (better name) --- lang/cem/cemcom.ansi/declar.g | 8 ++++---- lang/cem/cemcom.ansi/dumpidf.c | 11 ++--------- lang/cem/cemcom.ansi/idf.str | 5 ++--- lang/cem/cemcom.ansi/proto.c | 4 ++-- lang/cem/cemcom.ansi/stack.c | 4 ++-- lang/cem/cemcom.ansi/struct.c | 6 +++--- 6 files changed, 15 insertions(+), 23 deletions(-) diff --git a/lang/cem/cemcom.ansi/declar.g b/lang/cem/cemcom.ansi/declar.g index 4a2281424..61065fb71 100644 --- a/lang/cem/cemcom.ansi/declar.g +++ b/lang/cem/cemcom.ansi/declar.g @@ -379,7 +379,7 @@ enum_specifier(register struct type **tpp;) { #ifdef DBSYMTAB if (options['g']) { - stb_tag(idf->id_enum, idf->id_text); + stb_tag(idf->id_tag, idf->id_text); } #endif /*DBSYMTAB */ } @@ -446,14 +446,14 @@ struct_or_union_specifier(register struct type **tpp;) [ { declare_struct(fund, idf, tpp); - (idf->id_struct->tg_busy)++; + (idf->id_tag->tg_busy)++; } struct_declaration_pack(*tpp) { - (idf->id_struct->tg_busy)--; + (idf->id_tag->tg_busy)--; #ifdef DBSYMTAB if (options['g']) { - stb_tag(idf->id_struct, idf->id_text); + stb_tag(idf->id_tag, idf->id_text); } #endif /*DBSYMTAB */ } diff --git a/lang/cem/cemcom.ansi/dumpidf.c b/lang/cem/cemcom.ansi/dumpidf.c index e929b97db..7f6658341 100644 --- a/lang/cem/cemcom.ansi/dumpidf.c +++ b/lang/cem/cemcom.ansi/dumpidf.c @@ -138,19 +138,12 @@ dumpidf(idf, opt) } dumpsdefs(idf->id_sdef, selector); } - if (idf->id_struct) { + if (idf->id_tag) { if (!started++) { newline(); print("%s:", idf->id_text); } - dumptags(idf->id_struct); - } - if (idf->id_enum) { - if (!started++) { - newline(); - print("%s:", idf->id_text); - } - dumptags(idf->id_enum); + dumptags(idf->id_tag); } } diff --git a/lang/cem/cemcom.ansi/idf.str b/lang/cem/cemcom.ansi/idf.str index 9f77001d6..f9e2ad254 100644 --- a/lang/cem/cemcom.ansi/idf.str +++ b/lang/cem/cemcom.ansi/idf.str @@ -18,7 +18,7 @@ struct id_u { struct def *idd_label; /* labels */ struct def *idd_def; /* variables, typedefs, enum-constants */ struct sdef *idd_sdef; /* selector tags */ - struct tag *idd_struct; /* struct and union tags */ + struct tag *idd_tag; /* struct, union, and enum tags */ int idd_special; /* special action needed at occurrence */ }; @@ -31,8 +31,7 @@ struct id_u { #define id_label id_user.idd_label #define id_def id_user.idd_def #define id_sdef id_user.idd_sdef -#define id_struct id_user.idd_struct -#define id_enum id_user.idd_struct +#define id_tag id_user.idd_tag #define id_special id_user.idd_special #include diff --git a/lang/cem/cemcom.ansi/proto.c b/lang/cem/cemcom.ansi/proto.c index 81e7fce20..768e5d343 100644 --- a/lang/cem/cemcom.ansi/proto.c +++ b/lang/cem/cemcom.ansi/proto.c @@ -183,7 +183,7 @@ struct idf **idpp; switch(tp->tp_fund) { case ENUM: case UNION: - case STRUCT: tg = tp->tp_idf->id_struct; break; + case STRUCT: tg = tp->tp_idf->id_tag; break; } return tg; } @@ -333,7 +333,7 @@ struct type *tp; switch (tp->tp_fund) { case ENUM: case STRUCT: - case UNION: tgpp = &(ident->id_struct); break; + case UNION: tgpp = &(ident->id_tag); break; default: return; } diff --git a/lang/cem/cemcom.ansi/stack.c b/lang/cem/cemcom.ansi/stack.c index a9bcc6284..5e6433dd2 100644 --- a/lang/cem/cemcom.ansi/stack.c +++ b/lang/cem/cemcom.ansi/stack.c @@ -150,11 +150,11 @@ unstack_level() idf->id_sdef = sdef->next; free_sdef(sdef); } - while ( (tag = idf->id_struct) + while ( (tag = idf->id_tag) && tag->tg_level >= level ) { /* unlink it from the struct list under the idf block */ - idf->id_struct = tag->next; + idf->id_tag = tag->next; free_tag(tag); } } diff --git a/lang/cem/cemcom.ansi/struct.c b/lang/cem/cemcom.ansi/struct.c index dc01bcd50..ebac4e40d 100644 --- a/lang/cem/cemcom.ansi/struct.c +++ b/lang/cem/cemcom.ansi/struct.c @@ -72,7 +72,7 @@ add_sel(stp, tp, idf, sdefpp, szp, fd) /* this is horrible */ extern arith add_field(); #endif NOBITFIELD - struct tag *tg = stp->tp_idf->id_struct; /* or union */ + struct tag *tg = stp->tp_idf->id_tag; /* or union */ struct sdef *sdef = idf->id_sdef; register struct sdef *newsdef; int lvl = tg->tg_level; @@ -183,7 +183,7 @@ declare_struct(fund, idf, tpp) if (*tpp) error("multiple types in declaration"); if (!idf) idf = gen_idf(); - tgp = &idf->id_struct; + tgp = &idf->id_tag; tg = *tgp; if (tg && tg->tg_type->tp_size < 0 @@ -243,7 +243,7 @@ apply_struct(fund, idf, tpp) */ register struct tag **tgp; - tgp = &idf->id_struct; + tgp = &idf->id_tag; if (*tgp) *tpp = (*tgp)->tg_type; -- 2.34.1