aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
commit68229837ff1e690190d51b74b281cfe999220e6d (patch)
tree7cbdeded060f86cefc4edd006c2538c2a2a4ea97
parentf350160963c4412bb76f3e8cca669529fdde81d1 (diff)
downloadbusybox-w32-68229837ff1e690190d51b74b281cfe999220e6d.tar.gz
busybox-w32-68229837ff1e690190d51b74b281cfe999220e6d.tar.bz2
busybox-w32-68229837ff1e690190d51b74b281cfe999220e6d.zip
Remove all usage of the "register" storage class specifier.
-rw-r--r--archival/gzip.c20
-rw-r--r--archival/libunarchive/decompress_unzip.c2
-rw-r--r--coreutils/echo.c2
-rw-r--r--coreutils/od.c2
-rw-r--r--coreutils/test.c2
-rw-r--r--coreutils/tr.c4
-rw-r--r--editors/awk.c16
-rw-r--r--libbb/dump.c20
-rw-r--r--loginutils/login.c2
-rw-r--r--networking/udhcp/packet.c2
-rw-r--r--shell/ash.c2
-rw-r--r--shell/lash.c4
-rw-r--r--shell/msh.c419
-rw-r--r--util-linux/hexdump.c2
14 files changed, 247 insertions, 252 deletions
diff --git a/archival/gzip.c b/archival/gzip.c
index 91b294891..aebe90ea6 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -484,7 +484,7 @@ static void send_bits(int value, int length)
484 */ 484 */
485static unsigned bi_reverse(unsigned code, int len) 485static unsigned bi_reverse(unsigned code, int len)
486{ 486{
487 register unsigned res = 0; 487 unsigned res = 0;
488 488
489 do { 489 do {
490 res |= code & 1; 490 res |= code & 1;
@@ -782,7 +782,7 @@ static void check_match(IPos start, IPos match, int length);
782 */ 782 */
783static void lm_init(ush * flags) 783static void lm_init(ush * flags)
784{ 784{
785 register unsigned j; 785 unsigned j;
786 786
787 /* Initialize the hash table. */ 787 /* Initialize the hash table. */
788 memset(head, 0, HASH_SIZE * sizeof(*head)); 788 memset(head, 0, HASH_SIZE * sizeof(*head));
@@ -832,9 +832,9 @@ static void lm_init(ush * flags)
832static int longest_match(IPos cur_match) 832static int longest_match(IPos cur_match)
833{ 833{
834 unsigned chain_length = max_chain_length; /* max hash chain length */ 834 unsigned chain_length = max_chain_length; /* max hash chain length */
835 register uch *scan = window + strstart; /* current string */ 835 uch *scan = window + strstart; /* current string */
836 register uch *match; /* matched string */ 836 uch *match; /* matched string */
837 register int len; /* length of current match */ 837 int len; /* length of current match */
838 int best_len = prev_length; /* best match length so far */ 838 int best_len = prev_length; /* best match length so far */
839 IPos limit = 839 IPos limit =
840 strstart > (IPos) MAX_DIST ? strstart - (IPos) MAX_DIST : NIL; 840 strstart > (IPos) MAX_DIST ? strstart - (IPos) MAX_DIST : NIL;
@@ -848,9 +848,9 @@ static int longest_match(IPos cur_match)
848#if HASH_BITS < 8 || MAX_MATCH != 258 848#if HASH_BITS < 8 || MAX_MATCH != 258
849# error Code too clever 849# error Code too clever
850#endif 850#endif
851 register uch *strend = window + strstart + MAX_MATCH; 851 uch *strend = window + strstart + MAX_MATCH;
852 register uch scan_end1 = scan[best_len - 1]; 852 uch scan_end1 = scan[best_len - 1];
853 register uch scan_end = scan[best_len]; 853 uch scan_end = scan[best_len];
854 854
855 /* Do not waste too much time if we already have a good match: */ 855 /* Do not waste too much time if we already have a good match: */
856 if (prev_length >= good_match) { 856 if (prev_length >= good_match) {
@@ -937,7 +937,7 @@ static void check_match(IPos start, IPos match, int length)
937 */ 937 */
938static void fill_window(void) 938static void fill_window(void)
939{ 939{
940 register unsigned n, m; 940 unsigned n, m;
941 unsigned more = 941 unsigned more =
942 (unsigned) (window_size - (ulg) lookahead - (ulg) strstart); 942 (unsigned) (window_size - (ulg) lookahead - (ulg) strstart);
943 /* Amount of free space at the end of the window. */ 943 /* Amount of free space at the end of the window. */
@@ -1005,7 +1005,7 @@ static ulg deflate(void)
1005 IPos prev_match; /* previous match */ 1005 IPos prev_match; /* previous match */
1006 int flush; /* set if current block must be flushed */ 1006 int flush; /* set if current block must be flushed */
1007 int match_available = 0; /* set if previous match exists */ 1007 int match_available = 0; /* set if previous match exists */
1008 register unsigned match_length = MIN_MATCH - 1; /* length of best match */ 1008 unsigned match_length = MIN_MATCH - 1; /* length of best match */
1009 1009
1010 /* Process the input block. */ 1010 /* Process the input block. */
1011 while (lookahead != 0) { 1011 while (lookahead != 0) {
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c
index e39901c1b..46a26933b 100644
--- a/archival/libunarchive/decompress_unzip.c
+++ b/archival/libunarchive/decompress_unzip.c
@@ -514,7 +514,7 @@ static int inflate_stored(int my_n, int my_b_stored, int my_k_stored, int setup)
514static int inflate_block(int *e) 514static int inflate_block(int *e)
515{ 515{
516 unsigned t; /* block type */ 516 unsigned t; /* block type */
517 register unsigned int b; /* bit buffer */ 517 unsigned int b; /* bit buffer */
518 unsigned int k; /* number of bits in bit buffer */ 518 unsigned int k; /* number of bits in bit buffer */
519 519
520 /* make local bit buffer */ 520 /* make local bit buffer */
diff --git a/coreutils/echo.c b/coreutils/echo.c
index a673bb07a..d278c1143 100644
--- a/coreutils/echo.c
+++ b/coreutils/echo.c
@@ -71,7 +71,7 @@ int bb_echo(int ATTRIBUTE_UNUSED argc, char **argv)
71just_echo: 71just_echo:
72#endif 72#endif
73 while (*argv) { 73 while (*argv) {
74 register int c; 74 int c;
75 75
76 while ((c = *(*argv)++)) { 76 while ((c = *(*argv)++)) {
77 if (c == eflag) { /* Check for escape seq. */ 77 if (c == eflag) { /* Check for escape seq. */
diff --git a/coreutils/od.c b/coreutils/od.c
index b70cb85e2..13f91eec7 100644
--- a/coreutils/od.c
+++ b/coreutils/od.c
@@ -35,7 +35,7 @@
35static void 35static void
36odoffset(int argc, char ***argvp) 36odoffset(int argc, char ***argvp)
37{ 37{
38 register char *num, *p; 38 char *num, *p;
39 int base; 39 int base;
40 char *end; 40 char *end;
41 41
diff --git a/coreutils/test.c b/coreutils/test.c
index ab3793627..bbc802283 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -554,7 +554,7 @@ static void initialize_group_array(void)
554/* Return non-zero if GID is one that we have in our groups list. */ 554/* Return non-zero if GID is one that we have in our groups list. */
555static int is_a_group_member(gid_t gid) 555static int is_a_group_member(gid_t gid)
556{ 556{
557 register int i; 557 int i;
558 558
559 /* Short-circuit if possible, maybe saving a call to getgroups(). */ 559 /* Short-circuit if possible, maybe saving a call to getgroups(). */
560 if (gid == getgid() || gid == getegid()) 560 if (gid == getgid() || gid == getegid())
diff --git a/coreutils/tr.c b/coreutils/tr.c
index 32f6f5966..6eb86750d 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -178,7 +178,7 @@ static unsigned int expand(const char *arg, char *buffer)
178 178
179static int complement(char *buffer, int buffer_len) 179static int complement(char *buffer, int buffer_len)
180{ 180{
181 register short i, j, ix; 181 short i, j, ix;
182 char conv[ASCII + 2]; 182 char conv[ASCII + 2];
183 183
184 ix = 0; 184 ix = 0;
@@ -195,7 +195,7 @@ static int complement(char *buffer, int buffer_len)
195 195
196int tr_main(int argc, char **argv) 196int tr_main(int argc, char **argv)
197{ 197{
198 register unsigned char *ptr; 198 unsigned char *ptr;
199 int output_length=0, input_length; 199 int output_length=0, input_length;
200 int idx = 1; 200 int idx = 1;
201 int i; 201 int i;
diff --git a/editors/awk.c b/editors/awk.c
index 74f9d8e54..16c871f8c 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -463,7 +463,7 @@ static void syntax_error(const char * const message)
463 463
464static unsigned int hashidx(const char *name) 464static unsigned int hashidx(const char *name)
465{ 465{
466 register unsigned int idx=0; 466 unsigned int idx=0;
467 467
468 while (*name) idx = *name++ + (idx << 6) - idx; 468 while (*name) idx = *name++ + (idx << 6) - idx;
469 return idx; 469 return idx;
@@ -574,7 +574,7 @@ static void hash_remove(xhash *hash, const char *name)
574 574
575static void skip_spaces(char **s) 575static void skip_spaces(char **s)
576{ 576{
577 register char *p = *s; 577 char *p = *s;
578 578
579 while(*p == ' ' || *p == '\t' || 579 while(*p == ' ' || *p == '\t' ||
580 (*p == '\\' && *(p+1) == '\n' && (++p, ++t.lineno))) { 580 (*p == '\\' && *(p+1) == '\n' && (++p, ++t.lineno))) {
@@ -585,7 +585,7 @@ static void skip_spaces(char **s)
585 585
586static char *nextword(char **s) 586static char *nextword(char **s)
587{ 587{
588 register char *p = *s; 588 char *p = *s;
589 589
590 while (*(*s)++) ; 590 while (*(*s)++) ;
591 591
@@ -594,7 +594,7 @@ static char *nextword(char **s)
594 594
595static char nextchar(char **s) 595static char nextchar(char **s)
596{ 596{
597 register char c, *pps; 597 char c, *pps;
598 598
599 c = *((*s)++); 599 c = *((*s)++);
600 pps = *s; 600 pps = *s;
@@ -686,7 +686,7 @@ static var *setvar_u(var *v, const char *value)
686/* set array element to user string */ 686/* set array element to user string */
687static void setari_u(var *a, int idx, const char *s) 687static void setari_u(var *a, int idx, const char *s)
688{ 688{
689 register var *v; 689 var *v;
690 static char sidx[12]; 690 static char sidx[12];
691 691
692 sprintf(sidx, "%d", idx); 692 sprintf(sidx, "%d", idx);
@@ -991,7 +991,7 @@ static void rollback_token(void) { t.rollback = TRUE; }
991 991
992static node *new_node(uint32_t info) 992static node *new_node(uint32_t info)
993{ 993{
994 register node *n; 994 node *n;
995 995
996 n = (node *)xzalloc(sizeof(node)); 996 n = (node *)xzalloc(sizeof(node));
997 n->info = info; 997 n->info = info;
@@ -1136,7 +1136,7 @@ static node *parse_expr(uint32_t iexp)
1136/* add node to chain. Return ptr to alloc'd node */ 1136/* add node to chain. Return ptr to alloc'd node */
1137static node *chain_node(uint32_t info) 1137static node *chain_node(uint32_t info)
1138{ 1138{
1139 register node *n; 1139 node *n;
1140 1140
1141 if (! seq->first) 1141 if (! seq->first)
1142 seq->first = seq->last = new_node(0); 1142 seq->first = seq->last = new_node(0);
@@ -1355,7 +1355,7 @@ static void parse_program(char *p)
1355 1355
1356static node *mk_splitter(char *s, tsplitter *spl) 1356static node *mk_splitter(char *s, tsplitter *spl)
1357{ 1357{
1358 register regex_t *re, *ire; 1358 regex_t *re, *ire;
1359 node *n; 1359 node *n;
1360 1360
1361 re = &spl->re[0]; 1361 re = &spl->re[0];
diff --git a/libbb/dump.c b/libbb/dump.c
index 45ddb4034..283cba19a 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -37,9 +37,9 @@ static const char lcc[] = "diouxX";
37 37
38int bb_dump_size(FS * fs) 38int bb_dump_size(FS * fs)
39{ 39{
40 register FU *fu; 40 FU *fu;
41 register int bcnt, cur_size; 41 int bcnt, cur_size;
42 register char *fmt; 42 char *fmt;
43 const char *p; 43 const char *p;
44 int prec; 44 int prec;
45 45
@@ -354,7 +354,7 @@ static unsigned char *get(void)
354{ 354{
355 static int ateof = 1; 355 static int ateof = 1;
356 static unsigned char *curp=NULL, *savp; /*DBU:[dave@cray.com]initialize curp */ 356 static unsigned char *curp=NULL, *savp; /*DBU:[dave@cray.com]initialize curp */
357 register int n; 357 int n;
358 int need, nread; 358 int need, nread;
359 unsigned char *tmpp; 359 unsigned char *tmpp;
360 360
@@ -502,11 +502,11 @@ static void conv_u(PR * pr, unsigned char * p)
502static void display(void) 502static void display(void)
503{ 503{
504/* extern FU *endfu; */ 504/* extern FU *endfu; */
505 register FS *fs; 505 FS *fs;
506 register FU *fu; 506 FU *fu;
507 register PR *pr; 507 PR *pr;
508 register int cnt; 508 int cnt;
509 register unsigned char *bp; 509 unsigned char *bp;
510 510
511 off_t saveaddress; 511 off_t saveaddress;
512 unsigned char savech = 0, *savebp; 512 unsigned char savech = 0, *savebp;
@@ -650,7 +650,7 @@ static void display(void)
650 650
651int bb_dump_dump(char **argv) 651int bb_dump_dump(char **argv)
652{ 652{
653 register FS *tfs; 653 FS *tfs;
654 654
655 /* figure out the data block bb_dump_size */ 655 /* figure out the data block bb_dump_size */
656 for (bb_dump_blocksize = 0, tfs = bb_dump_fshead; tfs; tfs = tfs->nextfs) { 656 for (bb_dump_blocksize = 0, tfs = bb_dump_fshead; tfs; tfs = tfs->nextfs) {
diff --git a/loginutils/login.c b/loginutils/login.c
index 46c4ade56..789293af5 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -377,7 +377,7 @@ static int is_my_tty ( const char *tty )
377static void motd (void) 377static void motd (void)
378{ 378{
379 FILE *fp; 379 FILE *fp;
380 register int c; 380 int c;
381 381
382 if (( fp = fopen ( bb_path_motd_file, "r" ))) { 382 if (( fp = fopen ( bb_path_motd_file, "r" ))) {
383 while (( c = getc ( fp )) != EOF ) 383 while (( c = getc ( fp )) != EOF )
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index 8cf9fe283..1bdade7e5 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -87,7 +87,7 @@ uint16_t udhcp_checksum(void *addr, int count)
87 /* Compute Internet Checksum for "count" bytes 87 /* Compute Internet Checksum for "count" bytes
88 * beginning at location "addr". 88 * beginning at location "addr".
89 */ 89 */
90 register int32_t sum = 0; 90 int32_t sum = 0;
91 uint16_t *source = (uint16_t *) addr; 91 uint16_t *source = (uint16_t *) addr;
92 92
93 while (count > 1) { 93 while (count > 1) {
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
13473static arith_t arith (const char *expr, int *perrcode) 13473static 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
710static char* itoa(register int i) 710static 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
833int msh_main(int argc, char **argv) 828int 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
1023static void setdash(void) 1018static 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
1037static int newfile(REGISTER char *s) 1032static 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
1092static void onecommand(void) 1087static 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
1172static void warn(REGISTER char *s) 1167static 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
1196static int newenv(int f) 1191static 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
1220static void quitenv(void) 1215static 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 */
1240static int anys(REGISTER char *s1, REGISTER char *s2) 1235static 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 */
1251static int any(REGISTER int c, REGISTER char *s) 1246static 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
1259static char *putn(REGISTER int n) 1254static char *putn(int n)
1260{ 1255{
1261 return (itoa(n)); 1256 return (itoa(n));
1262} 1257}
1263 1258
1264static char *itoa(REGISTER int n) 1259static 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
1293static char *space(int n) 1288static 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
1302static char *strsave(REGISTER char *s, int a) 1297static 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 */
1317static void sig(REGISTER int i) 1312static 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 */
1344static struct var *lookup(REGISTER char *n) 1339static 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 */
1396static void nameval(REGISTER struct var *vp, char *val, char *name) 1391static 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
1442static int isassign(REGISTER char *s) 1437static 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
1455static int assign(REGISTER char *s, int cf) 1450static 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
1474static int checkname(REGISTER char *cp) 1469static 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
1486static void putvlist(REGISTER int f, REGISTER int out) 1481static 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
1501static int eqname(REGISTER char *n1, REGISTER char *n2) 1496static 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
1509static char *findeq(REGISTER char *cp) 1504static 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
1529static int gmatch(REGISTER char *s, REGISTER char *p) 1524static 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
1564static char *cclass(REGISTER char *p, REGISTER int sub) 1559static 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
1612char *getcell(unsigned nbytes) 1607char *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
1680static void freecell(char *cp) 1675static 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
1692static void freearea(REGISTER int a) 1687static 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
1702static void setarea(char *cp, int a) 1697static 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
1715static void garbage(void) 1710static 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
1754static struct op *pipeline(int cf) 1749static 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
1786static struct op *andor(void) 1781static 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
1814static struct op *c_list(void) 1809static 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
1846static int synio(int cf) 1841static 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
1881static struct op *simple(void) 1876static 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
1908static struct op *nested(int type, int mark) 1903static 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
1921static struct op *command(int cf) 1916static 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
2034static struct op *dowholefile(int type, int mark) 2029static 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
2048static struct op *dogroup(int onlydone) 2043static 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
2063static struct op *thenpart(void) 2058static 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
2081static struct op *elsepart(void) 2076static 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
2105static struct op *caselist(void) 2100static 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
2119static struct op *casepart(void) 2114static 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
2138static char **pattern(void) 2133static 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
2154static char **wordlist(void) 2149static 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 */
2173static struct op *list(REGISTER struct op *t1, REGISTER struct op *t2) 2168static 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
2185static struct op *block(int type, struct op *t1, struct op *t2, char **wp) 2180static 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) */
2204static int rlookup(REGISTER char *n) 2199static 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
2220static struct op *newtp(void) 2215static 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
2237static struct op *namelist(REGISTER struct op *t) 2232static 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
2265static char **copyw(void) 2260static 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
2279static struct ioword **copyio(void) 2274static 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
2288static struct ioword *io(int u, int f, char *cp) 2283static 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
2316static int yylex(int cf) 2311static 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
2449static int collect(REGISTER int c, REGISTER int c1) 2444static 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 */
2484static int dual(REGISTER int c) 2479static 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
2502static void diag(REGISTER int ec) 2497static 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
2522static char *tree(unsigned size) 2517static 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
2545static int execute(REGISTER struct op *t, int *pin, int *pout, int act) 2540static 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
2767static int 2762static int
2768forkexec(REGISTER struct op *t, int *pin, int *pout, int act, char **wp) 2763forkexec(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 */
2998static int iosetup(REGISTER struct ioword *iop, int pipein, int pipeout) 2993static 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
3074static void echo(REGISTER char **wp) 3069static 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
3087static struct op **find1case(struct op *t, char *w) 3082static 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
3122static struct op *findcase(struct op *t, char *w) 3117static 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 */
3145static int waitfor(REGISTER int lastpid, int canintr) 3140static 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
3200static int setstatus(REGISTER int s) 3195static 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 */
3212static char *rexecve(char *c, char **v, char **envp) 3207static 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
3376static int dochdir(REGISTER struct op *t) 3371static 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
3391static int doshift(REGISTER struct op *t) 3386static 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 */
3410static int dologin(struct op *t) 3405static 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
3425static int doumask(REGISTER struct op *t) 3420static 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
3444static int doexec(REGISTER struct op *t) 3439static 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
3463static int dodot(struct op *t) 3458static 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
3515static int dowait(struct op *t) 3510static 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
3530static int doread(struct op *t) 3525static 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
3553static int doeval(REGISTER struct op *t) 3548static 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
3558static int dotrap(REGISTER struct op *t) 3553static 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
3597static int getsig(char *s) 3592static 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
3608static void setsig(REGISTER int n, sighandler_t f) 3603static 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
3618static int getn(char *as) 3613static 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
3648static int brkcontin(REGISTER char *cp, int val) 3643static 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
3670static int doexit(struct op *t) 3665static 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
3720static void badid(REGISTER char *s) 3715static void badid(char *s)
3721{ 3716{
3722 prs(s); 3717 prs(s);
3723 err(": bad identifier"); 3718 err(": bad identifier");
3724} 3719}
3725 3720
3726static int doset(REGISTER struct op *t) 3721static 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
3769static void varput(REGISTER char *s, int out) 3764static 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 */
3866static char **makenv(int all, struct wdblock *wb) 3861static 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
3879static char *evalstr(REGISTER char *cp, int f) 3874static 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
3896static int expand(char *cp, REGISTER struct wdblock **wbp, int f) 3891static 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 */
3942static char *blank(int f) 3937static 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 */
4011static int subgetc(REGISTER char ec, int quoted) 4006static 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)
4141static int grave(int quoted) 4136static 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
4320static char *unquote(REGISTER char *as) 4315static 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
4343static struct wdblock *glob(char *cp, struct wdblock *wb) 4338static 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
4387static void globname(char *we, REGISTER char *pp) 4382static 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 */
4448static char *generate(char *start1, REGISTER char *end1, char *middle, char *end) 4443static 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
4463static int anyspcl(REGISTER struct wdblock *wb) 4458static 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
4482static struct wdblock *newword(REGISTER int nw) 4477static 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
4492static struct wdblock *addword(char *wd, REGISTER struct wdblock *wb) 4487static 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
4511static 4506static
4512char **getwords(REGISTER struct wdblock *wb) 4507char **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
4539static void glob1(char *base, char *lim) 4534static 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
4608static void glob2(char *i, char *j) 4603static 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
4623static void glob3(char *i, char *j, char *k) 4618static 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
4647static int my_getc(int ec) 4642static 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
4680static int readc(void) 4675static 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
4808static struct io *setbase(struct io *ip) 4803static 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 */
4824static int nlchar(REGISTER struct ioarg *ap) 4819static 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 */
4841static int wdchar(REGISTER struct ioarg *ap) 4836static 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 */
4862static int dolchar(REGISTER struct ioarg *ap) 4857static 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
4873static int xxchar(REGISTER struct ioarg *ap) 4868static 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 */
4889static int strchar(REGISTER struct ioarg *ap) 4884static 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 */
4901static int qstrchar(REGISTER struct ioarg *ap) 4896static 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 */
4913static int filechar(REGISTER struct ioarg *ap) 4908static 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 */
4964static int herechar(REGISTER struct ioarg *ap) 4959static 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 */
4981static int gravechar(struct ioarg *ap, struct io *iop) 4976static 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
4990static int qgravechar(REGISTER struct ioarg *ap, struct io *iop) 4985static 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 */
5019static int linechar(REGISTER struct ioarg *ap) 5014static 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
5032static void prs(REGISTER const char *s) 5027static 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
5043static void closef(REGISTER int i) 5038static 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
5049static void closeall(void) 5044static 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 */
5061static int remap(REGISTER int fd) 5056static 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
5091static int openpipe(REGISTER int *pv) 5086static 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
5100static void closepipe(REGISTER int *pv) 5095static 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
5114static void markhere(REGISTER char *s, struct ioword *iop) 5109static 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
5148static void gethere(void) 5143static 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
5166static void readhere(char **name, REGISTER char *s, int ec) 5161static 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 */
5225static int herein(char *hname, int xdoll) 5220static 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
5269static void scraphere(void) 5264static 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) */
5283static void freehere(int area) 5278static 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
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c
index 17854cb18..2181b846d 100644
--- a/util-linux/hexdump.c
+++ b/util-linux/hexdump.c
@@ -15,7 +15,7 @@
15 15
16static void bb_dump_addfile(char *name) 16static void bb_dump_addfile(char *name)
17{ 17{
18 register char *p; 18 char *p;
19 FILE *fp; 19 FILE *fp;
20 char *buf; 20 char *buf;
21 21