summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenis Vlasenko2007-01-29 22:51:00 +0000
committerDenis Vlasenko2007-01-29 22:51:00 +0000
commita41fdf331af344ecd3ec230a072857ea197e1890 (patch)
tree70ffff0b7f48b35a70b8b04253abe9118ded6026 /coreutils
parente935602ff5d5a45be56585b8bad44194c3e837a3 (diff)
downloadbusybox-a41fdf331af344ecd3ec230a072857ea197e1890.zip
busybox-a41fdf331af344ecd3ec230a072857ea197e1890.tar.gz
preparatory patch for -Wwrite-strings #1
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 2b7c603..7a34891 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -14,7 +14,7 @@
int bb_cat(char **argv)
{
- static char *const argv_dash[] = { "-", NULL };
+ static const char *const argv_dash[] = { "-", NULL };
FILE *f;
int retval = EXIT_SUCCESS;
diff --git a/coreutils/date.c b/coreutils/date.c
index a6690e8..034a18b 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -41,7 +41,7 @@ static void xputenv(char *s)
static void maybe_set_utc(int opt)
{
if (opt & DATE_OPT_UTC)
- xputenv("TZ=UTC0");
+ xputenv((char*)"TZ=UTC0");
}
int date_main(int argc, char **argv)
@@ -218,7 +218,7 @@ format_utc:
i = 22;
goto format_utc;
} else /* default case */
- date_fmt = "%a %b %e %H:%M:%S %Z %Y";
+ date_fmt = (char*)"%a %b %e %H:%M:%S %Z %Y";
}
if (*date_fmt == '\0') {
@@ -228,7 +228,7 @@ format_utc:
/* Handle special conversions */
if (strncmp(date_fmt, "%f", 2) == 0) {
- date_fmt = "%Y.%m.%d-%H:%M:%S";
+ date_fmt = (char*)"%Y.%m.%d-%H:%M:%S";
}
/* Generate output string */
diff --git a/coreutils/du.c b/coreutils/du.c
index a1ca5b5..a4b3c81 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -222,7 +222,7 @@ int du_main(int argc, char **argv)
/* go through remaining args (if any) */
argv += optind;
if (optind >= argc) {
- *--argv = ".";
+ *--argv = (char*)".";
if (slink_depth == 1) {
slink_depth = 0;
}
diff --git a/coreutils/expr.c b/coreutils/expr.c
index 51e553d..469d467 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -67,8 +67,8 @@ static char **args;
static VALUE *docolon(VALUE * sv, VALUE * pv);
static VALUE *eval(void);
static VALUE *int_value(arith_t i);
-static VALUE *str_value(char *s);
-static int nextarg(char *str);
+static VALUE *str_value(const char *s);
+static int nextarg(const char *str);
static int null(VALUE * v);
static int toarith(VALUE * v);
static void freev(VALUE * v);
@@ -110,7 +110,7 @@ static VALUE *int_value(arith_t i)
/* Return a VALUE for S. */
-static VALUE *str_value(char *s)
+static VALUE *str_value(const char *s)
{
VALUE *v;
@@ -172,7 +172,7 @@ static int toarith(VALUE * v)
/* Return nonzero if the next token matches STR exactly.
STR must not be NULL. */
-static int nextarg(char *str)
+static int nextarg(const char *str)
{
if (*args == NULL)
return 0;
diff --git a/coreutils/fold.c b/coreutils/fold.c
index fd72981..490882f 100644
--- a/coreutils/fold.c
+++ b/coreutils/fold.c
@@ -66,7 +66,7 @@ int fold_main(int argc, char **argv)
argv += optind;
if (!*argv) {
- *--argv = "-";
+ *--argv = (char*)"-";
}
do {
diff --git a/coreutils/head.c b/coreutils/head.c
index 56e7a96..59b4d55 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -92,7 +92,7 @@ int head_main(int argc, char **argv)
argv += optind;
if (!*argv) {
- *--argv = "-";
+ *--argv = (char*)"-";
}
fmt = header_fmt_str + 1;
diff --git a/coreutils/ln.c b/coreutils/ln.c
index 231a3bf..a307e55 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -26,7 +26,7 @@ int ln_main(int argc, char **argv)
char *last;
char *src_name;
char *src;
- char *suffix = "~";
+ char *suffix = (char*)"~";
struct stat statbuf;
int (*link_func)(const char *, const char *);
diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c
index 014ecef..d945ce7 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)
}
if (argc == optind) {
- argv[argc++] = "-";
+ argv[argc++] = (char*)"-";
}
if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK && (flags & FLAG_CHECK)) {
diff --git a/coreutils/printf.c b/coreutils/printf.c
index 0e81835..924499b 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -42,11 +42,11 @@
static int print_formatted(char *format, int argc, char **argv);
static void print_direc(char *start, size_t length,
- int field_width, int precision, char *argument);
+ int field_width, int precision, const char *argument);
-typedef void (*converter)(char *arg, void *result);
+typedef void (*converter)(const char *arg, void *result);
-static void multiconvert(char *arg, void *result, converter convert)
+static void multiconvert(const char *arg, void *result, converter convert)
{
char s[16];
if (*arg == '"' || *arg == '\'') {
@@ -58,15 +58,15 @@ static void multiconvert(char *arg, void *result, converter convert)
fputs(arg, stderr);
}
-static void conv_strtoul(char *arg, void *result)
+static void conv_strtoul(const char *arg, void *result)
{
*(unsigned long*)result = bb_strtoul(arg, NULL, 10);
}
-static void conv_strtol(char *arg, void *result)
+static void conv_strtol(const char *arg, void *result)
{
*(long*)result = bb_strtol(arg, NULL, 10);
}
-static void conv_strtod(char *arg, void *result)
+static void conv_strtod(const char *arg, void *result)
{
char *end;
/* Well, this one allows leading whitespace... so what */
@@ -75,21 +75,21 @@ static void conv_strtod(char *arg, void *result)
if (end[0]) errno = ERANGE;
}
-static unsigned long my_xstrtoul(char *arg)
+static unsigned long my_xstrtoul(const char *arg)
{
unsigned long result;
multiconvert(arg, &result, conv_strtoul);
return result;
}
-static long my_xstrtol(char *arg)
+static long my_xstrtol(const char *arg)
{
long result;
multiconvert(arg, &result, conv_strtol);
return result;
}
-static double my_xstrtod(char *arg)
+static double my_xstrtod(const char *arg)
{
double result;
multiconvert(arg, &result, conv_strtod);
@@ -239,7 +239,7 @@ static int print_formatted(char *format, int argc, char **argv)
static void
print_direc(char *start, size_t length, int field_width, int precision,
- char *argument)
+ const char *argument)
{
char *p; /* Null-terminated copy of % directive. */
diff --git a/coreutils/tail.c b/coreutils/tail.c
index f1ba04e..2a16453 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -91,7 +91,7 @@ int tail_main(int argc, char **argv)
if (argc >= 2 && (argv[1][0] == '+' || argv[1][0] == '-')
&& isdigit(argv[1][1])
) {
- argv[0] = "-n";
+ argv[0] = (char*)"-n";
argv--;
argc++;
}
diff --git a/coreutils/yes.c b/coreutils/yes.c
index 894506a..fc6e611 100644
--- a/coreutils/yes.c
+++ b/coreutils/yes.c
@@ -22,7 +22,7 @@ int yes_main(int argc, char **argv)
const char *fmt;
char **first_arg;
- *argv = "y";
+ *argv = (char*)"y";
if (argc != 1) {
++argv;
}