preparatory patch for -Wwrite-strings #2

This commit is contained in:
Denis Vlasenko
2007-01-29 22:51:25 +00:00
parent a41fdf331a
commit b6aae0f381
32 changed files with 110 additions and 109 deletions

View File

@@ -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";

View File

@@ -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);

View File

@@ -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 */