[hackers] [scc] [cc1] Add symbolic constants for dodcl() || Roberto E. Vargas Caballero
commit 9c48f641a47824a9759e93675d4e2e3c60786758
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Dec 14 14:56:44 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Dec 15 13:38:40 2016 +0100
[cc1] Add symbolic constants for dodcl()
Dodcl() has 4 parameters, and having a 0 or 1 in the first was
not clear at all. These new constants add a bit of information
about the proposal of the parameter.
diff --git a/cc1/decl.c b/cc1/decl.c
index b4930c1..960325e 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -12,6 +12,10 @@ static char sccsid[] = "@(#) ./cc1/decl.c";
#define NOSCLASS 0
+#define NOREP 0
+#define REP 1
+
+
struct declarators {
unsigned char nr;
struct declarator {
_AT_@ -257,7 +261,7 @@ ansifun(Type *tp, Type *types[], Symbol *syms[], int *ntypes, int *nsyms)
*types++ = ellipsistype;
break;
}
- if ((sym = dodcl(0, parameter, NS_IDEN, tp)) == NULL)
+ if ((sym = dodcl(NOREP, parameter, NS_IDEN, tp)) == NULL)
continue;
if (tp->n.elem == -1) {
n = -1;
_AT_@ -856,7 +860,7 @@ decl(void)
if (accept(';'))
return;
- sym = dodcl(1, identifier, NS_IDEN, NULL);
+ sym = dodcl(REP, identifier, NS_IDEN, NULL);
if (sym->type->op != FTN) {
expect(';');
_AT_@ -886,7 +890,7 @@ decl(void)
}
if (sym->type->prop & TK_R) {
while (yytoken != '{') {
- par = dodcl(1, parameter, NS_IDEN, sym->type);
+ par = dodcl(REP, parameter, NS_IDEN, sym->type);
expect(';');
}
}
_AT_@ -913,12 +917,12 @@ static void
fieldlist(Type *tp)
{
if (yytoken != ';')
- dodcl(1, field, tp->ns, tp);
+ dodcl(REP, field, tp->ns, tp);
expect(';');
}
Type *
typename(void)
{
- return dodcl(0, type, 0, NULL)->type;
+ return dodcl(NOREP, type, 0, NULL)->type;
}
Received on Thu Dec 15 2016 - 13:39:08 CET
This archive was generated by hypermail 2.3.0
: Thu Dec 15 2016 - 13:48:17 CET