svn commit: trunk/busybox/shell
vda at busybox.net
vda at busybox.net
Mon Jun 23 13:06:35 UTC 2008
Author: vda
Date: 2008-06-23 06:06:34 -0700 (Mon, 23 Jun 2008)
New Revision: 22478
Log:
ash: improve readability of the code. No real code changes.
Modified:
trunk/busybox/shell/ash.c
Changeset:
Modified: trunk/busybox/shell/ash.c
===================================================================
--- trunk/busybox/shell/ash.c 2008-06-23 11:53:47 UTC (rev 22477)
+++ trunk/busybox/shell/ash.c 2008-06-23 13:06:34 UTC (rev 22478)
@@ -11146,7 +11146,8 @@
}
}
}
- return lasttoken = xxreadtoken_tokens[p - xxreadtoken_chars];
+ lasttoken = xxreadtoken_tokens[p - xxreadtoken_chars];
+ return lasttoken;
}
}
} /* for */
@@ -12997,21 +12998,19 @@
char arithval; /* Current character under analysis */
operator lasttok, op;
operator prec;
-
+ operator *stack, *stackptr;
const char *p = endexpression;
int errcode;
+ v_n_t *numstack, *numstackptr;
+ unsigned datasizes = strlen(expr) + 2;
- size_t 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 @@
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 */
More information about the busybox-cvs
mailing list