diff options
| author | "Robert P. J. Day" <rpjday@mindspring.com> | 2006-07-01 13:08:46 +0000 |
|---|---|---|
| committer | "Robert P. J. Day" <rpjday@mindspring.com> | 2006-07-01 13:08:46 +0000 |
| commit | 68229837ff1e690190d51b74b281cfe999220e6d (patch) | |
| tree | 7cbdeded060f86cefc4edd006c2538c2a2a4ea97 /shell | |
| parent | f350160963c4412bb76f3e8cca669529fdde81d1 (diff) | |
| download | busybox-w32-68229837ff1e690190d51b74b281cfe999220e6d.tar.gz busybox-w32-68229837ff1e690190d51b74b281cfe999220e6d.tar.bz2 busybox-w32-68229837ff1e690190d51b74b281cfe999220e6d.zip | |
Remove all usage of the "register" storage class specifier.
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/ash.c | 2 | ||||
| -rw-r--r-- | shell/lash.c | 4 | ||||
| -rw-r--r-- | shell/msh.c | 419 |
3 files changed, 210 insertions, 215 deletions
diff --git a/shell/ash.c b/shell/ash.c index c2e70a535..300f19132 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
| @@ -13472,7 +13472,7 @@ static const char op_tokens[] = { | |||
| 13472 | 13472 | ||
| 13473 | static arith_t arith (const char *expr, int *perrcode) | 13473 | static arith_t arith (const char *expr, int *perrcode) |
| 13474 | { | 13474 | { |
| 13475 | register char arithval; /* Current character under analysis */ | 13475 | char arithval; /* Current character under analysis */ |
| 13476 | operator lasttok, op; | 13476 | operator lasttok, op; |
| 13477 | operator prec; | 13477 | operator prec; |
| 13478 | 13478 | ||
diff --git a/shell/lash.c b/shell/lash.c index a20934834..d87c5a25b 100644 --- a/shell/lash.c +++ b/shell/lash.c | |||
| @@ -707,10 +707,10 @@ static int get_command(FILE * source, char *command) | |||
| 707 | return 0; | 707 | return 0; |
| 708 | } | 708 | } |
| 709 | 709 | ||
| 710 | static char* itoa(register int i) | 710 | static char* itoa(int i) |
| 711 | { | 711 | { |
| 712 | static char a[7]; /* Max 7 ints */ | 712 | static char a[7]; /* Max 7 ints */ |
| 713 | register char *b = a + sizeof(a) - 1; | 713 | char *b = a + sizeof(a) - 1; |
| 714 | int sign = (i < 0); | 714 | int sign = (i < 0); |
| 715 | 715 | ||
| 716 | if (sign) | 716 | if (sign) |
diff --git a/shell/msh.c b/shell/msh.c index 5a9f2c707..f8562b725 100644 --- a/shell/msh.c +++ b/shell/msh.c | |||
| @@ -48,11 +48,6 @@ | |||
| 48 | 48 | ||
| 49 | #include "cmdedit.h" | 49 | #include "cmdedit.h" |
| 50 | 50 | ||
| 51 | |||
| 52 | /* Conditional use of "register" keyword */ | ||
| 53 | #define REGISTER register | ||
| 54 | |||
| 55 | |||
| 56 | /*#define MSHDEBUG 1*/ | 51 | /*#define MSHDEBUG 1*/ |
| 57 | 52 | ||
| 58 | #ifdef MSHDEBUG | 53 | #ifdef MSHDEBUG |
| @@ -832,8 +827,8 @@ static char *current_prompt; | |||
| 832 | 827 | ||
| 833 | int msh_main(int argc, char **argv) | 828 | int msh_main(int argc, char **argv) |
| 834 | { | 829 | { |
| 835 | REGISTER int f; | 830 | int f; |
| 836 | REGISTER char *s; | 831 | char *s; |
| 837 | int cflag; | 832 | int cflag; |
| 838 | char *name, **ap; | 833 | char *name, **ap; |
| 839 | int (*iof) (struct ioarg *); | 834 | int (*iof) (struct ioarg *); |
| @@ -1022,8 +1017,8 @@ int msh_main(int argc, char **argv) | |||
| 1022 | 1017 | ||
| 1023 | static void setdash(void) | 1018 | static void setdash(void) |
| 1024 | { | 1019 | { |
| 1025 | REGISTER char *cp; | 1020 | char *cp; |
| 1026 | REGISTER int c; | 1021 | int c; |
| 1027 | char m['z' - 'a' + 1]; | 1022 | char m['z' - 'a' + 1]; |
| 1028 | 1023 | ||
| 1029 | cp = m; | 1024 | cp = m; |
| @@ -1034,9 +1029,9 @@ static void setdash(void) | |||
| 1034 | setval(lookup("-"), m); | 1029 | setval(lookup("-"), m); |
| 1035 | } | 1030 | } |
| 1036 | 1031 | ||
| 1037 | static int newfile(REGISTER char *s) | 1032 | static int newfile(char *s) |
| 1038 | { | 1033 | { |
| 1039 | REGISTER int f; | 1034 | int f; |
| 1040 | 1035 | ||
| 1041 | DBGPRINTF7(("NEWFILE: opening %s\n", s)); | 1036 | DBGPRINTF7(("NEWFILE: opening %s\n", s)); |
| 1042 | 1037 | ||
| @@ -1091,7 +1086,7 @@ struct op *scantree(struct op *head) | |||
| 1091 | 1086 | ||
| 1092 | static void onecommand(void) | 1087 | static void onecommand(void) |
| 1093 | { | 1088 | { |
| 1094 | REGISTER int i; | 1089 | int i; |
| 1095 | jmp_buf m1; | 1090 | jmp_buf m1; |
| 1096 | 1091 | ||
| 1097 | DBGPRINTF(("ONECOMMAND: enter, outtree=%p\n", outtree)); | 1092 | DBGPRINTF(("ONECOMMAND: enter, outtree=%p\n", outtree)); |
| @@ -1169,7 +1164,7 @@ static void leave(void) | |||
| 1169 | /* NOTREACHED */ | 1164 | /* NOTREACHED */ |
| 1170 | } | 1165 | } |
| 1171 | 1166 | ||
| 1172 | static void warn(REGISTER char *s) | 1167 | static void warn(char *s) |
| 1173 | { | 1168 | { |
| 1174 | if (*s) { | 1169 | if (*s) { |
| 1175 | prs(s); | 1170 | prs(s); |
| @@ -1195,7 +1190,7 @@ static void err(char *s) | |||
| 1195 | 1190 | ||
| 1196 | static int newenv(int f) | 1191 | static int newenv(int f) |
| 1197 | { | 1192 | { |
| 1198 | REGISTER struct env *ep; | 1193 | struct env *ep; |
| 1199 | 1194 | ||
| 1200 | DBGPRINTF(("NEWENV: f=%d (indicates quitenv and return)\n", f)); | 1195 | DBGPRINTF(("NEWENV: f=%d (indicates quitenv and return)\n", f)); |
| 1201 | 1196 | ||
| @@ -1219,8 +1214,8 @@ static int newenv(int f) | |||
| 1219 | 1214 | ||
| 1220 | static void quitenv(void) | 1215 | static void quitenv(void) |
| 1221 | { | 1216 | { |
| 1222 | REGISTER struct env *ep; | 1217 | struct env *ep; |
| 1223 | REGISTER int fd; | 1218 | int fd; |
| 1224 | 1219 | ||
| 1225 | DBGPRINTF(("QUITENV: e.oenv=%p\n", e.oenv)); | 1220 | DBGPRINTF(("QUITENV: e.oenv=%p\n", e.oenv)); |
| 1226 | 1221 | ||
| @@ -1237,7 +1232,7 @@ static void quitenv(void) | |||
| 1237 | /* | 1232 | /* |
| 1238 | * Is any character from s1 in s2? | 1233 | * Is any character from s1 in s2? |
| 1239 | */ | 1234 | */ |
| 1240 | static int anys(REGISTER char *s1, REGISTER char *s2) | 1235 | static int anys(char *s1, char *s2) |
| 1241 | { | 1236 | { |
| 1242 | while (*s1) | 1237 | while (*s1) |
| 1243 | if (any(*s1++, s2)) | 1238 | if (any(*s1++, s2)) |
| @@ -1248,7 +1243,7 @@ static int anys(REGISTER char *s1, REGISTER char *s2) | |||
| 1248 | /* | 1243 | /* |
| 1249 | * Is character c in s? | 1244 | * Is character c in s? |
| 1250 | */ | 1245 | */ |
| 1251 | static int any(REGISTER int c, REGISTER char *s) | 1246 | static int any(int c, char *s) |
| 1252 | { | 1247 | { |
| 1253 | while (*s) | 1248 | while (*s) |
| 1254 | if (*s++ == c) | 1249 | if (*s++ == c) |
| @@ -1256,12 +1251,12 @@ static int any(REGISTER int c, REGISTER char *s) | |||
| 1256 | return (0); | 1251 | return (0); |
| 1257 | } | 1252 | } |
| 1258 | 1253 | ||
| 1259 | static char *putn(REGISTER int n) | 1254 | static char *putn(int n) |
| 1260 | { | 1255 | { |
| 1261 | return (itoa(n)); | 1256 | return (itoa(n)); |
| 1262 | } | 1257 | } |
| 1263 | 1258 | ||
| 1264 | static char *itoa(REGISTER int n) | 1259 | static char *itoa(int n) |
| 1265 | { | 1260 | { |
| 1266 | static char s[20]; | 1261 | static char s[20]; |
| 1267 | 1262 | ||
| @@ -1292,16 +1287,16 @@ static void onintr(int s) /* ANSI C requires a parameter */ | |||
| 1292 | 1287 | ||
| 1293 | static char *space(int n) | 1288 | static char *space(int n) |
| 1294 | { | 1289 | { |
| 1295 | REGISTER char *cp; | 1290 | char *cp; |
| 1296 | 1291 | ||
| 1297 | if ((cp = getcell(n)) == 0) | 1292 | if ((cp = getcell(n)) == 0) |
| 1298 | err("out of string space"); | 1293 | err("out of string space"); |
| 1299 | return (cp); | 1294 | return (cp); |
| 1300 | } | 1295 | } |
| 1301 | 1296 | ||
| 1302 | static char *strsave(REGISTER char *s, int a) | 1297 | static char *strsave(char *s, int a) |
| 1303 | { | 1298 | { |
| 1304 | REGISTER char *cp, *xp; | 1299 | char *cp, *xp; |
| 1305 | 1300 | ||
| 1306 | if ((cp = space(strlen(s) + 1)) != NULL) { | 1301 | if ((cp = space(strlen(s) + 1)) != NULL) { |
| 1307 | setarea((char *) cp, a); | 1302 | setarea((char *) cp, a); |
| @@ -1314,7 +1309,7 @@ static char *strsave(REGISTER char *s, int a) | |||
| 1314 | /* | 1309 | /* |
| 1315 | * trap handling | 1310 | * trap handling |
| 1316 | */ | 1311 | */ |
| 1317 | static void sig(REGISTER int i) | 1312 | static void sig(int i) |
| 1318 | { | 1313 | { |
| 1319 | trapset = i; | 1314 | trapset = i; |
| 1320 | signal(i, sig); | 1315 | signal(i, sig); |
| @@ -1341,11 +1336,11 @@ static void runtrap(int i) | |||
| 1341 | * not previously there, enter it now and | 1336 | * not previously there, enter it now and |
| 1342 | * return a null value. | 1337 | * return a null value. |
| 1343 | */ | 1338 | */ |
| 1344 | static struct var *lookup(REGISTER char *n) | 1339 | static struct var *lookup(char *n) |
| 1345 | { | 1340 | { |
| 1346 | REGISTER struct var *vp; | 1341 | struct var *vp; |
| 1347 | REGISTER char *cp; | 1342 | char *cp; |
| 1348 | REGISTER int c; | 1343 | int c; |
| 1349 | static struct var dummy; | 1344 | static struct var dummy; |
| 1350 | 1345 | ||
| 1351 | if (isdigit(*n)) { | 1346 | if (isdigit(*n)) { |
| @@ -1393,9 +1388,9 @@ static void setval(struct var *vp, char *val) | |||
| 1393 | * this is all so that exporting | 1388 | * this is all so that exporting |
| 1394 | * values is reasonably painless. | 1389 | * values is reasonably painless. |
| 1395 | */ | 1390 | */ |
| 1396 | static void nameval(REGISTER struct var *vp, char *val, char *name) | 1391 | static void nameval(struct var *vp, char *val, char *name) |
| 1397 | { | 1392 | { |
| 1398 | REGISTER char *cp, *xp; | 1393 | char *cp, *xp; |
| 1399 | char *nv; | 1394 | char *nv; |
| 1400 | int fl; | 1395 | int fl; |
| 1401 | 1396 | ||
| @@ -1439,7 +1434,7 @@ static void ronly(struct var *vp) | |||
| 1439 | vp->status |= RONLY; | 1434 | vp->status |= RONLY; |
| 1440 | } | 1435 | } |
| 1441 | 1436 | ||
| 1442 | static int isassign(REGISTER char *s) | 1437 | static int isassign(char *s) |
| 1443 | { | 1438 | { |
| 1444 | DBGPRINTF7(("ISASSIGN: enter, s=%s\n", s)); | 1439 | DBGPRINTF7(("ISASSIGN: enter, s=%s\n", s)); |
| 1445 | 1440 | ||
| @@ -1452,9 +1447,9 @@ static int isassign(REGISTER char *s) | |||
| 1452 | return (1); | 1447 | return (1); |
| 1453 | } | 1448 | } |
| 1454 | 1449 | ||
| 1455 | static int assign(REGISTER char *s, int cf) | 1450 | static int assign(char *s, int cf) |
| 1456 | { | 1451 | { |
| 1457 | REGISTER char *cp; | 1452 | char *cp; |
| 1458 | struct var *vp; | 1453 | struct var *vp; |
| 1459 | 1454 | ||
| 1460 | DBGPRINTF7(("ASSIGN: enter, s=%s, cf=%d\n", s, cf)); | 1455 | DBGPRINTF7(("ASSIGN: enter, s=%s, cf=%d\n", s, cf)); |
| @@ -1471,7 +1466,7 @@ static int assign(REGISTER char *s, int cf) | |||
| 1471 | return (1); | 1466 | return (1); |
| 1472 | } | 1467 | } |
| 1473 | 1468 | ||
| 1474 | static int checkname(REGISTER char *cp) | 1469 | static int checkname(char *cp) |
| 1475 | { | 1470 | { |
| 1476 | DBGPRINTF7(("CHECKNAME: enter, cp=%s\n", cp)); | 1471 | DBGPRINTF7(("CHECKNAME: enter, cp=%s\n", cp)); |
| 1477 | 1472 | ||
| @@ -1483,9 +1478,9 @@ static int checkname(REGISTER char *cp) | |||
| 1483 | return (1); | 1478 | return (1); |
| 1484 | } | 1479 | } |
| 1485 | 1480 | ||
| 1486 | static void putvlist(REGISTER int f, REGISTER int out) | 1481 | static void putvlist(int f, int out) |
| 1487 | { | 1482 | { |
| 1488 | REGISTER struct var *vp; | 1483 | struct var *vp; |
| 1489 | 1484 | ||
| 1490 | for (vp = vlist; vp; vp = vp->next) | 1485 | for (vp = vlist; vp; vp = vp->next) |
| 1491 | if (vp->status & f && (isalpha(*vp->name) || *vp->name == '_')) { | 1486 | if (vp->status & f && (isalpha(*vp->name) || *vp->name == '_')) { |
| @@ -1498,7 +1493,7 @@ static void putvlist(REGISTER int f, REGISTER int out) | |||
| 1498 | } | 1493 | } |
| 1499 | } | 1494 | } |
| 1500 | 1495 | ||
| 1501 | static int eqname(REGISTER char *n1, REGISTER char *n2) | 1496 | static int eqname(char *n1, char *n2) |
| 1502 | { | 1497 | { |
| 1503 | for (; *n1 != '=' && *n1 != 0; n1++) | 1498 | for (; *n1 != '=' && *n1 != 0; n1++) |
| 1504 | if (*n2++ != *n1) | 1499 | if (*n2++ != *n1) |
| @@ -1506,7 +1501,7 @@ static int eqname(REGISTER char *n1, REGISTER char *n2) | |||
| 1506 | return (*n2 == 0 || *n2 == '='); | 1501 | return (*n2 == 0 || *n2 == '='); |
| 1507 | } | 1502 | } |
| 1508 | 1503 | ||
| 1509 | static char *findeq(REGISTER char *cp) | 1504 | static char *findeq(char *cp) |
| 1510 | { | 1505 | { |
| 1511 | while (*cp != '\0' && *cp != '=') | 1506 | while (*cp != '\0' && *cp != '=') |
| 1512 | cp++; | 1507 | cp++; |
| @@ -1526,9 +1521,9 @@ static char *findeq(REGISTER char *cp) | |||
| 1526 | #define QMASK (CMASK&~QUOTE) | 1521 | #define QMASK (CMASK&~QUOTE) |
| 1527 | #define NOT '!' /* might use ^ */ | 1522 | #define NOT '!' /* might use ^ */ |
| 1528 | 1523 | ||
| 1529 | static int gmatch(REGISTER char *s, REGISTER char *p) | 1524 | static int gmatch(char *s, char *p) |
| 1530 | { | 1525 | { |
| 1531 | REGISTER int sc, pc; | 1526 | int sc, pc; |
| 1532 | 1527 | ||
| 1533 | if (s == NULL || p == NULL) | 1528 | if (s == NULL || p == NULL) |
| 1534 | return (0); | 1529 | return (0); |
| @@ -1561,9 +1556,9 @@ static int gmatch(REGISTER char *s, REGISTER char *p) | |||
| 1561 | return (*s == 0); | 1556 | return (*s == 0); |
| 1562 | } | 1557 | } |
| 1563 | 1558 | ||
| 1564 | static char *cclass(REGISTER char *p, REGISTER int sub) | 1559 | static char *cclass(char *p, int sub) |
| 1565 | { | 1560 | { |
| 1566 | REGISTER int c, d, not, found; | 1561 | int c, d, not, found; |
| 1567 | 1562 | ||
| 1568 | if ((not = *p == NOT) != 0) | 1563 | if ((not = *p == NOT) != 0) |
| 1569 | p++; | 1564 | p++; |
| @@ -1611,9 +1606,9 @@ static void initarea(void) | |||
| 1611 | 1606 | ||
| 1612 | char *getcell(unsigned nbytes) | 1607 | char *getcell(unsigned nbytes) |
| 1613 | { | 1608 | { |
| 1614 | REGISTER int nregio; | 1609 | int nregio; |
| 1615 | REGISTER struct region *p, *q; | 1610 | struct region *p, *q; |
| 1616 | REGISTER int i; | 1611 | int i; |
| 1617 | 1612 | ||
| 1618 | if (nbytes == 0) { | 1613 | if (nbytes == 0) { |
| 1619 | puts("getcell(0)"); | 1614 | puts("getcell(0)"); |
| @@ -1679,7 +1674,7 @@ char *getcell(unsigned nbytes) | |||
| 1679 | 1674 | ||
| 1680 | static void freecell(char *cp) | 1675 | static void freecell(char *cp) |
| 1681 | { | 1676 | { |
| 1682 | REGISTER struct region *p; | 1677 | struct region *p; |
| 1683 | 1678 | ||
| 1684 | if ((p = (struct region *) cp) != NULL) { | 1679 | if ((p = (struct region *) cp) != NULL) { |
| 1685 | p--; | 1680 | p--; |
| @@ -1689,9 +1684,9 @@ static void freecell(char *cp) | |||
| 1689 | } | 1684 | } |
| 1690 | } | 1685 | } |
| 1691 | 1686 | ||
| 1692 | static void freearea(REGISTER int a) | 1687 | static void freearea(int a) |
| 1693 | { | 1688 | { |
| 1694 | REGISTER struct region *p, *top; | 1689 | struct region *p, *top; |
| 1695 | 1690 | ||
| 1696 | top = areatop; | 1691 | top = areatop; |
| 1697 | for (p = areabot; p != top; p = p->next) | 1692 | for (p = areabot; p != top; p = p->next) |
| @@ -1701,7 +1696,7 @@ static void freearea(REGISTER int a) | |||
| 1701 | 1696 | ||
| 1702 | static void setarea(char *cp, int a) | 1697 | static void setarea(char *cp, int a) |
| 1703 | { | 1698 | { |
| 1704 | REGISTER struct region *p; | 1699 | struct region *p; |
| 1705 | 1700 | ||
| 1706 | if ((p = (struct region *) cp) != NULL) | 1701 | if ((p = (struct region *) cp) != NULL) |
| 1707 | (p - 1)->area = a; | 1702 | (p - 1)->area = a; |
| @@ -1714,7 +1709,7 @@ int getarea(char *cp) | |||
| 1714 | 1709 | ||
| 1715 | static void garbage(void) | 1710 | static void garbage(void) |
| 1716 | { | 1711 | { |
| 1717 | REGISTER struct region *p, *q, *top; | 1712 | struct region *p, *q, *top; |
| 1718 | 1713 | ||
| 1719 | top = areatop; | 1714 | top = areatop; |
| 1720 | for (p = areabot; p != top; p = p->next) { | 1715 | for (p = areabot; p != top; p = p->next) { |
| @@ -1753,8 +1748,8 @@ int yyparse(void) | |||
| 1753 | 1748 | ||
| 1754 | static struct op *pipeline(int cf) | 1749 | static struct op *pipeline(int cf) |
| 1755 | { | 1750 | { |
| 1756 | REGISTER struct op *t, *p; | 1751 | struct op *t, *p; |
| 1757 | REGISTER int c; | 1752 | int c; |
| 1758 | 1753 | ||
| 1759 | DBGPRINTF7(("PIPELINE: enter, cf=%d\n", cf)); | 1754 | DBGPRINTF7(("PIPELINE: enter, cf=%d\n", cf)); |
| 1760 | 1755 | ||
| @@ -1785,8 +1780,8 @@ static struct op *pipeline(int cf) | |||
| 1785 | 1780 | ||
| 1786 | static struct op *andor(void) | 1781 | static struct op *andor(void) |
| 1787 | { | 1782 | { |
| 1788 | REGISTER struct op *t, *p; | 1783 | struct op *t, *p; |
| 1789 | REGISTER int c; | 1784 | int c; |
| 1790 | 1785 | ||
| 1791 | DBGPRINTF7(("ANDOR: enter...\n")); | 1786 | DBGPRINTF7(("ANDOR: enter...\n")); |
| 1792 | 1787 | ||
| @@ -1813,8 +1808,8 @@ static struct op *andor(void) | |||
| 1813 | 1808 | ||
| 1814 | static struct op *c_list(void) | 1809 | static struct op *c_list(void) |
| 1815 | { | 1810 | { |
| 1816 | REGISTER struct op *t, *p; | 1811 | struct op *t, *p; |
| 1817 | REGISTER int c; | 1812 | int c; |
| 1818 | 1813 | ||
| 1819 | DBGPRINTF7(("C_LIST: enter...\n")); | 1814 | DBGPRINTF7(("C_LIST: enter...\n")); |
| 1820 | 1815 | ||
| @@ -1845,9 +1840,9 @@ static struct op *c_list(void) | |||
| 1845 | 1840 | ||
| 1846 | static int synio(int cf) | 1841 | static int synio(int cf) |
| 1847 | { | 1842 | { |
| 1848 | REGISTER struct ioword *iop; | 1843 | struct ioword *iop; |
| 1849 | REGISTER int i; | 1844 | int i; |
| 1850 | REGISTER int c; | 1845 | int c; |
| 1851 | 1846 | ||
| 1852 | DBGPRINTF7(("SYNIO: enter, cf=%d\n", cf)); | 1847 | DBGPRINTF7(("SYNIO: enter, cf=%d\n", cf)); |
| 1853 | 1848 | ||
| @@ -1880,7 +1875,7 @@ static void musthave(int c, int cf) | |||
| 1880 | 1875 | ||
| 1881 | static struct op *simple(void) | 1876 | static struct op *simple(void) |
| 1882 | { | 1877 | { |
| 1883 | REGISTER struct op *t; | 1878 | struct op *t; |
| 1884 | 1879 | ||
| 1885 | t = NULL; | 1880 | t = NULL; |
| 1886 | for (;;) { | 1881 | for (;;) { |
| @@ -1907,7 +1902,7 @@ static struct op *simple(void) | |||
| 1907 | 1902 | ||
| 1908 | static struct op *nested(int type, int mark) | 1903 | static struct op *nested(int type, int mark) |
| 1909 | { | 1904 | { |
| 1910 | REGISTER struct op *t; | 1905 | struct op *t; |
| 1911 | 1906 | ||
| 1912 | DBGPRINTF3(("NESTED: enter, type=%d, mark=%d\n", type, mark)); | 1907 | DBGPRINTF3(("NESTED: enter, type=%d, mark=%d\n", type, mark)); |
| 1913 | 1908 | ||
| @@ -1920,9 +1915,9 @@ static struct op *nested(int type, int mark) | |||
| 1920 | 1915 | ||
| 1921 | static struct op *command(int cf) | 1916 | static struct op *command(int cf) |
| 1922 | { | 1917 | { |
| 1923 | REGISTER struct op *t; | 1918 | struct op *t; |
| 1924 | struct wdblock *iosave; | 1919 | struct wdblock *iosave; |
| 1925 | REGISTER int c; | 1920 | int c; |
| 1926 | 1921 | ||
| 1927 | DBGPRINTF(("COMMAND: enter, cf=%d\n", cf)); | 1922 | DBGPRINTF(("COMMAND: enter, cf=%d\n", cf)); |
| 1928 | 1923 | ||
| @@ -2033,7 +2028,7 @@ static struct op *command(int cf) | |||
| 2033 | 2028 | ||
| 2034 | static struct op *dowholefile(int type, int mark) | 2029 | static struct op *dowholefile(int type, int mark) |
| 2035 | { | 2030 | { |
| 2036 | REGISTER struct op *t; | 2031 | struct op *t; |
| 2037 | 2032 | ||
| 2038 | DBGPRINTF(("DOWHOLEFILE: enter, type=%d, mark=%d\n", type, mark)); | 2033 | DBGPRINTF(("DOWHOLEFILE: enter, type=%d, mark=%d\n", type, mark)); |
| 2039 | 2034 | ||
| @@ -2047,8 +2042,8 @@ static struct op *dowholefile(int type, int mark) | |||
| 2047 | 2042 | ||
| 2048 | static struct op *dogroup(int onlydone) | 2043 | static struct op *dogroup(int onlydone) |
| 2049 | { | 2044 | { |
| 2050 | REGISTER int c; | 2045 | int c; |
| 2051 | REGISTER struct op *mylist; | 2046 | struct op *mylist; |
| 2052 | 2047 | ||
| 2053 | c = yylex(CONTIN); | 2048 | c = yylex(CONTIN); |
| 2054 | if (c == DONE && onlydone) | 2049 | if (c == DONE && onlydone) |
| @@ -2062,8 +2057,8 @@ static struct op *dogroup(int onlydone) | |||
| 2062 | 2057 | ||
| 2063 | static struct op *thenpart(void) | 2058 | static struct op *thenpart(void) |
| 2064 | { | 2059 | { |
| 2065 | REGISTER int c; | 2060 | int c; |
| 2066 | REGISTER struct op *t; | 2061 | struct op *t; |
| 2067 | 2062 | ||
| 2068 | if ((c = yylex(0)) != THEN) { | 2063 | if ((c = yylex(0)) != THEN) { |
| 2069 | peeksym = c; | 2064 | peeksym = c; |
| @@ -2080,8 +2075,8 @@ static struct op *thenpart(void) | |||
| 2080 | 2075 | ||
| 2081 | static struct op *elsepart(void) | 2076 | static struct op *elsepart(void) |
| 2082 | { | 2077 | { |
| 2083 | REGISTER int c; | 2078 | int c; |
| 2084 | REGISTER struct op *t; | 2079 | struct op *t; |
| 2085 | 2080 | ||
| 2086 | switch (c = yylex(0)) { | 2081 | switch (c = yylex(0)) { |
| 2087 | case ELSE: | 2082 | case ELSE: |
| @@ -2104,7 +2099,7 @@ static struct op *elsepart(void) | |||
| 2104 | 2099 | ||
| 2105 | static struct op *caselist(void) | 2100 | static struct op *caselist(void) |
| 2106 | { | 2101 | { |
| 2107 | REGISTER struct op *t; | 2102 | struct op *t; |
| 2108 | 2103 | ||
| 2109 | t = NULL; | 2104 | t = NULL; |
| 2110 | while ((peeksym = yylex(CONTIN)) != ESAC) { | 2105 | while ((peeksym = yylex(CONTIN)) != ESAC) { |
| @@ -2118,7 +2113,7 @@ static struct op *caselist(void) | |||
| 2118 | 2113 | ||
| 2119 | static struct op *casepart(void) | 2114 | static struct op *casepart(void) |
| 2120 | { | 2115 | { |
| 2121 | REGISTER struct op *t; | 2116 | struct op *t; |
| 2122 | 2117 | ||
| 2123 | DBGPRINTF7(("CASEPART: enter...\n")); | 2118 | DBGPRINTF7(("CASEPART: enter...\n")); |
| 2124 | 2119 | ||
| @@ -2137,7 +2132,7 @@ static struct op *casepart(void) | |||
| 2137 | 2132 | ||
| 2138 | static char **pattern(void) | 2133 | static char **pattern(void) |
| 2139 | { | 2134 | { |
| 2140 | REGISTER int c, cf; | 2135 | int c, cf; |
| 2141 | 2136 | ||
| 2142 | cf = CONTIN; | 2137 | cf = CONTIN; |
| 2143 | do { | 2138 | do { |
| @@ -2153,7 +2148,7 @@ static char **pattern(void) | |||
| 2153 | 2148 | ||
| 2154 | static char **wordlist(void) | 2149 | static char **wordlist(void) |
| 2155 | { | 2150 | { |
| 2156 | REGISTER int c; | 2151 | int c; |
| 2157 | 2152 | ||
| 2158 | if ((c = yylex(0)) != IN) { | 2153 | if ((c = yylex(0)) != IN) { |
| 2159 | peeksym = c; | 2154 | peeksym = c; |
| @@ -2170,7 +2165,7 @@ static char **wordlist(void) | |||
| 2170 | /* | 2165 | /* |
| 2171 | * supporting functions | 2166 | * supporting functions |
| 2172 | */ | 2167 | */ |
| 2173 | static struct op *list(REGISTER struct op *t1, REGISTER struct op *t2) | 2168 | static struct op *list(struct op *t1, struct op *t2) |
| 2174 | { | 2169 | { |
| 2175 | DBGPRINTF7(("LIST: enter, t1=%p, t2=%p\n", t1, t2)); | 2170 | DBGPRINTF7(("LIST: enter, t1=%p, t2=%p\n", t1, t2)); |
| 2176 | 2171 | ||
| @@ -2184,7 +2179,7 @@ static struct op *list(REGISTER struct op *t1, REGISTER struct op *t2) | |||
| 2184 | 2179 | ||
| 2185 | static struct op *block(int type, struct op *t1, struct op *t2, char **wp) | 2180 | static struct op *block(int type, struct op *t1, struct op *t2, char **wp) |
| 2186 | { | 2181 | { |
| 2187 | REGISTER struct op *t; | 2182 | struct op *t; |
| 2188 | 2183 | ||
| 2189 | DBGPRINTF7(("BLOCK: enter, type=%d (%s)\n", type, T_CMD_NAMES[type])); | 2184 | DBGPRINTF7(("BLOCK: enter, type=%d (%s)\n", type, T_CMD_NAMES[type])); |
| 2190 | 2185 | ||
| @@ -2201,9 +2196,9 @@ static struct op *block(int type, struct op *t1, struct op *t2, char **wp) | |||
| 2201 | } | 2196 | } |
| 2202 | 2197 | ||
| 2203 | /* See if given string is a shell multiline (FOR, IF, etc) */ | 2198 | /* See if given string is a shell multiline (FOR, IF, etc) */ |
| 2204 | static int rlookup(REGISTER char *n) | 2199 | static int rlookup(char *n) |
| 2205 | { | 2200 | { |
| 2206 | REGISTER const struct res *rp; | 2201 | const struct res *rp; |
| 2207 | 2202 | ||
| 2208 | DBGPRINTF7(("RLOOKUP: enter, n is %s\n", n)); | 2203 | DBGPRINTF7(("RLOOKUP: enter, n is %s\n", n)); |
| 2209 | 2204 | ||
| @@ -2219,7 +2214,7 @@ static int rlookup(REGISTER char *n) | |||
| 2219 | 2214 | ||
| 2220 | static struct op *newtp(void) | 2215 | static struct op *newtp(void) |
| 2221 | { | 2216 | { |
| 2222 | REGISTER struct op *t; | 2217 | struct op *t; |
| 2223 | 2218 | ||
| 2224 | t = (struct op *) tree(sizeof(*t)); | 2219 | t = (struct op *) tree(sizeof(*t)); |
| 2225 | t->type = 0; | 2220 | t->type = 0; |
| @@ -2234,7 +2229,7 @@ static struct op *newtp(void) | |||
| 2234 | return (t); | 2229 | return (t); |
| 2235 | } | 2230 | } |
| 2236 | 2231 | ||
| 2237 | static struct op *namelist(REGISTER struct op *t) | 2232 | static struct op *namelist(struct op *t) |
| 2238 | { | 2233 | { |
| 2239 | 2234 | ||
| 2240 | DBGPRINTF7(("NAMELIST: enter, t=%p, type %s, iolist=%p\n", t, | 2235 | DBGPRINTF7(("NAMELIST: enter, t=%p, type %s, iolist=%p\n", t, |
| @@ -2264,7 +2259,7 @@ static struct op *namelist(REGISTER struct op *t) | |||
| 2264 | 2259 | ||
| 2265 | static char **copyw(void) | 2260 | static char **copyw(void) |
| 2266 | { | 2261 | { |
| 2267 | REGISTER char **wd; | 2262 | char **wd; |
| 2268 | 2263 | ||
| 2269 | wd = getwords(wdlist); | 2264 | wd = getwords(wdlist); |
| 2270 | wdlist = 0; | 2265 | wdlist = 0; |
| @@ -2278,7 +2273,7 @@ static void word(char *cp) | |||
| 2278 | 2273 | ||
| 2279 | static struct ioword **copyio(void) | 2274 | static struct ioword **copyio(void) |
| 2280 | { | 2275 | { |
| 2281 | REGISTER struct ioword **iop; | 2276 | struct ioword **iop; |
| 2282 | 2277 | ||
| 2283 | iop = (struct ioword **) getwords(iolist); | 2278 | iop = (struct ioword **) getwords(iolist); |
| 2284 | iolist = 0; | 2279 | iolist = 0; |
| @@ -2287,7 +2282,7 @@ static struct ioword **copyio(void) | |||
| 2287 | 2282 | ||
| 2288 | static struct ioword *io(int u, int f, char *cp) | 2283 | static struct ioword *io(int u, int f, char *cp) |
| 2289 | { | 2284 | { |
| 2290 | REGISTER struct ioword *iop; | 2285 | struct ioword *iop; |
| 2291 | 2286 | ||
| 2292 | iop = (struct ioword *) tree(sizeof(*iop)); | 2287 | iop = (struct ioword *) tree(sizeof(*iop)); |
| 2293 | iop->io_unit = u; | 2288 | iop->io_unit = u; |
| @@ -2315,7 +2310,7 @@ static void yyerror(char *s) | |||
| 2315 | 2310 | ||
| 2316 | static int yylex(int cf) | 2311 | static int yylex(int cf) |
| 2317 | { | 2312 | { |
| 2318 | REGISTER int c, c1; | 2313 | int c, c1; |
| 2319 | int atstart; | 2314 | int atstart; |
| 2320 | 2315 | ||
| 2321 | if ((c = peeksym) > 0) { | 2316 | if ((c = peeksym) > 0) { |
| @@ -2446,7 +2441,7 @@ static int yylex(int cf) | |||
| 2446 | } | 2441 | } |
| 2447 | 2442 | ||
| 2448 | 2443 | ||
| 2449 | static int collect(REGISTER int c, REGISTER int c1) | 2444 | static int collect(int c, int c1) |
| 2450 | { | 2445 | { |
| 2451 | char s[2]; | 2446 | char s[2]; |
| 2452 | 2447 | ||
| @@ -2481,10 +2476,10 @@ static int collect(REGISTER int c, REGISTER int c1) | |||
| 2481 | 2476 | ||
| 2482 | /* "multiline commands" helper func */ | 2477 | /* "multiline commands" helper func */ |
| 2483 | /* see if next 2 chars form a shell multiline */ | 2478 | /* see if next 2 chars form a shell multiline */ |
| 2484 | static int dual(REGISTER int c) | 2479 | static int dual(int c) |
| 2485 | { | 2480 | { |
| 2486 | char s[3]; | 2481 | char s[3]; |
| 2487 | REGISTER char *cp = s; | 2482 | char *cp = s; |
| 2488 | 2483 | ||
| 2489 | DBGPRINTF8(("DUAL: enter, c=%d\n", c)); | 2484 | DBGPRINTF8(("DUAL: enter, c=%d\n", c)); |
| 2490 | 2485 | ||
| @@ -2499,9 +2494,9 @@ static int dual(REGISTER int c) | |||
| 2499 | return (c); /* String is multiline, return numeric multiline (restab) code */ | 2494 | return (c); /* String is multiline, return numeric multiline (restab) code */ |
| 2500 | } | 2495 | } |
| 2501 | 2496 | ||
| 2502 | static void diag(REGISTER int ec) | 2497 | static void diag(int ec) |
| 2503 | { | 2498 | { |
| 2504 | REGISTER int c; | 2499 | int c; |
| 2505 | 2500 | ||
| 2506 | DBGPRINTF8(("DIAG: enter, ec=%d\n", ec)); | 2501 | DBGPRINTF8(("DIAG: enter, ec=%d\n", ec)); |
| 2507 | 2502 | ||
| @@ -2521,7 +2516,7 @@ static void diag(REGISTER int ec) | |||
| 2521 | 2516 | ||
| 2522 | static char *tree(unsigned size) | 2517 | static char *tree(unsigned size) |
| 2523 | { | 2518 | { |
| 2524 | REGISTER char *t; | 2519 | char *t; |
| 2525 | 2520 | ||
| 2526 | if ((t = getcell(size)) == NULL) { | 2521 | if ((t = getcell(size)) == NULL) { |
| 2527 | DBGPRINTF2(("TREE: getcell(%d) failed!\n", size)); | 2522 | DBGPRINTF2(("TREE: getcell(%d) failed!\n", size)); |
| @@ -2542,9 +2537,9 @@ static char *tree(unsigned size) | |||
| 2542 | */ | 2537 | */ |
| 2543 | 2538 | ||
| 2544 | 2539 | ||
| 2545 | static int execute(REGISTER struct op *t, int *pin, int *pout, int act) | 2540 | static int execute(struct op *t, int *pin, int *pout, int act) |
| 2546 | { | 2541 | { |
| 2547 | REGISTER struct op *t1; | 2542 | struct op *t1; |
| 2548 | volatile int i, rv, a; | 2543 | volatile int i, rv, a; |
| 2549 | char *cp, **wp, **wp2; | 2544 | char *cp, **wp, **wp2; |
| 2550 | struct var *vp; | 2545 | struct var *vp; |
| @@ -2765,12 +2760,12 @@ static int execute(REGISTER struct op *t, int *pin, int *pout, int act) | |||
| 2765 | } | 2760 | } |
| 2766 | 2761 | ||
| 2767 | static int | 2762 | static int |
| 2768 | forkexec(REGISTER struct op *t, int *pin, int *pout, int act, char **wp) | 2763 | forkexec(struct op *t, int *pin, int *pout, int act, char **wp) |
| 2769 | { | 2764 | { |
| 2770 | pid_t newpid; | 2765 | pid_t newpid; |
| 2771 | int i, rv; | 2766 | int i, rv; |
| 2772 | int (*shcom) (struct op *) = NULL; | 2767 | int (*shcom) (struct op *) = NULL; |
| 2773 | REGISTER int f; | 2768 | int f; |
| 2774 | char *cp = NULL; | 2769 | char *cp = NULL; |
| 2775 | struct ioword **iopp; | 2770 | struct ioword **iopp; |
| 2776 | int resetsig; | 2771 | int resetsig; |
| @@ -2995,9 +2990,9 @@ forkexec(REGISTER struct op *t, int *pin, int *pout, int act, char **wp) | |||
| 2995 | * 0< 1> are ignored as required | 2990 | * 0< 1> are ignored as required |
| 2996 | * within pipelines. | 2991 | * within pipelines. |
| 2997 | */ | 2992 | */ |
| 2998 | static int iosetup(REGISTER struct ioword *iop, int pipein, int pipeout) | 2993 | static int iosetup(struct ioword *iop, int pipein, int pipeout) |
| 2999 | { | 2994 | { |
| 3000 | REGISTER int u = -1; | 2995 | int u = -1; |
| 3001 | char *cp = NULL, *msg; | 2996 | char *cp = NULL, *msg; |
| 3002 | 2997 | ||
| 3003 | DBGPRINTF(("IOSETUP: iop %p, pipein %i, pipeout %i\n", iop, | 2998 | DBGPRINTF(("IOSETUP: iop %p, pipein %i, pipeout %i\n", iop, |
| @@ -3071,9 +3066,9 @@ static int iosetup(REGISTER struct ioword *iop, int pipein, int pipeout) | |||
| 3071 | return (0); | 3066 | return (0); |
| 3072 | } | 3067 | } |
| 3073 | 3068 | ||
| 3074 | static void echo(REGISTER char **wp) | 3069 | static void echo(char **wp) |
| 3075 | { | 3070 | { |
| 3076 | REGISTER int i; | 3071 | int i; |
| 3077 | 3072 | ||
| 3078 | prs("+"); | 3073 | prs("+"); |
| 3079 | for (i = 0; wp[i]; i++) { | 3074 | for (i = 0; wp[i]; i++) { |
| @@ -3086,9 +3081,9 @@ static void echo(REGISTER char **wp) | |||
| 3086 | 3081 | ||
| 3087 | static struct op **find1case(struct op *t, char *w) | 3082 | static struct op **find1case(struct op *t, char *w) |
| 3088 | { | 3083 | { |
| 3089 | REGISTER struct op *t1; | 3084 | struct op *t1; |
| 3090 | struct op **tp; | 3085 | struct op **tp; |
| 3091 | REGISTER char **wp, *cp; | 3086 | char **wp, *cp; |
| 3092 | 3087 | ||
| 3093 | 3088 | ||
| 3094 | if (t == NULL) { | 3089 | if (t == NULL) { |
| @@ -3121,7 +3116,7 @@ static struct op **find1case(struct op *t, char *w) | |||
| 3121 | 3116 | ||
| 3122 | static struct op *findcase(struct op *t, char *w) | 3117 | static struct op *findcase(struct op *t, char *w) |
| 3123 | { | 3118 | { |
| 3124 | REGISTER struct op **tp; | 3119 | struct op **tp; |
| 3125 | 3120 | ||
| 3126 | return ((tp = find1case(t, w)) != NULL ? *tp : (struct op *) NULL); | 3121 | return ((tp = find1case(t, w)) != NULL ? *tp : (struct op *) NULL); |
| 3127 | } | 3122 | } |
| @@ -3142,9 +3137,9 @@ static void brkset(struct brkcon *bc) | |||
| 3142 | * Ignore interrupt signals while waiting | 3137 | * Ignore interrupt signals while waiting |
| 3143 | * unless `canintr' is true. | 3138 | * unless `canintr' is true. |
| 3144 | */ | 3139 | */ |
| 3145 | static int waitfor(REGISTER int lastpid, int canintr) | 3140 | static int waitfor(int lastpid, int canintr) |
| 3146 | { | 3141 | { |
| 3147 | REGISTER int pid, rv; | 3142 | int pid, rv; |
| 3148 | int s; | 3143 | int s; |
| 3149 | int oheedint = heedint; | 3144 | int oheedint = heedint; |
| 3150 | 3145 | ||
| @@ -3197,7 +3192,7 @@ static int waitfor(REGISTER int lastpid, int canintr) | |||
| 3197 | return (rv); | 3192 | return (rv); |
| 3198 | } | 3193 | } |
| 3199 | 3194 | ||
| 3200 | static int setstatus(REGISTER int s) | 3195 | static int setstatus(int s) |
| 3201 | { | 3196 | { |
| 3202 | exstat = s; | 3197 | exstat = s; |
| 3203 | setval(lookup("?"), putn(s)); | 3198 | setval(lookup("?"), putn(s)); |
| @@ -3211,8 +3206,8 @@ static int setstatus(REGISTER int s) | |||
| 3211 | */ | 3206 | */ |
| 3212 | static char *rexecve(char *c, char **v, char **envp) | 3207 | static char *rexecve(char *c, char **v, char **envp) |
| 3213 | { | 3208 | { |
| 3214 | REGISTER int i; | 3209 | int i; |
| 3215 | REGISTER char *sp, *tp; | 3210 | char *sp, *tp; |
| 3216 | int eacces = 0, asis = 0; | 3211 | int eacces = 0, asis = 0; |
| 3217 | 3212 | ||
| 3218 | #ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL | 3213 | #ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL |
| @@ -3373,9 +3368,9 @@ static int dolabel(struct op *t) | |||
| 3373 | return (0); | 3368 | return (0); |
| 3374 | } | 3369 | } |
| 3375 | 3370 | ||
| 3376 | static int dochdir(REGISTER struct op *t) | 3371 | static int dochdir(struct op *t) |
| 3377 | { | 3372 | { |
| 3378 | REGISTER char *cp, *er; | 3373 | char *cp, *er; |
| 3379 | 3374 | ||
| 3380 | if ((cp = t->words[1]) == NULL && (cp = homedir->value) == NULL) | 3375 | if ((cp = t->words[1]) == NULL && (cp = homedir->value) == NULL) |
| 3381 | er = ": no home directory"; | 3376 | er = ": no home directory"; |
| @@ -3388,9 +3383,9 @@ static int dochdir(REGISTER struct op *t) | |||
| 3388 | return (1); | 3383 | return (1); |
| 3389 | } | 3384 | } |
| 3390 | 3385 | ||
| 3391 | static int doshift(REGISTER struct op *t) | 3386 | static int doshift(struct op *t) |
| 3392 | { | 3387 | { |
| 3393 | REGISTER int n; | 3388 | int n; |
| 3394 | 3389 | ||
| 3395 | n = t->words[1] ? getn(t->words[1]) : 1; | 3390 | n = t->words[1] ? getn(t->words[1]) : 1; |
| 3396 | if (dolc < n) { | 3391 | if (dolc < n) { |
| @@ -3409,7 +3404,7 @@ static int doshift(REGISTER struct op *t) | |||
| 3409 | */ | 3404 | */ |
| 3410 | static int dologin(struct op *t) | 3405 | static int dologin(struct op *t) |
| 3411 | { | 3406 | { |
| 3412 | REGISTER char *cp; | 3407 | char *cp; |
| 3413 | 3408 | ||
| 3414 | if (interactive) { | 3409 | if (interactive) { |
| 3415 | signal(SIGINT, SIG_DFL); | 3410 | signal(SIGINT, SIG_DFL); |
| @@ -3422,10 +3417,10 @@ static int dologin(struct op *t) | |||
| 3422 | return (1); | 3417 | return (1); |
| 3423 | } | 3418 | } |
| 3424 | 3419 | ||
| 3425 | static int doumask(REGISTER struct op *t) | 3420 | static int doumask(struct op *t) |
| 3426 | { | 3421 | { |
| 3427 | REGISTER int i, n; | 3422 | int i, n; |
| 3428 | REGISTER char *cp; | 3423 | char *cp; |
| 3429 | 3424 | ||
| 3430 | if ((cp = t->words[1]) == NULL) { | 3425 | if ((cp = t->words[1]) == NULL) { |
| 3431 | i = umask(0); | 3426 | i = umask(0); |
| @@ -3441,9 +3436,9 @@ static int doumask(REGISTER struct op *t) | |||
| 3441 | return (0); | 3436 | return (0); |
| 3442 | } | 3437 | } |
| 3443 | 3438 | ||
| 3444 | static int doexec(REGISTER struct op *t) | 3439 | static int doexec(struct op *t) |
| 3445 | { | 3440 | { |
| 3446 | REGISTER int i; | 3441 | int i; |
| 3447 | jmp_buf ex; | 3442 | jmp_buf ex; |
| 3448 | xint *ofail; | 3443 | xint *ofail; |
| 3449 | 3444 | ||
| @@ -3462,8 +3457,8 @@ static int doexec(REGISTER struct op *t) | |||
| 3462 | 3457 | ||
| 3463 | static int dodot(struct op *t) | 3458 | static int dodot(struct op *t) |
| 3464 | { | 3459 | { |
| 3465 | REGISTER int i; | 3460 | int i; |
| 3466 | REGISTER char *sp, *tp; | 3461 | char *sp, *tp; |
| 3467 | char *cp; | 3462 | char *cp; |
| 3468 | int maltmp; | 3463 | int maltmp; |
| 3469 | 3464 | ||
| @@ -3514,8 +3509,8 @@ static int dodot(struct op *t) | |||
| 3514 | 3509 | ||
| 3515 | static int dowait(struct op *t) | 3510 | static int dowait(struct op *t) |
| 3516 | { | 3511 | { |
| 3517 | REGISTER int i; | 3512 | int i; |
| 3518 | REGISTER char *cp; | 3513 | char *cp; |
| 3519 | 3514 | ||
| 3520 | if ((cp = t->words[1]) != NULL) { | 3515 | if ((cp = t->words[1]) != NULL) { |
| 3521 | i = getn(cp); | 3516 | i = getn(cp); |
| @@ -3529,9 +3524,9 @@ static int dowait(struct op *t) | |||
| 3529 | 3524 | ||
| 3530 | static int doread(struct op *t) | 3525 | static int doread(struct op *t) |
| 3531 | { | 3526 | { |
| 3532 | REGISTER char *cp, **wp; | 3527 | char *cp, **wp; |
| 3533 | REGISTER int nb = 0; | 3528 | int nb = 0; |
| 3534 | REGISTER int nl = 0; | 3529 | int nl = 0; |
| 3535 | 3530 | ||
| 3536 | if (t->words[1] == NULL) { | 3531 | if (t->words[1] == NULL) { |
| 3537 | err("Usage: read name ..."); | 3532 | err("Usage: read name ..."); |
| @@ -3550,15 +3545,15 @@ static int doread(struct op *t) | |||
| 3550 | return (nb <= 0); | 3545 | return (nb <= 0); |
| 3551 | } | 3546 | } |
| 3552 | 3547 | ||
| 3553 | static int doeval(REGISTER struct op *t) | 3548 | static int doeval(struct op *t) |
| 3554 | { | 3549 | { |
| 3555 | return (RUN(awordlist, t->words + 1, wdchar)); | 3550 | return (RUN(awordlist, t->words + 1, wdchar)); |
| 3556 | } | 3551 | } |
| 3557 | 3552 | ||
| 3558 | static int dotrap(REGISTER struct op *t) | 3553 | static int dotrap(struct op *t) |
| 3559 | { | 3554 | { |
| 3560 | REGISTER int n, i; | 3555 | int n, i; |
| 3561 | REGISTER int resetsig; | 3556 | int resetsig; |
| 3562 | 3557 | ||
| 3563 | if (t->words[1] == NULL) { | 3558 | if (t->words[1] == NULL) { |
| 3564 | for (i = 0; i <= _NSIG; i++) | 3559 | for (i = 0; i <= _NSIG; i++) |
| @@ -3596,7 +3591,7 @@ static int dotrap(REGISTER struct op *t) | |||
| 3596 | 3591 | ||
| 3597 | static int getsig(char *s) | 3592 | static int getsig(char *s) |
| 3598 | { | 3593 | { |
| 3599 | REGISTER int n; | 3594 | int n; |
| 3600 | 3595 | ||
| 3601 | if ((n = getn(s)) < 0 || n > _NSIG) { | 3596 | if ((n = getn(s)) < 0 || n > _NSIG) { |
| 3602 | err("trap: bad signal number"); | 3597 | err("trap: bad signal number"); |
| @@ -3605,7 +3600,7 @@ static int getsig(char *s) | |||
| 3605 | return (n); | 3600 | return (n); |
| 3606 | } | 3601 | } |
| 3607 | 3602 | ||
| 3608 | static void setsig(REGISTER int n, sighandler_t f) | 3603 | static void setsig(int n, sighandler_t f) |
| 3609 | { | 3604 | { |
| 3610 | if (n == 0) | 3605 | if (n == 0) |
| 3611 | return; | 3606 | return; |
| @@ -3617,8 +3612,8 @@ static void setsig(REGISTER int n, sighandler_t f) | |||
| 3617 | 3612 | ||
| 3618 | static int getn(char *as) | 3613 | static int getn(char *as) |
| 3619 | { | 3614 | { |
| 3620 | REGISTER char *s; | 3615 | char *s; |
| 3621 | REGISTER int n, m; | 3616 | int n, m; |
| 3622 | 3617 | ||
| 3623 | s = as; | 3618 | s = as; |
| 3624 | m = 1; | 3619 | m = 1; |
| @@ -3645,10 +3640,10 @@ static int docontinue(struct op *t) | |||
| 3645 | return (brkcontin(t->words[1], 0)); | 3640 | return (brkcontin(t->words[1], 0)); |
| 3646 | } | 3641 | } |
| 3647 | 3642 | ||
| 3648 | static int brkcontin(REGISTER char *cp, int val) | 3643 | static int brkcontin(char *cp, int val) |
| 3649 | { | 3644 | { |
| 3650 | REGISTER struct brkcon *bc; | 3645 | struct brkcon *bc; |
| 3651 | REGISTER int nl; | 3646 | int nl; |
| 3652 | 3647 | ||
| 3653 | nl = cp == NULL ? 1 : getn(cp); | 3648 | nl = cp == NULL ? 1 : getn(cp); |
| 3654 | if (nl <= 0) | 3649 | if (nl <= 0) |
| @@ -3669,7 +3664,7 @@ static int brkcontin(REGISTER char *cp, int val) | |||
| 3669 | 3664 | ||
| 3670 | static int doexit(struct op *t) | 3665 | static int doexit(struct op *t) |
| 3671 | { | 3666 | { |
| 3672 | REGISTER char *cp; | 3667 | char *cp; |
| 3673 | 3668 | ||
| 3674 | execflg = 0; | 3669 | execflg = 0; |
| 3675 | if ((cp = t->words[1]) != NULL) | 3670 | if ((cp = t->words[1]) != NULL) |
| @@ -3717,17 +3712,17 @@ static void rdexp(char **wp, void (*f) (struct var *), int key) | |||
| 3717 | putvlist(key, 1); | 3712 | putvlist(key, 1); |
| 3718 | } | 3713 | } |
| 3719 | 3714 | ||
| 3720 | static void badid(REGISTER char *s) | 3715 | static void badid(char *s) |
| 3721 | { | 3716 | { |
| 3722 | prs(s); | 3717 | prs(s); |
| 3723 | err(": bad identifier"); | 3718 | err(": bad identifier"); |
| 3724 | } | 3719 | } |
| 3725 | 3720 | ||
| 3726 | static int doset(REGISTER struct op *t) | 3721 | static int doset(struct op *t) |
| 3727 | { | 3722 | { |
| 3728 | REGISTER struct var *vp; | 3723 | struct var *vp; |
| 3729 | REGISTER char *cp; | 3724 | char *cp; |
| 3730 | REGISTER int n; | 3725 | int n; |
| 3731 | 3726 | ||
| 3732 | if ((cp = t->words[1]) == NULL) { | 3727 | if ((cp = t->words[1]) == NULL) { |
| 3733 | for (vp = vlist; vp; vp = vp->next) | 3728 | for (vp = vlist; vp; vp = vp->next) |
| @@ -3766,7 +3761,7 @@ static int doset(REGISTER struct op *t) | |||
| 3766 | return (0); | 3761 | return (0); |
| 3767 | } | 3762 | } |
| 3768 | 3763 | ||
| 3769 | static void varput(REGISTER char *s, int out) | 3764 | static void varput(char *s, int out) |
| 3770 | { | 3765 | { |
| 3771 | if (isalnum(*s) || *s == '_') { | 3766 | if (isalnum(*s) || *s == '_') { |
| 3772 | write(out, s, strlen(s)); | 3767 | write(out, s, strlen(s)); |
| @@ -3865,7 +3860,7 @@ static char **eval(char **ap, int f) | |||
| 3865 | */ | 3860 | */ |
| 3866 | static char **makenv(int all, struct wdblock *wb) | 3861 | static char **makenv(int all, struct wdblock *wb) |
| 3867 | { | 3862 | { |
| 3868 | REGISTER struct var *vp; | 3863 | struct var *vp; |
| 3869 | 3864 | ||
| 3870 | DBGPRINTF5(("MAKENV: enter, all=%d\n", all)); | 3865 | DBGPRINTF5(("MAKENV: enter, all=%d\n", all)); |
| 3871 | 3866 | ||
| @@ -3876,7 +3871,7 @@ static char **makenv(int all, struct wdblock *wb) | |||
| 3876 | return (getwords(wb)); | 3871 | return (getwords(wb)); |
| 3877 | } | 3872 | } |
| 3878 | 3873 | ||
| 3879 | static char *evalstr(REGISTER char *cp, int f) | 3874 | static char *evalstr(char *cp, int f) |
| 3880 | { | 3875 | { |
| 3881 | struct wdblock *wb; | 3876 | struct wdblock *wb; |
| 3882 | 3877 | ||
| @@ -3893,7 +3888,7 @@ static char *evalstr(REGISTER char *cp, int f) | |||
| 3893 | return (cp); | 3888 | return (cp); |
| 3894 | } | 3889 | } |
| 3895 | 3890 | ||
| 3896 | static int expand(char *cp, REGISTER struct wdblock **wbp, int f) | 3891 | static int expand(char *cp, struct wdblock **wbp, int f) |
| 3897 | { | 3892 | { |
| 3898 | jmp_buf ev; | 3893 | jmp_buf ev; |
| 3899 | 3894 | ||
| @@ -3941,8 +3936,8 @@ static int expand(char *cp, REGISTER struct wdblock **wbp, int f) | |||
| 3941 | */ | 3936 | */ |
| 3942 | static char *blank(int f) | 3937 | static char *blank(int f) |
| 3943 | { | 3938 | { |
| 3944 | REGISTER int c, c1; | 3939 | int c, c1; |
| 3945 | REGISTER char *sp; | 3940 | char *sp; |
| 3946 | int scanequals, foundequals; | 3941 | int scanequals, foundequals; |
| 3947 | 3942 | ||
| 3948 | DBGPRINTF3(("BLANK: enter, f=%d\n", f)); | 3943 | DBGPRINTF3(("BLANK: enter, f=%d\n", f)); |
| @@ -4008,9 +4003,9 @@ static char *blank(int f) | |||
| 4008 | /* | 4003 | /* |
| 4009 | * Get characters, substituting for ` and $ | 4004 | * Get characters, substituting for ` and $ |
| 4010 | */ | 4005 | */ |
| 4011 | static int subgetc(REGISTER char ec, int quoted) | 4006 | static int subgetc(char ec, int quoted) |
| 4012 | { | 4007 | { |
| 4013 | REGISTER char c; | 4008 | char c; |
| 4014 | 4009 | ||
| 4015 | DBGPRINTF3(("SUBGETC: enter, quoted=%d\n", quoted)); | 4010 | DBGPRINTF3(("SUBGETC: enter, quoted=%d\n", quoted)); |
| 4016 | 4011 | ||
| @@ -4039,7 +4034,7 @@ static int dollar(int quoted) | |||
| 4039 | int otask; | 4034 | int otask; |
| 4040 | struct io *oiop; | 4035 | struct io *oiop; |
| 4041 | char *dolp; | 4036 | char *dolp; |
| 4042 | REGISTER char *s, c, *cp = NULL; | 4037 | char *s, c, *cp = NULL; |
| 4043 | struct var *vp; | 4038 | struct var *vp; |
| 4044 | 4039 | ||
| 4045 | DBGPRINTF3(("DOLLAR: enter, quoted=%d\n", quoted)); | 4040 | DBGPRINTF3(("DOLLAR: enter, quoted=%d\n", quoted)); |
| @@ -4141,7 +4136,7 @@ static int dollar(int quoted) | |||
| 4141 | static int grave(int quoted) | 4136 | static int grave(int quoted) |
| 4142 | { | 4137 | { |
| 4143 | char *cp; | 4138 | char *cp; |
| 4144 | REGISTER int i; | 4139 | int i; |
| 4145 | int j; | 4140 | int j; |
| 4146 | int pf[2]; | 4141 | int pf[2]; |
| 4147 | static char child_cmd[LINELIM]; | 4142 | static char child_cmd[LINELIM]; |
| @@ -4317,9 +4312,9 @@ static int grave(int quoted) | |||
| 4317 | } | 4312 | } |
| 4318 | 4313 | ||
| 4319 | 4314 | ||
| 4320 | static char *unquote(REGISTER char *as) | 4315 | static char *unquote(char *as) |
| 4321 | { | 4316 | { |
| 4322 | REGISTER char *s; | 4317 | char *s; |
| 4323 | 4318 | ||
| 4324 | if ((s = as) != NULL) | 4319 | if ((s = as) != NULL) |
| 4325 | while (*s) | 4320 | while (*s) |
| @@ -4342,8 +4337,8 @@ static char spcl[] = "[?*"; | |||
| 4342 | 4337 | ||
| 4343 | static struct wdblock *glob(char *cp, struct wdblock *wb) | 4338 | static struct wdblock *glob(char *cp, struct wdblock *wb) |
| 4344 | { | 4339 | { |
| 4345 | REGISTER int i; | 4340 | int i; |
| 4346 | REGISTER char *pp; | 4341 | char *pp; |
| 4347 | 4342 | ||
| 4348 | if (cp == 0) | 4343 | if (cp == 0) |
| 4349 | return (wb); | 4344 | return (wb); |
| @@ -4384,9 +4379,9 @@ static struct wdblock *glob(char *cp, struct wdblock *wb) | |||
| 4384 | return (wb); | 4379 | return (wb); |
| 4385 | } | 4380 | } |
| 4386 | 4381 | ||
| 4387 | static void globname(char *we, REGISTER char *pp) | 4382 | static void globname(char *we, char *pp) |
| 4388 | { | 4383 | { |
| 4389 | REGISTER char *np, *cp; | 4384 | char *np, *cp; |
| 4390 | char *name, *gp, *dp; | 4385 | char *name, *gp, *dp; |
| 4391 | int k; | 4386 | int k; |
| 4392 | DIR *dirp; | 4387 | DIR *dirp; |
| @@ -4445,10 +4440,10 @@ static void globname(char *we, REGISTER char *pp) | |||
| 4445 | * start..end1 / middle end | 4440 | * start..end1 / middle end |
| 4446 | * the slashes come for free | 4441 | * the slashes come for free |
| 4447 | */ | 4442 | */ |
| 4448 | static char *generate(char *start1, REGISTER char *end1, char *middle, char *end) | 4443 | static char *generate(char *start1, char *end1, char *middle, char *end) |
| 4449 | { | 4444 | { |
| 4450 | char *p; | 4445 | char *p; |
| 4451 | REGISTER char *op, *xp; | 4446 | char *op, *xp; |
| 4452 | 4447 | ||
| 4453 | p = op = | 4448 | p = op = |
| 4454 | space((int) (end1 - start1) + strlen(middle) + strlen(end) + 2); | 4449 | space((int) (end1 - start1) + strlen(middle) + strlen(end) + 2); |
| @@ -4460,10 +4455,10 @@ static char *generate(char *start1, REGISTER char *end1, char *middle, char *end | |||
| 4460 | return (p); | 4455 | return (p); |
| 4461 | } | 4456 | } |
| 4462 | 4457 | ||
| 4463 | static int anyspcl(REGISTER struct wdblock *wb) | 4458 | static int anyspcl(struct wdblock *wb) |
| 4464 | { | 4459 | { |
| 4465 | REGISTER int i; | 4460 | int i; |
| 4466 | REGISTER char **wd; | 4461 | char **wd; |
| 4467 | 4462 | ||
| 4468 | wd = wb->w_words; | 4463 | wd = wb->w_words; |
| 4469 | for (i = 0; i < wb->w_nword; i++) | 4464 | for (i = 0; i < wb->w_nword; i++) |
| @@ -4479,9 +4474,9 @@ static int xstrcmp(char *p1, char *p2) | |||
| 4479 | 4474 | ||
| 4480 | /* -------- word.c -------- */ | 4475 | /* -------- word.c -------- */ |
| 4481 | 4476 | ||
| 4482 | static struct wdblock *newword(REGISTER int nw) | 4477 | static struct wdblock *newword(int nw) |
| 4483 | { | 4478 | { |
| 4484 | REGISTER struct wdblock *wb; | 4479 | struct wdblock *wb; |
| 4485 | 4480 | ||
| 4486 | wb = (struct wdblock *) space(sizeof(*wb) + nw * sizeof(char *)); | 4481 | wb = (struct wdblock *) space(sizeof(*wb) + nw * sizeof(char *)); |
| 4487 | wb->w_bsize = nw; | 4482 | wb->w_bsize = nw; |
| @@ -4489,10 +4484,10 @@ static struct wdblock *newword(REGISTER int nw) | |||
| 4489 | return (wb); | 4484 | return (wb); |
| 4490 | } | 4485 | } |
| 4491 | 4486 | ||
| 4492 | static struct wdblock *addword(char *wd, REGISTER struct wdblock *wb) | 4487 | static struct wdblock *addword(char *wd, struct wdblock *wb) |
| 4493 | { | 4488 | { |
| 4494 | REGISTER struct wdblock *wb2; | 4489 | struct wdblock *wb2; |
| 4495 | REGISTER int nw; | 4490 | int nw; |
| 4496 | 4491 | ||
| 4497 | if (wb == NULL) | 4492 | if (wb == NULL) |
| 4498 | wb = newword(NSTART); | 4493 | wb = newword(NSTART); |
| @@ -4509,10 +4504,10 @@ static struct wdblock *addword(char *wd, REGISTER struct wdblock *wb) | |||
| 4509 | } | 4504 | } |
| 4510 | 4505 | ||
| 4511 | static | 4506 | static |
| 4512 | char **getwords(REGISTER struct wdblock *wb) | 4507 | char **getwords(struct wdblock *wb) |
| 4513 | { | 4508 | { |
| 4514 | REGISTER char **wd; | 4509 | char **wd; |
| 4515 | REGISTER int nb; | 4510 | int nb; |
| 4516 | 4511 | ||
| 4517 | if (wb == NULL) | 4512 | if (wb == NULL) |
| 4518 | return ((char **) NULL); | 4513 | return ((char **) NULL); |
| @@ -4538,7 +4533,7 @@ static void glob0(char *a0, unsigned a1, int a2, int (*a3) (char *, char *)) | |||
| 4538 | 4533 | ||
| 4539 | static void glob1(char *base, char *lim) | 4534 | static void glob1(char *base, char *lim) |
| 4540 | { | 4535 | { |
| 4541 | REGISTER char *i, *j; | 4536 | char *i, *j; |
| 4542 | int v2; | 4537 | int v2; |
| 4543 | char *lptr, *hptr; | 4538 | char *lptr, *hptr; |
| 4544 | int c; | 4539 | int c; |
| @@ -4607,7 +4602,7 @@ static void glob1(char *base, char *lim) | |||
| 4607 | 4602 | ||
| 4608 | static void glob2(char *i, char *j) | 4603 | static void glob2(char *i, char *j) |
| 4609 | { | 4604 | { |
| 4610 | REGISTER char *index1, *index2, c; | 4605 | char *index1, *index2, c; |
| 4611 | int m; | 4606 | int m; |
| 4612 | 4607 | ||
| 4613 | m = globv; | 4608 | m = globv; |
| @@ -4622,7 +4617,7 @@ static void glob2(char *i, char *j) | |||
| 4622 | 4617 | ||
| 4623 | static void glob3(char *i, char *j, char *k) | 4618 | static void glob3(char *i, char *j, char *k) |
| 4624 | { | 4619 | { |
| 4625 | REGISTER char *index1, *index2, *index3; | 4620 | char *index1, *index2, *index3; |
| 4626 | int c; | 4621 | int c; |
| 4627 | int m; | 4622 | int m; |
| 4628 | 4623 | ||
| @@ -4646,7 +4641,7 @@ static void glob3(char *i, char *j, char *k) | |||
| 4646 | 4641 | ||
| 4647 | static int my_getc(int ec) | 4642 | static int my_getc(int ec) |
| 4648 | { | 4643 | { |
| 4649 | REGISTER int c; | 4644 | int c; |
| 4650 | 4645 | ||
| 4651 | if (e.linep > elinep) { | 4646 | if (e.linep > elinep) { |
| 4652 | while ((c = readc()) != '\n' && c); | 4647 | while ((c = readc()) != '\n' && c); |
| @@ -4679,7 +4674,7 @@ static int eofc(void) | |||
| 4679 | 4674 | ||
| 4680 | static int readc(void) | 4675 | static int readc(void) |
| 4681 | { | 4676 | { |
| 4682 | REGISTER int c; | 4677 | int c; |
| 4683 | 4678 | ||
| 4684 | RCPRINTF(("READC: e.iop %p, e.iobase %p\n", e.iop, e.iobase)); | 4679 | RCPRINTF(("READC: e.iop %p, e.iobase %p\n", e.iop, e.iobase)); |
| 4685 | 4680 | ||
| @@ -4807,7 +4802,7 @@ static void pushio(struct ioarg *argp, int (*fn) (struct ioarg *)) | |||
| 4807 | 4802 | ||
| 4808 | static struct io *setbase(struct io *ip) | 4803 | static struct io *setbase(struct io *ip) |
| 4809 | { | 4804 | { |
| 4810 | REGISTER struct io *xp; | 4805 | struct io *xp; |
| 4811 | 4806 | ||
| 4812 | xp = e.iobase; | 4807 | xp = e.iobase; |
| 4813 | e.iobase = ip; | 4808 | e.iobase = ip; |
| @@ -4821,9 +4816,9 @@ static struct io *setbase(struct io *ip) | |||
| 4821 | /* | 4816 | /* |
| 4822 | * Produce the characters of a string, then a newline, then EOF. | 4817 | * Produce the characters of a string, then a newline, then EOF. |
| 4823 | */ | 4818 | */ |
| 4824 | static int nlchar(REGISTER struct ioarg *ap) | 4819 | static int nlchar(struct ioarg *ap) |
| 4825 | { | 4820 | { |
| 4826 | REGISTER int c; | 4821 | int c; |
| 4827 | 4822 | ||
| 4828 | if (ap->aword == NULL) | 4823 | if (ap->aword == NULL) |
| 4829 | return (0); | 4824 | return (0); |
| @@ -4838,10 +4833,10 @@ static int nlchar(REGISTER struct ioarg *ap) | |||
| 4838 | * Given a list of words, produce the characters | 4833 | * Given a list of words, produce the characters |
| 4839 | * in them, with a space after each word. | 4834 | * in them, with a space after each word. |
| 4840 | */ | 4835 | */ |
| 4841 | static int wdchar(REGISTER struct ioarg *ap) | 4836 | static int wdchar(struct ioarg *ap) |
| 4842 | { | 4837 | { |
| 4843 | REGISTER char c; | 4838 | char c; |
| 4844 | REGISTER char **wl; | 4839 | char **wl; |
| 4845 | 4840 | ||
| 4846 | if ((wl = ap->awordlist) == NULL) | 4841 | if ((wl = ap->awordlist) == NULL) |
| 4847 | return (0); | 4842 | return (0); |
| @@ -4859,9 +4854,9 @@ static int wdchar(REGISTER struct ioarg *ap) | |||
| 4859 | * Return the characters of a list of words, | 4854 | * Return the characters of a list of words, |
| 4860 | * producing a space between them. | 4855 | * producing a space between them. |
| 4861 | */ | 4856 | */ |
| 4862 | static int dolchar(REGISTER struct ioarg *ap) | 4857 | static int dolchar(struct ioarg *ap) |
| 4863 | { | 4858 | { |
| 4864 | REGISTER char *wp; | 4859 | char *wp; |
| 4865 | 4860 | ||
| 4866 | if ((wp = *ap->awordlist++) != NULL) { | 4861 | if ((wp = *ap->awordlist++) != NULL) { |
| 4867 | PUSHIO(aword, wp, *ap->awordlist == NULL ? strchar : xxchar); | 4862 | PUSHIO(aword, wp, *ap->awordlist == NULL ? strchar : xxchar); |
| @@ -4870,9 +4865,9 @@ static int dolchar(REGISTER struct ioarg *ap) | |||
| 4870 | return (0); | 4865 | return (0); |
| 4871 | } | 4866 | } |
| 4872 | 4867 | ||
| 4873 | static int xxchar(REGISTER struct ioarg *ap) | 4868 | static int xxchar(struct ioarg *ap) |
| 4874 | { | 4869 | { |
| 4875 | REGISTER int c; | 4870 | int c; |
| 4876 | 4871 | ||
| 4877 | if (ap->aword == NULL) | 4872 | if (ap->aword == NULL) |
| 4878 | return (0); | 4873 | return (0); |
| @@ -4886,9 +4881,9 @@ static int xxchar(REGISTER struct ioarg *ap) | |||
| 4886 | /* | 4881 | /* |
| 4887 | * Produce the characters from a single word (string). | 4882 | * Produce the characters from a single word (string). |
| 4888 | */ | 4883 | */ |
| 4889 | static int strchar(REGISTER struct ioarg *ap) | 4884 | static int strchar(struct ioarg *ap) |
| 4890 | { | 4885 | { |
| 4891 | REGISTER int c; | 4886 | int c; |
| 4892 | 4887 | ||
| 4893 | if (ap->aword == NULL || (c = *ap->aword++) == 0) | 4888 | if (ap->aword == NULL || (c = *ap->aword++) == 0) |
| 4894 | return (0); | 4889 | return (0); |
| @@ -4898,9 +4893,9 @@ static int strchar(REGISTER struct ioarg *ap) | |||
| 4898 | /* | 4893 | /* |
| 4899 | * Produce quoted characters from a single word (string). | 4894 | * Produce quoted characters from a single word (string). |
| 4900 | */ | 4895 | */ |
| 4901 | static int qstrchar(REGISTER struct ioarg *ap) | 4896 | static int qstrchar(struct ioarg *ap) |
| 4902 | { | 4897 | { |
| 4903 | REGISTER int c; | 4898 | int c; |
| 4904 | 4899 | ||
| 4905 | if (ap->aword == NULL || (c = *ap->aword++) == 0) | 4900 | if (ap->aword == NULL || (c = *ap->aword++) == 0) |
| 4906 | return (0); | 4901 | return (0); |
| @@ -4910,9 +4905,9 @@ static int qstrchar(REGISTER struct ioarg *ap) | |||
| 4910 | /* | 4905 | /* |
| 4911 | * Return the characters from a file. | 4906 | * Return the characters from a file. |
| 4912 | */ | 4907 | */ |
| 4913 | static int filechar(REGISTER struct ioarg *ap) | 4908 | static int filechar(struct ioarg *ap) |
| 4914 | { | 4909 | { |
| 4915 | REGISTER int i; | 4910 | int i; |
| 4916 | char c; | 4911 | char c; |
| 4917 | struct iobuf *bp = ap->afbuf; | 4912 | struct iobuf *bp = ap->afbuf; |
| 4918 | 4913 | ||
| @@ -4961,7 +4956,7 @@ static int filechar(REGISTER struct ioarg *ap) | |||
| 4961 | /* | 4956 | /* |
| 4962 | * Return the characters from a here temp file. | 4957 | * Return the characters from a here temp file. |
| 4963 | */ | 4958 | */ |
| 4964 | static int herechar(REGISTER struct ioarg *ap) | 4959 | static int herechar(struct ioarg *ap) |
| 4965 | { | 4960 | { |
| 4966 | char c; | 4961 | char c; |
| 4967 | 4962 | ||
| @@ -4980,16 +4975,16 @@ static int herechar(REGISTER struct ioarg *ap) | |||
| 4980 | */ | 4975 | */ |
| 4981 | static int gravechar(struct ioarg *ap, struct io *iop) | 4976 | static int gravechar(struct ioarg *ap, struct io *iop) |
| 4982 | { | 4977 | { |
| 4983 | REGISTER int c; | 4978 | int c; |
| 4984 | 4979 | ||
| 4985 | if ((c = qgravechar(ap, iop) & ~QUOTE) == '\n') | 4980 | if ((c = qgravechar(ap, iop) & ~QUOTE) == '\n') |
| 4986 | c = ' '; | 4981 | c = ' '; |
| 4987 | return (c); | 4982 | return (c); |
| 4988 | } | 4983 | } |
| 4989 | 4984 | ||
| 4990 | static int qgravechar(REGISTER struct ioarg *ap, struct io *iop) | 4985 | static int qgravechar(struct ioarg *ap, struct io *iop) |
| 4991 | { | 4986 | { |
| 4992 | REGISTER int c; | 4987 | int c; |
| 4993 | 4988 | ||
| 4994 | DBGPRINTF3(("QGRAVECHAR: enter, ap=%p, iop=%p\n", ap, iop)); | 4989 | DBGPRINTF3(("QGRAVECHAR: enter, ap=%p, iop=%p\n", ap, iop)); |
| 4995 | 4990 | ||
| @@ -5016,9 +5011,9 @@ static int qgravechar(REGISTER struct ioarg *ap, struct io *iop) | |||
| 5016 | /* | 5011 | /* |
| 5017 | * Return a single command (usually the first line) from a file. | 5012 | * Return a single command (usually the first line) from a file. |
| 5018 | */ | 5013 | */ |
| 5019 | static int linechar(REGISTER struct ioarg *ap) | 5014 | static int linechar(struct ioarg *ap) |
| 5020 | { | 5015 | { |
| 5021 | REGISTER int c; | 5016 | int c; |
| 5022 | 5017 | ||
| 5023 | if ((c = filechar(ap)) == '\n') { | 5018 | if ((c = filechar(ap)) == '\n') { |
| 5024 | if (!multiline) { | 5019 | if (!multiline) { |
| @@ -5029,7 +5024,7 @@ static int linechar(REGISTER struct ioarg *ap) | |||
| 5029 | return (c); | 5024 | return (c); |
| 5030 | } | 5025 | } |
| 5031 | 5026 | ||
| 5032 | static void prs(REGISTER const char *s) | 5027 | static void prs(const char *s) |
| 5033 | { | 5028 | { |
| 5034 | if (*s) | 5029 | if (*s) |
| 5035 | write(2, s, strlen(s)); | 5030 | write(2, s, strlen(s)); |
| @@ -5040,7 +5035,7 @@ static void prn(unsigned u) | |||
| 5040 | prs(itoa(u)); | 5035 | prs(itoa(u)); |
| 5041 | } | 5036 | } |
| 5042 | 5037 | ||
| 5043 | static void closef(REGISTER int i) | 5038 | static void closef(int i) |
| 5044 | { | 5039 | { |
| 5045 | if (i > 2) | 5040 | if (i > 2) |
| 5046 | close(i); | 5041 | close(i); |
| @@ -5048,7 +5043,7 @@ static void closef(REGISTER int i) | |||
| 5048 | 5043 | ||
| 5049 | static void closeall(void) | 5044 | static void closeall(void) |
| 5050 | { | 5045 | { |
| 5051 | REGISTER int u; | 5046 | int u; |
| 5052 | 5047 | ||
| 5053 | for (u = NUFILE; u < NOFILE;) | 5048 | for (u = NUFILE; u < NOFILE;) |
| 5054 | close(u++); | 5049 | close(u++); |
| @@ -5058,9 +5053,9 @@ static void closeall(void) | |||
| 5058 | /* | 5053 | /* |
| 5059 | * remap fd into Shell's fd space | 5054 | * remap fd into Shell's fd space |
| 5060 | */ | 5055 | */ |
| 5061 | static int remap(REGISTER int fd) | 5056 | static int remap(int fd) |
| 5062 | { | 5057 | { |
| 5063 | REGISTER int i; | 5058 | int i; |
| 5064 | int map[NOFILE]; | 5059 | int map[NOFILE]; |
| 5065 | int newfd; | 5060 | int newfd; |
| 5066 | 5061 | ||
| @@ -5088,16 +5083,16 @@ static int remap(REGISTER int fd) | |||
| 5088 | return (fd); | 5083 | return (fd); |
| 5089 | } | 5084 | } |
| 5090 | 5085 | ||
| 5091 | static int openpipe(REGISTER int *pv) | 5086 | static int openpipe(int *pv) |
| 5092 | { | 5087 | { |
| 5093 | REGISTER int i; | 5088 | int i; |
| 5094 | 5089 | ||
| 5095 | if ((i = pipe(pv)) < 0) | 5090 | if ((i = pipe(pv)) < 0) |
| 5096 | err("can't create pipe - try again"); | 5091 | err("can't create pipe - try again"); |
| 5097 | return (i); | 5092 | return (i); |
| 5098 | } | 5093 | } |
| 5099 | 5094 | ||
| 5100 | static void closepipe(REGISTER int *pv) | 5095 | static void closepipe(int *pv) |
| 5101 | { | 5096 | { |
| 5102 | if (pv != NULL) { | 5097 | if (pv != NULL) { |
| 5103 | close(*pv++); | 5098 | close(*pv++); |
| @@ -5111,9 +5106,9 @@ static void closepipe(REGISTER int *pv) | |||
| 5111 | * here documents | 5106 | * here documents |
| 5112 | */ | 5107 | */ |
| 5113 | 5108 | ||
| 5114 | static void markhere(REGISTER char *s, struct ioword *iop) | 5109 | static void markhere(char *s, struct ioword *iop) |
| 5115 | { | 5110 | { |
| 5116 | REGISTER struct here *h, *lh; | 5111 | struct here *h, *lh; |
| 5117 | 5112 | ||
| 5118 | DBGPRINTF7(("MARKHERE: enter, s=%p\n", s)); | 5113 | DBGPRINTF7(("MARKHERE: enter, s=%p\n", s)); |
| 5119 | 5114 | ||
| @@ -5147,7 +5142,7 @@ static void markhere(REGISTER char *s, struct ioword *iop) | |||
| 5147 | 5142 | ||
| 5148 | static void gethere(void) | 5143 | static void gethere(void) |
| 5149 | { | 5144 | { |
| 5150 | REGISTER struct here *h, *hp; | 5145 | struct here *h, *hp; |
| 5151 | 5146 | ||
| 5152 | DBGPRINTF7(("GETHERE: enter...\n")); | 5147 | DBGPRINTF7(("GETHERE: enter...\n")); |
| 5153 | 5148 | ||
| @@ -5163,11 +5158,11 @@ static void gethere(void) | |||
| 5163 | } | 5158 | } |
| 5164 | } | 5159 | } |
| 5165 | 5160 | ||
| 5166 | static void readhere(char **name, REGISTER char *s, int ec) | 5161 | static void readhere(char **name, char *s, int ec) |
| 5167 | { | 5162 | { |
| 5168 | int tf; | 5163 | int tf; |
| 5169 | char tname[30] = ".msh_XXXXXX"; | 5164 | char tname[30] = ".msh_XXXXXX"; |
| 5170 | REGISTER int c; | 5165 | int c; |
| 5171 | jmp_buf ev; | 5166 | jmp_buf ev; |
| 5172 | char myline[LINELIM + 1]; | 5167 | char myline[LINELIM + 1]; |
| 5173 | char *thenext; | 5168 | char *thenext; |
| @@ -5224,7 +5219,7 @@ static void readhere(char **name, REGISTER char *s, int ec) | |||
| 5224 | */ | 5219 | */ |
| 5225 | static int herein(char *hname, int xdoll) | 5220 | static int herein(char *hname, int xdoll) |
| 5226 | { | 5221 | { |
| 5227 | REGISTER int hf; | 5222 | int hf; |
| 5228 | int tf; | 5223 | int tf; |
| 5229 | 5224 | ||
| 5230 | #if __GNUC__ | 5225 | #if __GNUC__ |
| @@ -5268,7 +5263,7 @@ static int herein(char *hname, int xdoll) | |||
| 5268 | 5263 | ||
| 5269 | static void scraphere(void) | 5264 | static void scraphere(void) |
| 5270 | { | 5265 | { |
| 5271 | REGISTER struct here *h; | 5266 | struct here *h; |
| 5272 | 5267 | ||
| 5273 | DBGPRINTF7(("SCRAPHERE: enter...\n")); | 5268 | DBGPRINTF7(("SCRAPHERE: enter...\n")); |
| 5274 | 5269 | ||
| @@ -5282,7 +5277,7 @@ static void scraphere(void) | |||
| 5282 | /* unlink here temp files before a freearea(area) */ | 5277 | /* unlink here temp files before a freearea(area) */ |
| 5283 | static void freehere(int area) | 5278 | static void freehere(int area) |
| 5284 | { | 5279 | { |
| 5285 | REGISTER struct here *h, *hl; | 5280 | struct here *h, *hl; |
| 5286 | 5281 | ||
| 5287 | DBGPRINTF6(("FREEHERE: enter, area=%d\n", area)); | 5282 | DBGPRINTF6(("FREEHERE: enter, area=%d\n", area)); |
| 5288 | 5283 | ||
