aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-01-29 22:51:00 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-01-29 22:51:00 +0000
commit32d944197db7cd9a6d6014aa83d1d9fd36e4f7ca (patch)
tree70ffff0b7f48b35a70b8b04253abe9118ded6026 /coreutils
parent2014b85b6cade935b303d4cd10a20d21efd42aad (diff)
downloadbusybox-w32-32d944197db7cd9a6d6014aa83d1d9fd36e4f7ca.tar.gz
busybox-w32-32d944197db7cd9a6d6014aa83d1d9fd36e4f7ca.tar.bz2
busybox-w32-32d944197db7cd9a6d6014aa83d1d9fd36e4f7ca.zip
preparatory patch for -Wwrite-strings #1
git-svn-id: svn://busybox.net/trunk/busybox@17653 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cat.c2
-rw-r--r--coreutils/date.c6
-rw-r--r--coreutils/du.c2
-rw-r--r--coreutils/expr.c8
-rw-r--r--coreutils/fold.c2
-rw-r--r--coreutils/head.c2
-rw-r--r--coreutils/ln.c2
-rw-r--r--coreutils/md5_sha1_sum.c2
-rw-r--r--coreutils/printf.c20
-rw-r--r--coreutils/tail.c2
-rw-r--r--coreutils/yes.c2
11 files changed, 25 insertions, 25 deletions
diff --git a/coreutils/cat.c b/coreutils/cat.c
index 2b7c6035f..7a34891e8 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -14,7 +14,7 @@
14 14
15int bb_cat(char **argv) 15int bb_cat(char **argv)
16{ 16{
17 static char *const argv_dash[] = { "-", NULL }; 17 static const char *const argv_dash[] = { "-", NULL };
18 FILE *f; 18 FILE *f;
19 int retval = EXIT_SUCCESS; 19 int retval = EXIT_SUCCESS;
20 20
diff --git a/coreutils/date.c b/coreutils/date.c
index a6690e8bd..034a18b98 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -41,7 +41,7 @@ static void xputenv(char *s)
41static void maybe_set_utc(int opt) 41static void maybe_set_utc(int opt)
42{ 42{
43 if (opt & DATE_OPT_UTC) 43 if (opt & DATE_OPT_UTC)
44 xputenv("TZ=UTC0"); 44 xputenv((char*)"TZ=UTC0");
45} 45}
46 46
47int date_main(int argc, char **argv) 47int date_main(int argc, char **argv)
@@ -218,7 +218,7 @@ format_utc:
218 i = 22; 218 i = 22;
219 goto format_utc; 219 goto format_utc;
220 } else /* default case */ 220 } else /* default case */
221 date_fmt = "%a %b %e %H:%M:%S %Z %Y"; 221 date_fmt = (char*)"%a %b %e %H:%M:%S %Z %Y";
222 } 222 }
223 223
224 if (*date_fmt == '\0') { 224 if (*date_fmt == '\0') {
@@ -228,7 +228,7 @@ format_utc:
228 /* Handle special conversions */ 228 /* Handle special conversions */
229 229
230 if (strncmp(date_fmt, "%f", 2) == 0) { 230 if (strncmp(date_fmt, "%f", 2) == 0) {
231 date_fmt = "%Y.%m.%d-%H:%M:%S"; 231 date_fmt = (char*)"%Y.%m.%d-%H:%M:%S";
232 } 232 }
233 233
234 /* Generate output string */ 234 /* Generate output string */
diff --git a/coreutils/du.c b/coreutils/du.c
index a1ca5b59b..a4b3c817e 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -222,7 +222,7 @@ int du_main(int argc, char **argv)
222 /* go through remaining args (if any) */ 222 /* go through remaining args (if any) */
223 argv += optind; 223 argv += optind;
224 if (optind >= argc) { 224 if (optind >= argc) {
225 *--argv = "."; 225 *--argv = (char*)".";
226 if (slink_depth == 1) { 226 if (slink_depth == 1) {
227 slink_depth = 0; 227 slink_depth = 0;
228 } 228 }
diff --git a/coreutils/expr.c b/coreutils/expr.c
index 51e553dc6..469d467bf 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -67,8 +67,8 @@ static char **args;
67static VALUE *docolon(VALUE * sv, VALUE * pv); 67static VALUE *docolon(VALUE * sv, VALUE * pv);
68static VALUE *eval(void); 68static VALUE *eval(void);
69static VALUE *int_value(arith_t i); 69static VALUE *int_value(arith_t i);
70static VALUE *str_value(char *s); 70static VALUE *str_value(const char *s);
71static int nextarg(char *str); 71static int nextarg(const char *str);
72static int null(VALUE * v); 72static int null(VALUE * v);
73static int toarith(VALUE * v); 73static int toarith(VALUE * v);
74static void freev(VALUE * v); 74static void freev(VALUE * v);
@@ -110,7 +110,7 @@ static VALUE *int_value(arith_t i)
110 110
111/* Return a VALUE for S. */ 111/* Return a VALUE for S. */
112 112
113static VALUE *str_value(char *s) 113static VALUE *str_value(const char *s)
114{ 114{
115 VALUE *v; 115 VALUE *v;
116 116
@@ -172,7 +172,7 @@ static int toarith(VALUE * v)
172/* Return nonzero if the next token matches STR exactly. 172/* Return nonzero if the next token matches STR exactly.
173 STR must not be NULL. */ 173 STR must not be NULL. */
174 174
175static int nextarg(char *str) 175static int nextarg(const char *str)
176{ 176{
177 if (*args == NULL) 177 if (*args == NULL)
178 return 0; 178 return 0;
diff --git a/coreutils/fold.c b/coreutils/fold.c
index fd7298169..490882f6d 100644
--- a/coreutils/fold.c
+++ b/coreutils/fold.c
@@ -66,7 +66,7 @@ int fold_main(int argc, char **argv)
66 66
67 argv += optind; 67 argv += optind;
68 if (!*argv) { 68 if (!*argv) {
69 *--argv = "-"; 69 *--argv = (char*)"-";
70 } 70 }
71 71
72 do { 72 do {
diff --git a/coreutils/head.c b/coreutils/head.c
index 56e7a960c..59b4d552c 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -92,7 +92,7 @@ int head_main(int argc, char **argv)
92 92
93 argv += optind; 93 argv += optind;
94 if (!*argv) { 94 if (!*argv) {
95 *--argv = "-"; 95 *--argv = (char*)"-";
96 } 96 }
97 97
98 fmt = header_fmt_str + 1; 98 fmt = header_fmt_str + 1;
diff --git a/coreutils/ln.c b/coreutils/ln.c
index 231a3bf03..a307e5579 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -26,7 +26,7 @@ int ln_main(int argc, char **argv)
26 char *last; 26 char *last;
27 char *src_name; 27 char *src_name;
28 char *src; 28 char *src;
29 char *suffix = "~"; 29 char *suffix = (char*)"~";
30 struct stat statbuf; 30 struct stat statbuf;
31 int (*link_func)(const char *, const char *); 31 int (*link_func)(const char *, const char *);
32 32
diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c
index 014ecefd0..d945ce7e0 100644
--- a/coreutils/md5_sha1_sum.c
+++ b/coreutils/md5_sha1_sum.c
@@ -102,7 +102,7 @@ int md5_sha1_sum_main(int argc, char **argv)
102 } 102 }
103 103
104 if (argc == optind) { 104 if (argc == optind) {
105 argv[argc++] = "-"; 105 argv[argc++] = (char*)"-";
106 } 106 }
107 107
108 if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK && (flags & FLAG_CHECK)) { 108 if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK && (flags & FLAG_CHECK)) {
diff --git a/coreutils/printf.c b/coreutils/printf.c
index 0e818354f..924499b29 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -42,11 +42,11 @@
42 42
43static int print_formatted(char *format, int argc, char **argv); 43static int print_formatted(char *format, int argc, char **argv);
44static void print_direc(char *start, size_t length, 44static void print_direc(char *start, size_t length,
45 int field_width, int precision, char *argument); 45 int field_width, int precision, const char *argument);
46 46
47typedef void (*converter)(char *arg, void *result); 47typedef void (*converter)(const char *arg, void *result);
48 48
49static void multiconvert(char *arg, void *result, converter convert) 49static void multiconvert(const char *arg, void *result, converter convert)
50{ 50{
51 char s[16]; 51 char s[16];
52 if (*arg == '"' || *arg == '\'') { 52 if (*arg == '"' || *arg == '\'') {
@@ -58,15 +58,15 @@ static void multiconvert(char *arg, void *result, converter convert)
58 fputs(arg, stderr); 58 fputs(arg, stderr);
59} 59}
60 60
61static void conv_strtoul(char *arg, void *result) 61static void conv_strtoul(const char *arg, void *result)
62{ 62{
63 *(unsigned long*)result = bb_strtoul(arg, NULL, 10); 63 *(unsigned long*)result = bb_strtoul(arg, NULL, 10);
64} 64}
65static void conv_strtol(char *arg, void *result) 65static void conv_strtol(const char *arg, void *result)
66{ 66{
67 *(long*)result = bb_strtol(arg, NULL, 10); 67 *(long*)result = bb_strtol(arg, NULL, 10);
68} 68}
69static void conv_strtod(char *arg, void *result) 69static void conv_strtod(const char *arg, void *result)
70{ 70{
71 char *end; 71 char *end;
72 /* Well, this one allows leading whitespace... so what */ 72 /* Well, this one allows leading whitespace... so what */
@@ -75,21 +75,21 @@ static void conv_strtod(char *arg, void *result)
75 if (end[0]) errno = ERANGE; 75 if (end[0]) errno = ERANGE;
76} 76}
77 77
78static unsigned long my_xstrtoul(char *arg) 78static unsigned long my_xstrtoul(const char *arg)
79{ 79{
80 unsigned long result; 80 unsigned long result;
81 multiconvert(arg, &result, conv_strtoul); 81 multiconvert(arg, &result, conv_strtoul);
82 return result; 82 return result;
83} 83}
84 84
85static long my_xstrtol(char *arg) 85static long my_xstrtol(const char *arg)
86{ 86{
87 long result; 87 long result;
88 multiconvert(arg, &result, conv_strtol); 88 multiconvert(arg, &result, conv_strtol);
89 return result; 89 return result;
90} 90}
91 91
92static double my_xstrtod(char *arg) 92static double my_xstrtod(const char *arg)
93{ 93{
94 double result; 94 double result;
95 multiconvert(arg, &result, conv_strtod); 95 multiconvert(arg, &result, conv_strtod);
@@ -239,7 +239,7 @@ static int print_formatted(char *format, int argc, char **argv)
239 239
240static void 240static void
241print_direc(char *start, size_t length, int field_width, int precision, 241print_direc(char *start, size_t length, int field_width, int precision,
242 char *argument) 242 const char *argument)
243{ 243{
244 char *p; /* Null-terminated copy of % directive. */ 244 char *p; /* Null-terminated copy of % directive. */
245 245
diff --git a/coreutils/tail.c b/coreutils/tail.c
index f1ba04ec6..2a1645309 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -91,7 +91,7 @@ int tail_main(int argc, char **argv)
91 if (argc >= 2 && (argv[1][0] == '+' || argv[1][0] == '-') 91 if (argc >= 2 && (argv[1][0] == '+' || argv[1][0] == '-')
92 && isdigit(argv[1][1]) 92 && isdigit(argv[1][1])
93 ) { 93 ) {
94 argv[0] = "-n"; 94 argv[0] = (char*)"-n";
95 argv--; 95 argv--;
96 argc++; 96 argc++;
97 } 97 }
diff --git a/coreutils/yes.c b/coreutils/yes.c
index 894506a89..fc6e611e6 100644
--- a/coreutils/yes.c
+++ b/coreutils/yes.c
@@ -22,7 +22,7 @@ int yes_main(int argc, char **argv)
22 const char *fmt; 22 const char *fmt;
23 char **first_arg; 23 char **first_arg;
24 24
25 *argv = "y"; 25 *argv = (char*)"y";
26 if (argc != 1) { 26 if (argc != 1) {
27 ++argv; 27 ++argv;
28 } 28 }