summaryrefslogtreecommitdiff
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
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
-rw-r--r--src/bin/embryo/embryo_cc_sc1.c40
-rw-r--r--src/bin/embryo/embryo_cc_sc2.c126
-rw-r--r--src/bin/embryo/embryo_cc_sc3.c48
-rw-r--r--src/bin/embryo/embryo_cc_sc4.c4
-rw-r--r--src/bin/embryo/embryo_cc_sc7.c36
5 files changed, 127 insertions, 127 deletions
diff --git a/src/bin/embryo/embryo_cc_sc1.c b/src/bin/embryo/embryo_cc_sc1.c
index c8d534b47d..58b4b3cc3f 100644
--- a/src/bin/embryo/embryo_cc_sc1.c
+++ b/src/bin/embryo/embryo_cc_sc1.c
@@ -449,11 +449,11 @@ sc_compile(int argc, char *argv[])
449} 449}
450 450
451int 451int
452sc_addconstant(char *name, cell value, int tag) 452sc_addconstant(char *name, cell val, int tag)
453{ 453{
454 errorset(sFORCESET); /* make sure error engine is silenced */ 454 errorset(sFORCESET); /* make sure error engine is silenced */
455 sc_status = statIDLE; 455 sc_status = statIDLE;
456 add_constant(name, value, sGLOBAL, tag); 456 add_constant(name, val, sGLOBAL, tag);
457 return 1; 457 return 1;
458} 458}
459 459
@@ -1585,7 +1585,7 @@ static void
1585decl_enum(int vclass) 1585decl_enum(int vclass)
1586{ 1586{
1587 char enumname[sNAMEMAX + 1], constname[sNAMEMAX + 1]; 1587 char enumname[sNAMEMAX + 1], constname[sNAMEMAX + 1];
1588 cell val, value, size; 1588 cell lexval, enumvalue, size;
1589 char *str; 1589 char *str;
1590 int tok, tag, explicittag; 1590 int tok, tag, explicittag;
1591 cell increment, multiplier; 1591 cell increment, multiplier;
@@ -1594,7 +1594,7 @@ decl_enum(int vclass)
1594 * explicit tag was passed, even if that explicit tag was "_:", so we 1594 * explicit tag was passed, even if that explicit tag was "_:", so we
1595 * cannot call sc_addtag() here 1595 * cannot call sc_addtag() here
1596 */ 1596 */
1597 if (lex(&val, &str) == tLABEL) 1597 if (lex(&lexval, &str) == tLABEL)
1598 { 1598 {
1599 tag = sc_addtag(str); 1599 tag = sc_addtag(str);
1600 explicittag = TRUE; 1600 explicittag = TRUE;
@@ -1608,7 +1608,7 @@ decl_enum(int vclass)
1608 1608
1609 /* get optional enum name (also serves as a tag if no explicit 1609 /* get optional enum name (also serves as a tag if no explicit
1610 * tag was set) */ 1610 * tag was set) */
1611 if (lex(&val, &str) == tSYMBOL) 1611 if (lex(&lexval, &str) == tSYMBOL)
1612 { /* read in (new) token */ 1612 { /* read in (new) token */
1613 strcpy(enumname, str); /* save enum name (last constant) */ 1613 strcpy(enumname, str); /* save enum name (last constant) */
1614 if (!explicittag) 1614 if (!explicittag)
@@ -1635,8 +1635,8 @@ decl_enum(int vclass)
1635 } 1635 }
1636 else if (matchtoken(taSHL)) 1636 else if (matchtoken(taSHL))
1637 { 1637 {
1638 constexpr(&val, NULL); 1638 constexpr(&lexval, NULL);
1639 while (val-- > 0) 1639 while (lexval-- > 0)
1640 multiplier *= 2; 1640 multiplier *= 2;
1641 } /* if */ 1641 } /* if */
1642 needtoken(')'); 1642 needtoken(')');
@@ -1644,7 +1644,7 @@ decl_enum(int vclass)
1644 1644
1645 needtoken('{'); 1645 needtoken('{');
1646 /* go through all constants */ 1646 /* go through all constants */
1647 value = 0; /* default starting value */ 1647 enumvalue = 0; /* default starting value */
1648 do 1648 do
1649 { 1649 {
1650 if (matchtoken('}')) 1650 if (matchtoken('}'))
@@ -1652,7 +1652,7 @@ decl_enum(int vclass)
1652 lexpush(); 1652 lexpush();
1653 break; 1653 break;
1654 } /* if */ 1654 } /* if */
1655 tok = lex(&val, &str); /* read in (new) token */ 1655 tok = lex(&lexval, &str); /* read in (new) token */
1656 if (tok != tSYMBOL && tok != tLABEL) 1656 if (tok != tSYMBOL && tok != tLABEL)
1657 error(20, str); /* invalid symbol name */ 1657 error(20, str); /* invalid symbol name */
1658 strcpy(constname, str); /* save symbol name */ 1658 strcpy(constname, str); /* save symbol name */
@@ -1660,14 +1660,14 @@ decl_enum(int vclass)
1660 if (tok == tLABEL || matchtoken(':')) 1660 if (tok == tLABEL || matchtoken(':'))
1661 constexpr(&size, NULL); /* get size */ 1661 constexpr(&size, NULL); /* get size */
1662 if (matchtoken('=')) 1662 if (matchtoken('='))
1663 constexpr(&value, NULL); /* get value */ 1663 constexpr(&enumvalue, NULL); /* get value */
1664 /* add_constant() checks whether a variable (global or local) or 1664 /* add_constant() checks whether a variable (global or local) or
1665 * a constant with the same name already exists */ 1665 * a constant with the same name already exists */
1666 add_constant(constname, value, vclass, tag); 1666 add_constant(constname, enumvalue, vclass, tag);
1667 if (multiplier == 1) 1667 if (multiplier == 1)
1668 value += size; 1668 enumvalue += size;
1669 else 1669 else
1670 value *= size * multiplier; 1670 enumvalue *= size * multiplier;
1671 } 1671 }
1672 while (matchtoken(',')); 1672 while (matchtoken(','));
1673 needtoken('}'); /* terminates the constant list */ 1673 needtoken('}'); /* terminates the constant list */
@@ -1675,7 +1675,7 @@ decl_enum(int vclass)
1675 1675
1676 /* set the enum name to the last value plus one */ 1676 /* set the enum name to the last value plus one */
1677 if (enumname[0] != '\0') 1677 if (enumname[0] != '\0')
1678 add_constant(enumname, value, vclass, tag); 1678 add_constant(enumname, enumvalue, vclass, tag);
1679} 1679}
1680 1680
1681/* 1681/*
@@ -2728,11 +2728,11 @@ doarg(char *name, int ident, int offset, int tags[], int numtags,
2728 if (needtoken(tSYMBOL)) 2728 if (needtoken(tSYMBOL))
2729 { 2729 {
2730 /* save the name of the argument whose size id to take */ 2730 /* save the name of the argument whose size id to take */
2731 char *name; 2731 char *argname;
2732 cell val; 2732 cell val;
2733 2733
2734 tokeninfo(&val, &name); 2734 tokeninfo(&val, &argname);
2735 if (!(arg->defvalue.size.symname = strdup(name))) 2735 if (!(arg->defvalue.size.symname = strdup(argname)))
2736 error(103); /* insufficient memory */ 2736 error(103); /* insufficient memory */
2737 arg->defvalue.size.level = 0; 2737 arg->defvalue.size.level = 0;
2738 if (size_tag_token == uSIZEOF) 2738 if (size_tag_token == uSIZEOF)
@@ -3406,7 +3406,7 @@ constexpr(cell * val, int *tag)
3406 * Global references: intest (altered, but restored upon termination) 3406 * Global references: intest (altered, but restored upon termination)
3407 */ 3407 */
3408static void 3408static void
3409test(int label, int parens, int invert) 3409test(int label, int parens, int inv)
3410{ 3410{
3411 int idx, tok; 3411 int idx, tok;
3412 cell cidx; 3412 cell cidx;
@@ -3469,8 +3469,8 @@ test(int label, int parens, int invert)
3469 } /* if */ 3469 } /* if */
3470 if (lval.tag != 0 && lval.tag != sc_addtag("bool")) 3470 if (lval.tag != 0 && lval.tag != sc_addtag("bool"))
3471 if (check_userop(lneg, lval.tag, 0, 1, NULL, &lval.tag)) 3471 if (check_userop(lneg, lval.tag, 0, 1, NULL, &lval.tag))
3472 invert = !invert; /* user-defined ! operator inverted result */ 3472 inv = !inv; /* user-defined ! operator inverted result */
3473 if (invert) 3473 if (inv)
3474 jmp_ne0(label); /* jump to label if true (different from 0) */ 3474 jmp_ne0(label); /* jump to label if true (different from 0) */
3475 else 3475 else
3476 jmp_eq0(label); /* jump to label if false (equal to 0) */ 3476 jmp_eq0(label); /* jump to label if false (equal to 0) */
diff --git a/src/bin/embryo/embryo_cc_sc2.c b/src/bin/embryo/embryo_cc_sc2.c
index f72703a64e..5f93b19548 100644
--- a/src/bin/embryo/embryo_cc_sc2.c
+++ b/src/bin/embryo/embryo_cc_sc2.c
@@ -157,12 +157,12 @@ plungefile(char *name, int try_currentpath, int try_includepaths)
157} 157}
158 158
159static void 159static void
160check_empty(char *lptr) 160check_empty(const char *sptr)
161{ 161{
162 /* verifies that the string contains only whitespace */ 162 /* verifies that the string contains only whitespace */
163 while (*lptr <= ' ' && *lptr != '\0') 163 while (*sptr <= ' ' && *sptr != '\0')
164 lptr++; 164 sptr++;
165 if (*lptr != '\0') 165 if (*sptr != '\0')
166 error(38); /* extra characters on line */ 166 error(38); /* extra characters on line */
167} 167}
168 168
@@ -235,7 +235,6 @@ static void
235readline(char *line) 235readline(char *line)
236{ 236{
237 int i, num, cont; 237 int i, num, cont;
238 char *ptr;
239 238
240 if (lptr == term_expr) 239 if (lptr == term_expr)
241 return; 240 return;
@@ -285,15 +284,16 @@ readline(char *line)
285 } 284 }
286 else 285 else
287 { 286 {
287 char *ptr;
288 /* check whether to erase leading spaces */ 288 /* check whether to erase leading spaces */
289 if (cont) 289 if (cont)
290 { 290 {
291 char *ptr = line; 291 char *sptr = line;
292 292
293 while (*ptr == ' ' || *ptr == '\t') 293 while (*sptr == ' ' || *sptr == '\t')
294 ptr++; 294 sptr++;
295 if (ptr != line) 295 if (sptr != line)
296 memmove(line, ptr, strlen(ptr) + 1); 296 memmove(line, sptr, strlen(sptr) + 1);
297 } /* if */ 297 } /* if */
298 cont = FALSE; 298 cont = FALSE;
299 /* check whether a full line was read */ 299 /* check whether a full line was read */
@@ -694,13 +694,13 @@ static int
694number(cell * val, char *curptr) 694number(cell * val, char *curptr)
695{ 695{
696 int i; 696 int i;
697 cell value; 697 cell curval;
698 698
699 if ((i = btoi(&value, curptr)) != 0 /* binary? */ 699 if ((i = btoi(&curval, curptr)) != 0 /* binary? */
700 || (i = htoi(&value, curptr)) != 0 /* hexadecimal? */ 700 || (i = htoi(&curval, curptr)) != 0 /* hexadecimal? */
701 || (i = dtoi(&value, curptr)) != 0) /* decimal? */ 701 || (i = dtoi(&curval, curptr)) != 0) /* decimal? */
702 { 702 {
703 *val = value; 703 *val = curval;
704 return i; 704 return i;
705 } 705 }
706 else 706 else
@@ -983,10 +983,10 @@ command(void)
983 } 983 }
984 else if (strcmp(str, "compress") == 0) 984 else if (strcmp(str, "compress") == 0)
985 { 985 {
986 cell val; 986 cell compval;
987 987
988 preproc_expr(&val, NULL); 988 preproc_expr(&compval, NULL);
989 sc_compress = (int)val; /* switch code packing on/off */ 989 sc_compress = (int)compval; /* switch code packing on/off */
990 } 990 }
991 else if (strcmp(str, "dynamic") == 0) 991 else if (strcmp(str, "dynamic") == 0)
992 { 992 {
@@ -1029,10 +1029,10 @@ command(void)
1029 } 1029 }
1030 else if (strcmp(str, "pack") == 0) 1030 else if (strcmp(str, "pack") == 0)
1031 { 1031 {
1032 cell val; 1032 cell packval;
1033 1033
1034 preproc_expr(&val, NULL); /* default = packed/unpacked */ 1034 preproc_expr(&packval, NULL); /* default = packed/unpacked */
1035 sc_packstr = (int)val; 1035 sc_packstr = (int)packval;
1036 } 1036 }
1037 else if (strcmp(str, "rational") == 0) 1037 else if (strcmp(str, "rational") == 0)
1038 { 1038 {
@@ -1080,17 +1080,17 @@ command(void)
1080 } 1080 }
1081 else if (strcmp(str, "semicolon") == 0) 1081 else if (strcmp(str, "semicolon") == 0)
1082 { 1082 {
1083 cell val; 1083 cell semicolval;
1084 1084
1085 preproc_expr(&val, NULL); 1085 preproc_expr(&semicolval, NULL);
1086 sc_needsemicolon = (int)val; 1086 sc_needsemicolon = (int)semicolval;
1087 } 1087 }
1088 else if (strcmp(str, "tabsize") == 0) 1088 else if (strcmp(str, "tabsize") == 0)
1089 { 1089 {
1090 cell val; 1090 cell tabsizeval;
1091 1091
1092 preproc_expr(&val, NULL); 1092 preproc_expr(&tabsizeval, NULL);
1093 sc_tabsize = (int)val; 1093 sc_tabsize = (int)tabsizeval;
1094 } 1094 }
1095 else if (strcmp(str, "align") == 0) 1095 else if (strcmp(str, "align") == 0)
1096 { 1096 {
@@ -1479,7 +1479,7 @@ substpattern(char *line, size_t buffersize, char *pattern, char *substitution)
1479{ 1479{
1480 int prefixlen; 1480 int prefixlen;
1481 char *p, *s, *e, *args[10]; 1481 char *p, *s, *e, *args[10];
1482 int match, arg, len; 1482 int is_match, arg, len;
1483 1483
1484 memset(args, 0, sizeof args); 1484 memset(args, 0, sizeof args);
1485 1485
@@ -1495,8 +1495,8 @@ substpattern(char *line, size_t buffersize, char *pattern, char *substitution)
1495 */ 1495 */
1496 s = line + prefixlen; 1496 s = line + prefixlen;
1497 p = pattern + prefixlen; 1497 p = pattern + prefixlen;
1498 match = TRUE; /* so far, pattern matches */ 1498 is_match = TRUE; /* so far, pattern matches */
1499 while (match && *s != '\0' && *p != '\0') 1499 while (is_match && *s != '\0' && *p != '\0')
1500 { 1500 {
1501 if (*p == '%') 1501 if (*p == '%')
1502 { 1502 {
@@ -1543,14 +1543,14 @@ substpattern(char *line, size_t buffersize, char *pattern, char *substitution)
1543 else 1543 else
1544 { 1544 {
1545 assert(*e == '\0' || *e == '\n'); 1545 assert(*e == '\0' || *e == '\n');
1546 match = FALSE; 1546 is_match = FALSE;
1547 s = e; 1547 s = e;
1548 } /* if */ 1548 } /* if */
1549 p++; 1549 p++;
1550 } 1550 }
1551 else 1551 else
1552 { 1552 {
1553 match = FALSE; 1553 is_match = FALSE;
1554 } /* if */ 1554 } /* if */
1555 } 1555 }
1556 else if (*p == ';' && *(p + 1) == '\0' && !sc_needsemicolon) 1556 else if (*p == ';' && *(p + 1) == '\0' && !sc_needsemicolon)
@@ -1559,7 +1559,7 @@ substpattern(char *line, size_t buffersize, char *pattern, char *substitution)
1559 while (*s <= ' ' && *s != '\0') 1559 while (*s <= ' ' && *s != '\0')
1560 s++; /* skip white space */ 1560 s++; /* skip white space */
1561 if (*s != ';' && *s != '\0') 1561 if (*s != ';' && *s != '\0')
1562 match = FALSE; 1562 is_match = FALSE;
1563 p++; /* skip the semicolon in the pattern */ 1563 p++; /* skip the semicolon in the pattern */
1564 } 1564 }
1565 else 1565 else
@@ -1575,23 +1575,23 @@ substpattern(char *line, size_t buffersize, char *pattern, char *substitution)
1575 s++; /* skip white space */ 1575 s++; /* skip white space */
1576 ch = litchar(&p, FALSE); /* this increments "p" */ 1576 ch = litchar(&p, FALSE); /* this increments "p" */
1577 if (*s != ch) 1577 if (*s != ch)
1578 match = FALSE; 1578 is_match = FALSE;
1579 else 1579 else
1580 s++; /* this character matches */ 1580 s++; /* this character matches */
1581 } /* if */ 1581 } /* if */
1582 } /* while */ 1582 } /* while */
1583 1583
1584 if (match && *p == '\0') 1584 if (is_match && *p == '\0')
1585 { 1585 {
1586 /* if the last character to match is an alphanumeric character, the 1586 /* if the last character to match is an alphanumeric character, the
1587 * current character in the source may not be alphanumeric 1587 * current character in the source may not be alphanumeric
1588 */ 1588 */
1589 assert(p > pattern); 1589 assert(p > pattern);
1590 if (alphanum(*(p - 1)) && alphanum(*s)) 1590 if (alphanum(*(p - 1)) && alphanum(*s))
1591 match = FALSE; 1591 is_match = FALSE;
1592 } /* if */ 1592 } /* if */
1593 1593
1594 if (match) 1594 if (is_match)
1595 { 1595 {
1596 /* calculate the length of the substituted string */ 1596 /* calculate the length of the substituted string */
1597 for (e = substitution, len = 0; *e != '\0'; e++) 1597 for (e = substitution, len = 0; *e != '\0'; e++)
@@ -1644,7 +1644,7 @@ substpattern(char *line, size_t buffersize, char *pattern, char *substitution)
1644 if (args[arg]) 1644 if (args[arg])
1645 free(args[arg]); 1645 free(args[arg]);
1646 1646
1647 return match; 1647 return is_match;
1648} 1648}
1649 1649
1650static void 1650static void
@@ -1742,63 +1742,63 @@ preprocess(void)
1742} 1742}
1743 1743
1744static char * 1744static char *
1745unpackedstring(char *lptr, int rawstring) 1745unpackedstring(char *sptr, int rawstring)
1746{ 1746{
1747 while (*lptr != '\0') 1747 while (*sptr != '\0')
1748 { 1748 {
1749 /* check for doublequotes indicating the end of the string */ 1749 /* check for doublequotes indicating the end of the string */
1750 if (*lptr == '\"') 1750 if (*sptr == '\"')
1751 { 1751 {
1752 /* check whether there's another pair of quotes following. 1752 /* check whether there's another pair of quotes following.
1753 * If so, paste the two strings together, thus 1753 * If so, paste the two strings together, thus
1754 * "pants""off" becomes "pantsoff" 1754 * "pants""off" becomes "pantsoff"
1755 */ 1755 */
1756 if (*(lptr + 1) == '\"') 1756 if (*(sptr + 1) == '\"')
1757 lptr += 2; 1757 sptr += 2;
1758 else 1758 else
1759 break; 1759 break;
1760 } 1760 }
1761 1761
1762 if (*lptr == '\a') 1762 if (*sptr == '\a')
1763 { /* ignore '\a' (which was inserted at a line concatenation) */ 1763 { /* ignore '\a' (which was inserted at a line concatenation) */
1764 lptr++; 1764 sptr++;
1765 continue; 1765 continue;
1766 } /* if */ 1766 } /* if */
1767 stowlit(litchar(&lptr, rawstring)); /* litchar() alters "lptr" */ 1767 stowlit(litchar(&sptr, rawstring)); /* litchar() alters "lptr" */
1768 } /* while */ 1768 } /* while */
1769 stowlit(0); /* terminate string */ 1769 stowlit(0); /* terminate string */
1770 return lptr; 1770 return sptr;
1771} 1771}
1772 1772
1773static char * 1773static char *
1774packedstring(char *lptr, int rawstring) 1774packedstring(char *sptr, int rawstring)
1775{ 1775{
1776 int i; 1776 int i;
1777 ucell val, c; 1777 ucell val, c;
1778 1778
1779 i = sizeof(ucell) - (charbits / 8); /* start at most significant byte */ 1779 i = sizeof(ucell) - (charbits / 8); /* start at most significant byte */
1780 val = 0; 1780 val = 0;
1781 while (*lptr != '\0') 1781 while (*sptr != '\0')
1782 { 1782 {
1783 /* check for doublequotes indicating the end of the string */ 1783 /* check for doublequotes indicating the end of the string */
1784 if (*lptr == '\"') 1784 if (*sptr == '\"')
1785 { 1785 {
1786 /* check whether there's another pair of quotes following. 1786 /* check whether there's another pair of quotes following.
1787 * If so, paste the two strings together, thus 1787 * If so, paste the two strings together, thus
1788 * "pants""off" becomes "pantsoff" 1788 * "pants""off" becomes "pantsoff"
1789 */ 1789 */
1790 if (*(lptr + 1) == '\"') 1790 if (*(sptr + 1) == '\"')
1791 lptr += 2; 1791 sptr += 2;
1792 else 1792 else
1793 break; 1793 break;
1794 } 1794 }
1795 1795
1796 if (*lptr == '\a') 1796 if (*sptr == '\a')
1797 { /* ignore '\a' (which was inserted at a line concatenation) */ 1797 { /* ignore '\a' (which was inserted at a line concatenation) */
1798 lptr++; 1798 sptr++;
1799 continue; 1799 continue;
1800 } /* if */ 1800 } /* if */
1801 c = litchar(&lptr, rawstring); /* litchar() alters "lptr" */ 1801 c = litchar(&sptr, rawstring); /* litchar() alters "sptr" */
1802 if (c >= (ucell) (1 << charbits)) 1802 if (c >= (ucell) (1 << charbits))
1803 error(43); /* character constant exceeds range */ 1803 error(43); /* character constant exceeds range */
1804 val |= (c << 8 * i); 1804 val |= (c << 8 * i);
@@ -1814,7 +1814,7 @@ packedstring(char *lptr, int rawstring)
1814 stowlit(val); /* at least one zero character in "val" */ 1814 stowlit(val); /* at least one zero character in "val" */
1815 else 1815 else
1816 stowlit(0); /* add full cell of zeros */ 1816 stowlit(0); /* add full cell of zeros */
1817 return lptr; 1817 return sptr;
1818} 1818}
1819 1819
1820/* lex(lexvalue,lexsym) Lexical Analysis 1820/* lex(lexvalue,lexsym) Lexical Analysis
@@ -2230,7 +2230,7 @@ match(char *st, int end)
2230 * litq (altered) 2230 * litq (altered)
2231 */ 2231 */
2232void 2232void
2233stowlit(cell value) 2233stowlit(cell val)
2234{ 2234{
2235 if (litidx >= litmax) 2235 if (litidx >= litmax)
2236 { 2236 {
@@ -2243,7 +2243,7 @@ stowlit(cell value)
2243 litq = p; 2243 litq = p;
2244 } /* if */ 2244 } /* if */
2245 assert(litidx < litmax); 2245 assert(litidx < litmax);
2246 litq[litidx++] = value; 2246 litq[litidx++] = val;
2247} 2247}
2248 2248
2249/* litchar 2249/* litchar
@@ -2256,12 +2256,12 @@ stowlit(cell value)
2256 * but ddd must be decimal! 2256 * but ddd must be decimal!
2257 */ 2257 */
2258static cell 2258static cell
2259litchar(char **lptr, int rawmode) 2259litchar(char **p_str, int rawmode)
2260{ 2260{
2261 cell c = 0; 2261 cell c = 0;
2262 unsigned char *cptr; 2262 unsigned char *cptr;
2263 2263
2264 cptr = (unsigned char *)*lptr; 2264 cptr = (unsigned char *)*p_str;
2265 if (rawmode || *cptr != sc_ctrlchar) 2265 if (rawmode || *cptr != sc_ctrlchar)
2266 { /* no escape character */ 2266 { /* no escape character */
2267 c = *cptr; 2267 c = *cptr;
@@ -2333,7 +2333,7 @@ litchar(char **lptr, int rawmode)
2333 } /* switch */ 2333 } /* switch */
2334 } /* if */ 2334 } /* if */
2335 } /* if */ 2335 } /* if */
2336 *lptr = (char *)cptr; 2336 *p_str = (char *)cptr;
2337 assert(c >= 0 && c < 256); 2337 assert(c >= 0 && c < 256);
2338 return c; 2338 return c;
2339} 2339}
@@ -2502,7 +2502,7 @@ namehash(char *name)
2502} 2502}
2503 2503
2504static symbol * 2504static symbol *
2505find_symbol(symbol * root, char *name, int fnumber) 2505find_symbol(symbol * root, char *name, int fnum)
2506{ 2506{
2507 symbol *ptr = root->next; 2507 symbol *ptr = root->next;
2508 unsigned long hash = namehash(name); 2508 unsigned long hash = namehash(name);
@@ -2511,7 +2511,7 @@ find_symbol(symbol * root, char *name, int fnumber)
2511 { 2511 {
2512 if (hash == ptr->hash && strcmp(name, ptr->name) == 0 2512 if (hash == ptr->hash && strcmp(name, ptr->name) == 0
2513 && !ptr->parent && (ptr->fnumber < 0 2513 && !ptr->parent && (ptr->fnumber < 0
2514 || ptr->fnumber == fnumber)) 2514 || ptr->fnumber == fnum))
2515 return ptr; 2515 return ptr;
2516 ptr = ptr->next; 2516 ptr = ptr->next;
2517 } /* while */ 2517 } /* while */
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;
diff --git a/src/bin/embryo/embryo_cc_sc4.c b/src/bin/embryo/embryo_cc_sc4.c
index 1d4a321bd0..f780927529 100644
--- a/src/bin/embryo/embryo_cc_sc4.c
+++ b/src/bin/embryo/embryo_cc_sc4.c
@@ -132,10 +132,10 @@ begdseg(void)
132} 132}
133 133
134void 134void
135setactivefile(int fnumber) 135setactivefile(int fnum)
136{ 136{
137 stgwrite("curfile "); 137 stgwrite("curfile ");
138 outval(fnumber, TRUE); 138 outval(fnum, TRUE);
139} 139}
140 140
141cell 141cell
diff --git a/src/bin/embryo/embryo_cc_sc7.c b/src/bin/embryo/embryo_cc_sc7.c
index f18302d229..00e02523fe 100644
--- a/src/bin/embryo/embryo_cc_sc7.c
+++ b/src/bin/embryo/embryo_cc_sc7.c
@@ -524,7 +524,7 @@ static char *
524replacesequence(char *pattern, char symbols[_maxoptvars][_aliasmax + 1], 524replacesequence(char *pattern, char symbols[_maxoptvars][_aliasmax + 1],
525 int *repl_length) 525 int *repl_length)
526{ 526{
527 char *lptr; 527 char *sptr;
528 int var; 528 int var;
529 char *buffer; 529 char *buffer;
530 530
@@ -535,15 +535,15 @@ replacesequence(char *pattern, char symbols[_maxoptvars][_aliasmax + 1],
535 */ 535 */
536 assert(repl_length != NULL); 536 assert(repl_length != NULL);
537 *repl_length = 0; 537 *repl_length = 0;
538 lptr = pattern; 538 sptr = pattern;
539 while (*lptr) 539 while (*sptr)
540 { 540 {
541 switch (*lptr) 541 switch (*sptr)
542 { 542 {
543 case '%': 543 case '%':
544 lptr++; /* skip '%' */ 544 sptr++; /* skip '%' */
545 assert(sc_isdigit(*lptr)); 545 assert(sc_isdigit(*sptr));
546 var = atoi(lptr) - 1; 546 var = atoi(sptr) - 1;
547 assert(var >= 0 && var < _maxoptvars); 547 assert(var >= 0 && var < _maxoptvars);
548 assert(symbols[var][0] != '\0'); /* variable should be defined */ 548 assert(symbols[var][0] != '\0'); /* variable should be defined */
549 *repl_length += strlen(symbols[var]); 549 *repl_length += strlen(symbols[var]);
@@ -554,7 +554,7 @@ replacesequence(char *pattern, char symbols[_maxoptvars][_aliasmax + 1],
554 default: 554 default:
555 *repl_length += 1; 555 *repl_length += 1;
556 } /* switch */ 556 } /* switch */
557 lptr++; 557 sptr++;
558 } /* while */ 558 } /* while */
559 559
560 /* allocate a buffer to replace the sequence in */ 560 /* allocate a buffer to replace the sequence in */
@@ -565,11 +565,11 @@ replacesequence(char *pattern, char symbols[_maxoptvars][_aliasmax + 1],
565 } 565 }
566 566
567 /* replace the pattern into this temporary buffer */ 567 /* replace the pattern into this temporary buffer */
568 lptr = buffer; 568 sptr = buffer;
569 *lptr++ = '\t'; /* the "replace" patterns do not have tabs */ 569 *sptr++ = '\t'; /* the "replace" patterns do not have tabs */
570 while (*pattern) 570 while (*pattern)
571 { 571 {
572 assert((int)(lptr - buffer) < *repl_length); 572 assert((int)(sptr - buffer) < *repl_length);
573 switch (*pattern) 573 switch (*pattern)
574 { 574 {
575 case '%': 575 case '%':
@@ -579,23 +579,23 @@ replacesequence(char *pattern, char symbols[_maxoptvars][_aliasmax + 1],
579 var = atoi(pattern) - 1; 579 var = atoi(pattern) - 1;
580 assert(var >= 0 && var < _maxoptvars); 580 assert(var >= 0 && var < _maxoptvars);
581 assert(symbols[var][0] != '\0'); /* variable should be defined */ 581 assert(symbols[var][0] != '\0'); /* variable should be defined */
582 strcpy(lptr, symbols[var]); 582 strcpy(sptr, symbols[var]);
583 lptr += strlen(symbols[var]); 583 sptr += strlen(symbols[var]);
584 break; 584 break;
585 case '!': 585 case '!':
586 /* finish the line, optionally start the next line with an indent */ 586 /* finish the line, optionally start the next line with an indent */
587 *lptr++ = '\n'; 587 *sptr++ = '\n';
588 *lptr++ = '\0'; 588 *sptr++ = '\0';
589 if (*(pattern + 1) != '\0') 589 if (*(pattern + 1) != '\0')
590 *lptr++ = '\t'; 590 *sptr++ = '\t';
591 break; 591 break;
592 default: 592 default:
593 *lptr++ = *pattern; 593 *sptr++ = *pattern;
594 } /* switch */ 594 } /* switch */
595 pattern++; 595 pattern++;
596 } /* while */ 596 } /* while */
597 597
598 assert((int)(lptr - buffer) == *repl_length); 598 assert((int)(sptr - buffer) == *repl_length);
599 return buffer; 599 return buffer;
600} 600}
601 601