diff options
author | Eric Andersen | 2006-01-30 19:48:23 +0000 |
---|---|---|
committer | Eric Andersen | 2006-01-30 19:48:23 +0000 |
commit | 5e678873f9ff7c95d43b278feee547ce989b3b20 (patch) | |
tree | 6b0bab1e0d6df7f659352acc7dc844663c11634c /coreutils | |
parent | 2cdd4d56ffc3b467d5ffa76e3c4cd009dc311097 (diff) | |
download | busybox-5e678873f9ff7c95d43b278feee547ce989b3b20.zip busybox-5e678873f9ff7c95d43b278feee547ce989b3b20.tar.gz |
clean up yet more annoying signed/unsigned mismatches and fixup
yet more incorrect types
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/expr.c | 6 | ||||
-rw-r--r-- | coreutils/install.c | 2 | ||||
-rw-r--r-- | coreutils/ls.c | 2 | ||||
-rw-r--r-- | coreutils/od.c | 10 | ||||
-rw-r--r-- | coreutils/tr.c | 24 | ||||
-rw-r--r-- | coreutils/uudecode.c | 2 | ||||
-rw-r--r-- | coreutils/uuencode.c | 2 |
7 files changed, 25 insertions, 23 deletions
diff --git a/coreutils/expr.c b/coreutils/expr.c index e0eb4ec..b23de8e 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c @@ -57,10 +57,12 @@ typedef enum valtype TYPE; #if ENABLE_EXPR_MATH_SUPPORT_64 typedef int64_t arith_t; #define PF_REZ "ll" +#define PF_REZ_TYPE (long long) #define STRTOL(s, e, b) strtoll(s, e, b) #else typedef long arith_t; #define PF_REZ "l" +#define PF_REZ_TYPE (long) #define STRTOL(s, e, b) strtol(s, e, b) #endif @@ -102,7 +104,7 @@ int expr_main (int argc, char **argv) bb_error_msg_and_die ("syntax error"); if (v->type == integer) - printf ("%" PF_REZ "d\n", v->u.i); + printf ("%" PF_REZ "d\n", PF_REZ_TYPE v->u.i); else puts (v->u.s); @@ -159,7 +161,7 @@ static int null (VALUE *v) static void tostring (VALUE *v) { if (v->type == integer) { - v->u.s = bb_xasprintf ("%" PF_REZ "d", v->u.i); + v->u.s = bb_xasprintf ("%" PF_REZ "d", PF_REZ_TYPE v->u.i); v->type = string; } } diff --git a/coreutils/install.c b/coreutils/install.c index c3d4f8c..e58cac9 100644 --- a/coreutils/install.c +++ b/coreutils/install.c @@ -115,7 +115,7 @@ extern int install_main(int argc, char **argv) ? 0 : S_ISDIR(statbuf.st_mode); } for (i = optind; i < argc - 1; i++) { - unsigned char *dest; + char *dest; dest = argv[argc - 1]; if (isdir) dest = concat_path_file(argv[argc - 1], basename(argv[i])); diff --git a/coreutils/ls.c b/coreutils/ls.c index 46ab865..489c29a 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c @@ -679,7 +679,7 @@ static int list_single(struct dnode *dn) break; case LIST_BLOCKS: #if _FILE_OFFSET_BITS == 64 - column += printf("%4lld ", dn->dstat.st_blocks >> 1); + column += printf("%4lld ", (long long)dn->dstat.st_blocks >> 1); #else column += printf("%4ld ", dn->dstat.st_blocks >> 1); #endif diff --git a/coreutils/od.c b/coreutils/od.c index 6a138e8..b70cb85 100644 --- a/coreutils/od.c +++ b/coreutils/od.c @@ -155,9 +155,9 @@ static const char * const add_strings[] = { "4/4 \" %011o \" \"\\n\"", /* O */ }; -static const signed char od_opts[] = "aBbcDdeFfHhIiLlOoXxv"; +static const char od_opts[] = "aBbcDdeFfHhIiLlOoXxv"; -static const signed char od_o2si[] = { +static const char od_o2si[] = { 0, 1, 2, 3, 5, 4, 6, 6, 7, 8, 9, 0xa, 0xb, 0xa, 0xa, @@ -168,14 +168,14 @@ int od_main(int argc, char **argv) { int ch; int first = 1; - signed char *p; + char *p; bb_dump_vflag = FIRST; bb_dump_length = -1; while ((ch = getopt(argc, argv, od_opts)) > 0) { if (ch == 'v') { bb_dump_vflag = ALL; - } else if (((p = strchr(od_opts, ch)) != NULL) && (*p >= 0)) { + } else if (((p = strchr(od_opts, ch)) != NULL) && (*p != '\0')) { if (first) { first = 0; bb_dump_add("\"%07.7_Ao\n\""); @@ -183,7 +183,7 @@ int od_main(int argc, char **argv) } else { bb_dump_add("\" \""); } - bb_dump_add(add_strings[od_o2si[(int)(p-od_opts)]]); + bb_dump_add(add_strings[(int)od_o2si[(p-od_opts)]]); } else { /* P, p, s, w, or other unhandled */ bb_show_usage(); } diff --git a/coreutils/tr.c b/coreutils/tr.c index e9eca4c..d6c5e34 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c @@ -40,7 +40,7 @@ static short in_index, out_index; /* these last are pointers to static buffers declared in tr_main */ static unsigned char *poutput; static unsigned char *pvector; -static char *pinvec, *poutvec; +static unsigned char *pinvec, *poutvec; #define input bb_common_bufsiz1 @@ -141,9 +141,9 @@ static unsigned int expand(const char *arg, register unsigned char *buffer) for (i = 'A'; i <= 'Z'; i++) *buffer++ = i; else if (strncmp(arg, "space", 5) == 0) - strcat(buffer, " \f\n\r\t\v"); + strcat((char*)buffer, " \f\n\r\t\v"); else if (strncmp(arg, "blank", 5) == 0) - strcat(buffer, " \t"); + strcat((char*)buffer, " \t"); /* gcc gives a warning if braces aren't used here */ else if (strncmp(arg, "punct", 5) == 0) { for (i = 0; i <= ASCII; i++) @@ -156,7 +156,7 @@ static unsigned int expand(const char *arg, register unsigned char *buffer) *buffer++ = i; } else { - strcat(buffer, "[:"); + strcat((char*)buffer, "[:"); arg++; continue; } @@ -214,10 +214,10 @@ extern int tr_main(int argc, char **argv) RESERVE_CONFIG_BUFFER(outvec, ASCII+1); /* ... but make them available globally */ - poutput = output; - pvector = vector; - pinvec = invec; - poutvec = outvec; + poutput = (unsigned char*)output; + pvector = (unsigned char*)vector; + pinvec = (unsigned char*)invec; + poutvec = (unsigned char*)outvec; if (argc > 1 && argv[idx][0] == '-') { for (ptr = (unsigned char *) &argv[idx][1]; *ptr; ptr++) { @@ -243,14 +243,14 @@ extern int tr_main(int argc, char **argv) } if (argv[idx] != NULL) { - input_length = expand(argv[idx++], input); + input_length = expand(argv[idx++], (unsigned char*)input); if (com_fl) - input_length = complement(input, input_length); + input_length = complement((unsigned char*)input, input_length); if (argv[idx] != NULL) { if (*argv[idx] == '\0') bb_error_msg_and_die("STRING2 cannot be empty"); - output_length = expand(argv[idx], output); - map(input, input_length, output, output_length); + output_length = expand(argv[idx], (unsigned char*)output); + map((unsigned char*)input, input_length, (unsigned char*)output, output_length); } for (i = 0; i < input_length; i++) invec[(unsigned char)input[i]] = TRUE; diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index da6490a..60bf7d8 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c @@ -93,7 +93,7 @@ static int read_base64(FILE *src_stream, FILE *dst_stream) while (count < 4) { char *table_ptr; - char ch; + int ch; /* Get next _valid_ character */ do { diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index 2660f4a..ee07b08 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c @@ -130,7 +130,7 @@ int uuencode_main(int argc, char **argv) memset(&src_buf[size], 0, src_buf_size - size); } /* Encode the buffer we just read in */ - uuencode(src_buf, dst_buf, size, tbl); + uuencode((unsigned char*)src_buf, dst_buf, size, tbl); putchar('\n'); if (tbl == tbl_std) { |