summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorEric Andersen2006-01-30 22:48:39 +0000
committerEric Andersen2006-01-30 22:48:39 +0000
commita68ea1cb93c29125bc4f30ddd415fca02249e010 (patch)
tree5741be315758b807145c24da9ff3a1dbf8fce4e8 /shell
parent9a58b02ec75caafb7214f1ad0317f9a4830cbd2a (diff)
downloadbusybox-a68ea1cb93c29125bc4f30ddd415fca02249e010.zip
busybox-a68ea1cb93c29125bc4f30ddd415fca02249e010.tar.gz
fix up yet more annoying signed/unsigned and mixed type errors
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c26
-rw-r--r--shell/hush.c6
-rw-r--r--shell/lash.c2
-rw-r--r--shell/msh.c2
4 files changed, 19 insertions, 17 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 3564d85..e9e6def 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -1402,8 +1402,10 @@ static void unsetfunc(const char *);
#ifdef CONFIG_ASH_MATH_SUPPORT_64
typedef int64_t arith_t;
+#define arith_t_type (long long)
#else
typedef long arith_t;
+#define arith_t_type (long)
#endif
#ifdef CONFIG_ASH_MATH_SUPPORT
@@ -10132,15 +10134,15 @@ readtoken1(int firstc, int syntax, char *eofmark, int striptabs)
char *out;
int len;
char line[EOFMARKLEN + 1];
- struct nodelist *bqlist;
- int quotef;
- int dblquote;
- int varnest; /* levels of variables expansion */
- int arinest; /* levels of arithmetic expansion */
- int parenlevel; /* levels of parens in arithmetic */
- int dqvarnest; /* levels of variables expansion within double quotes */
- int oldstyle;
- int prevsyntax; /* syntax before arithmetic */
+ struct nodelist *bqlist = 0;
+ int quotef = 0;
+ int dblquote = 0;
+ int varnest = 0; /* levels of variables expansion */
+ int arinest = 0; /* levels of arithmetic expansion */
+ int parenlevel = 0; /* levels of parens in arithmetic */
+ int dqvarnest = 0; /* levels of variables expansion within double quotes */
+ int oldstyle = 0;
+ int prevsyntax = 0; /* syntax before arithmetic */
#if __GNUC__
/* Avoid longjmp clobbering */
(void) &out;
@@ -10563,7 +10565,7 @@ parsebackq: {
struct jmploc jmploc;
struct jmploc *volatile savehandler;
size_t savelen;
- int saveprompt;
+ int saveprompt = 0;
#ifdef __GNUC__
(void) &saveprompt;
#endif
@@ -13380,9 +13382,9 @@ arith_apply(operator op, v_n_t *numstack, v_n_t **numstackptr)
}
/* save to shell variable */
#ifdef CONFIG_ASH_MATH_SUPPORT_64
- snprintf(buf, sizeof(buf), "%lld", rez);
+ snprintf(buf, sizeof(buf), "%lld", arith_t_type rez);
#else
- snprintf(buf, sizeof(buf), "%ld", rez);
+ snprintf(buf, sizeof(buf), "%ld", arith_t_type rez);
#endif
setvar(numptr_m1->var, buf, 0);
/* after saving, make previous value for v++ or v-- */
diff --git a/shell/hush.c b/shell/hush.c
index ff29974..096b402 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2614,10 +2614,10 @@ int parse_stream(o_string *dest, struct p_context *ctx,
return 0;
}
-static void mapset(const unsigned char *set, int code)
+static void mapset(const char *set, int code)
{
- const unsigned char *s;
- for (s=set; *s; s++) map[*s] = code;
+ const char *s;
+ for (s=set; *s; s++) map[(int)*s] = code;
}
static void update_ifs_map(void)
diff --git a/shell/lash.c b/shell/lash.c
index 56a3a23..1b8aca5 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -1440,7 +1440,7 @@ static int busy_loop(FILE * input)
char *next_command = NULL;
struct job newjob;
int i;
- int inbg;
+ int inbg = 0;
int status;
#ifdef CONFIG_LASH_JOB_CONTROL
pid_t parent_pgrp;
diff --git a/shell/msh.c b/shell/msh.c
index 08ca792..d56db57 100644
--- a/shell/msh.c
+++ b/shell/msh.c
@@ -1622,7 +1622,7 @@ static void initarea()
brkaddr = malloc(AREASIZE);
brktop = brkaddr + AREASIZE;
- while ((int) sbrk(0) & ALIGN)
+ while ((long) sbrk(0) & ALIGN)
sbrk(1);
areabot = (struct region *) sbrk(REGSIZE);