summaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorDenis Vlasenko2007-01-29 22:51:25 +0000
committerDenis Vlasenko2007-01-29 22:51:25 +0000
commitb6aae0f38194cd39960a898606ee65d4be93a895 (patch)
treeb73c92aefaf614291a71d05e9d28ca68f4ef021b /miscutils
parenta41fdf331af344ecd3ec230a072857ea197e1890 (diff)
downloadbusybox-b6aae0f38194cd39960a898606ee65d4be93a895.zip
busybox-b6aae0f38194cd39960a898606ee65d4be93a895.tar.gz
preparatory patch for -Wwrite-strings #2
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/eject.c2
-rw-r--r--miscutils/hdparm.c18
-rw-r--r--miscutils/strings.c2
3 files changed, 9 insertions, 13 deletions
diff --git a/miscutils/eject.c b/miscutils/eject.c
index ff23b16..8e37c84 100644
--- a/miscutils/eject.c
+++ b/miscutils/eject.c
@@ -28,7 +28,7 @@
int eject_main(int argc, char **argv)
{
unsigned long flags;
- char *device;
+ const char *device;
int dev, cmd;
opt_complementary = "?:?1:t--T:T--t";
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index e60e642..afb4ecc 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -463,9 +463,7 @@ static void on_off(unsigned int value);
static void print_flag_on_off(unsigned long get_arg, const char *s, unsigned long arg)
{
-
- if (get_arg)
- {
+ if (get_arg) {
printf(" setting %s to %ld", s, arg);
on_off(arg);
}
@@ -476,8 +474,7 @@ static void bb_ioctl_on_off(int fd, int request, void *argp, const char *string,
{
if (ioctl(fd, request, &argp) != 0)
bb_perror_msg(" %s", string);
- else
- {
+ else {
printf(" %s\t= %2ld", str, (unsigned long) argp);
on_off((unsigned long) argp);
}
@@ -486,16 +483,15 @@ static void bb_ioctl_on_off(int fd, int request, void *argp, const char *string,
#ifdef CONFIG_FEATURE_HDPARM_GET_IDENTITY
static void print_ascii(uint16_t *p, uint8_t length);
-static void xprint_ascii(uint16_t *val ,int i, char * string, int n)
+static void xprint_ascii(uint16_t *val ,int i, const char *string, int n)
{
- if (val[i])
- {
- printf("\t%-20s",string);
+ if (val[i]) {
+ printf("\t%-20s", string);
print_ascii(&val[i], n);
}
}
#endif
-/* end of busybox specific stuff */
+/* end of busybox specific stuff */
#ifdef CONFIG_FEATURE_HDPARM_GET_IDENTITY
static uint8_t mode_loop(uint16_t mode_sup, uint16_t mode_sel, int cc, uint8_t *have_mode)
@@ -1587,7 +1583,7 @@ static void interpret_xfermode(unsigned int xfermode)
}
#endif /* HDIO_DRIVE_CMD */
-static void print_flag(unsigned long flag, char *s, unsigned long value)
+static void print_flag(unsigned long flag, const char *s, unsigned long value)
{
if (flag)
printf(" setting %s to %ld\n", s, value);
diff --git a/miscutils/strings.c b/miscutils/strings.c
index 0d5576e..691502d 100644
--- a/miscutils/strings.c
+++ b/miscutils/strings.c
@@ -26,7 +26,7 @@ int strings_main(int argc, char **argv)
FILE *file = stdin;
char *string;
const char *fmt = "%s: ";
- char *n_arg = "4";
+ const char *n_arg = "4";
opt = getopt32(argc, argv, "afon:", &n_arg);
/* -a is our default behaviour */