Not sure, but I seem to be seeing a small code shrink too.
Some unrelated small cleanups found their way into this patch too :)
Looks like there's still some 100 conversion warnings left to be taken
care of.
Cheers,
--
Cristian
--- /tmp/ash.c.orig 2009-10-10 08:35:34.000000000 +0200
+++ /tmp/ash.c 2009-10-10 19:23:33.000000000 +0200
@@ -4204,11 +4204,9 @@ makejob(/*union node *node,*/ int nprocs
curjob = jp;
jp->used = 1;
jp->ps = &jp->ps0;
- if (nprocs > 1) {
- jp->ps = ckmalloc(nprocs * sizeof(struct procstat));
- }
- TRACE(("makejob(%d) returns %%%d\n", nprocs,
- jobno(jp)));
+ if (nprocs > 1)
+ jp->ps = ckmalloc((size_t)nprocs * sizeof(struct procstat));
+ TRACE(("makejob(%d) returns %%%d\n", nprocs, jobno(jp)));
return jp;
}
@@ -5103,7 +5101,7 @@ static void
redirect(union node *redir, int flags)
{
struct redirtab *sv;
- int sv_pos;
+ size_t sv_pos;
int i;
int fd;
int newfd;
@@ -6992,7 +6990,8 @@ expandmeta(struct strlist *str /*, int f
INT_OFF;
p = preglob(str->text, 0, RMESCAPE_ALLOC | RMESCAPE_HEAP);
{
- int i = strlen(str->text);
+ size_t i = strlen(str->text);
+
expdir = ckmalloc(i < 2048 ? 2048 : i); /* XXX */
}
@@ -7761,8 +7760,8 @@ commandcmd(int argc UNUSED_PARAM, char *
/* ============ eval.c */
-static int funcblocksize; /* size of structures in function */
-static int funcstringsize; /* size of strings in node */
+static size_t funcblocksize; /* size of structures in function */
+static size_t funcstringsize; /* size of strings in node */
static void *funcblock; /* block to allocate function from */
static char *funcstring; /* block to allocate strings from */
@@ -7771,7 +7770,7 @@ static char *funcstring; /* block
#define EV_TESTED 02 /* exit status is checked; ignore -e flag */
#define EV_BACKCMD 04 /* command executing within back quotes */
-static const short nodesize[N_NUMBER] = {
+static const unsigned short nodesize[N_NUMBER] = {
[NCMD ] = SHELL_ALIGN(sizeof(struct ncmd)),
[NPIPE ] = SHELL_ALIGN(sizeof(struct npipe)),
[NREDIR ] = SHELL_ALIGN(sizeof(struct nredir)),
@@ -9846,7 +9845,7 @@ setparam(char **argv)
{
char **newparam;
char **ap;
- int nparam;
+ size_t nparam;
for (nparam = 0; argv[nparam]; nparam++)
continue;
@@ -9857,7 +9856,7 @@ setparam(char **argv)
*ap = NULL;
freeparam(&shellparam);
shellparam.malloced = 1;
- shellparam.nparam = nparam;
+ shellparam.nparam = (int)nparam;
shellparam.p = newparam;
#if ENABLE_ASH_GETOPTS
shellparam.optind = 1;
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox