From: dick Date: Fri, 5 Jul 1991 11:33:49 +0000 (+0000) Subject: compatibility change in l_class.h for prototypes in ANSI C X-Git-Tag: release-5-5~1084 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a0460b8bfc16bca78ce657e79325fde432c7c88e;p=ack.git compatibility change in l_class.h for prototypes in ANSI C --- diff --git a/lang/cem/cemcom/l_class.h b/lang/cem/cemcom/l_class.h index 2a77e546f..ff91f3bfd 100644 --- a/lang/cem/cemcom/l_class.h +++ b/lang/cem/cemcom/l_class.h @@ -8,14 +8,25 @@ #define LFDF 'a' /* Library Function Definition */ #define LVDF 'b' /* Library Variable Definition */ -#define EFDF 'c' /* External Function Definition */ -#define EVDF 'd' /* External Variable Definition */ -#define EFDC 'e' /* External Function Declaration */ -#define EVDC 'f' /* External Variable Declaration */ -#define IFDC 'g' /* Implicit Function Declaration */ -#define SFDF 'h' /* Static Function Definition */ -#define SVDF 'i' /* Static Variable Definition */ -#define FC 'j' /* Function Call */ -#define VU 'k' /* Variable Usage */ -#define XXDF 'l' /* Ignore Class */ + +#define PFDF 'd' /* Prototype Function Definition */ + +#define EFDF 'f' /* External Function Definition */ +#define EVDF 'g' /* External Variable Definition */ +#define EFDC 'h' /* External Function Declaration */ +#define EVDC 'i' /* External Variable Declaration */ + +#define IFDC 'm' /* Implicit Function Declaration */ + +#define SFDF 'q' /* Static Function Definition */ +#define SVDF 'r' /* Static Variable Definition */ + +#define FC 'u' /* Function Call */ +#define VU 'v' /* Variable Usage */ + +#define XXDF 'z' /* Ignore Class */ + +/* Two meta-definitions */ +#define MIN_CLASS_CONST LFDF +#define MAX_CLASS_CONST XXDF diff --git a/lang/cem/cemcom/l_em.h b/lang/cem/cemcom/l_em.h index c8bbb4c1e..02e7a3490 100644 --- a/lang/cem/cemcom/l_em.h +++ b/lang/cem/cemcom/l_em.h @@ -28,6 +28,7 @@ #define C_lin(c) #define C_loi(c) #define C_lol(c) +#define C_ret(c) #define C_sdl(c) #define C_sti(c) #define C_stl(c) diff --git a/lang/cem/cemcom/l_misc.c b/lang/cem/cemcom/l_misc.c index d0213ca1b..51e52c292 100644 --- a/lang/cem/cemcom/l_misc.c +++ b/lang/cem/cemcom/l_misc.c @@ -364,6 +364,10 @@ lint_ptr_conv(from, to) break; } + if (from == VOID) { + /* OK any which way */ + } + else if (from == CHAR) { hwarning("pointer to char may not align correctly for a %s", symbol2str(to)); diff --git a/lang/cem/cemcom/l_outdef.c b/lang/cem/cemcom/l_outdef.c index fd3a31aef..576ef9978 100644 --- a/lang/cem/cemcom/l_outdef.c +++ b/lang/cem/cemcom/l_outdef.c @@ -50,7 +50,7 @@ PRIVATE outargs(); PRIVATE outarg(); PRIVATE outargstring(); PRIVATE outargtype(); -PRIVATE fill_arg(); +PRIVATE add_expr_arg(); lint_declare_idf(idf, sc) struct idf *idf; @@ -159,7 +159,7 @@ local_EFDC(idf) lint_formals() { -/* Make a list of tp_entries containing the types of the formal +/* Make a list of 'struct argument's containing the types of the formal * parameters of the function definition just parsed. */ register struct stack_entry *se = stack_level_of(L_FORMAL1)->sl_entry; @@ -286,7 +286,7 @@ PRIVATE output_def(od) struct outdef *od; { -/* As the types are output the tp_entries are removed, because they +/* As the types are output the 'struct argument's are removed, because they * are then not needed anymore. */ if (od->od_class == XXDF || !od->od_name || od->od_name[0] == '#') @@ -301,7 +301,7 @@ output_def(od) od->od_class = LVDF; break; case SFDF: - /* remove tp_entries */ + /* remove 'struct argument's */ while (od->od_arg) { register struct argument *tmp = od->od_arg; od->od_arg = od->od_arg->next; @@ -526,19 +526,20 @@ fill_outcall(ex, used) OutCall.od_arg = (struct argument *)0; OutCall.od_nrargs = 0; - if ((ex = ex->OP_RIGHT) != 0) { /* function call with arguments */ - /* store types of argument expressions in tp_entries */ + if ((ex = ex->OP_RIGHT) != 0) { + /* function call with arguments */ + /* store types of argument expressions in 'struct argument's */ while (ex->ex_class == Oper && ex->OP_OPER == PARCOMMA) { - fill_arg(ex->OP_RIGHT); + add_expr_arg(ex->OP_RIGHT); ex = ex->OP_LEFT; } - fill_arg(ex); + add_expr_arg(ex); } OutCall.od_valused = used; /* USED, IGNORED or VOIDED */ } PRIVATE -fill_arg(e) +add_expr_arg(e) struct expr *e; { register struct argument *arg; diff --git a/lang/cem/cemcom/l_outdef.str b/lang/cem/cemcom/l_outdef.str index 541fbcd68..01a006c77 100644 --- a/lang/cem/cemcom/l_outdef.str +++ b/lang/cem/cemcom/l_outdef.str @@ -10,6 +10,7 @@ #define ArgExpr 1 /* actual */ #define ArgConst 2 /* integer constant */ #define ArgString 3 /* string */ +#define ArgEllipsis 4 /* ellipsis */ struct argument { struct argument *next;