summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenis Vlasenko2008-06-23 13:06:34 +0000
committerDenis Vlasenko2008-06-23 13:06:34 +0000
commit2b75a94118b29df8d0aaa1240ab75a6ad48f2cd1 (patch)
treed136b31fd14eb9274a12aa71ab7621e24ead9c63 /shell
parentef527f50e62ee8c0c9f34e8c1ab0489f6b0b1293 (diff)
downloadbusybox-2b75a94118b29df8d0aaa1240ab75a6ad48f2cd1.zip
busybox-2b75a94118b29df8d0aaa1240ab75a6ad48f2cd1.tar.gz
ash: improve readability of the code. No real code changes.
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 8a731fd..e407dc3 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -11146,7 +11146,8 @@ xxreadtoken(void)
}
}
}
- return lasttoken = xxreadtoken_tokens[p - xxreadtoken_chars];
+ lasttoken = xxreadtoken_tokens[p - xxreadtoken_chars];
+ return lasttoken;
}
}
} /* for */
@@ -12997,21 +12998,19 @@ arith(const char *expr, int *perrcode)
char arithval; /* Current character under analysis */
operator lasttok, op;
operator prec;
-
+ operator *stack, *stackptr;
const char *p = endexpression;
int errcode;
-
- size_t datasizes = strlen(expr) + 2;
+ v_n_t *numstack, *numstackptr;
+ unsigned datasizes = strlen(expr) + 2;
/* Stack of integers */
/* The proof that there can be no more than strlen(startbuf)/2+1 integers
* in any given correct or incorrect expression is left as an exercise to
* the reader. */
- v_n_t *numstack = alloca(((datasizes)/2)*sizeof(v_n_t)),
- *numstackptr = numstack;
+ numstackptr = numstack = alloca((datasizes / 2) * sizeof(numstack[0]));
/* Stack of operator tokens */
- operator *stack = alloca((datasizes) * sizeof(operator)),
- *stackptr = stack;
+ stackptr = stack = alloca(datasizes * sizeof(stack[0]));
*stackptr++ = lasttok = TOK_LPAREN; /* start off with a left paren */
*perrcode = errcode = 0;
@@ -13040,7 +13039,8 @@ arith(const char *expr, int *perrcode)
if (numstackptr != numstack+1) {
/* ... but if there isn't, it's bad */
err:
- return (*perrcode = -1);
+ *perrcode = -1;
+ return *perrcode;
}
if (numstack->var) {
/* expression is $((var)) only, lookup now */