History

kconfig: replace a `switch()' statement by a more flexible `if()' statement

With the upcoming dynamical configuration prefix, we can no longer assume that the prefix will start by a 'C'. As such, we can no longer hardcode this value in the `case ...:', so replace the `switch() { ... }' statement by a more flexible 'if () { ... }' statement.

Arnaud Lacombe committed 16 years ago

Commit 8baefd31 parent 71d80661 file · +5 −14Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kconfig/confdata.c+5−14
@@ -221,8 +221,7 @@ load: · 220 unmodified lines
221 while (fgets(line, sizeof(line), in)) {221 while (fgets(line, sizeof(line), in)) {
222 conf_lineno++;222 conf_lineno++;
223 sym = NULL;223 sym = NULL;
224 switch (line[0]) {224 if (line[0] == '#') {
225 case '#':
226 if (memcmp(line + 2, "CONFIG_", 7))225 if (memcmp(line + 2, "CONFIG_", 7))
227 continue;226 continue;
228 p = strchr(line + 9, ' ');227 p = strchr(line + 9, ' ');
@@ -254,12 +253,7 @@ load: · 25 unmodified lines
254 default:253 default:
255 ;254 ;
256 }255 }
257 break;256 } else if (memcmp(line, "CONFIG_", 7) == 0) {
258 case 'C':
259 if (memcmp(line, "CONFIG_", 7)) {
260 conf_warning("unexpected data");
261 continue;
262 }
263 p = strchr(line + 7, '=');257 p = strchr(line + 7, '=');
264 if (!p)258 if (!p)
265 continue;259 continue;
@@ -286,12 +280,9 @@ load: · 20 unmodified lines
286 }280 }
287 if (conf_set_sym_val(sym, def, def_flags, p))281 if (conf_set_sym_val(sym, def, def_flags, p))
288 continue;282 continue;
289 break;283 } else {
290 case '\r':284 if (line[0] != '\r' && line[0] != '\n')
291 case '\n':285 conf_warning("unexpected data");
292 break;
293 default:
294 conf_warning("unexpected data");
295 continue;286 continue;
296 }287 }
297 if (sym && sym_is_choice_value(sym)) {288 if (sym && sym_is_choice_value(sym)) {