aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-06-25 22:08:53 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-06-25 22:08:53 +0000
commitf087798e8bf5857b679c369601426ca29334caee (patch)
treee5f71b53c9af54ca4db5ca7aca9a7ab99a9d3934
parenta892bf82840423f680bba65c0e679657b0dd347f (diff)
downloadbusybox-w32-f087798e8bf5857b679c369601426ca29334caee.tar.gz
busybox-w32-f087798e8bf5857b679c369601426ca29334caee.tar.bz2
busybox-w32-f087798e8bf5857b679c369601426ca29334caee.zip
- convert old-style parameter declarations (K&R) to modern style.
-rw-r--r--miscutils/devfsd.c2
-rw-r--r--shell/ash.c5
-rw-r--r--shell/msh.c461
3 files changed, 154 insertions, 314 deletions
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c
index b2912a89e..9853067ee 100644
--- a/miscutils/devfsd.c
+++ b/miscutils/devfsd.c
@@ -1186,7 +1186,7 @@ do_chown:
1186 return (FALSE); 1186 return (FALSE);
1187} /* End Function copy_inode */ 1187} /* End Function copy_inode */
1188 1188
1189static void free_config () 1189static void free_config (void)
1190/* [SUMMARY] Free the configuration information. 1190/* [SUMMARY] Free the configuration information.
1191 [RETURNS] Nothing. 1191 [RETURNS] Nothing.
1192*/ 1192*/
diff --git a/shell/ash.c b/shell/ash.c
index 35d58b5d7..c2e70a535 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -9026,8 +9026,7 @@ setcmd(int argc, char **argv)
9026 9026
9027#ifdef CONFIG_ASH_GETOPTS 9027#ifdef CONFIG_ASH_GETOPTS
9028static void 9028static void
9029getoptsreset(value) 9029getoptsreset(const char *value)
9030 const char *value;
9031{ 9030{
9032 shellparam.optind = number(value); 9031 shellparam.optind = number(value);
9033 shellparam.optoff = -1; 9032 shellparam.optoff = -1;
@@ -9994,7 +9993,7 @@ static const char xxreadtoken_tokens[] = {
9994#define xxreadtoken_singles \ 9993#define xxreadtoken_singles \
9995 (sizeof(xxreadtoken_chars) - xxreadtoken_doubles - 1) 9994 (sizeof(xxreadtoken_chars) - xxreadtoken_doubles - 1)
9996 9995
9997static int xxreadtoken() 9996static int xxreadtoken(void)
9998{ 9997{
9999 int c; 9998 int c;
10000 9999
diff --git a/shell/msh.c b/shell/msh.c
index 2c0184392..a2d3864a3 100644
--- a/shell/msh.c
+++ b/shell/msh.c
@@ -308,7 +308,7 @@ static struct var *lookup(char *n);
308static int rlookup(char *n); 308static int rlookup(char *n);
309static struct wdblock *glob(char *cp, struct wdblock *wb); 309static struct wdblock *glob(char *cp, struct wdblock *wb);
310static int my_getc(int ec); 310static int my_getc(int ec);
311static int subgetc(int ec, int quoted); 311static int subgetc(char ec, int quoted);
312static char **makenv(int all, struct wdblock *wb); 312static char **makenv(int all, struct wdblock *wb);
313static char **eval(char **ap, int f); 313static char **eval(char **ap, int f);
314static int setstatus(int s); 314static int setstatus(int s);
@@ -522,7 +522,7 @@ static int run(struct ioarg *argp, int (*f) (struct ioarg *));
522static int eofc(void); 522static int eofc(void);
523static int readc(void); 523static int readc(void);
524static void unget(int c); 524static void unget(int c);
525static void ioecho(int c); 525static void ioecho(char c);
526static void prs(const char *s); 526static void prs(const char *s);
527static void prn(unsigned u); 527static void prn(unsigned u);
528static void closef(int i); 528static void closef(int i);
@@ -1020,7 +1020,7 @@ int msh_main(int argc, char **argv)
1020 DBGPRINTF(("MSH_MAIN: returning.\n")); 1020 DBGPRINTF(("MSH_MAIN: returning.\n"));
1021} 1021}
1022 1022
1023static void setdash() 1023static void setdash(void)
1024{ 1024{
1025 REGISTER char *cp; 1025 REGISTER char *cp;
1026 REGISTER int c; 1026 REGISTER int c;
@@ -1034,8 +1034,7 @@ static void setdash()
1034 setval(lookup("-"), m); 1034 setval(lookup("-"), m);
1035} 1035}
1036 1036
1037static int newfile(s) 1037static int newfile(REGISTER char *s)
1038REGISTER char *s;
1039{ 1038{
1040 REGISTER int f; 1039 REGISTER int f;
1041 1040
@@ -1057,8 +1056,7 @@ REGISTER char *s;
1057} 1056}
1058 1057
1059 1058
1060struct op *scantree(head) 1059struct op *scantree(struct op *head)
1061struct op *head;
1062{ 1060{
1063 struct op *dotnode; 1061 struct op *dotnode;
1064 1062
@@ -1091,7 +1089,7 @@ struct op *head;
1091} 1089}
1092 1090
1093 1091
1094static void onecommand() 1092static void onecommand(void)
1095{ 1093{
1096 REGISTER int i; 1094 REGISTER int i;
1097 jmp_buf m1; 1095 jmp_buf m1;
@@ -1152,13 +1150,13 @@ static void onecommand()
1152 } 1150 }
1153} 1151}
1154 1152
1155static void fail() 1153static void fail(void)
1156{ 1154{
1157 longjmp(failpt, 1); 1155 longjmp(failpt, 1);
1158 /* NOTREACHED */ 1156 /* NOTREACHED */
1159} 1157}
1160 1158
1161static void leave() 1159static void leave(void)
1162{ 1160{
1163 DBGPRINTF(("LEAVE: leave called!\n")); 1161 DBGPRINTF(("LEAVE: leave called!\n"));
1164 1162
@@ -1171,8 +1169,7 @@ static void leave()
1171 /* NOTREACHED */ 1169 /* NOTREACHED */
1172} 1170}
1173 1171
1174static void warn(s) 1172static void warn(REGISTER char *s)
1175REGISTER char *s;
1176{ 1173{
1177 if (*s) { 1174 if (*s) {
1178 prs(s); 1175 prs(s);
@@ -1183,8 +1180,7 @@ REGISTER char *s;
1183 leave(); 1180 leave();
1184} 1181}
1185 1182
1186static void err(s) 1183static void err(char *s)
1187char *s;
1188{ 1184{
1189 warn(s); 1185 warn(s);
1190 if (flag['n']) 1186 if (flag['n'])
@@ -1197,8 +1193,7 @@ char *s;
1197 e.iop = e.iobase = iostack; 1193 e.iop = e.iobase = iostack;
1198} 1194}
1199 1195
1200static int newenv(f) 1196static int newenv(int f)
1201int f;
1202{ 1197{
1203 REGISTER struct env *ep; 1198 REGISTER struct env *ep;
1204 1199
@@ -1222,7 +1217,7 @@ int f;
1222 return (0); 1217 return (0);
1223} 1218}
1224 1219
1225static void quitenv() 1220static void quitenv(void)
1226{ 1221{
1227 REGISTER struct env *ep; 1222 REGISTER struct env *ep;
1228 REGISTER int fd; 1223 REGISTER int fd;
@@ -1242,8 +1237,7 @@ static void quitenv()
1242/* 1237/*
1243 * Is any character from s1 in s2? 1238 * Is any character from s1 in s2?
1244 */ 1239 */
1245static int anys(s1, s2) 1240static int anys(REGISTER char *s1, REGISTER char *s2)
1246REGISTER char *s1, *s2;
1247{ 1241{
1248 while (*s1) 1242 while (*s1)
1249 if (any(*s1++, s2)) 1243 if (any(*s1++, s2))
@@ -1254,9 +1248,7 @@ REGISTER char *s1, *s2;
1254/* 1248/*
1255 * Is character c in s? 1249 * Is character c in s?
1256 */ 1250 */
1257static int any(c, s) 1251static int any(REGISTER int c, REGISTER char *s)
1258REGISTER int c;
1259REGISTER char *s;
1260{ 1252{
1261 while (*s) 1253 while (*s)
1262 if (*s++ == c) 1254 if (*s++ == c)
@@ -1264,14 +1256,12 @@ REGISTER char *s;
1264 return (0); 1256 return (0);
1265} 1257}
1266 1258
1267static char *putn(n) 1259static char *putn(REGISTER int n)
1268REGISTER int n;
1269{ 1260{
1270 return (itoa(n)); 1261 return (itoa(n));
1271} 1262}
1272 1263
1273static char *itoa(n) 1264static char *itoa(REGISTER int n)
1274REGISTER int n;
1275{ 1265{
1276 static char s[20]; 1266 static char s[20];
1277 1267
@@ -1285,8 +1275,7 @@ static void next(int f)
1285 PUSHIO(afile, f, filechar); 1275 PUSHIO(afile, f, filechar);
1286} 1276}
1287 1277
1288static void onintr(s) 1278static void onintr(int s) /* ANSI C requires a parameter */
1289int s; /* ANSI C requires a parameter */
1290{ 1279{
1291 signal(SIGINT, onintr); 1280 signal(SIGINT, onintr);
1292 intr = 1; 1281 intr = 1;
@@ -1301,8 +1290,7 @@ int s; /* ANSI C requires a parameter */
1301 } 1290 }
1302} 1291}
1303 1292
1304static char *space(n) 1293static char *space(int n)
1305int n;
1306{ 1294{
1307 REGISTER char *cp; 1295 REGISTER char *cp;
1308 1296
@@ -1311,9 +1299,7 @@ int n;
1311 return (cp); 1299 return (cp);
1312} 1300}
1313 1301
1314static char *strsave(s, a) 1302static char *strsave(REGISTER char *s, int a)
1315REGISTER char *s;
1316int a;
1317{ 1303{
1318 REGISTER char *cp, *xp; 1304 REGISTER char *cp, *xp;
1319 1305
@@ -1328,15 +1314,13 @@ int a;
1328/* 1314/*
1329 * trap handling 1315 * trap handling
1330 */ 1316 */
1331static void sig(i) 1317static void sig(REGISTER int i)
1332REGISTER int i;
1333{ 1318{
1334 trapset = i; 1319 trapset = i;
1335 signal(i, sig); 1320 signal(i, sig);
1336} 1321}
1337 1322
1338static void runtrap(i) 1323static void runtrap(int i)
1339int i;
1340{ 1324{
1341 char *trapstr; 1325 char *trapstr;
1342 1326
@@ -1357,8 +1341,7 @@ int i;
1357 * not previously there, enter it now and 1341 * not previously there, enter it now and
1358 * return a null value. 1342 * return a null value.
1359 */ 1343 */
1360static struct var *lookup(n) 1344static struct var *lookup(REGISTER char *n)
1361REGISTER char *n;
1362{ 1345{
1363 REGISTER struct var *vp; 1346 REGISTER struct var *vp;
1364 REGISTER char *cp; 1347 REGISTER char *cp;
@@ -1398,9 +1381,7 @@ REGISTER char *n;
1398/* 1381/*
1399 * give variable at `vp' the value `val'. 1382 * give variable at `vp' the value `val'.
1400 */ 1383 */
1401static void setval(vp, val) 1384static void setval(struct var *vp, char *val)
1402struct var *vp;
1403char *val;
1404{ 1385{
1405 nameval(vp, val, (char *) NULL); 1386 nameval(vp, val, (char *) NULL);
1406} 1387}
@@ -1412,9 +1393,7 @@ char *val;
1412 * this is all so that exporting 1393 * this is all so that exporting
1413 * values is reasonably painless. 1394 * values is reasonably painless.
1414 */ 1395 */
1415static void nameval(vp, val, name) 1396static void nameval(REGISTER struct var *vp, char *val, char *name)
1416REGISTER struct var *vp;
1417char *val, *name;
1418{ 1397{
1419 REGISTER char *cp, *xp; 1398 REGISTER char *cp, *xp;
1420 char *nv; 1399 char *nv;
@@ -1449,21 +1428,18 @@ char *val, *name;
1449 vp->status |= fl; 1428 vp->status |= fl;
1450} 1429}
1451 1430
1452static void export(vp) 1431static void export(struct var *vp)
1453struct var *vp;
1454{ 1432{
1455 vp->status |= EXPORT; 1433 vp->status |= EXPORT;
1456} 1434}
1457 1435
1458static void ronly(vp) 1436static void ronly(struct var *vp)
1459struct var *vp;
1460{ 1437{
1461 if (isalpha(vp->name[0]) || vp->name[0] == '_') /* not an internal symbol */ 1438 if (isalpha(vp->name[0]) || vp->name[0] == '_') /* not an internal symbol */
1462 vp->status |= RONLY; 1439 vp->status |= RONLY;
1463} 1440}
1464 1441
1465static int isassign(s) 1442static int isassign(REGISTER char *s)
1466REGISTER char *s;
1467{ 1443{
1468 DBGPRINTF7(("ISASSIGN: enter, s=%s\n", s)); 1444 DBGPRINTF7(("ISASSIGN: enter, s=%s\n", s));
1469 1445
@@ -1476,9 +1452,7 @@ REGISTER char *s;
1476 return (1); 1452 return (1);
1477} 1453}
1478 1454
1479static int assign(s, cf) 1455static int assign(REGISTER char *s, int cf)
1480REGISTER char *s;
1481int cf;
1482{ 1456{
1483 REGISTER char *cp; 1457 REGISTER char *cp;
1484 struct var *vp; 1458 struct var *vp;
@@ -1497,8 +1471,7 @@ int cf;
1497 return (1); 1471 return (1);
1498} 1472}
1499 1473
1500static int checkname(cp) 1474static int checkname(REGISTER char *cp)
1501REGISTER char *cp;
1502{ 1475{
1503 DBGPRINTF7(("CHECKNAME: enter, cp=%s\n", cp)); 1476 DBGPRINTF7(("CHECKNAME: enter, cp=%s\n", cp));
1504 1477
@@ -1510,8 +1483,7 @@ REGISTER char *cp;
1510 return (1); 1483 return (1);
1511} 1484}
1512 1485
1513static void putvlist(f, out) 1486static void putvlist(REGISTER int f, REGISTER int out)
1514REGISTER int f, out;
1515{ 1487{
1516 REGISTER struct var *vp; 1488 REGISTER struct var *vp;
1517 1489
@@ -1526,8 +1498,7 @@ REGISTER int f, out;
1526 } 1498 }
1527} 1499}
1528 1500
1529static int eqname(n1, n2) 1501static int eqname(REGISTER char *n1, REGISTER char *n2)
1530REGISTER char *n1, *n2;
1531{ 1502{
1532 for (; *n1 != '=' && *n1 != 0; n1++) 1503 for (; *n1 != '=' && *n1 != 0; n1++)
1533 if (*n2++ != *n1) 1504 if (*n2++ != *n1)
@@ -1535,8 +1506,7 @@ REGISTER char *n1, *n2;
1535 return (*n2 == 0 || *n2 == '='); 1506 return (*n2 == 0 || *n2 == '=');
1536} 1507}
1537 1508
1538static char *findeq(cp) 1509static char *findeq(REGISTER char *cp)
1539REGISTER char *cp;
1540{ 1510{
1541 while (*cp != '\0' && *cp != '=') 1511 while (*cp != '\0' && *cp != '=')
1542 cp++; 1512 cp++;
@@ -1556,8 +1526,7 @@ REGISTER char *cp;
1556#define QMASK (CMASK&~QUOTE) 1526#define QMASK (CMASK&~QUOTE)
1557#define NOT '!' /* might use ^ */ 1527#define NOT '!' /* might use ^ */
1558 1528
1559static int gmatch(s, p) 1529static int gmatch(REGISTER char *s, REGISTER char *p)
1560REGISTER char *s, *p;
1561{ 1530{
1562 REGISTER int sc, pc; 1531 REGISTER int sc, pc;
1563 1532
@@ -1592,9 +1561,7 @@ REGISTER char *s, *p;
1592 return (*s == 0); 1561 return (*s == 0);
1593} 1562}
1594 1563
1595static char *cclass(p, sub) 1564static char *cclass(REGISTER char *p, REGISTER int sub)
1596REGISTER char *p;
1597REGISTER int sub;
1598{ 1565{
1599 REGISTER int c, d, not, found; 1566 REGISTER int c, d, not, found;
1600 1567
@@ -1627,7 +1594,7 @@ REGISTER int sub;
1627 1594
1628#define sbrk(X) ({ void * __q = (void *)-1; if (brkaddr + (int)(X) < brktop) { __q = brkaddr; brkaddr+=(int)(X); } __q;}) 1595#define sbrk(X) ({ void * __q = (void *)-1; if (brkaddr + (int)(X) < brktop) { __q = brkaddr; brkaddr+=(int)(X); } __q;})
1629 1596
1630static void initarea() 1597static void initarea(void)
1631{ 1598{
1632 brkaddr = xmalloc(AREASIZE); 1599 brkaddr = xmalloc(AREASIZE);
1633 brktop = brkaddr + AREASIZE; 1600 brktop = brkaddr + AREASIZE;
@@ -1642,8 +1609,7 @@ static void initarea()
1642 areanxt = areabot; 1609 areanxt = areabot;
1643} 1610}
1644 1611
1645char *getcell(nbytes) 1612char *getcell(unsigned nbytes)
1646unsigned nbytes;
1647{ 1613{
1648 REGISTER int nregio; 1614 REGISTER int nregio;
1649 REGISTER struct region *p, *q; 1615 REGISTER struct region *p, *q;
@@ -1711,8 +1677,7 @@ unsigned nbytes;
1711 return ((char *) (p + 1)); 1677 return ((char *) (p + 1));
1712} 1678}
1713 1679
1714static void freecell(cp) 1680static void freecell(char *cp)
1715char *cp;
1716{ 1681{
1717 REGISTER struct region *p; 1682 REGISTER struct region *p;
1718 1683
@@ -1724,8 +1689,7 @@ char *cp;
1724 } 1689 }
1725} 1690}
1726 1691
1727static void freearea(a) 1692static void freearea(REGISTER int a)
1728REGISTER int a;
1729{ 1693{
1730 REGISTER struct region *p, *top; 1694 REGISTER struct region *p, *top;
1731 1695
@@ -1735,9 +1699,7 @@ REGISTER int a;
1735 p->area = FREE; 1699 p->area = FREE;
1736} 1700}
1737 1701
1738static void setarea(cp, a) 1702static void setarea(char *cp, int a)
1739char *cp;
1740int a;
1741{ 1703{
1742 REGISTER struct region *p; 1704 REGISTER struct region *p;
1743 1705
@@ -1745,13 +1707,12 @@ int a;
1745 (p - 1)->area = a; 1707 (p - 1)->area = a;
1746} 1708}
1747 1709
1748int getarea(cp) 1710int getarea(char *cp)
1749char *cp;
1750{ 1711{
1751 return ((struct region *) cp - 1)->area; 1712 return ((struct region *) cp - 1)->area;
1752} 1713}
1753 1714
1754static void garbage() 1715static void garbage(void)
1755{ 1716{
1756 REGISTER struct region *p, *q, *top; 1717 REGISTER struct region *p, *q, *top;
1757 1718
@@ -1778,7 +1739,7 @@ static void garbage()
1778 * shell: syntax (C version) 1739 * shell: syntax (C version)
1779 */ 1740 */
1780 1741
1781int yyparse() 1742int yyparse(void)
1782{ 1743{
1783 DBGPRINTF7(("YYPARSE: enter...\n")); 1744 DBGPRINTF7(("YYPARSE: enter...\n"));
1784 1745
@@ -1790,8 +1751,7 @@ int yyparse()
1790 return (yynerrs != 0); 1751 return (yynerrs != 0);
1791} 1752}
1792 1753
1793static struct op *pipeline(cf) 1754static struct op *pipeline(int cf)
1794int cf;
1795{ 1755{
1796 REGISTER struct op *t, *p; 1756 REGISTER struct op *t, *p;
1797 REGISTER int c; 1757 REGISTER int c;
@@ -1823,7 +1783,7 @@ int cf;
1823 return (t); 1783 return (t);
1824} 1784}
1825 1785
1826static struct op *andor() 1786static struct op *andor(void)
1827{ 1787{
1828 REGISTER struct op *t, *p; 1788 REGISTER struct op *t, *p;
1829 REGISTER int c; 1789 REGISTER int c;
@@ -1851,7 +1811,7 @@ static struct op *andor()
1851 return (t); 1811 return (t);
1852} 1812}
1853 1813
1854static struct op *c_list() 1814static struct op *c_list(void)
1855{ 1815{
1856 REGISTER struct op *t, *p; 1816 REGISTER struct op *t, *p;
1857 REGISTER int c; 1817 REGISTER int c;
@@ -1883,8 +1843,7 @@ static struct op *c_list()
1883 return (t); 1843 return (t);
1884} 1844}
1885 1845
1886static int synio(cf) 1846static int synio(int cf)
1887int cf;
1888{ 1847{
1889 REGISTER struct ioword *iop; 1848 REGISTER struct ioword *iop;
1890 REGISTER int i; 1849 REGISTER int i;
@@ -1909,8 +1868,7 @@ int cf;
1909 return (1); 1868 return (1);
1910} 1869}
1911 1870
1912static void musthave(c, cf) 1871static void musthave(int c, int cf)
1913int c, cf;
1914{ 1872{
1915 if ((peeksym = yylex(cf)) != c) { 1873 if ((peeksym = yylex(cf)) != c) {
1916 DBGPRINTF7(("MUSTHAVE: error!\n")); 1874 DBGPRINTF7(("MUSTHAVE: error!\n"));
@@ -1920,7 +1878,7 @@ int c, cf;
1920 peeksym = 0; 1878 peeksym = 0;
1921} 1879}
1922 1880
1923static struct op *simple() 1881static struct op *simple(void)
1924{ 1882{
1925 REGISTER struct op *t; 1883 REGISTER struct op *t;
1926 1884
@@ -1947,8 +1905,7 @@ static struct op *simple()
1947 } 1905 }
1948} 1906}
1949 1907
1950static struct op *nested(type, mark) 1908static struct op *nested(int type, int mark)
1951int type, mark;
1952{ 1909{
1953 REGISTER struct op *t; 1910 REGISTER struct op *t;
1954 1911
@@ -1961,8 +1918,7 @@ int type, mark;
1961 return (block(type, t, NOBLOCK, NOWORDS)); 1918 return (block(type, t, NOBLOCK, NOWORDS));
1962} 1919}
1963 1920
1964static struct op *command(cf) 1921static struct op *command(int cf)
1965int cf;
1966{ 1922{
1967 REGISTER struct op *t; 1923 REGISTER struct op *t;
1968 struct wdblock *iosave; 1924 struct wdblock *iosave;
@@ -2075,9 +2031,7 @@ int cf;
2075 return (t); 2031 return (t);
2076} 2032}
2077 2033
2078static struct op *dowholefile(type, mark) 2034static struct op *dowholefile(int type, int mark)
2079int type;
2080int mark;
2081{ 2035{
2082 REGISTER struct op *t; 2036 REGISTER struct op *t;
2083 2037
@@ -2091,8 +2045,7 @@ int mark;
2091 return (t); 2045 return (t);
2092} 2046}
2093 2047
2094static struct op *dogroup(onlydone) 2048static struct op *dogroup(int onlydone)
2095int onlydone;
2096{ 2049{
2097 REGISTER int c; 2050 REGISTER int c;
2098 REGISTER struct op *mylist; 2051 REGISTER struct op *mylist;
@@ -2107,7 +2060,7 @@ int onlydone;
2107 return (mylist); 2060 return (mylist);
2108} 2061}
2109 2062
2110static struct op *thenpart() 2063static struct op *thenpart(void)
2111{ 2064{
2112 REGISTER int c; 2065 REGISTER int c;
2113 REGISTER struct op *t; 2066 REGISTER struct op *t;
@@ -2125,7 +2078,7 @@ static struct op *thenpart()
2125 return (t); 2078 return (t);
2126} 2079}
2127 2080
2128static struct op *elsepart() 2081static struct op *elsepart(void)
2129{ 2082{
2130 REGISTER int c; 2083 REGISTER int c;
2131 REGISTER struct op *t; 2084 REGISTER struct op *t;
@@ -2149,7 +2102,7 @@ static struct op *elsepart()
2149 } 2102 }
2150} 2103}
2151 2104
2152static struct op *caselist() 2105static struct op *caselist(void)
2153{ 2106{
2154 REGISTER struct op *t; 2107 REGISTER struct op *t;
2155 2108
@@ -2163,7 +2116,7 @@ static struct op *caselist()
2163 return (t); 2116 return (t);
2164} 2117}
2165 2118
2166static struct op *casepart() 2119static struct op *casepart(void)
2167{ 2120{
2168 REGISTER struct op *t; 2121 REGISTER struct op *t;
2169 2122
@@ -2182,7 +2135,7 @@ static struct op *casepart()
2182 return (t); 2135 return (t);
2183} 2136}
2184 2137
2185static char **pattern() 2138static char **pattern(void)
2186{ 2139{
2187 REGISTER int c, cf; 2140 REGISTER int c, cf;
2188 2141
@@ -2198,7 +2151,7 @@ static char **pattern()
2198 return (copyw()); 2151 return (copyw());
2199} 2152}
2200 2153
2201static char **wordlist() 2154static char **wordlist(void)
2202{ 2155{
2203 REGISTER int c; 2156 REGISTER int c;
2204 2157
@@ -2217,8 +2170,7 @@ static char **wordlist()
2217/* 2170/*
2218 * supporting functions 2171 * supporting functions
2219 */ 2172 */
2220static struct op *list(t1, t2) 2173static struct op *list(REGISTER struct op *t1, REGISTER struct op *t2)
2221REGISTER struct op *t1, *t2;
2222{ 2174{
2223 DBGPRINTF7(("LIST: enter, t1=%p, t2=%p\n", t1, t2)); 2175 DBGPRINTF7(("LIST: enter, t1=%p, t2=%p\n", t1, t2));
2224 2176
@@ -2230,10 +2182,7 @@ REGISTER struct op *t1, *t2;
2230 return (block(TLIST, t1, t2, NOWORDS)); 2182 return (block(TLIST, t1, t2, NOWORDS));
2231} 2183}
2232 2184
2233static struct op *block(type, t1, t2, wp) 2185static struct op *block(int type, struct op *t1, struct op *t2, char **wp)
2234int type;
2235struct op *t1, *t2;
2236char **wp;
2237{ 2186{
2238 REGISTER struct op *t; 2187 REGISTER struct op *t;
2239 2188
@@ -2252,8 +2201,7 @@ char **wp;
2252} 2201}
2253 2202
2254/* See if given string is a shell multiline (FOR, IF, etc) */ 2203/* See if given string is a shell multiline (FOR, IF, etc) */
2255static int rlookup(n) 2204static int rlookup(REGISTER char *n)
2256REGISTER char *n;
2257{ 2205{
2258 REGISTER const struct res *rp; 2206 REGISTER const struct res *rp;
2259 2207
@@ -2269,7 +2217,7 @@ REGISTER char *n;
2269 return (0); /* Not a shell multiline */ 2217 return (0); /* Not a shell multiline */
2270} 2218}
2271 2219
2272static struct op *newtp() 2220static struct op *newtp(void)
2273{ 2221{
2274 REGISTER struct op *t; 2222 REGISTER struct op *t;
2275 2223
@@ -2286,8 +2234,7 @@ static struct op *newtp()
2286 return (t); 2234 return (t);
2287} 2235}
2288 2236
2289static struct op *namelist(t) 2237static struct op *namelist(REGISTER struct op *t)
2290REGISTER struct op *t;
2291{ 2238{
2292 2239
2293 DBGPRINTF7(("NAMELIST: enter, t=%p, type %s, iolist=%p\n", t, 2240 DBGPRINTF7(("NAMELIST: enter, t=%p, type %s, iolist=%p\n", t,
@@ -2315,7 +2262,7 @@ REGISTER struct op *t;
2315 return (t); 2262 return (t);
2316} 2263}
2317 2264
2318static char **copyw() 2265static char **copyw(void)
2319{ 2266{
2320 REGISTER char **wd; 2267 REGISTER char **wd;
2321 2268
@@ -2324,13 +2271,12 @@ static char **copyw()
2324 return (wd); 2271 return (wd);
2325} 2272}
2326 2273
2327static void word(cp) 2274static void word(char *cp)
2328char *cp;
2329{ 2275{
2330 wdlist = addword(cp, wdlist); 2276 wdlist = addword(cp, wdlist);
2331} 2277}
2332 2278
2333static struct ioword **copyio() 2279static struct ioword **copyio(void)
2334{ 2280{
2335 REGISTER struct ioword **iop; 2281 REGISTER struct ioword **iop;
2336 2282
@@ -2339,10 +2285,7 @@ static struct ioword **copyio()
2339 return (iop); 2285 return (iop);
2340} 2286}
2341 2287
2342static struct ioword *io(u, f, cp) 2288static struct ioword *io(int u, int f, char *cp)
2343int u;
2344int f;
2345char *cp;
2346{ 2289{
2347 REGISTER struct ioword *iop; 2290 REGISTER struct ioword *iop;
2348 2291
@@ -2354,13 +2297,12 @@ char *cp;
2354 return (iop); 2297 return (iop);
2355} 2298}
2356 2299
2357static void zzerr() 2300static void zzerr(void)
2358{ 2301{
2359 yyerror("syntax error"); 2302 yyerror("syntax error");
2360} 2303}
2361 2304
2362static void yyerror(s) 2305static void yyerror(char *s)
2363char *s;
2364{ 2306{
2365 yynerrs++; 2307 yynerrs++;
2366 if (interactive && e.iop <= iostack) { 2308 if (interactive && e.iop <= iostack) {
@@ -2371,8 +2313,7 @@ char *s;
2371 fail(); 2313 fail();
2372} 2314}
2373 2315
2374static int yylex(cf) 2316static int yylex(int cf)
2375int cf;
2376{ 2317{
2377 REGISTER int c, c1; 2318 REGISTER int c, c1;
2378 int atstart; 2319 int atstart;
@@ -2505,8 +2446,7 @@ int cf;
2505} 2446}
2506 2447
2507 2448
2508static int collect(c, c1) 2449static int collect(REGISTER int c, REGISTER int c1)
2509REGISTER int c, c1;
2510{ 2450{
2511 char s[2]; 2451 char s[2];
2512 2452
@@ -2541,8 +2481,7 @@ REGISTER int c, c1;
2541 2481
2542/* "multiline commands" helper func */ 2482/* "multiline commands" helper func */
2543/* see if next 2 chars form a shell multiline */ 2483/* see if next 2 chars form a shell multiline */
2544static int dual(c) 2484static int dual(REGISTER int c)
2545REGISTER int c;
2546{ 2485{
2547 char s[3]; 2486 char s[3];
2548 REGISTER char *cp = s; 2487 REGISTER char *cp = s;
@@ -2560,8 +2499,7 @@ REGISTER int c;
2560 return (c); /* String is multiline, return numeric multiline (restab) code */ 2499 return (c); /* String is multiline, return numeric multiline (restab) code */
2561} 2500}
2562 2501
2563static void diag(ec) 2502static void diag(REGISTER int ec)
2564REGISTER int ec;
2565{ 2503{
2566 REGISTER int c; 2504 REGISTER int c;
2567 2505
@@ -2581,8 +2519,7 @@ REGISTER int ec;
2581 yylval.i |= IODUP; 2519 yylval.i |= IODUP;
2582} 2520}
2583 2521
2584static char *tree(size) 2522static char *tree(unsigned size)
2585unsigned size;
2586{ 2523{
2587 REGISTER char *t; 2524 REGISTER char *t;
2588 2525
@@ -2605,10 +2542,7 @@ unsigned size;
2605 */ 2542 */
2606 2543
2607 2544
2608static int execute(t, pin, pout, act) 2545static int execute(REGISTER struct op *t, int *pin, int *pout, int act)
2609REGISTER struct op *t;
2610int *pin, *pout;
2611int act;
2612{ 2546{
2613 REGISTER struct op *t1; 2547 REGISTER struct op *t1;
2614 volatile int i, rv, a; 2548 volatile int i, rv, a;
@@ -3065,9 +2999,7 @@ forkexec(REGISTER struct op *t, int *pin, int *pout, int act, char **wp)
3065 * 0< 1> are ignored as required 2999 * 0< 1> are ignored as required
3066 * within pipelines. 3000 * within pipelines.
3067 */ 3001 */
3068static int iosetup(iop, pipein, pipeout) 3002static int iosetup(REGISTER struct ioword *iop, int pipein, int pipeout)
3069REGISTER struct ioword *iop;
3070int pipein, pipeout;
3071{ 3003{
3072 REGISTER int u = -1; 3004 REGISTER int u = -1;
3073 char *cp = NULL, *msg; 3005 char *cp = NULL, *msg;
@@ -3143,8 +3075,7 @@ int pipein, pipeout;
3143 return (0); 3075 return (0);
3144} 3076}
3145 3077
3146static void echo(wp) 3078static void echo(REGISTER char **wp)
3147REGISTER char **wp;
3148{ 3079{
3149 REGISTER int i; 3080 REGISTER int i;
3150 3081
@@ -3157,9 +3088,7 @@ REGISTER char **wp;
3157 prs("\n"); 3088 prs("\n");
3158} 3089}
3159 3090
3160static struct op **find1case(t, w) 3091static struct op **find1case(struct op *t, char *w)
3161struct op *t;
3162char *w;
3163{ 3092{
3164 REGISTER struct op *t1; 3093 REGISTER struct op *t1;
3165 struct op **tp; 3094 struct op **tp;
@@ -3194,9 +3123,7 @@ char *w;
3194 return ((struct op **) NULL); 3123 return ((struct op **) NULL);
3195} 3124}
3196 3125
3197static struct op *findcase(t, w) 3126static struct op *findcase(struct op *t, char *w)
3198struct op *t;
3199char *w;
3200{ 3127{
3201 REGISTER struct op **tp; 3128 REGISTER struct op **tp;
3202 3129
@@ -3206,8 +3133,7 @@ char *w;
3206/* 3133/*
3207 * Enter a new loop level (marked for break/continue). 3134 * Enter a new loop level (marked for break/continue).
3208 */ 3135 */
3209static void brkset(bc) 3136static void brkset(struct brkcon *bc)
3210struct brkcon *bc;
3211{ 3137{
3212 bc->nextlev = brklist; 3138 bc->nextlev = brklist;
3213 brklist = bc; 3139 brklist = bc;
@@ -3220,9 +3146,7 @@ struct brkcon *bc;
3220 * Ignore interrupt signals while waiting 3146 * Ignore interrupt signals while waiting
3221 * unless `canintr' is true. 3147 * unless `canintr' is true.
3222 */ 3148 */
3223static int waitfor(lastpid, canintr) 3149static int waitfor(REGISTER int lastpid, int canintr)
3224REGISTER int lastpid;
3225int canintr;
3226{ 3150{
3227 REGISTER int pid, rv; 3151 REGISTER int pid, rv;
3228 int s; 3152 int s;
@@ -3277,8 +3201,7 @@ int canintr;
3277 return (rv); 3201 return (rv);
3278} 3202}
3279 3203
3280static int setstatus(s) 3204static int setstatus(REGISTER int s)
3281REGISTER int s;
3282{ 3205{
3283 exstat = s; 3206 exstat = s;
3284 setval(lookup("?"), putn(s)); 3207 setval(lookup("?"), putn(s));
@@ -3290,8 +3213,7 @@ REGISTER int s;
3290 * If getenv("PATH") were kept up-to-date, 3213 * If getenv("PATH") were kept up-to-date,
3291 * execvp might be used. 3214 * execvp might be used.
3292 */ 3215 */
3293static char *rexecve(c, v, envp) 3216static char *rexecve(char *c, char **v, char **envp)
3294char *c, **v, **envp;
3295{ 3217{
3296 REGISTER int i; 3218 REGISTER int i;
3297 REGISTER char *sp, *tp; 3219 REGISTER char *sp, *tp;
@@ -3455,8 +3377,7 @@ static int dolabel(struct op *t)
3455 return (0); 3377 return (0);
3456} 3378}
3457 3379
3458static int dochdir(t) 3380static int dochdir(REGISTER struct op *t)
3459REGISTER struct op *t;
3460{ 3381{
3461 REGISTER char *cp, *er; 3382 REGISTER char *cp, *er;
3462 3383
@@ -3471,8 +3392,7 @@ REGISTER struct op *t;
3471 return (1); 3392 return (1);
3472} 3393}
3473 3394
3474static int doshift(t) 3395static int doshift(REGISTER struct op *t)
3475REGISTER struct op *t;
3476{ 3396{
3477 REGISTER int n; 3397 REGISTER int n;
3478 3398
@@ -3491,8 +3411,7 @@ REGISTER struct op *t;
3491/* 3411/*
3492 * execute login and newgrp directly 3412 * execute login and newgrp directly
3493 */ 3413 */
3494static int dologin(t) 3414static int dologin(struct op *t)
3495struct op *t;
3496{ 3415{
3497 REGISTER char *cp; 3416 REGISTER char *cp;
3498 3417
@@ -3507,8 +3426,7 @@ struct op *t;
3507 return (1); 3426 return (1);
3508} 3427}
3509 3428
3510static int doumask(t) 3429static int doumask(REGISTER struct op *t)
3511REGISTER struct op *t;
3512{ 3430{
3513 REGISTER int i, n; 3431 REGISTER int i, n;
3514 REGISTER char *cp; 3432 REGISTER char *cp;
@@ -3527,8 +3445,7 @@ REGISTER struct op *t;
3527 return (0); 3445 return (0);
3528} 3446}
3529 3447
3530static int doexec(t) 3448static int doexec(REGISTER struct op *t)
3531REGISTER struct op *t;
3532{ 3449{
3533 REGISTER int i; 3450 REGISTER int i;
3534 jmp_buf ex; 3451 jmp_buf ex;
@@ -3547,8 +3464,7 @@ REGISTER struct op *t;
3547 return (1); 3464 return (1);
3548} 3465}
3549 3466
3550static int dodot(t) 3467static int dodot(struct op *t)
3551struct op *t;
3552{ 3468{
3553 REGISTER int i; 3469 REGISTER int i;
3554 REGISTER char *sp, *tp; 3470 REGISTER char *sp, *tp;
@@ -3600,8 +3516,7 @@ struct op *t;
3600 return (-1); 3516 return (-1);
3601} 3517}
3602 3518
3603static int dowait(t) 3519static int dowait(struct op *t)
3604struct op *t;
3605{ 3520{
3606 REGISTER int i; 3521 REGISTER int i;
3607 REGISTER char *cp; 3522 REGISTER char *cp;
@@ -3616,8 +3531,7 @@ struct op *t;
3616 return (0); 3531 return (0);
3617} 3532}
3618 3533
3619static int doread(t) 3534static int doread(struct op *t)
3620struct op *t;
3621{ 3535{
3622 REGISTER char *cp, **wp; 3536 REGISTER char *cp, **wp;
3623 REGISTER int nb = 0; 3537 REGISTER int nb = 0;
@@ -3640,14 +3554,12 @@ struct op *t;
3640 return (nb <= 0); 3554 return (nb <= 0);
3641} 3555}
3642 3556
3643static int doeval(t) 3557static int doeval(REGISTER struct op *t)
3644REGISTER struct op *t;
3645{ 3558{
3646 return (RUN(awordlist, t->words + 1, wdchar)); 3559 return (RUN(awordlist, t->words + 1, wdchar));
3647} 3560}
3648 3561
3649static int dotrap(t) 3562static int dotrap(REGISTER struct op *t)
3650REGISTER struct op *t;
3651{ 3563{
3652 REGISTER int n, i; 3564 REGISTER int n, i;
3653 REGISTER int resetsig; 3565 REGISTER int resetsig;
@@ -3686,8 +3598,7 @@ REGISTER struct op *t;
3686 return (0); 3598 return (0);
3687} 3599}
3688 3600
3689static int getsig(s) 3601static int getsig(char *s)
3690char *s;
3691{ 3602{
3692 REGISTER int n; 3603 REGISTER int n;
3693 3604
@@ -3708,8 +3619,7 @@ static void setsig(REGISTER int n, sighandler_t f)
3708 } 3619 }
3709} 3620}
3710 3621
3711static int getn(as) 3622static int getn(char *as)
3712char *as;
3713{ 3623{
3714 REGISTER char *s; 3624 REGISTER char *s;
3715 REGISTER int n, m; 3625 REGISTER int n, m;
@@ -3729,21 +3639,17 @@ char *as;
3729 return (n * m); 3639 return (n * m);
3730} 3640}
3731 3641
3732static int dobreak(t) 3642static int dobreak(struct op *t)
3733struct op *t;
3734{ 3643{
3735 return (brkcontin(t->words[1], 1)); 3644 return (brkcontin(t->words[1], 1));
3736} 3645}
3737 3646
3738static int docontinue(t) 3647static int docontinue(struct op *t)
3739struct op *t;
3740{ 3648{
3741 return (brkcontin(t->words[1], 0)); 3649 return (brkcontin(t->words[1], 0));
3742} 3650}
3743 3651
3744static int brkcontin(cp, val) 3652static int brkcontin(REGISTER char *cp, int val)
3745REGISTER char *cp;
3746int val;
3747{ 3653{
3748 REGISTER struct brkcon *bc; 3654 REGISTER struct brkcon *bc;
3749 REGISTER int nl; 3655 REGISTER int nl;
@@ -3765,8 +3671,7 @@ int val;
3765 /* NOTREACHED */ 3671 /* NOTREACHED */
3766} 3672}
3767 3673
3768static int doexit(t) 3674static int doexit(struct op *t)
3769struct op *t;
3770{ 3675{
3771 REGISTER char *cp; 3676 REGISTER char *cp;
3772 3677
@@ -3781,15 +3686,13 @@ struct op *t;
3781 return (0); 3686 return (0);
3782} 3687}
3783 3688
3784static int doexport(t) 3689static int doexport(struct op *t)
3785struct op *t;
3786{ 3690{
3787 rdexp(t->words + 1, export, EXPORT); 3691 rdexp(t->words + 1, export, EXPORT);
3788 return (0); 3692 return (0);
3789} 3693}
3790 3694
3791static int doreadonly(t) 3695static int doreadonly(struct op *t)
3792struct op *t;
3793{ 3696{
3794 rdexp(t->words + 1, ronly, RONLY); 3697 rdexp(t->words + 1, ronly, RONLY);
3795 return (0); 3698 return (0);
@@ -3818,15 +3721,13 @@ static void rdexp(char **wp, void (*f) (struct var *), int key)
3818 putvlist(key, 1); 3721 putvlist(key, 1);
3819} 3722}
3820 3723
3821static void badid(s) 3724static void badid(REGISTER char *s)
3822REGISTER char *s;
3823{ 3725{
3824 prs(s); 3726 prs(s);
3825 err(": bad identifier"); 3727 err(": bad identifier");
3826} 3728}
3827 3729
3828static int doset(t) 3730static int doset(REGISTER struct op *t)
3829REGISTER struct op *t;
3830{ 3731{
3831 REGISTER struct var *vp; 3732 REGISTER struct var *vp;
3832 REGISTER char *cp; 3733 REGISTER char *cp;
@@ -3869,9 +3770,7 @@ REGISTER struct op *t;
3869 return (0); 3770 return (0);
3870} 3771}
3871 3772
3872static void varput(s, out) 3773static void varput(REGISTER char *s, int out)
3873REGISTER char *s;
3874int out;
3875{ 3774{
3876 if (isalnum(*s) || *s == '_') { 3775 if (isalnum(*s) || *s == '_') {
3877 write(out, s, strlen(s)); 3776 write(out, s, strlen(s));
@@ -3981,9 +3880,7 @@ static char **makenv(int all, struct wdblock *wb)
3981 return (getwords(wb)); 3880 return (getwords(wb));
3982} 3881}
3983 3882
3984static char *evalstr(cp, f) 3883static char *evalstr(REGISTER char *cp, int f)
3985REGISTER char *cp;
3986int f;
3987{ 3884{
3988 struct wdblock *wb; 3885 struct wdblock *wb;
3989 3886
@@ -4046,8 +3943,7 @@ static int expand(char *cp, REGISTER struct wdblock **wbp, int f)
4046/* 3943/*
4047 * Blank interpretation and quoting 3944 * Blank interpretation and quoting
4048 */ 3945 */
4049static char *blank(f) 3946static char *blank(int f)
4050int f;
4051{ 3947{
4052 REGISTER int c, c1; 3948 REGISTER int c, c1;
4053 REGISTER char *sp; 3949 REGISTER char *sp;
@@ -4116,9 +4012,7 @@ int f;
4116/* 4012/*
4117 * Get characters, substituting for ` and $ 4013 * Get characters, substituting for ` and $
4118 */ 4014 */
4119static int subgetc(ec, quoted) 4015static int subgetc(REGISTER char ec, int quoted)
4120REGISTER char ec;
4121int quoted;
4122{ 4016{
4123 REGISTER char c; 4017 REGISTER char c;
4124 4018
@@ -4144,8 +4038,7 @@ int quoted;
4144/* 4038/*
4145 * Prepare to generate the string returned by ${} substitution. 4039 * Prepare to generate the string returned by ${} substitution.
4146 */ 4040 */
4147static int dollar(quoted) 4041static int dollar(int quoted)
4148int quoted;
4149{ 4042{
4150 int otask; 4043 int otask;
4151 struct io *oiop; 4044 struct io *oiop;
@@ -4249,8 +4142,7 @@ int quoted;
4249 * Run the command in `...` and read its output. 4142 * Run the command in `...` and read its output.
4250 */ 4143 */
4251 4144
4252static int grave(quoted) 4145static int grave(int quoted)
4253int quoted;
4254{ 4146{
4255 char *cp; 4147 char *cp;
4256 REGISTER int i; 4148 REGISTER int i;
@@ -4429,8 +4321,7 @@ int quoted;
4429} 4321}
4430 4322
4431 4323
4432static char *unquote(as) 4324static char *unquote(REGISTER char *as)
4433REGISTER char *as;
4434{ 4325{
4435 REGISTER char *s; 4326 REGISTER char *s;
4436 4327
@@ -4453,9 +4344,7 @@ REGISTER char *as;
4453static struct wdblock *cl, *nl; 4344static struct wdblock *cl, *nl;
4454static char spcl[] = "[?*"; 4345static char spcl[] = "[?*";
4455 4346
4456static struct wdblock *glob(cp, wb) 4347static struct wdblock *glob(char *cp, struct wdblock *wb)
4457char *cp;
4458struct wdblock *wb;
4459{ 4348{
4460 REGISTER int i; 4349 REGISTER int i;
4461 REGISTER char *pp; 4350 REGISTER char *pp;
@@ -4499,9 +4388,7 @@ struct wdblock *wb;
4499 return (wb); 4388 return (wb);
4500} 4389}
4501 4390
4502static void globname(we, pp) 4391static void globname(char *we, REGISTER char *pp)
4503char *we;
4504REGISTER char *pp;
4505{ 4392{
4506 REGISTER char *np, *cp; 4393 REGISTER char *np, *cp;
4507 char *name, *gp, *dp; 4394 char *name, *gp, *dp;
@@ -4562,10 +4449,7 @@ REGISTER char *pp;
4562 * start..end1 / middle end 4449 * start..end1 / middle end
4563 * the slashes come for free 4450 * the slashes come for free
4564 */ 4451 */
4565static char *generate(start1, end1, middle, end) 4452static char *generate(char *start1, REGISTER char *end1, char *middle, char *end)
4566char *start1;
4567REGISTER char *end1;
4568char *middle, *end;
4569{ 4453{
4570 char *p; 4454 char *p;
4571 REGISTER char *op, *xp; 4455 REGISTER char *op, *xp;
@@ -4580,8 +4464,7 @@ char *middle, *end;
4580 return (p); 4464 return (p);
4581} 4465}
4582 4466
4583static int anyspcl(wb) 4467static int anyspcl(REGISTER struct wdblock *wb)
4584REGISTER struct wdblock *wb;
4585{ 4468{
4586 REGISTER int i; 4469 REGISTER int i;
4587 REGISTER char **wd; 4470 REGISTER char **wd;
@@ -4593,16 +4476,14 @@ REGISTER struct wdblock *wb;
4593 return (0); 4476 return (0);
4594} 4477}
4595 4478
4596static int xstrcmp(p1, p2) 4479static int xstrcmp(char *p1, char *p2)
4597char *p1, *p2;
4598{ 4480{
4599 return (strcmp(*(char **) p1, *(char **) p2)); 4481 return (strcmp(*(char **) p1, *(char **) p2));
4600} 4482}
4601 4483
4602/* -------- word.c -------- */ 4484/* -------- word.c -------- */
4603 4485
4604static struct wdblock *newword(nw) 4486static struct wdblock *newword(REGISTER int nw)
4605REGISTER int nw;
4606{ 4487{
4607 REGISTER struct wdblock *wb; 4488 REGISTER struct wdblock *wb;
4608 4489
@@ -4612,9 +4493,7 @@ REGISTER int nw;
4612 return (wb); 4493 return (wb);
4613} 4494}
4614 4495
4615static struct wdblock *addword(wd, wb) 4496static struct wdblock *addword(char *wd, REGISTER struct wdblock *wb)
4616char *wd;
4617REGISTER struct wdblock *wb;
4618{ 4497{
4619 REGISTER struct wdblock *wb2; 4498 REGISTER struct wdblock *wb2;
4620 REGISTER int nw; 4499 REGISTER int nw;
@@ -4634,8 +4513,7 @@ REGISTER struct wdblock *wb;
4634} 4513}
4635 4514
4636static 4515static
4637char **getwords(wb) 4516char **getwords(REGISTER struct wdblock *wb)
4638REGISTER struct wdblock *wb;
4639{ 4517{
4640 REGISTER char **wd; 4518 REGISTER char **wd;
4641 REGISTER int nb; 4519 REGISTER int nb;
@@ -4655,19 +4533,14 @@ REGISTER struct wdblock *wb;
4655static int (*func) (char *, char *); 4533static int (*func) (char *, char *);
4656static int globv; 4534static int globv;
4657 4535
4658static void glob0(a0, a1, a2, a3) 4536static void glob0(char *a0, unsigned a1, int a2, int (*a3) (char *, char *))
4659char *a0;
4660unsigned a1;
4661int a2;
4662int (*a3) (char *, char *);
4663{ 4537{
4664 func = a3; 4538 func = a3;
4665 globv = a2; 4539 globv = a2;
4666 glob1(a0, a0 + a1 * a2); 4540 glob1(a0, a0 + a1 * a2);
4667} 4541}
4668 4542
4669static void glob1(base, lim) 4543static void glob1(char *base, char *lim)
4670char *base, *lim;
4671{ 4544{
4672 REGISTER char *i, *j; 4545 REGISTER char *i, *j;
4673 int v2; 4546 int v2;
@@ -4736,8 +4609,7 @@ char *base, *lim;
4736 } 4609 }
4737} 4610}
4738 4611
4739static void glob2(i, j) 4612static void glob2(char *i, char *j)
4740char *i, *j;
4741{ 4613{
4742 REGISTER char *index1, *index2, c; 4614 REGISTER char *index1, *index2, c;
4743 int m; 4615 int m;
@@ -4752,8 +4624,7 @@ char *i, *j;
4752 } while (--m); 4624 } while (--m);
4753} 4625}
4754 4626
4755static void glob3(i, j, k) 4627static void glob3(char *i, char *j, char *k)
4756char *i, *j, *k;
4757{ 4628{
4758 REGISTER char *index1, *index2, *index3; 4629 REGISTER char *index1, *index2, *index3;
4759 int c; 4630 int c;
@@ -4799,19 +4670,18 @@ static int my_getc(int ec)
4799 return (c); 4670 return (c);
4800} 4671}
4801 4672
4802static void unget(c) 4673static void unget(int c)
4803int c;
4804{ 4674{
4805 if (e.iop >= e.iobase) 4675 if (e.iop >= e.iobase)
4806 e.iop->peekc = c; 4676 e.iop->peekc = c;
4807} 4677}
4808 4678
4809static int eofc() 4679static int eofc(void)
4810{ 4680{
4811 return e.iop < e.iobase || (e.iop->peekc == 0 && e.iop->prev == 0); 4681 return e.iop < e.iobase || (e.iop->peekc == 0 && e.iop->prev == 0);
4812} 4682}
4813 4683
4814static int readc() 4684static int readc(void)
4815{ 4685{
4816 REGISTER int c; 4686 REGISTER int c;
4817 4687
@@ -4867,8 +4737,7 @@ static int readc()
4867 return (0); 4737 return (0);
4868} 4738}
4869 4739
4870static void ioecho(c) 4740static void ioecho(char c)
4871char c;
4872{ 4741{
4873 if (flag['v']) 4742 if (flag['v'])
4874 write(2, &c, sizeof c); 4743 write(2, &c, sizeof c);
@@ -4940,8 +4809,7 @@ static void pushio(struct ioarg *argp, int (*fn) (struct ioarg *))
4940 return; 4809 return;
4941} 4810}
4942 4811
4943static struct io *setbase(ip) 4812static struct io *setbase(struct io *ip)
4944struct io *ip;
4945{ 4813{
4946 REGISTER struct io *xp; 4814 REGISTER struct io *xp;
4947 4815
@@ -4957,8 +4825,7 @@ struct io *ip;
4957/* 4825/*
4958 * Produce the characters of a string, then a newline, then EOF. 4826 * Produce the characters of a string, then a newline, then EOF.
4959 */ 4827 */
4960static int nlchar(ap) 4828static int nlchar(REGISTER struct ioarg *ap)
4961REGISTER struct ioarg *ap;
4962{ 4829{
4963 REGISTER int c; 4830 REGISTER int c;
4964 4831
@@ -4975,8 +4842,7 @@ REGISTER struct ioarg *ap;
4975 * Given a list of words, produce the characters 4842 * Given a list of words, produce the characters
4976 * in them, with a space after each word. 4843 * in them, with a space after each word.
4977 */ 4844 */
4978static int wdchar(ap) 4845static int wdchar(REGISTER struct ioarg *ap)
4979REGISTER struct ioarg *ap;
4980{ 4846{
4981 REGISTER char c; 4847 REGISTER char c;
4982 REGISTER char **wl; 4848 REGISTER char **wl;
@@ -4997,8 +4863,7 @@ REGISTER struct ioarg *ap;
4997 * Return the characters of a list of words, 4863 * Return the characters of a list of words,
4998 * producing a space between them. 4864 * producing a space between them.
4999 */ 4865 */
5000static int dolchar(ap) 4866static int dolchar(REGISTER struct ioarg *ap)
5001REGISTER struct ioarg *ap;
5002{ 4867{
5003 REGISTER char *wp; 4868 REGISTER char *wp;
5004 4869
@@ -5009,8 +4874,7 @@ REGISTER struct ioarg *ap;
5009 return (0); 4874 return (0);
5010} 4875}
5011 4876
5012static int xxchar(ap) 4877static int xxchar(REGISTER struct ioarg *ap)
5013REGISTER struct ioarg *ap;
5014{ 4878{
5015 REGISTER int c; 4879 REGISTER int c;
5016 4880
@@ -5026,8 +4890,7 @@ REGISTER struct ioarg *ap;
5026/* 4890/*
5027 * Produce the characters from a single word (string). 4891 * Produce the characters from a single word (string).
5028 */ 4892 */
5029static int strchar(ap) 4893static int strchar(REGISTER struct ioarg *ap)
5030REGISTER struct ioarg *ap;
5031{ 4894{
5032 REGISTER int c; 4895 REGISTER int c;
5033 4896
@@ -5039,8 +4902,7 @@ REGISTER struct ioarg *ap;
5039/* 4902/*
5040 * Produce quoted characters from a single word (string). 4903 * Produce quoted characters from a single word (string).
5041 */ 4904 */
5042static int qstrchar(ap) 4905static int qstrchar(REGISTER struct ioarg *ap)
5043REGISTER struct ioarg *ap;
5044{ 4906{
5045 REGISTER int c; 4907 REGISTER int c;
5046 4908
@@ -5052,8 +4914,7 @@ REGISTER struct ioarg *ap;
5052/* 4914/*
5053 * Return the characters from a file. 4915 * Return the characters from a file.
5054 */ 4916 */
5055static int filechar(ap) 4917static int filechar(REGISTER struct ioarg *ap)
5056REGISTER struct ioarg *ap;
5057{ 4918{
5058 REGISTER int i; 4919 REGISTER int i;
5059 char c; 4920 char c;
@@ -5104,8 +4965,7 @@ REGISTER struct ioarg *ap;
5104/* 4965/*
5105 * Return the characters from a here temp file. 4966 * Return the characters from a here temp file.
5106 */ 4967 */
5107static int herechar(ap) 4968static int herechar(REGISTER struct ioarg *ap)
5108REGISTER struct ioarg *ap;
5109{ 4969{
5110 char c; 4970 char c;
5111 4971
@@ -5122,9 +4982,7 @@ REGISTER struct ioarg *ap;
5122 * Return the characters produced by a process (`...`). 4982 * Return the characters produced by a process (`...`).
5123 * Quote them if required, and remove any trailing newline characters. 4983 * Quote them if required, and remove any trailing newline characters.
5124 */ 4984 */
5125static int gravechar(ap, iop) 4985static int gravechar(struct ioarg *ap, struct io *iop)
5126struct ioarg *ap;
5127struct io *iop;
5128{ 4986{
5129 REGISTER int c; 4987 REGISTER int c;
5130 4988
@@ -5133,9 +4991,7 @@ struct io *iop;
5133 return (c); 4991 return (c);
5134} 4992}
5135 4993
5136static int qgravechar(ap, iop) 4994static int qgravechar(REGISTER struct ioarg *ap, struct io *iop)
5137REGISTER struct ioarg *ap;
5138struct io *iop;
5139{ 4995{
5140 REGISTER int c; 4996 REGISTER int c;
5141 4997
@@ -5164,8 +5020,7 @@ struct io *iop;
5164/* 5020/*
5165 * Return a single command (usually the first line) from a file. 5021 * Return a single command (usually the first line) from a file.
5166 */ 5022 */
5167static int linechar(ap) 5023static int linechar(REGISTER struct ioarg *ap)
5168REGISTER struct ioarg *ap;
5169{ 5024{
5170 REGISTER int c; 5025 REGISTER int c;
5171 5026
@@ -5178,27 +5033,24 @@ REGISTER struct ioarg *ap;
5178 return (c); 5033 return (c);
5179} 5034}
5180 5035
5181static void prs(s) 5036static void prs(REGISTER const char *s)
5182REGISTER const char *s;
5183{ 5037{
5184 if (*s) 5038 if (*s)
5185 write(2, s, strlen(s)); 5039 write(2, s, strlen(s));
5186} 5040}
5187 5041
5188static void prn(u) 5042static void prn(unsigned u)
5189unsigned u;
5190{ 5043{
5191 prs(itoa(u)); 5044 prs(itoa(u));
5192} 5045}
5193 5046
5194static void closef(i) 5047static void closef(REGISTER int i)
5195REGISTER int i;
5196{ 5048{
5197 if (i > 2) 5049 if (i > 2)
5198 close(i); 5050 close(i);
5199} 5051}
5200 5052
5201static void closeall() 5053static void closeall(void)
5202{ 5054{
5203 REGISTER int u; 5055 REGISTER int u;
5204 5056
@@ -5210,8 +5062,7 @@ static void closeall()
5210/* 5062/*
5211 * remap fd into Shell's fd space 5063 * remap fd into Shell's fd space
5212 */ 5064 */
5213static int remap(fd) 5065static int remap(REGISTER int fd)
5214REGISTER int fd;
5215{ 5066{
5216 REGISTER int i; 5067 REGISTER int i;
5217 int map[NOFILE]; 5068 int map[NOFILE];
@@ -5241,8 +5092,7 @@ REGISTER int fd;
5241 return (fd); 5092 return (fd);
5242} 5093}
5243 5094
5244static int openpipe(pv) 5095static int openpipe(REGISTER int *pv)
5245REGISTER int *pv;
5246{ 5096{
5247 REGISTER int i; 5097 REGISTER int i;
5248 5098
@@ -5251,8 +5101,7 @@ REGISTER int *pv;
5251 return (i); 5101 return (i);
5252} 5102}
5253 5103
5254static void closepipe(pv) 5104static void closepipe(REGISTER int *pv)
5255REGISTER int *pv;
5256{ 5105{
5257 if (pv != NULL) { 5106 if (pv != NULL) {
5258 close(*pv++); 5107 close(*pv++);
@@ -5266,9 +5115,7 @@ REGISTER int *pv;
5266 * here documents 5115 * here documents
5267 */ 5116 */
5268 5117
5269static void markhere(s, iop) 5118static void markhere(REGISTER char *s, struct ioword *iop)
5270REGISTER char *s;
5271struct ioword *iop;
5272{ 5119{
5273 REGISTER struct here *h, *lh; 5120 REGISTER struct here *h, *lh;
5274 5121
@@ -5302,7 +5149,7 @@ struct ioword *iop;
5302 h->h_dosub = iop->io_flag & IOXHERE; 5149 h->h_dosub = iop->io_flag & IOXHERE;
5303} 5150}
5304 5151
5305static void gethere() 5152static void gethere(void)
5306{ 5153{
5307 REGISTER struct here *h, *hp; 5154 REGISTER struct here *h, *hp;
5308 5155
@@ -5320,10 +5167,7 @@ static void gethere()
5320 } 5167 }
5321} 5168}
5322 5169
5323static void readhere(name, s, ec) 5170static void readhere(char **name, REGISTER char *s, int ec)
5324char **name;
5325REGISTER char *s;
5326int ec;
5327{ 5171{
5328 int tf; 5172 int tf;
5329 char tname[30] = ".msh_XXXXXX"; 5173 char tname[30] = ".msh_XXXXXX";
@@ -5382,9 +5226,7 @@ int ec;
5382 * open here temp file. 5226 * open here temp file.
5383 * if unquoted here, expand here temp file into second temp file. 5227 * if unquoted here, expand here temp file into second temp file.
5384 */ 5228 */
5385static int herein(hname, xdoll) 5229static int herein(char *hname, int xdoll)
5386char *hname;
5387int xdoll;
5388{ 5230{
5389 REGISTER int hf; 5231 REGISTER int hf;
5390 int tf; 5232 int tf;
@@ -5428,7 +5270,7 @@ int xdoll;
5428 return (hf); 5270 return (hf);
5429} 5271}
5430 5272
5431static void scraphere() 5273static void scraphere(void)
5432{ 5274{
5433 REGISTER struct here *h; 5275 REGISTER struct here *h;
5434 5276
@@ -5442,8 +5284,7 @@ static void scraphere()
5442} 5284}
5443 5285
5444/* unlink here temp files before a freearea(area) */ 5286/* unlink here temp files before a freearea(area) */
5445static void freehere(area) 5287static void freehere(int area)
5446int area;
5447{ 5288{
5448 REGISTER struct here *h, *hl; 5289 REGISTER struct here *h, *hl;
5449 5290