Kaydet (Commit) 640405a4 authored tarafından Jens-Heiner Rechtien's avatar Jens-Heiner Rechtien

INTEGRATION: CWS warnings01 (1.1.146); FILE MERGED

2005/11/07 12:08:31 sb 1.1.146.2: #i53898# Made code warning-free (additional -W switches for GCC).
2005/09/02 14:57:33 sb 1.1.146.1: #i53898# Made code warning-free.
üst 26621004
...@@ -233,7 +233,7 @@ long ...@@ -233,7 +233,7 @@ long
{ {
Token *tp; Token *tp;
Nlist *np; Nlist *np;
int ntok, rand; int ntok, rnd;
trp->tp++; trp->tp++;
if (kw == KIFDEF || kw == KIFNDEF) if (kw == KIFDEF || kw == KIFNDEF)
...@@ -254,7 +254,7 @@ long ...@@ -254,7 +254,7 @@ long
vp = vals; vp = vals;
op = ops; op = ops;
*op++ = END; *op++ = END;
for (rand = 0, tp = trp->bp + ntok; tp < trp->lp; tp++) for (rnd = 0, tp = trp->bp + ntok; tp < trp->lp; tp++)
{ {
switch (tp->type) switch (tp->type)
{ {
...@@ -269,17 +269,17 @@ long ...@@ -269,17 +269,17 @@ long
case NUMBER: case NUMBER:
case CCON: case CCON:
case STRING: case STRING:
if (rand) if (rnd)
goto syntax; goto syntax;
*vp++ = tokval(tp); *vp++ = tokval(tp);
rand = 1; rnd = 1;
continue; continue;
/* unary */ /* unary */
case DEFINED: case DEFINED:
case TILDE: case TILDE:
case NOT: case NOT:
if (rand) if (rnd)
goto syntax; goto syntax;
*op++ = tp->type; *op++ = tp->type;
continue; continue;
...@@ -289,7 +289,7 @@ long ...@@ -289,7 +289,7 @@ long
case MINUS: case MINUS:
case STAR: case STAR:
case AND: case AND:
if (rand == 0) if (rnd == 0)
{ {
if (tp->type == MINUS) if (tp->type == MINUS)
*op++ = UMINUS; *op++ = UMINUS;
...@@ -320,22 +320,22 @@ long ...@@ -320,22 +320,22 @@ long
case QUEST: case QUEST:
case COLON: case COLON:
case COMMA: case COMMA:
if (rand == 0) if (rnd == 0)
goto syntax; goto syntax;
if (evalop(priority[tp->type]) != 0) if (evalop(priority[tp->type]) != 0)
return 0; return 0;
*op++ = tp->type; *op++ = tp->type;
rand = 0; rnd = 0;
continue; continue;
case LP: case LP:
if (rand) if (rnd)
goto syntax; goto syntax;
*op++ = LP; *op++ = LP;
continue; continue;
case RP: case RP:
if (!rand) if (!rnd)
goto syntax; goto syntax;
if (evalop(priority[RP]) != 0) if (evalop(priority[RP]) != 0)
return 0; return 0;
...@@ -347,15 +347,18 @@ long ...@@ -347,15 +347,18 @@ long
continue; continue;
case SHARP: case SHARP:
if (((tp + 1) < trp->lp) && if ((tp + 1) < trp->lp)
(np = lookup(tp + 1, 0)) && (np->val == KMACHINE)) {
np = lookup(tp + 1, 0);
if (np && (np->val == KMACHINE))
{ {
tp++; tp++;
if (rand) if (rnd)
goto syntax; goto syntax;
*op++ = ARCHITECTURE; *op++ = ARCHITECTURE;
continue; continue;
} }
}
/* fall through */ /* fall through */
default: default:
...@@ -363,7 +366,7 @@ long ...@@ -363,7 +366,7 @@ long
return 0; return 0;
} }
} }
if (rand == 0) if (rnd == 0)
goto syntax; goto syntax;
if (evalop(priority[END]) != 0) if (evalop(priority[END]) != 0)
return 0; return 0;
...@@ -383,7 +386,8 @@ syntax: ...@@ -383,7 +386,8 @@ syntax:
int int
evalop(struct pri pri) evalop(struct pri pri)
{ {
struct value v1, v2; struct value v1;
struct value v2 = { 0, UND };
long rv1, rv2; long rv1, rv2;
int rtype, oper; int rtype, oper;
...@@ -709,17 +713,18 @@ struct value ...@@ -709,17 +713,18 @@ struct value
{ {
static char cvcon[] static char cvcon[]
= "b\bf\fn\nr\rt\tv\v''\"\"??\\\\"; = "b\bf\fn\nr\rt\tv\v''\"\"??\\\\";
size_t j;
for (i = 0; i < sizeof(cvcon); i += 2) for (j = 0; j < sizeof(cvcon); j += 2)
{ {
if (*p == cvcon[i]) if (*p == cvcon[j])
{ {
n = cvcon[i + 1]; n = cvcon[j + 1];
break; break;
} }
} }
p += 1; p += 1;
if (i >= sizeof(cvcon)) if (j >= sizeof(cvcon))
error(WARNING, error(WARNING,
"Undefined escape in character constant"); "Undefined escape in character constant");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment