[REVISED PATCH] more complete removal of "register" storage class
Robert P. J. Day
rpjday at mindspring.com
Wed May 17 09:08:04 UTC 2006
this patch supersedes the earlier by *also* cleaning out
shell/msh.c so you can pick which patch you want to apply.
rday
-------------- next part --------------
diff -pru busybox/archival/gzip.c busybox.new/archival/gzip.c
--- busybox/archival/gzip.c 2006-05-11 08:04:11.000000000 -0400
+++ busybox.new/archival/gzip.c 2006-05-17 05:01:43.000000000 -0400
@@ -494,7 +494,7 @@ static void send_bits(int value, int len
*/
static unsigned bi_reverse(unsigned code, int len)
{
- register unsigned res = 0;
+ unsigned res = 0;
do {
res |= code & 1;
@@ -792,7 +792,7 @@ static void check_match(IPos start, IPos
*/
static void lm_init(ush * flags)
{
- register unsigned j;
+ unsigned j;
/* Initialize the hash table. */
memset(head, 0, HASH_SIZE * sizeof(*head));
@@ -842,9 +842,9 @@ static void lm_init(ush * flags)
static int longest_match(IPos cur_match)
{
unsigned chain_length = max_chain_length; /* max hash chain length */
- register uch *scan = window + strstart; /* current string */
- register uch *match; /* matched string */
- register int len; /* length of current match */
+ uch *scan = window + strstart; /* current string */
+ uch *match; /* matched string */
+ int len; /* length of current match */
int best_len = prev_length; /* best match length so far */
IPos limit =
strstart > (IPos) MAX_DIST ? strstart - (IPos) MAX_DIST : NIL;
@@ -858,9 +858,9 @@ static int longest_match(IPos cur_match)
#if HASH_BITS < 8 || MAX_MATCH != 258
# error Code too clever
#endif
- register uch *strend = window + strstart + MAX_MATCH;
- register uch scan_end1 = scan[best_len - 1];
- register uch scan_end = scan[best_len];
+ uch *strend = window + strstart + MAX_MATCH;
+ uch scan_end1 = scan[best_len - 1];
+ uch scan_end = scan[best_len];
/* Do not waste too much time if we already have a good match: */
if (prev_length >= good_match) {
@@ -947,7 +947,7 @@ static void check_match(IPos start, IPos
*/
static void fill_window(void)
{
- register unsigned n, m;
+ unsigned n, m;
unsigned more =
(unsigned) (window_size - (ulg) lookahead - (ulg) strstart);
/* Amount of free space at the end of the window. */
@@ -1015,7 +1015,7 @@ static ulg deflate(void)
IPos prev_match; /* previous match */
int flush; /* set if current block must be flushed */
int match_available = 0; /* set if previous match exists */
- register unsigned match_length = MIN_MATCH - 1; /* length of best match */
+ unsigned match_length = MIN_MATCH - 1; /* length of best match */
/* Process the input block. */
while (lookahead != 0) {
diff -pru busybox/archival/libunarchive/decompress_unzip.c busybox.new/archival/libunarchive/decompress_unzip.c
--- busybox/archival/libunarchive/decompress_unzip.c 2006-05-11 08:04:11.000000000 -0400
+++ busybox.new/archival/libunarchive/decompress_unzip.c 2006-05-17 05:01:43.000000000 -0400
@@ -214,16 +214,16 @@ int huft_build(unsigned int *b, const un
unsigned f; /* i repeats in table every f entries */
int g; /* maximum code length */
int h; /* table level */
- register unsigned i; /* counter, current code */
- register unsigned j; /* counter */
- register int k; /* number of bits in current code */
- register unsigned *p; /* pointer into c[], b[], or v[] */
- register huft_t *q; /* points to current table */
+ unsigned i; /* counter, current code */
+ unsigned j; /* counter */
+ int k; /* number of bits in current code */
+ unsigned *p; /* pointer into c[], b[], or v[] */
+ huft_t *q; /* points to current table */
huft_t r; /* table entry for structure assignment */
huft_t *u[BMAX]; /* table stack */
unsigned v[N_MAX]; /* values in order of bit length */
int ws[BMAX+1]; /* bits decoded stack */
- register int w; /* bits decoded */
+ int w; /* bits decoded */
unsigned x[BMAX + 1]; /* bit offsets, then code stack */
unsigned *xp; /* pointer into x */
int y; /* number of dummy codes added */
@@ -553,7 +553,7 @@ static int inflate_stored(int my_n, int
static int inflate_block(int *e)
{
unsigned t; /* block type */
- register unsigned int b; /* bit buffer */
+ unsigned int b; /* bit buffer */
unsigned int k; /* number of bits in bit buffer */
/* make local bit buffer */
diff -pru busybox/coreutils/od.c busybox.new/coreutils/od.c
--- busybox/coreutils/od.c 2006-05-11 08:04:16.000000000 -0400
+++ busybox.new/coreutils/od.c 2006-05-17 05:01:43.000000000 -0400
@@ -35,7 +35,7 @@
static void
odoffset(int argc, char ***argvp)
{
- register char *num, *p;
+ char *num, *p;
int base;
char *end;
diff -pru busybox/coreutils/test.c busybox.new/coreutils/test.c
--- busybox/coreutils/test.c 2006-05-11 08:04:16.000000000 -0400
+++ busybox.new/coreutils/test.c 2006-05-17 05:01:43.000000000 -0400
@@ -547,7 +547,7 @@ static void initialize_group_array(void)
/* Return non-zero if GID is one that we have in our groups list. */
static int is_a_group_member(gid_t gid)
{
- register int i;
+ int i;
/* Short-circuit if possible, maybe saving a call to getgroups(). */
if (gid == getgid() || gid == getegid())
diff -pru busybox/coreutils/tr.c busybox.new/coreutils/tr.c
--- busybox/coreutils/tr.c 2006-05-11 08:04:16.000000000 -0400
+++ busybox.new/coreutils/tr.c 2006-05-17 05:01:43.000000000 -0400
@@ -76,8 +76,8 @@ static void convert(void)
/* NOTREACHED */
}
-static void map(register unsigned char *string1, unsigned int string1_len,
- register unsigned char *string2, unsigned int string2_len)
+static void map(unsigned char *string1, unsigned int string1_len,
+ unsigned char *string2, unsigned int string2_len)
{
unsigned char last = '0';
unsigned int i, j;
@@ -95,7 +95,7 @@ static void map(register unsigned char *
* Escapes, e.g., \a ==> Control-G
* Character classes, e.g. [:upper:] ==> A ... Z
*/
-static unsigned int expand(const char *arg, register unsigned char *buffer)
+static unsigned int expand(const char *arg, unsigned char *buffer)
{
unsigned char *buffer_start = buffer;
int i, ac;
@@ -192,7 +192,7 @@ static unsigned int expand(const char *a
static int complement(unsigned char *buffer, int buffer_len)
{
- register short i, j, ix;
+ short i, j, ix;
char conv[ASCII + 2];
ix = 0;
@@ -209,7 +209,7 @@ static int complement(unsigned char *buf
int tr_main(int argc, char **argv)
{
- register unsigned char *ptr;
+ unsigned char *ptr;
int output_length=0, input_length;
int idx = 1;
int i;
diff -pru busybox/editors/awk.c busybox.new/editors/awk.c
--- busybox/editors/awk.c 2006-05-11 08:04:29.000000000 -0400
+++ busybox.new/editors/awk.c 2006-05-17 05:01:43.000000000 -0400
@@ -462,7 +462,7 @@ static void syntax_error(const char * co
static unsigned int hashidx(const char *name)
{
- register unsigned int idx=0;
+ unsigned int idx=0;
while (*name) idx = *name++ + (idx << 6) - idx;
return idx;
@@ -573,7 +573,7 @@ static void hash_remove(xhash *hash, con
static void skip_spaces(char **s)
{
- register char *p = *s;
+ char *p = *s;
while(*p == ' ' || *p == '\t' ||
(*p == '\\' && *(p+1) == '\n' && (++p, ++t.lineno))) {
@@ -584,7 +584,7 @@ static void skip_spaces(char **s)
static char *nextword(char **s)
{
- register char *p = *s;
+ char *p = *s;
while (*(*s)++) ;
@@ -593,7 +593,7 @@ static char *nextword(char **s)
static char nextchar(char **s)
{
- register char c, *pps;
+ char c, *pps;
c = *((*s)++);
pps = *s;
@@ -685,7 +685,7 @@ static var *setvar_u(var *v, const char
/* set array element to user string */
static void setari_u(var *a, int idx, const char *s)
{
- register var *v;
+ var *v;
static char sidx[12];
sprintf(sidx, "%d", idx);
@@ -990,7 +990,7 @@ static void rollback_token(void) { t.rol
static node *new_node(uint32_t info)
{
- register node *n;
+ node *n;
n = (node *)xcalloc(sizeof(node), 1);
n->info = info;
@@ -1135,7 +1135,7 @@ static node *parse_expr(uint32_t iexp)
/* add node to chain. Return ptr to alloc'd node */
static node *chain_node(uint32_t info)
{
- register node *n;
+ node *n;
if (! seq->first)
seq->first = seq->last = new_node(0);
@@ -1354,7 +1354,7 @@ static void parse_program(char *p)
static node *mk_splitter(char *s, tsplitter *spl)
{
- register regex_t *re, *ire;
+ regex_t *re, *ire;
node *n;
re = &spl->re[0];
diff -pru busybox/libbb/bb_echo.c busybox.new/libbb/bb_echo.c
--- busybox/libbb/bb_echo.c 2006-05-11 08:04:19.000000000 -0400
+++ busybox.new/libbb/bb_echo.c 2006-05-17 05:01:43.000000000 -0400
@@ -70,7 +70,7 @@ int bb_echo(int ATTRIBUTE_UNUSED argc, c
just_echo:
#endif
while (*argv) {
- register int c;
+ int c;
while ((c = *(*argv)++)) {
if (c == eflag) { /* Check for escape seq. */
diff -pru busybox/libbb/dump.c busybox.new/libbb/dump.c
--- busybox/libbb/dump.c 2006-05-11 08:04:19.000000000 -0400
+++ busybox.new/libbb/dump.c 2006-05-17 05:01:43.000000000 -0400
@@ -38,9 +38,9 @@ static const char lcc[] = "diouxX";
int bb_dump_size(FS * fs)
{
- register FU *fu;
- register int bcnt, cur_size;
- register char *fmt;
+ FU *fu;
+ int bcnt, cur_size;
+ char *fmt;
const char *p;
int prec;
@@ -83,9 +83,9 @@ int bb_dump_size(FS * fs)
static void rewrite(FS * fs)
{
enum { NOTOKAY, USEBCNT, USEPREC } sokay;
- register PR *pr, **nextpr = NULL;
- register FU *fu;
- register char *p1, *p2, *p3;
+ PR *pr, **nextpr = NULL;
+ FU *fu;
+ char *p1, *p2, *p3;
char savech, *fmtp;
const char *byte_count_str;
int nconv, prec = 0;
@@ -356,7 +356,7 @@ static unsigned char *get(void)
{
static int ateof = 1;
static unsigned char *curp=NULL, *savp; /*DBU:[dave at cray.com]initialize curp */
- register int n;
+ int n;
int need, nread;
unsigned char *tmpp;
@@ -426,7 +426,7 @@ static unsigned char *get(void)
static void bpad(PR * pr)
{
- register char *p1, *p2;
+ char *p1, *p2;
/*
* remove all conversion flags; '-' is the only one valid
@@ -503,11 +503,11 @@ static void conv_u(PR * pr, unsigned cha
static void display(void)
{
/* extern FU *endfu; */
- register FS *fs;
- register FU *fu;
- register PR *pr;
- register int cnt;
- register unsigned char *bp;
+ FS *fs;
+ FU *fu;
+ PR *pr;
+ int cnt;
+ unsigned char *bp;
off_t saveaddress;
unsigned char savech = 0, *savebp;
@@ -651,7 +651,7 @@ static void display(void)
int bb_dump_dump(char **argv)
{
- register FS *tfs;
+ FS *tfs;
/* figure out the data block bb_dump_size */
for (bb_dump_blocksize = 0, tfs = bb_dump_fshead; tfs; tfs = tfs->nextfs) {
@@ -673,9 +673,9 @@ int bb_dump_dump(char **argv)
void bb_dump_add(const char *fmt)
{
- register const char *p;
- register char *p1;
- register char *p2;
+ const char *p;
+ char *p1;
+ char *p2;
static FS **nextfs;
FS *tfs;
FU *tfu, **nextfu;
diff -pru busybox/loginutils/login.c busybox.new/loginutils/login.c
--- busybox/loginutils/login.c 2006-05-11 08:04:24.000000000 -0400
+++ busybox.new/loginutils/login.c 2006-05-17 05:01:43.000000000 -0400
@@ -378,7 +378,7 @@ static int is_my_tty ( const char *tty )
static void motd (void)
{
FILE *fp;
- register int c;
+ int c;
if (( fp = fopen ( bb_path_motd_file, "r" ))) {
while (( c = getc ( fp )) != EOF )
diff -pru busybox/networking/udhcp/packet.c busybox.new/networking/udhcp/packet.c
--- busybox/networking/udhcp/packet.c 2006-05-11 08:04:07.000000000 -0400
+++ busybox.new/networking/udhcp/packet.c 2006-05-17 05:01:43.000000000 -0400
@@ -87,7 +87,7 @@ uint16_t checksum(void *addr, int count)
/* Compute Internet Checksum for "count" bytes
* beginning at location "addr".
*/
- register int32_t sum = 0;
+ int32_t sum = 0;
uint16_t *source = (uint16_t *) addr;
while (count > 1) {
diff -pru busybox/shell/ash.c busybox.new/shell/ash.c
--- busybox/shell/ash.c 2006-05-12 17:48:03.000000000 -0400
+++ busybox.new/shell/ash.c 2006-05-17 05:01:43.000000000 -0400
@@ -13452,7 +13452,7 @@ static const char op_tokens[] = {
static arith_t arith (const char *expr, int *perrcode)
{
- register char arithval; /* Current character under analysis */
+ char arithval; /* Current character under analysis */
operator lasttok, op;
operator prec;
diff -pru busybox/shell/lash.c busybox.new/shell/lash.c
--- busybox/shell/lash.c 2006-05-11 08:04:13.000000000 -0400
+++ busybox.new/shell/lash.c 2006-05-17 05:01:43.000000000 -0400
@@ -747,10 +747,10 @@ static int get_command(FILE * source, ch
return 0;
}
-static char* itoa(register int i)
+static char* itoa(int i)
{
static char a[7]; /* Max 7 ints */
- register char *b = a + sizeof(a) - 1;
+ char *b = a + sizeof(a) - 1;
int sign = (i < 0);
if (sign)
diff -pru busybox/shell/msh.c busybox.new/shell/msh.c
--- busybox/shell/msh.c 2006-05-11 08:04:13.000000000 -0400
+++ busybox.new/shell/msh.c 2006-05-17 05:04:06.000000000 -0400
@@ -48,11 +48,6 @@
#include "cmdedit.h"
#include "busybox.h"
-
-/* Conditional use of "register" keyword */
-#define REGISTER register
-
-
/*#define MSHDEBUG 1*/
#ifdef MSHDEBUG
@@ -823,8 +818,8 @@ static char *current_prompt;
int msh_main(int argc, char **argv)
{
- REGISTER int f;
- REGISTER char *s;
+ int f;
+ char *s;
int cflag;
char *name, **ap;
int (*iof) (struct ioarg *);
@@ -1014,8 +1009,8 @@ int msh_main(int argc, char **argv)
static void setdash()
{
- REGISTER char *cp;
- REGISTER int c;
+ char *cp;
+ int c;
char m['z' - 'a' + 1];
cp = m;
@@ -1027,9 +1022,9 @@ static void setdash()
}
static int newfile(s)
-REGISTER char *s;
+char *s;
{
- REGISTER int f;
+ int f;
DBGPRINTF7(("NEWFILE: opening %s\n", s));
@@ -1085,7 +1080,7 @@ struct op *head;
static void onecommand()
{
- REGISTER int i;
+ int i;
jmp_buf m1;
DBGPRINTF(("ONECOMMAND: enter, outtree=%p\n", outtree));
@@ -1164,7 +1159,7 @@ static void leave()
}
static void warn(s)
-REGISTER char *s;
+char *s;
{
if (*s) {
prs(s);
@@ -1192,7 +1187,7 @@ char *s;
static int newenv(f)
int f;
{
- REGISTER struct env *ep;
+ struct env *ep;
DBGPRINTF(("NEWENV: f=%d (indicates quitenv and return)\n", f));
@@ -1216,8 +1211,8 @@ int f;
static void quitenv()
{
- REGISTER struct env *ep;
- REGISTER int fd;
+ struct env *ep;
+ int fd;
DBGPRINTF(("QUITENV: e.oenv=%p\n", e.oenv));
@@ -1235,7 +1230,7 @@ static void quitenv()
* Is any character from s1 in s2?
*/
static int anys(s1, s2)
-REGISTER char *s1, *s2;
+char *s1, *s2;
{
while (*s1)
if (any(*s1++, s2))
@@ -1247,8 +1242,8 @@ REGISTER char *s1, *s2;
* Is character c in s?
*/
static int any(c, s)
-REGISTER int c;
-REGISTER char *s;
+int c;
+char *s;
{
while (*s)
if (*s++ == c)
@@ -1257,13 +1252,13 @@ REGISTER char *s;
}
static char *putn(n)
-REGISTER int n;
+int n;
{
return (itoa(n));
}
static char *itoa(n)
-REGISTER int n;
+int n;
{
static char s[20];
@@ -1296,7 +1291,7 @@ int s; /* ANSI C requires a parame
static char *space(n)
int n;
{
- REGISTER char *cp;
+ char *cp;
if ((cp = getcell(n)) == 0)
err("out of string space");
@@ -1304,10 +1299,10 @@ int n;
}
static char *strsave(s, a)
-REGISTER char *s;
+char *s;
int a;
{
- REGISTER char *cp, *xp;
+ char *cp, *xp;
if ((cp = space(strlen(s) + 1)) != NULL) {
setarea((char *) cp, a);
@@ -1321,7 +1316,7 @@ int a;
* trap handling
*/
static void sig(i)
-REGISTER int i;
+int i;
{
trapset = i;
signal(i, sig);
@@ -1350,11 +1345,11 @@ int i;
* return a null value.
*/
static struct var *lookup(n)
-REGISTER char *n;
+char *n;
{
- REGISTER struct var *vp;
- REGISTER char *cp;
- REGISTER int c;
+ struct var *vp;
+ char *cp;
+ int c;
static struct var dummy;
if (isdigit(*n)) {
@@ -1405,10 +1400,10 @@ char *val;
* values is reasonably painless.
*/
static void nameval(vp, val, name)
-REGISTER struct var *vp;
+struct var *vp;
char *val, *name;
{
- REGISTER char *cp, *xp;
+ char *cp, *xp;
char *nv;
int fl;
@@ -1455,7 +1450,7 @@ struct var *vp;
}
static int isassign(s)
-REGISTER char *s;
+char *s;
{
DBGPRINTF7(("ISASSIGN: enter, s=%s\n", s));
@@ -1469,10 +1464,10 @@ REGISTER char *s;
}
static int assign(s, cf)
-REGISTER char *s;
+char *s;
int cf;
{
- REGISTER char *cp;
+ char *cp;
struct var *vp;
DBGPRINTF7(("ASSIGN: enter, s=%s, cf=%d\n", s, cf));
@@ -1490,7 +1485,7 @@ int cf;
}
static int checkname(cp)
-REGISTER char *cp;
+char *cp;
{
DBGPRINTF7(("CHECKNAME: enter, cp=%s\n", cp));
@@ -1503,9 +1498,9 @@ REGISTER char *cp;
}
static void putvlist(f, out)
-REGISTER int f, out;
+int f, out;
{
- REGISTER struct var *vp;
+ struct var *vp;
for (vp = vlist; vp; vp = vp->next)
if (vp->status & f && (isalpha(*vp->name) || *vp->name == '_')) {
@@ -1519,7 +1514,7 @@ REGISTER int f, out;
}
static int eqname(n1, n2)
-REGISTER char *n1, *n2;
+char *n1, *n2;
{
for (; *n1 != '=' && *n1 != 0; n1++)
if (*n2++ != *n1)
@@ -1528,7 +1523,7 @@ REGISTER char *n1, *n2;
}
static char *findeq(cp)
-REGISTER char *cp;
+char *cp;
{
while (*cp != '\0' && *cp != '=')
cp++;
@@ -1549,9 +1544,9 @@ REGISTER char *cp;
#define NOT '!' /* might use ^ */
static int gmatch(s, p)
-REGISTER char *s, *p;
+char *s, *p;
{
- REGISTER int sc, pc;
+ int sc, pc;
if (s == NULL || p == NULL)
return (0);
@@ -1585,10 +1580,10 @@ REGISTER char *s, *p;
}
static char *cclass(p, sub)
-REGISTER char *p;
-REGISTER int sub;
+char *p;
+int sub;
{
- REGISTER int c, d, not, found;
+ int c, d, not, found;
if ((not = *p == NOT) != 0)
p++;
@@ -1637,9 +1632,9 @@ static void initarea()
char *getcell(nbytes)
unsigned nbytes;
{
- REGISTER int nregio;
- REGISTER struct region *p, *q;
- REGISTER int i;
+ int nregio;
+ struct region *p, *q;
+ int i;
if (nbytes == 0) {
puts("getcell(0)");
@@ -1706,7 +1701,7 @@ unsigned nbytes;
static void freecell(cp)
char *cp;
{
- REGISTER struct region *p;
+ struct region *p;
if ((p = (struct region *) cp) != NULL) {
p--;
@@ -1717,9 +1712,9 @@ char *cp;
}
static void freearea(a)
-REGISTER int a;
+int a;
{
- REGISTER struct region *p, *top;
+ struct region *p, *top;
top = areatop;
for (p = areabot; p != top; p = p->next)
@@ -1731,7 +1726,7 @@ static void setarea(cp, a)
char *cp;
int a;
{
- REGISTER struct region *p;
+ struct region *p;
if ((p = (struct region *) cp) != NULL)
(p - 1)->area = a;
@@ -1745,7 +1740,7 @@ char *cp;
static void garbage()
{
- REGISTER struct region *p, *q, *top;
+ struct region *p, *q, *top;
top = areatop;
for (p = areabot; p != top; p = p->next) {
@@ -1785,8 +1780,8 @@ int yyparse()
static struct op *pipeline(cf)
int cf;
{
- REGISTER struct op *t, *p;
- REGISTER int c;
+ struct op *t, *p;
+ int c;
DBGPRINTF7(("PIPELINE: enter, cf=%d\n", cf));
@@ -1817,8 +1812,8 @@ int cf;
static struct op *andor()
{
- REGISTER struct op *t, *p;
- REGISTER int c;
+ struct op *t, *p;
+ int c;
DBGPRINTF7(("ANDOR: enter...\n"));
@@ -1845,8 +1840,8 @@ static struct op *andor()
static struct op *c_list()
{
- REGISTER struct op *t, *p;
- REGISTER int c;
+ struct op *t, *p;
+ int c;
DBGPRINTF7(("C_LIST: enter...\n"));
@@ -1878,9 +1873,9 @@ static struct op *c_list()
static int synio(cf)
int cf;
{
- REGISTER struct ioword *iop;
- REGISTER int i;
- REGISTER int c;
+ struct ioword *iop;
+ int i;
+ int c;
DBGPRINTF7(("SYNIO: enter, cf=%d\n", cf));
@@ -1914,7 +1909,7 @@ int c, cf;
static struct op *simple()
{
- REGISTER struct op *t;
+ struct op *t;
t = NULL;
for (;;) {
@@ -1942,7 +1937,7 @@ static struct op *simple()
static struct op *nested(type, mark)
int type, mark;
{
- REGISTER struct op *t;
+ struct op *t;
DBGPRINTF3(("NESTED: enter, type=%d, mark=%d\n", type, mark));
@@ -1956,9 +1951,9 @@ int type, mark;
static struct op *command(cf)
int cf;
{
- REGISTER struct op *t;
+ struct op *t;
struct wdblock *iosave;
- REGISTER int c;
+ int c;
DBGPRINTF(("COMMAND: enter, cf=%d\n", cf));
@@ -2071,7 +2066,7 @@ static struct op *dowholefile(type, mark
int type;
int mark;
{
- REGISTER struct op *t;
+ struct op *t;
DBGPRINTF(("DOWHOLEFILE: enter, type=%d, mark=%d\n", type, mark));
@@ -2086,8 +2081,8 @@ int mark;
static struct op *dogroup(onlydone)
int onlydone;
{
- REGISTER int c;
- REGISTER struct op *mylist;
+ int c;
+ struct op *mylist;
c = yylex(CONTIN);
if (c == DONE && onlydone)
@@ -2101,8 +2096,8 @@ int onlydone;
static struct op *thenpart()
{
- REGISTER int c;
- REGISTER struct op *t;
+ int c;
+ struct op *t;
if ((c = yylex(0)) != THEN) {
peeksym = c;
@@ -2119,8 +2114,8 @@ static struct op *thenpart()
static struct op *elsepart()
{
- REGISTER int c;
- REGISTER struct op *t;
+ int c;
+ struct op *t;
switch (c = yylex(0)) {
case ELSE:
@@ -2143,7 +2138,7 @@ static struct op *elsepart()
static struct op *caselist()
{
- REGISTER struct op *t;
+ struct op *t;
t = NULL;
while ((peeksym = yylex(CONTIN)) != ESAC) {
@@ -2157,7 +2152,7 @@ static struct op *caselist()
static struct op *casepart()
{
- REGISTER struct op *t;
+ struct op *t;
DBGPRINTF7(("CASEPART: enter...\n"));
@@ -2176,7 +2171,7 @@ static struct op *casepart()
static char **pattern()
{
- REGISTER int c, cf;
+ int c, cf;
cf = CONTIN;
do {
@@ -2192,7 +2187,7 @@ static char **pattern()
static char **wordlist()
{
- REGISTER int c;
+ int c;
if ((c = yylex(0)) != IN) {
peeksym = c;
@@ -2210,7 +2205,7 @@ static char **wordlist()
* supporting functions
*/
static struct op *list(t1, t2)
-REGISTER struct op *t1, *t2;
+struct op *t1, *t2;
{
DBGPRINTF7(("LIST: enter, t1=%p, t2=%p\n", t1, t2));
@@ -2227,7 +2222,7 @@ int type;
struct op *t1, *t2;
char **wp;
{
- REGISTER struct op *t;
+ struct op *t;
DBGPRINTF7(("BLOCK: enter, type=%d (%s)\n", type, T_CMD_NAMES[type]));
@@ -2245,9 +2240,9 @@ char **wp;
/* See if given string is a shell multiline (FOR, IF, etc) */
static int rlookup(n)
-REGISTER char *n;
+char *n;
{
- REGISTER const struct res *rp;
+ const struct res *rp;
DBGPRINTF7(("RLOOKUP: enter, n is %s\n", n));
@@ -2263,7 +2258,7 @@ REGISTER char *n;
static struct op *newtp()
{
- REGISTER struct op *t;
+ struct op *t;
t = (struct op *) tree(sizeof(*t));
t->type = 0;
@@ -2279,7 +2274,7 @@ static struct op *newtp()
}
static struct op *namelist(t)
-REGISTER struct op *t;
+struct op *t;
{
DBGPRINTF7(("NAMELIST: enter, t=%p, type %s, iolist=%p\n", t,
@@ -2309,7 +2304,7 @@ REGISTER struct op *t;
static char **copyw()
{
- REGISTER char **wd;
+ char **wd;
wd = getwords(wdlist);
wdlist = 0;
@@ -2324,7 +2319,7 @@ char *cp;
static struct ioword **copyio()
{
- REGISTER struct ioword **iop;
+ struct ioword **iop;
iop = (struct ioword **) getwords(iolist);
iolist = 0;
@@ -2336,7 +2331,7 @@ int u;
int f;
char *cp;
{
- REGISTER struct ioword *iop;
+ struct ioword *iop;
iop = (struct ioword *) tree(sizeof(*iop));
iop->io_unit = u;
@@ -2366,7 +2361,7 @@ char *s;
static int yylex(cf)
int cf;
{
- REGISTER int c, c1;
+ int c, c1;
int atstart;
if ((c = peeksym) > 0) {
@@ -2498,7 +2493,7 @@ int cf;
static int collect(c, c1)
-REGISTER int c, c1;
+int c, c1;
{
char s[2];
@@ -2534,10 +2529,10 @@ REGISTER int c, c1;
/* "multiline commands" helper func */
/* see if next 2 chars form a shell multiline */
static int dual(c)
-REGISTER int c;
+int c;
{
char s[3];
- REGISTER char *cp = s;
+ char *cp = s;
DBGPRINTF8(("DUAL: enter, c=%d\n", c));
@@ -2553,9 +2548,9 @@ REGISTER int c;
}
static void diag(ec)
-REGISTER int ec;
+int ec;
{
- REGISTER int c;
+ int c;
DBGPRINTF8(("DIAG: enter, ec=%d\n", ec));
@@ -2576,7 +2571,7 @@ REGISTER int ec;
static char *tree(size)
unsigned size;
{
- REGISTER char *t;
+ char *t;
if ((t = getcell(size)) == NULL) {
DBGPRINTF2(("TREE: getcell(%d) failed!\n", size));
@@ -2598,11 +2593,11 @@ unsigned size;
static int execute(t, pin, pout, act)
-REGISTER struct op *t;
+struct op *t;
int *pin, *pout;
int act;
{
- REGISTER struct op *t1;
+ struct op *t1;
volatile int i, rv, a;
char *cp, **wp, **wp2;
struct var *vp;
@@ -2823,12 +2818,12 @@ int act;
}
static int
-forkexec(REGISTER struct op *t, int *pin, int *pout, int act, char **wp)
+forkexec(struct op *t, int *pin, int *pout, int act, char **wp)
{
pid_t newpid;
int i, rv;
int (*shcom) (struct op *) = NULL;
- REGISTER int f;
+ int f;
char *cp = NULL;
struct ioword **iopp;
int resetsig;
@@ -3058,10 +3053,10 @@ forkexec(REGISTER struct op *t, int *pin
* within pipelines.
*/
static int iosetup(iop, pipein, pipeout)
-REGISTER struct ioword *iop;
+struct ioword *iop;
int pipein, pipeout;
{
- REGISTER int u = -1;
+ int u = -1;
char *cp = NULL, *msg;
DBGPRINTF(("IOSETUP: iop %p, pipein %i, pipeout %i\n", iop,
@@ -3136,9 +3131,9 @@ int pipein, pipeout;
}
static void echo(wp)
-REGISTER char **wp;
+char **wp;
{
- REGISTER int i;
+ int i;
prs("+");
for (i = 0; wp[i]; i++) {
@@ -3153,9 +3148,9 @@ static struct op **find1case(t, w)
struct op *t;
char *w;
{
- REGISTER struct op *t1;
+ struct op *t1;
struct op **tp;
- REGISTER char **wp, *cp;
+ char **wp, *cp;
if (t == NULL) {
@@ -3190,7 +3185,7 @@ static struct op *findcase(t, w)
struct op *t;
char *w;
{
- REGISTER struct op **tp;
+ struct op **tp;
return ((tp = find1case(t, w)) != NULL ? *tp : (struct op *) NULL);
}
@@ -3213,10 +3208,10 @@ struct brkcon *bc;
* unless `canintr' is true.
*/
static int waitfor(lastpid, canintr)
-REGISTER int lastpid;
+int lastpid;
int canintr;
{
- REGISTER int pid, rv;
+ int pid, rv;
int s;
int oheedint = heedint;
@@ -3270,7 +3265,7 @@ int canintr;
}
static int setstatus(s)
-REGISTER int s;
+int s;
{
exstat = s;
setval(lookup("?"), putn(s));
@@ -3285,8 +3280,8 @@ REGISTER int s;
static char *rexecve(c, v, envp)
char *c, **v, **envp;
{
- REGISTER int i;
- REGISTER char *sp, *tp;
+ int i;
+ char *sp, *tp;
int eacces = 0, asis = 0;
#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL
@@ -3449,9 +3444,9 @@ static int dolabel(struct op *t)
}
static int dochdir(t)
-REGISTER struct op *t;
+struct op *t;
{
- REGISTER char *cp, *er;
+ char *cp, *er;
if ((cp = t->words[1]) == NULL && (cp = homedir->value) == NULL)
er = ": no home directory";
@@ -3465,9 +3460,9 @@ REGISTER struct op *t;
}
static int doshift(t)
-REGISTER struct op *t;
+struct op *t;
{
- REGISTER int n;
+ int n;
n = t->words[1] ? getn(t->words[1]) : 1;
if (dolc < n) {
@@ -3487,7 +3482,7 @@ REGISTER struct op *t;
static int dologin(t)
struct op *t;
{
- REGISTER char *cp;
+ char *cp;
if (interactive) {
signal(SIGINT, SIG_DFL);
@@ -3501,10 +3496,10 @@ struct op *t;
}
static int doumask(t)
-REGISTER struct op *t;
+struct op *t;
{
- REGISTER int i, n;
- REGISTER char *cp;
+ int i, n;
+ char *cp;
if ((cp = t->words[1]) == NULL) {
i = umask(0);
@@ -3521,9 +3516,9 @@ REGISTER struct op *t;
}
static int doexec(t)
-REGISTER struct op *t;
+struct op *t;
{
- REGISTER int i;
+ int i;
jmp_buf ex;
xint *ofail;
@@ -3543,8 +3538,8 @@ REGISTER struct op *t;
static int dodot(t)
struct op *t;
{
- REGISTER int i;
- REGISTER char *sp, *tp;
+ int i;
+ char *sp, *tp;
char *cp;
int maltmp;
@@ -3596,8 +3591,8 @@ struct op *t;
static int dowait(t)
struct op *t;
{
- REGISTER int i;
- REGISTER char *cp;
+ int i;
+ char *cp;
if ((cp = t->words[1]) != NULL) {
i = getn(cp);
@@ -3612,9 +3607,9 @@ struct op *t;
static int doread(t)
struct op *t;
{
- REGISTER char *cp, **wp;
- REGISTER int nb = 0;
- REGISTER int nl = 0;
+ char *cp, **wp;
+ int nb = 0;
+ int nl = 0;
if (t->words[1] == NULL) {
err("Usage: read name ...");
@@ -3634,16 +3629,16 @@ struct op *t;
}
static int doeval(t)
-REGISTER struct op *t;
+struct op *t;
{
return (RUN(awordlist, t->words + 1, wdchar));
}
static int dotrap(t)
-REGISTER struct op *t;
+struct op *t;
{
- REGISTER int n, i;
- REGISTER int resetsig;
+ int n, i;
+ int resetsig;
if (t->words[1] == NULL) {
for (i = 0; i <= _NSIG; i++)
@@ -3682,7 +3677,7 @@ REGISTER struct op *t;
static int getsig(s)
char *s;
{
- REGISTER int n;
+ int n;
if ((n = getn(s)) < 0 || n > _NSIG) {
err("trap: bad signal number");
@@ -3691,7 +3686,7 @@ char *s;
return (n);
}
-static void setsig(REGISTER int n, sighandler_t f)
+static void setsig(int n, sighandler_t f)
{
if (n == 0)
return;
@@ -3704,8 +3699,8 @@ static void setsig(REGISTER int n, sigha
static int getn(as)
char *as;
{
- REGISTER char *s;
- REGISTER int n, m;
+ char *s;
+ int n, m;
s = as;
m = 1;
@@ -3735,11 +3730,11 @@ struct op *t;
}
static int brkcontin(cp, val)
-REGISTER char *cp;
+char *cp;
int val;
{
- REGISTER struct brkcon *bc;
- REGISTER int nl;
+ struct brkcon *bc;
+ int nl;
nl = cp == NULL ? 1 : getn(cp);
if (nl <= 0)
@@ -3761,7 +3756,7 @@ int val;
static int doexit(t)
struct op *t;
{
- REGISTER char *cp;
+ char *cp;
execflg = 0;
if ((cp = t->words[1]) != NULL)
@@ -3812,18 +3807,18 @@ static void rdexp(char **wp, void (*f) (
}
static void badid(s)
-REGISTER char *s;
+char *s;
{
prs(s);
err(": bad identifier");
}
static int doset(t)
-REGISTER struct op *t;
+struct op *t;
{
- REGISTER struct var *vp;
- REGISTER char *cp;
- REGISTER int n;
+ struct var *vp;
+ char *cp;
+ int n;
if ((cp = t->words[1]) == NULL) {
for (vp = vlist; vp; vp = vp->next)
@@ -3863,7 +3858,7 @@ REGISTER struct op *t;
}
static void varput(s, out)
-REGISTER char *s;
+char *s;
int out;
{
if (isalnum(*s) || *s == '_') {
@@ -3963,7 +3958,7 @@ static char **eval(char **ap, int f)
*/
static char **makenv(int all, struct wdblock *wb)
{
- REGISTER struct var *vp;
+ struct var *vp;
DBGPRINTF5(("MAKENV: enter, all=%d\n", all));
@@ -3975,7 +3970,7 @@ static char **makenv(int all, struct wdb
}
static char *evalstr(cp, f)
-REGISTER char *cp;
+char *cp;
int f;
{
struct wdblock *wb;
@@ -3993,7 +3988,7 @@ int f;
return (cp);
}
-static int expand(char *cp, REGISTER struct wdblock **wbp, int f)
+static int expand(char *cp, struct wdblock **wbp, int f)
{
jmp_buf ev;
@@ -4042,8 +4037,8 @@ static int expand(char *cp, REGISTER str
static char *blank(f)
int f;
{
- REGISTER int c, c1;
- REGISTER char *sp;
+ int c, c1;
+ char *sp;
int scanequals, foundequals;
DBGPRINTF3(("BLANK: enter, f=%d\n", f));
@@ -4110,10 +4105,10 @@ int f;
* Get characters, substituting for ` and $
*/
static int subgetc(ec, quoted)
-REGISTER char ec;
+char ec;
int quoted;
{
- REGISTER char c;
+ char c;
DBGPRINTF3(("SUBGETC: enter, quoted=%d\n", quoted));
@@ -4143,7 +4138,7 @@ int quoted;
int otask;
struct io *oiop;
char *dolp;
- REGISTER char *s, c, *cp = NULL;
+ char *s, c, *cp = NULL;
struct var *vp;
DBGPRINTF3(("DOLLAR: enter, quoted=%d\n", quoted));
@@ -4246,7 +4241,7 @@ static int grave(quoted)
int quoted;
{
char *cp;
- REGISTER int i;
+ int i;
int j;
int pf[2];
static char child_cmd[LINELIM];
@@ -4423,9 +4418,9 @@ int quoted;
static char *unquote(as)
-REGISTER char *as;
+char *as;
{
- REGISTER char *s;
+ char *s;
if ((s = as) != NULL)
while (*s)
@@ -4450,8 +4445,8 @@ static struct wdblock *glob(cp, wb)
char *cp;
struct wdblock *wb;
{
- REGISTER int i;
- REGISTER char *pp;
+ int i;
+ char *pp;
if (cp == 0)
return (wb);
@@ -4494,9 +4489,9 @@ struct wdblock *wb;
static void globname(we, pp)
char *we;
-REGISTER char *pp;
+char *pp;
{
- REGISTER char *np, *cp;
+ char *np, *cp;
char *name, *gp, *dp;
int k;
DIR *dirp;
@@ -4557,11 +4552,11 @@ REGISTER char *pp;
*/
static char *generate(start1, end1, middle, end)
char *start1;
-REGISTER char *end1;
+char *end1;
char *middle, *end;
{
char *p;
- REGISTER char *op, *xp;
+ char *op, *xp;
p = op =
space((int) (end1 - start1) + strlen(middle) + strlen(end) + 2);
@@ -4574,10 +4569,10 @@ char *middle, *end;
}
static int anyspcl(wb)
-REGISTER struct wdblock *wb;
+struct wdblock *wb;
{
- REGISTER int i;
- REGISTER char **wd;
+ int i;
+ char **wd;
wd = wb->w_words;
for (i = 0; i < wb->w_nword; i++)
@@ -4595,9 +4590,9 @@ char *p1, *p2;
/* -------- word.c -------- */
static struct wdblock *newword(nw)
-REGISTER int nw;
+int nw;
{
- REGISTER struct wdblock *wb;
+ struct wdblock *wb;
wb = (struct wdblock *) space(sizeof(*wb) + nw * sizeof(char *));
wb->w_bsize = nw;
@@ -4607,10 +4602,10 @@ REGISTER int nw;
static struct wdblock *addword(wd, wb)
char *wd;
-REGISTER struct wdblock *wb;
+struct wdblock *wb;
{
- REGISTER struct wdblock *wb2;
- REGISTER int nw;
+ struct wdblock *wb2;
+ int nw;
if (wb == NULL)
wb = newword(NSTART);
@@ -4628,10 +4623,10 @@ REGISTER struct wdblock *wb;
static
char **getwords(wb)
-REGISTER struct wdblock *wb;
+struct wdblock *wb;
{
- REGISTER char **wd;
- REGISTER int nb;
+ char **wd;
+ int nb;
if (wb == NULL)
return ((char **) NULL);
@@ -4662,7 +4657,7 @@ int (*a3) (char *, char *);
static void glob1(base, lim)
char *base, *lim;
{
- REGISTER char *i, *j;
+ char *i, *j;
int v2;
char *lptr, *hptr;
int c;
@@ -4732,7 +4727,7 @@ char *base, *lim;
static void glob2(i, j)
char *i, *j;
{
- REGISTER char *index1, *index2, c;
+ char *index1, *index2, c;
int m;
m = globv;
@@ -4748,7 +4743,7 @@ char *i, *j;
static void glob3(i, j, k)
char *i, *j, *k;
{
- REGISTER char *index1, *index2, *index3;
+ char *index1, *index2, *index3;
int c;
int m;
@@ -4772,7 +4767,7 @@ char *i, *j, *k;
static int my_getc(int ec)
{
- REGISTER int c;
+ int c;
if (e.linep > elinep) {
while ((c = readc()) != '\n' && c);
@@ -4806,7 +4801,7 @@ static int eofc()
static int readc()
{
- REGISTER int c;
+ int c;
RCPRINTF(("READC: e.iop %p, e.iobase %p\n", e.iop, e.iobase));
@@ -4936,7 +4931,7 @@ static void pushio(struct ioarg *argp, i
static struct io *setbase(ip)
struct io *ip;
{
- REGISTER struct io *xp;
+ struct io *xp;
xp = e.iobase;
e.iobase = ip;
@@ -4951,9 +4946,9 @@ struct io *ip;
* Produce the characters of a string, then a newline, then EOF.
*/
static int nlchar(ap)
-REGISTER struct ioarg *ap;
+struct ioarg *ap;
{
- REGISTER int c;
+ int c;
if (ap->aword == NULL)
return (0);
@@ -4969,10 +4964,10 @@ REGISTER struct ioarg *ap;
* in them, with a space after each word.
*/
static int wdchar(ap)
-REGISTER struct ioarg *ap;
+struct ioarg *ap;
{
- REGISTER char c;
- REGISTER char **wl;
+ char c;
+ char **wl;
if ((wl = ap->awordlist) == NULL)
return (0);
@@ -4991,9 +4986,9 @@ REGISTER struct ioarg *ap;
* producing a space between them.
*/
static int dolchar(ap)
-REGISTER struct ioarg *ap;
+struct ioarg *ap;
{
- REGISTER char *wp;
+ char *wp;
if ((wp = *ap->awordlist++) != NULL) {
PUSHIO(aword, wp, *ap->awordlist == NULL ? strchar : xxchar);
@@ -5003,9 +4998,9 @@ REGISTER struct ioarg *ap;
}
static int xxchar(ap)
-REGISTER struct ioarg *ap;
+struct ioarg *ap;
{
- REGISTER int c;
+ int c;
if (ap->aword == NULL)
return (0);
@@ -5020,9 +5015,9 @@ REGISTER struct ioarg *ap;
* Produce the characters from a single word (string).
*/
static int strchar(ap)
-REGISTER struct ioarg *ap;
+struct ioarg *ap;
{
- REGISTER int c;
+ int c;
if (ap->aword == NULL || (c = *ap->aword++) == 0)
return (0);
@@ -5033,9 +5028,9 @@ REGISTER struct ioarg *ap;
* Produce quoted characters from a single word (string).
*/
static int qstrchar(ap)
-REGISTER struct ioarg *ap;
+struct ioarg *ap;
{
- REGISTER int c;
+ int c;
if (ap->aword == NULL || (c = *ap->aword++) == 0)
return (0);
@@ -5046,9 +5041,9 @@ REGISTER struct ioarg *ap;
* Return the characters from a file.
*/
static int filechar(ap)
-REGISTER struct ioarg *ap;
+struct ioarg *ap;
{
- REGISTER int i;
+ int i;
char c;
struct iobuf *bp = ap->afbuf;
@@ -5098,7 +5093,7 @@ REGISTER struct ioarg *ap;
* Return the characters from a here temp file.
*/
static int herechar(ap)
-REGISTER struct ioarg *ap;
+struct ioarg *ap;
{
char c;
@@ -5119,7 +5114,7 @@ static int gravechar(ap, iop)
struct ioarg *ap;
struct io *iop;
{
- REGISTER int c;
+ int c;
if ((c = qgravechar(ap, iop) & ~QUOTE) == '\n')
c = ' ';
@@ -5127,10 +5122,10 @@ struct io *iop;
}
static int qgravechar(ap, iop)
-REGISTER struct ioarg *ap;
+struct ioarg *ap;
struct io *iop;
{
- REGISTER int c;
+ int c;
DBGPRINTF3(("QGRAVECHAR: enter, ap=%p, iop=%p\n", ap, iop));
@@ -5158,9 +5153,9 @@ struct io *iop;
* Return a single command (usually the first line) from a file.
*/
static int linechar(ap)
-REGISTER struct ioarg *ap;
+struct ioarg *ap;
{
- REGISTER int c;
+ int c;
if ((c = filechar(ap)) == '\n') {
if (!multiline) {
@@ -5172,7 +5167,7 @@ REGISTER struct ioarg *ap;
}
static void prs(s)
-REGISTER const char *s;
+const char *s;
{
if (*s)
write(2, s, strlen(s));
@@ -5185,7 +5180,7 @@ unsigned u;
}
static void closef(i)
-REGISTER int i;
+int i;
{
if (i > 2)
close(i);
@@ -5193,7 +5188,7 @@ REGISTER int i;
static void closeall()
{
- REGISTER int u;
+ int u;
for (u = NUFILE; u < NOFILE;)
close(u++);
@@ -5204,9 +5199,9 @@ static void closeall()
* remap fd into Shell's fd space
*/
static int remap(fd)
-REGISTER int fd;
+int fd;
{
- REGISTER int i;
+ int i;
int map[NOFILE];
int newfd;
@@ -5235,9 +5230,9 @@ REGISTER int fd;
}
static int openpipe(pv)
-REGISTER int *pv;
+int *pv;
{
- REGISTER int i;
+ int i;
if ((i = pipe(pv)) < 0)
err("can't create pipe - try again");
@@ -5245,7 +5240,7 @@ REGISTER int *pv;
}
static void closepipe(pv)
-REGISTER int *pv;
+int *pv;
{
if (pv != NULL) {
close(*pv++);
@@ -5260,10 +5255,10 @@ REGISTER int *pv;
*/
static void markhere(s, iop)
-REGISTER char *s;
+char *s;
struct ioword *iop;
{
- REGISTER struct here *h, *lh;
+ struct here *h, *lh;
DBGPRINTF7(("MARKHERE: enter, s=%p\n", s));
@@ -5297,7 +5292,7 @@ struct ioword *iop;
static void gethere()
{
- REGISTER struct here *h, *hp;
+ struct here *h, *hp;
DBGPRINTF7(("GETHERE: enter...\n"));
@@ -5315,12 +5310,12 @@ static void gethere()
static void readhere(name, s, ec)
char **name;
-REGISTER char *s;
+char *s;
int ec;
{
int tf;
char tname[30] = ".msh_XXXXXX";
- REGISTER int c;
+ int c;
jmp_buf ev;
char myline[LINELIM + 1];
char *thenext;
@@ -5379,7 +5374,7 @@ static int herein(hname, xdoll)
char *hname;
int xdoll;
{
- REGISTER int hf;
+ int hf;
int tf;
#if __GNUC__
@@ -5423,7 +5418,7 @@ int xdoll;
static void scraphere()
{
- REGISTER struct here *h;
+ struct here *h;
DBGPRINTF7(("SCRAPHERE: enter...\n"));
@@ -5438,7 +5433,7 @@ static void scraphere()
static void freehere(area)
int area;
{
- REGISTER struct here *h, *hl;
+ struct here *h, *hl;
DBGPRINTF6(("FREEHERE: enter, area=%d\n", area));
More information about the busybox
mailing list