diff options
author | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-10-04 01:21:34 +0000 |
---|---|---|
committer | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-10-04 01:21:34 +0000 |
commit | 45d6a88841f0db650d615522b1f6594ea72ceb7e (patch) | |
tree | dec4fac8ff8638b6a0d8749d52e66d0207eb161b /lcc/src/decl.c | |
parent | 6d9be1722b2221cae39b389ce218e93d73d99335 (diff) | |
download | ioquake3-aero-45d6a88841f0db650d615522b1f6594ea72ceb7e.tar.gz ioquake3-aero-45d6a88841f0db650d615522b1f6594ea72ceb7e.zip |
* Dewarninged the lcc and q3asm source
* Removed traditional target platforms from the lcc build. This might break
building lcc on Windows using nmake. Submit patches or be quiet :p
* Default target for lcc is now bytecode, so -Wf-target=bytecode is no longer
needed on the lcc command line
git-svn-id: svn://svn.icculus.org/quake3/trunk@132 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'lcc/src/decl.c')
-rw-r--r-- | lcc/src/decl.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/lcc/src/decl.c b/lcc/src/decl.c index fc1d6bc..132241e 100644 --- a/lcc/src/decl.c +++ b/lcc/src/decl.c @@ -115,10 +115,10 @@ static Type specifier(int *sclass) { type = INT; ty = inttype; } - if (size == SHORT && type != INT - || size == LONG+LONG && type != INT - || size == LONG && type != INT && type != DOUBLE - || sign && type != INT && type != CHAR) + if ((size == SHORT && type != INT) + || (size == LONG+LONG && type != INT) + || (size == LONG && type != INT && type != DOUBLE) + || (sign && type != INT && type != CHAR)) error("invalid type specification\n"); if (type == CHAR && sign) ty = sign == UNSIGNED ? unsignedchar : signedchar; @@ -196,7 +196,7 @@ static void decl(Symbol (*dcl)(int, char *, Type, Coordinate *)) { } } else if (ty == NULL || !(isenum(ty) || - isstruct(ty) && (*unqual(ty)->u.sym->name < '1' || *unqual(ty)->u.sym->name > '9'))) + (isstruct(ty) && (*unqual(ty)->u.sym->name < '1' || *unqual(ty)->u.sym->name > '9')))) error("empty declaration\n"); test(';', stop); } @@ -220,9 +220,9 @@ static Symbol dclglobal(int sclass, char *id, Type ty, Coordinate *pos) { if (!isfunc(ty) && p->defined && t == '=') error("redefinition of `%s' previously defined at %w\n", p->name, &p->src); - if (p->sclass == EXTERN && sclass == STATIC - || p->sclass == STATIC && sclass == AUTO - || p->sclass == AUTO && sclass == STATIC) + if ((p->sclass == EXTERN && sclass == STATIC) + || (p->sclass == STATIC && sclass == AUTO) + || (p->sclass == AUTO && sclass == STATIC)) warning("inconsistent linkage for `%s' previously declared at %w\n", p->name, &p->src); } @@ -416,7 +416,7 @@ static Symbol *parameters(Type fty) { error("missing parameter type\n"); n++; ty = dclr(specifier(&sclass), &id, NULL, 1); - if ( ty == voidtype && (ty1 || id) + if ( (ty == voidtype && (ty1 || id)) || ty1 == voidtype) error("illegal formal parameter types\n"); if (id == NULL) @@ -736,10 +736,10 @@ static void funcdefn(int sclass, char *id, Type ty, Symbol params[], Coordinate if (ty->u.f.oldstyle) warning("`%t %s()' is a non-ANSI definition\n", rty, id); else if (!(rty == inttype - && (n == 0 && callee[0] == NULL - || n == 2 && callee[0]->type == inttype + && ((n == 0 && callee[0] == NULL) + || (n == 2 && callee[0]->type == inttype && isptr(callee[1]->type) && callee[1]->type->type == charptype - && !variadic(ty)))) + && !variadic(ty))))) warning("`%s' is a non-ANSI definition\n", typestring(ty, id)); } p = lookup(id, identifiers); @@ -853,7 +853,7 @@ void compound(int loop, struct swtch *swp, int lev) { registers = append(retv, registers); } while (kind[t] == CHAR || kind[t] == STATIC - || istypename(t, tsym) && getchr() != ':') + || (istypename(t, tsym) && getchr() != ':')) decl(dcllocal); { int i; @@ -908,7 +908,7 @@ static void checkref(Symbol p, void *cl) { p->type, p->name); } if (p->sclass == AUTO - && (p->scope == PARAM && regcount == 0 + && ((p->scope == PARAM && regcount == 0) || p->scope >= LOCAL) && !p->addressed && isscalar(p->type) && p->ref >= 3.0) p->sclass = REGISTER; @@ -933,13 +933,14 @@ static Symbol dcllocal(int sclass, char *id, Type ty, Coordinate *pos) { sclass = AUTO; } q = lookup(id, identifiers); - if (q && q->scope >= level - || q && q->scope == PARAM && level == LOCAL) + if ((q && q->scope >= level) + || (q && q->scope == PARAM && level == LOCAL)) { if (sclass == EXTERN && q->sclass == EXTERN && eqtype(q->type, ty, 1)) ty = compose(ty, q->type); else error("redeclaration of `%s' previously declared at %w\n", q->name, &q->src); + } assert(level >= LOCAL); p = install(id, &identifiers, level, sclass == STATIC || sclass == EXTERN ? PERM : FUNC); @@ -964,13 +965,14 @@ static Symbol dcllocal(int sclass, char *id, Type ty, Coordinate *pos) { p->u.alias = q; break; case STATIC: (*IR->defsymbol)(p); initglobal(p, 0); - if (!p->defined) + if (!p->defined) { if (p->type->size > 0) { defglobal(p, BSS); (*IR->space)(p->type->size); } else error("undefined size for `%t %s'\n", p->type, p->name); + } p->defined = 1; break; case REGISTER: registers = append(p, registers); regcount++; @@ -987,7 +989,7 @@ static Symbol dcllocal(int sclass, char *id, Type ty, Coordinate *pos) { t = gettok(); definept(NULL); if (isscalar(p->type) - || isstruct(p->type) && t != '{') { + || (isstruct(p->type) && t != '{')) { if (t == '{') { t = gettok(); e = expr1(0); @@ -1027,7 +1029,7 @@ static void doextern(Symbol p, void *cl) { } static void doglobal(Symbol p, void *cl) { if (!p->defined && (p->sclass == EXTERN - || isfunc(p->type) && p->sclass == AUTO)) + || (isfunc(p->type) && p->sclass == AUTO))) (*IR->import)(p); else if (!p->defined && !isfunc(p->type) && (p->sclass == AUTO || p->sclass == STATIC)) { @@ -1077,7 +1079,7 @@ void checklab(Symbol p, void *cl) { Type enumdcl(void) { char *tag; Type ty; - Symbol p; + Symbol p = {0}; Coordinate pos; t = gettok(); |