aboutsummaryrefslogtreecommitdiffstats
path: root/lcc/src/enode.c
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-10-04 01:21:34 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-10-04 01:21:34 +0000
commit45d6a88841f0db650d615522b1f6594ea72ceb7e (patch)
treedec4fac8ff8638b6a0d8749d52e66d0207eb161b /lcc/src/enode.c
parent6d9be1722b2221cae39b389ce218e93d73d99335 (diff)
downloadioquake3-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/enode.c')
-rw-r--r--lcc/src/enode.c62
1 files changed, 32 insertions, 30 deletions
diff --git a/lcc/src/enode.c b/lcc/src/enode.c
index 0503cc3..0f2adbd 100644
--- a/lcc/src/enode.c
+++ b/lcc/src/enode.c
@@ -64,7 +64,7 @@ Tree call(Tree f, Type fty, Coordinate src) {
else
q = cast(q, promote(q->type));
}
- if (!IR->wants_argb && isstruct(q->type))
+ if (!IR->wants_argb && isstruct(q->type)) {
if (iscallb(q))
q = addrof(q);
else {
@@ -73,6 +73,7 @@ Tree call(Tree f, Type fty, Coordinate src) {
q = tree(RIGHT, ptr(t1->type),
root(q), lvalue(idtree(t1)));
}
+ }
if (q->type->size == 0)
q->type = inttype;
if (hascall(q))
@@ -223,15 +224,15 @@ static int isnullptr(Tree e) {
Type ty = unqual(e->type);
return generic(e->op) == CNST
- && (ty->op == INT && e->u.v.i == 0
- || ty->op == UNSIGNED && e->u.v.u == 0
- || isvoidptr(ty) && e->u.v.p == NULL);
+ && ((ty->op == INT && e->u.v.i == 0)
+ || (ty->op == UNSIGNED && e->u.v.u == 0)
+ || (isvoidptr(ty) && e->u.v.p == NULL));
}
Tree eqtree(int op, Tree l, Tree r) {
Type xty = l->type, yty = r->type;
- if (isptr(xty) && isnullptr(r)
- || isptr(xty) && !isfunc(xty->type) && isvoidptr(yty)
+ if ((isptr(xty) && isnullptr(r))
+ || (isptr(xty) && !isfunc(xty->type) && isvoidptr(yty))
|| (isptr(xty) && isptr(yty)
&& eqtype(unqual(xty->type), unqual(yty->type), 1))) {
Type ty = unsignedptr;
@@ -239,8 +240,8 @@ Tree eqtree(int op, Tree l, Tree r) {
r = cast(r, ty);
return simplify(mkop(op,ty), inttype, l, r);
}
- if (isptr(yty) && isnullptr(l)
- || isptr(yty) && !isfunc(yty->type) && isvoidptr(xty))
+ if ((isptr(yty) && isnullptr(l))
+ || (isptr(yty) && !isfunc(yty->type) && isvoidptr(xty)))
return eqtree(op, r, l);
return cmptree(op, l, r);
}
@@ -253,13 +254,13 @@ Type assign(Type xty, Tree e) {
xty = xty->type;
if (xty->size == 0 || yty->size == 0)
return NULL;
- if ( isarith(xty) && isarith(yty)
- || isstruct(xty) && xty == yty)
+ if ( (isarith(xty) && isarith(yty))
+ || (isstruct(xty) && xty == yty))
return xty;
if (isptr(xty) && isnullptr(e))
return xty;
- if ((isvoidptr(xty) && isptr(yty)
- || isptr(xty) && isvoidptr(yty))
+ if (((isvoidptr(xty) && isptr(yty))
+ || (isptr(xty) && isvoidptr(yty)))
&& ( (isconst(xty->type) || !isconst(yty->type))
&& (isvolatile(xty->type) || !isvolatile(yty->type))))
return xty;
@@ -273,8 +274,8 @@ Type assign(Type xty, Tree e) {
&& ( (isconst(xty->type) || !isconst(yty->type))
&& (isvolatile(xty->type) || !isvolatile(yty->type)))) {
Type lty = unqual(xty->type), rty = unqual(yty->type);
- if (isenum(lty) && rty == inttype
- || isenum(rty) && lty == inttype) {
+ if ((isenum(lty) && rty == inttype)
+ || (isenum(rty) && lty == inttype)) {
if (Aflag >= 1)
warning("assignment between `%t' and `%t' is compiler-dependent\n",
xty, yty);
@@ -302,13 +303,14 @@ Tree asgntree(int op, Tree l, Tree r) {
if (isptr(aty))
aty = unqual(aty)->type;
if ( isconst(aty)
- || isstruct(aty) && unqual(aty)->u.sym->u.s.cfields)
+ || (isstruct(aty) && unqual(aty)->u.sym->u.s.cfields)) {
if (isaddrop(l->op)
&& !l->u.sym->computed && !l->u.sym->generated)
error("assignment to const identifier `%s'\n",
l->u.sym->name);
else
error("assignment to const location\n");
+ }
if (l->op == FIELD) {
long n = 8*l->u.field->type->size - fieldsize(l->u.field);
if (n > 0 && isunsigned(l->u.field->type))
@@ -345,8 +347,8 @@ Tree condtree(Tree e, Tree l, Tree r) {
ty = xty;
else if (isnullptr(l) && isptr(yty))
ty = yty;
- else if (isptr(xty) && !isfunc(xty->type) && isvoidptr(yty)
- || isptr(yty) && !isfunc(yty->type) && isvoidptr(xty))
+ else if ((isptr(xty) && !isfunc(xty->type) && isvoidptr(yty))
+ || (isptr(yty) && !isfunc(yty->type) && isvoidptr(xty)))
ty = voidptype;
else if ((isptr(xty) && isptr(yty)
&& eqtype(unqual(xty->type), unqual(yty->type), 1)))
@@ -357,11 +359,11 @@ Tree condtree(Tree e, Tree l, Tree r) {
}
if (isptr(ty)) {
ty = unqual(unqual(ty)->type);
- if (isptr(xty) && isconst(unqual(xty)->type)
- || isptr(yty) && isconst(unqual(yty)->type))
+ if ((isptr(xty) && isconst(unqual(xty)->type))
+ || (isptr(yty) && isconst(unqual(yty)->type)))
ty = qual(CONST, ty);
- if (isptr(xty) && isvolatile(unqual(xty)->type)
- || isptr(yty) && isvolatile(unqual(yty)->type))
+ if ((isptr(xty) && isvolatile(unqual(xty)->type))
+ || (isptr(yty) && isvolatile(unqual(yty)->type)))
ty = qual(VOLATILE, ty);
ty = ptr(ty);
}
@@ -518,15 +520,15 @@ static Tree subtree(int op, Tree l, Tree r) {
void typeerror(int op, Tree l, Tree r) {
int i;
static struct { int op; char *name; } ops[] = {
- ASGN, "=", INDIR, "*", NEG, "-",
- ADD, "+", SUB, "-", LSH, "<<",
- MOD, "%", RSH, ">>", BAND, "&",
- BCOM, "~", BOR, "|", BXOR, "^",
- DIV, "/", MUL, "*", EQ, "==",
- GE, ">=", GT, ">", LE, "<=",
- LT, "<", NE, "!=", AND, "&&",
- NOT, "!", OR, "||", COND, "?:",
- 0, 0
+ {ASGN, "="}, {INDIR, "*"}, {NEG, "-"},
+ {ADD, "+"}, {SUB, "-"}, {LSH, "<<"},
+ {MOD, "%"}, {RSH, ">>"}, {BAND, "&"},
+ {BCOM, "~"}, {BOR, "|"}, {BXOR, "^"},
+ {DIV, "/"}, {MUL, "*"}, {EQ, "=="},
+ {GE, ">="}, {GT, ">"}, {LE, "<="},
+ {LT, "<"}, {NE, "!="}, {AND, "&&"},
+ {NOT, "!"}, {OR, "||"}, {COND, "?:"},
+ {0, 0}
};
op = generic(op);