From: Jesper Juhl <juhl-lkml@dif.dk>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [patch] pedantic correctness cleanup for conf.c in scripts/kconfig/ .
Date: Tue, 4 Jan 2005 00:35:36 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.61.0501040031460.3529@dragon.hygekrogen.localhost> (raw)
Hi,
Tiny, pedantic patch for scripts/kconfig/conf.c
'line' is an array of signed chars, so lets stuff chars into it, not ints.
Doesn't make any actual difference, just feels nicer ;)
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
diff -up linux-2.6.10-bk6-orig/scripts/kconfig/conf.c linux-2.6.10-bk6/scripts/kconfig/conf.c
--- linux-2.6.10-bk6-orig/scripts/kconfig/conf.c 2004-12-24 22:35:28.000000000 +0100
+++ linux-2.6.10-bk6/scripts/kconfig/conf.c 2005-01-04 00:30:02.000000000 +0100
@@ -72,12 +72,12 @@ static void conf_askvalue(struct symbol
printf("(NEW) ");
line[0] = '\n';
- line[1] = 0;
+ line[1] = '\0';
if (!sym_is_changable(sym)) {
printf("%s\n", def);
line[0] = '\n';
- line[1] = 0;
+ line[1] = '\0';
return;
}
@@ -114,7 +114,7 @@ static void conf_askvalue(struct symbol
if (sym_tristate_within_range(sym, yes)) {
line[0] = 'y';
line[1] = '\n';
- line[2] = 0;
+ line[2] = '\0';
break;
}
case set_mod:
@@ -122,14 +122,14 @@ static void conf_askvalue(struct symbol
if (sym_tristate_within_range(sym, mod)) {
line[0] = 'm';
line[1] = '\n';
- line[2] = 0;
+ line[2] = '\0';
break;
}
} else {
if (sym_tristate_within_range(sym, yes)) {
line[0] = 'y';
line[1] = '\n';
- line[2] = 0;
+ line[2] = '\0';
break;
}
}
@@ -137,7 +137,7 @@ static void conf_askvalue(struct symbol
if (sym_tristate_within_range(sym, no)) {
line[0] = 'n';
line[1] = '\n';
- line[2] = 0;
+ line[2] = '\0';
break;
}
case set_random:
@@ -150,7 +150,7 @@ static void conf_askvalue(struct symbol
case yes: line[0] = 'y'; break;
}
line[1] = '\n';
- line[2] = 0;
+ line[2] = '\0';
break;
default:
break;
@@ -184,7 +184,7 @@ int conf_string(struct menu *menu)
break;
}
default:
- line[strlen(line)-1] = 0;
+ line[strlen(line)-1] = '\0';
def = line;
}
if (def && sym_set_string_value(sym, def))
@@ -248,7 +248,7 @@ static int conf_sym(struct menu *menu)
if (!line[1] || !strcmp(&line[1], "es"))
break;
continue;
- case 0:
+ case '\0':
newval = oldval;
break;
case '?':
@@ -305,8 +305,8 @@ static int conf_choice(struct menu *menu
printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
def_sym = sym_get_choice_value(sym);
cnt = def = 0;
- line[0] = '0';
- line[1] = 0;
+ line[0] = '\0';
+ line[1] = '\0';
for (child = menu->list; child; child = child->next) {
if (!menu_is_visible(child))
continue;
next reply other threads:[~2005-01-04 1:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-03 23:35 Jesper Juhl [this message]
2005-01-05 12:26 ` [patch] pedantic correctness cleanup for conf.c in scripts/kconfig/ Roman Zippel
2005-01-05 21:58 ` Jesper Juhl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.61.0501040031460.3529@dragon.hygekrogen.localhost \
--to=juhl-lkml@dif.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=zippel@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).