From: johanknol Date: Sat, 5 Apr 2003 16:43:19 +0000 (+0000) Subject: fixed a warning about the new enum ASTTYPE X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=96ff919c3470720e4bf26c7d278c753a97eeef09;p=fw%2Fsdcc fixed a warning about the new enum ASTTYPE git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2483 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCast.c b/src/SDCCast.c index dd7e0de7..5fd56732 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -110,14 +110,6 @@ newAst_LINK (sym_link * val) return ex; } -ast * -newAst_STMNT (unsigned val) -{ - ast *ex = newAst_ (EX_STMNT); - ex->opval.stmnt = val; - return ex; -} - /*-----------------------------------------------------------------*/ /* newNode - creates a new node */ /*-----------------------------------------------------------------*/ @@ -1287,6 +1279,8 @@ bool constExprTree (ast *cexpr) { if (constExprTree(cexpr->left) && constExprTree(cexpr->right)) { return TRUE; } + case EX_OPERAND: + return IS_CONSTANT(operandType(cexpr->opval.oprnd)); } return FALSE; } diff --git a/src/SDCCast.h b/src/SDCCast.h index 194612d5..24cc4f7a 100644 --- a/src/SDCCast.h +++ b/src/SDCCast.h @@ -35,7 +35,6 @@ typedef enum { EX_OP=0, EX_VALUE, EX_LINK, - EX_STMNT, EX_OPERAND } ASTTYPE; @@ -58,7 +57,6 @@ typedef struct ast value *val; /* value if type = EX_VALUE */ sym_link *lnk; /* sym_link * if type= EX_LINK */ struct operand *oprnd; /* used only for side effecting function calls */ - unsigned stmnt; /* statement if type=EX_STMNT */ unsigned op; /* operator if type= EX_OP */ } opval; @@ -180,7 +178,6 @@ extern struct memmap *GcurMemmap; ast *newAst_VALUE (value * val); ast *newAst_OP (unsigned op); ast *newAst_LINK (sym_link * val); -ast *newAst_STMNT (unsigned val); void initAst (); ast *newNode (long, ast *, ast *); diff --git a/src/SDCCicode.c b/src/SDCCicode.c index a94d664f..cc65ac06 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -1521,10 +1521,13 @@ operandFromAst (ast * tree,int lvl) case EX_LINK: return operandFromLink (tree->opval.lnk); - } + break; - assert (0); - /* Just to keep the comiler happy */ + default: + assert (0); + } + + /* Just to keep the compiler happy */ return (operand *) 0; }