summaryrefslogtreecommitdiff
path: root/src/bin/embryo/embryo_cc_sc3.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-13 23:54:21 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-13 23:54:21 +0000
commit62bca66249c381c39f8d649dcfc1a9ff902c6201 (patch)
tree3c3f9dbee30eb71a899119d8f4a2e8baf497cd2a /src/bin/embryo/embryo_cc_sc3.c
parent0099729e096326ada2e3927cca5fe2bbfa5f8195 (diff)
embryo: remove simple -Wshadow errors. Dangerous/uncertain left.
The follow are left: {{{ bin/embryo/embryo_cc_sc1.c: In function ‘dowhile’: bin/embryo/embryo_cc_sc1.c:3524:24: warning: declaration of ‘wq’ shadows a global declaration [-Wshadow] bin/embryo/embryo_cc_sc1.c:115:21: warning: shadowed declaration is here [-Wshadow] bin/embryo/embryo_cc_sc1.c: In function ‘dodo’: bin/embryo/embryo_cc_sc1.c:3546:24: warning: declaration of ‘wq’ shadows a global declaration [-Wshadow] bin/embryo/embryo_cc_sc1.c:115:21: warning: shadowed declaration is here [-Wshadow] bin/embryo/embryo_cc_sc1.c: In function ‘dofor’: bin/embryo/embryo_cc_sc1.c:3565:24: warning: declaration of ‘wq’ shadows a global declaration [-Wshadow] bin/embryo/embryo_cc_sc1.c:115:21: warning: shadowed declaration is here [-Wshadow] }}} looking at their code, they say to alloc a local "wq", but then they call functions such as delwhile() that changes the global... VERY suspicious!! SVN revision: 82734
Diffstat (limited to 'src/bin/embryo/embryo_cc_sc3.c')
-rw-r--r--src/bin/embryo/embryo_cc_sc3.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/bin/embryo/embryo_cc_sc3.c b/src/bin/embryo/embryo_cc_sc3.c
index b1f8aa5480..303ae688b4 100644
--- a/src/bin/embryo/embryo_cc_sc3.c
+++ b/src/bin/embryo/embryo_cc_sc3.c
@@ -759,7 +759,7 @@ calc(cell left, void (*oper) (), cell right, char *boolresult)
759} 759}
760 760
761int 761int
762expression(int *constant, cell * val, int *tag, int chkfuncresult) 762expression(int *is_constant, cell * val, int *tag, int chkfuncresult)
763{ 763{
764 value lval = { NULL, 0, 0, 0, 0, NULL }; 764 value lval = { NULL, 0, 0, 0, 0, NULL };
765 765
@@ -767,12 +767,12 @@ expression(int *constant, cell * val, int *tag, int chkfuncresult)
767 rvalue(&lval); 767 rvalue(&lval);
768 if (lval.ident == iCONSTEXPR) 768 if (lval.ident == iCONSTEXPR)
769 { /* constant expression */ 769 { /* constant expression */
770 *constant = TRUE; 770 *is_constant = TRUE;
771 *val = lval.constval; 771 *val = lval.constval;
772 } 772 }
773 else 773 else
774 { 774 {
775 *constant = FALSE; 775 *is_constant = FALSE;
776 *val = 0; 776 *val = 0;
777 } /* if */ 777 } /* if */
778 if (tag) 778 if (tag)
@@ -1013,7 +1013,7 @@ hier14(value * lval1)
1013 /* check the sizes of all sublevels too */ 1013 /* check the sizes of all sublevels too */
1014 symbol *sym1 = lval3.sym; 1014 symbol *sym1 = lval3.sym;
1015 symbol *sym2 = lval2.sym; 1015 symbol *sym2 = lval2.sym;
1016 int i; 1016 int clvl;
1017 1017
1018 assert(sym1 != NULL && sym2 != NULL); 1018 assert(sym1 != NULL && sym2 != NULL);
1019 /* ^^^ sym2 must be valid, because only variables can be 1019 /* ^^^ sym2 must be valid, because only variables can be
@@ -1021,7 +1021,7 @@ hier14(value * lval1)
1021 * sym1 must be valid because it must be an lvalue 1021 * sym1 must be valid because it must be an lvalue
1022 */ 1022 */
1023 assert(exactmatch); 1023 assert(exactmatch);
1024 for (i = 0; i < level; i++) 1024 for (clvl = 0; clvl < level; clvl++)
1025 { 1025 {
1026 sym1 = finddepend(sym1); 1026 sym1 = finddepend(sym1);
1027 sym2 = finddepend(sym2); 1027 sym2 = finddepend(sym2);
@@ -2118,37 +2118,37 @@ callfunction(symbol * sym)
2118 } 2118 }
2119 else 2119 else
2120 { 2120 {
2121 symbol *sym = lval.sym; 2121 symbol *lsym = lval.sym;
2122 short level = 0; 2122 short level = 0;
2123 2123
2124 assert(sym != NULL); 2124 assert(lsym != NULL);
2125 if (sym->dim.array.level + 1 != arg[argidx].numdim) 2125 if (lsym->dim.array.level + 1 != arg[argidx].numdim)
2126 error(48); /* array dimensions must match */ 2126 error(48); /* array dimensions must match */
2127 /* the lengths for all dimensions must match, unless the dimension 2127 /* the lengths for all dimensions must match, unless the dimension
2128 * length was defined at zero (which means "undefined") 2128 * length was defined at zero (which means "undefined")
2129 */ 2129 */
2130 while (sym->dim.array.level > 0) 2130 while (lsym->dim.array.level > 0)
2131 { 2131 {
2132 assert(level < sDIMEN_MAX); 2132 assert(level < sDIMEN_MAX);
2133 if (arg[argidx].dim[level] != 0 2133 if (arg[argidx].dim[level] != 0
2134 && sym->dim.array.length != 2134 && lsym->dim.array.length !=
2135 arg[argidx].dim[level]) 2135 arg[argidx].dim[level])
2136 error(47); /* array sizes must match */ 2136 error(47); /* array sizes must match */
2137 append_constval(&arrayszlst, arg[argidx].name, 2137 append_constval(&arrayszlst, arg[argidx].name,
2138 sym->dim.array.length, level); 2138 lsym->dim.array.length, level);
2139 sym = finddepend(sym); 2139 lsym = finddepend(lsym);
2140 assert(sym != NULL); 2140 assert(lsym != NULL);
2141 level++; 2141 level++;
2142 } /* if */ 2142 } /* if */
2143 /* the last dimension is checked too, again, unless it is zero */ 2143 /* the last dimension is checked too, again, unless it is zero */
2144 assert(level < sDIMEN_MAX); 2144 assert(level < sDIMEN_MAX);
2145 assert(sym != NULL); 2145 assert(lsym != NULL);
2146 if (arg[argidx].dim[level] != 0 2146 if (arg[argidx].dim[level] != 0
2147 && sym->dim.array.length != 2147 && lsym->dim.array.length !=
2148 arg[argidx].dim[level]) 2148 arg[argidx].dim[level])
2149 error(47); /* array sizes must match */ 2149 error(47); /* array sizes must match */
2150 append_constval(&arrayszlst, arg[argidx].name, 2150 append_constval(&arrayszlst, arg[argidx].name,
2151 sym->dim.array.length, level); 2151 lsym->dim.array.length, level);
2152 } /* if */ 2152 } /* if */
2153 /* address already in PRI */ 2153 /* address already in PRI */
2154 if (!checktag 2154 if (!checktag
@@ -2280,13 +2280,13 @@ callfunction(symbol * sym)
2280 } 2280 }
2281 else 2281 else
2282 { 2282 {
2283 symbol *sym; 2283 symbol *lsym;
2284 2284
2285 assert((arg[argidx].hasdefault & uTAGOF) != 0); 2285 assert((arg[argidx].hasdefault & uTAGOF) != 0);
2286 sym = findloc(arg[argidx].defvalue.size.symname); 2286 lsym = findloc(arg[argidx].defvalue.size.symname);
2287 if (!sym) 2287 if (!lsym)
2288 sym = findglb(arg[argidx].defvalue.size.symname); 2288 lsym = findglb(arg[argidx].defvalue.size.symname);
2289 array_sz = (sym) ? sym->tag : 0; 2289 array_sz = (lsym) ? lsym->tag : 0;
2290 exporttag(array_sz); 2290 exporttag(array_sz);
2291 } /* if */ 2291 } /* if */
2292 const1(array_sz); 2292 const1(array_sz);
@@ -2365,7 +2365,7 @@ commutative(void (*oper) ())
2365static int 2365static int
2366constant(value * lval) 2366constant(value * lval)
2367{ 2367{
2368 int tok, idx, constant; 2368 int tok, idx, is_constant;
2369 cell val, item, cidx; 2369 cell val, item, cidx;
2370 char *st; 2370 char *st;
2371 symbol *sym; 2371 symbol *sym;
@@ -2414,9 +2414,9 @@ constant(value * lval)
2414 * on at this point */ 2414 * on at this point */
2415 assert(staging); 2415 assert(staging);
2416 stgget(&idx, &cidx); /* mark position in code generator */ 2416 stgget(&idx, &cidx); /* mark position in code generator */
2417 expression(&constant, &item, &tag, FALSE); 2417 expression(&is_constant, &item, &tag, FALSE);
2418 stgdel(idx, cidx); /* scratch generated code */ 2418 stgdel(idx, cidx); /* scratch generated code */
2419 if (constant == 0) 2419 if (is_constant == 0)
2420 error(8); /* must be constant expression */ 2420 error(8); /* must be constant expression */
2421 if (lasttag < 0) 2421 if (lasttag < 0)
2422 lasttag = tag; 2422 lasttag = tag;