summaryrefslogtreecommitdiff
path: root/coreutils/printf.c
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/printf.c
parente935602ff5d5a45be56585b8bad44194c3e837a3 (diff)
downloadbusybox-a41fdf331af344ecd3ec230a072857ea197e1890.zip
busybox-a41fdf331af344ecd3ec230a072857ea197e1890.tar.gz
preparatory patch for -Wwrite-strings #1
Diffstat (limited to 'coreutils/printf.c')
-rw-r--r--coreutils/printf.c20
1 files changed, 10 insertions, 10 deletions
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. */