diff options
author | Arnaud Lacombe <lacombar@gmail.com> | 2011-05-04 21:14:44 -0400 |
---|---|---|
committer | Arnaud Lacombe <lacombar@gmail.com> | 2011-06-09 14:04:42 -0400 |
commit | 61f956f576031bea270ea54b10411ebb1e172b1b (patch) | |
tree | 745793d79480331af3dc27573aadd8c31fac98cd /scripts | |
parent | 58ef81c5cf147f35dfa248cffdfc60a415783690 (diff) |
kconfig: constify `kconf_id_lookup'
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/Makefile | 2 | ||||
-rw-r--r-- | scripts/kconfig/zconf.gperf | 2 | ||||
-rw-r--r-- | scripts/kconfig/zconf.l | 4 | ||||
-rw-r--r-- | scripts/kconfig/zconf.y | 8 |
4 files changed, 8 insertions, 8 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index faa9a4701b6f..bde4529a4d4e 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -356,7 +356,7 @@ lex.%.c: %.l | |||
356 | cp $@ $@_shipped | 356 | cp $@ $@_shipped |
357 | 357 | ||
358 | %.hash.c: %.gperf | 358 | %.hash.c: %.gperf |
359 | gperf < $< > $@ | 359 | gperf -C < $< > $@ |
360 | cp $@ $@_shipped | 360 | cp $@ $@_shipped |
361 | 361 | ||
362 | endif | 362 | endif |
diff --git a/scripts/kconfig/zconf.gperf b/scripts/kconfig/zconf.gperf index c9e690eb7545..f14ab41154b6 100644 --- a/scripts/kconfig/zconf.gperf +++ b/scripts/kconfig/zconf.gperf | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | struct kconf_id; | 10 | struct kconf_id; |
11 | 11 | ||
12 | static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); | 12 | static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); |
13 | 13 | ||
14 | %% | 14 | %% |
15 | mainmenu, T_MAINMENU, TF_COMMAND | 15 | mainmenu, T_MAINMENU, TF_COMMAND |
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index b22f884f9022..98aad534a682 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l | |||
@@ -96,7 +96,7 @@ n [A-Za-z0-9_] | |||
96 | 96 | ||
97 | <COMMAND>{ | 97 | <COMMAND>{ |
98 | {n}+ { | 98 | {n}+ { |
99 | struct kconf_id *id = kconf_id_lookup(yytext, yyleng); | 99 | const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); |
100 | BEGIN(PARAM); | 100 | BEGIN(PARAM); |
101 | current_pos.file = current_file; | 101 | current_pos.file = current_file; |
102 | current_pos.lineno = current_file->lineno; | 102 | current_pos.lineno = current_file->lineno; |
@@ -132,7 +132,7 @@ n [A-Za-z0-9_] | |||
132 | \n BEGIN(INITIAL); current_file->lineno++; return T_EOL; | 132 | \n BEGIN(INITIAL); current_file->lineno++; return T_EOL; |
133 | --- /* ignore */ | 133 | --- /* ignore */ |
134 | ({n}|[-/.])+ { | 134 | ({n}|[-/.])+ { |
135 | struct kconf_id *id = kconf_id_lookup(yytext, yyleng); | 135 | const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); |
136 | if (id && id->flags & TF_PARAM) { | 136 | if (id && id->flags & TF_PARAM) { |
137 | zconflval.id = id; | 137 | zconflval.id = id; |
138 | return id->token; | 138 | return id->token; |
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 49fb4ab664c3..98c57167ef7e 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y | |||
@@ -25,7 +25,7 @@ extern int zconflex(void); | |||
25 | static void zconfprint(const char *err, ...); | 25 | static void zconfprint(const char *err, ...); |
26 | static void zconf_error(const char *err, ...); | 26 | static void zconf_error(const char *err, ...); |
27 | static void zconferror(const char *err); | 27 | static void zconferror(const char *err); |
28 | static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken); | 28 | static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken); |
29 | 29 | ||
30 | struct symbol *symbol_hash[SYMBOL_HASHSIZE]; | 30 | struct symbol *symbol_hash[SYMBOL_HASHSIZE]; |
31 | 31 | ||
@@ -45,7 +45,7 @@ static struct menu *current_menu, *current_entry; | |||
45 | struct symbol *symbol; | 45 | struct symbol *symbol; |
46 | struct expr *expr; | 46 | struct expr *expr; |
47 | struct menu *menu; | 47 | struct menu *menu; |
48 | struct kconf_id *id; | 48 | const struct kconf_id *id; |
49 | } | 49 | } |
50 | 50 | ||
51 | %token <id>T_MAINMENU | 51 | %token <id>T_MAINMENU |
@@ -229,7 +229,7 @@ symbol_option_list: | |||
229 | /* empty */ | 229 | /* empty */ |
230 | | symbol_option_list T_WORD symbol_option_arg | 230 | | symbol_option_list T_WORD symbol_option_arg |
231 | { | 231 | { |
232 | struct kconf_id *id = kconf_id_lookup($2, strlen($2)); | 232 | const struct kconf_id *id = kconf_id_lookup($2, strlen($2)); |
233 | if (id && id->flags & TF_OPTION) | 233 | if (id && id->flags & TF_OPTION) |
234 | menu_add_option(id->token, $3); | 234 | menu_add_option(id->token, $3); |
235 | else | 235 | else |
@@ -545,7 +545,7 @@ static const char *zconf_tokenname(int token) | |||
545 | return "<token>"; | 545 | return "<token>"; |
546 | } | 546 | } |
547 | 547 | ||
548 | static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken) | 548 | static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken) |
549 | { | 549 | { |
550 | if (id->token != endtoken) { | 550 | if (id->token != endtoken) { |
551 | zconf_error("unexpected '%s' within %s block", | 551 | zconf_error("unexpected '%s' within %s block", |