Skip to content

Commit ed9df09

Browse files
committed
genksyms: Mark is_reserved_word static
The genksyms keyword gperf hash provides a function is_reserved_word. genksyms #includes the resulting generated file keywords.c, so the function gets used only in the same source file that defines it. Mark is_reserved_word static, and regenerate the corresponding generated file. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
1 parent 6516657 commit ed9df09

2 files changed

Lines changed: 52 additions & 45 deletions

File tree

‎scripts/genksyms/keywords.c_shipped‎

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ANSI-C code produced by gperf version 3.0.2 */
1+
/* ANSI-C code produced by gperf version 3.0.3 */
22
/* Command-line: gperf -L ANSI-C -a -C -E -g -H is_reserved_hash -k '1,3,$' -N is_reserved_word -p -t scripts/genksyms/keywords.gperf */
33

44
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@@ -30,7 +30,9 @@
3030

3131
#line 1 "scripts/genksyms/keywords.gperf"
3232

33-
#line 3 "scripts/genksyms/keywords.gperf"
33+
struct resword;
34+
static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
35+
#line 5 "scripts/genksyms/keywords.gperf"
3436
struct resword { const char *name; int token; };
3537
/* maximum key range = 62, duplicates = 0 */
3638

@@ -78,6 +80,9 @@ is_reserved_hash (register const char *str, register unsigned int len)
7880

7981
#ifdef __GNUC__
8082
__inline
83+
#ifdef __GNUC_STDC_INLINE__
84+
__attribute__ ((__gnu_inline__))
85+
#endif
8186
#endif
8287
const struct resword *
8388
is_reserved_word (register const char *str, register unsigned int len)
@@ -94,105 +99,105 @@ is_reserved_word (register const char *str, register unsigned int len)
9499
static const struct resword wordlist[] =
95100
{
96101
{""}, {""}, {""},
97-
#line 26 "scripts/genksyms/keywords.gperf"
102+
#line 28 "scripts/genksyms/keywords.gperf"
98103
{"asm", ASM_KEYW},
99104
{""},
100-
#line 8 "scripts/genksyms/keywords.gperf"
105+
#line 10 "scripts/genksyms/keywords.gperf"
101106
{"__asm", ASM_KEYW},
102107
{""},
103-
#line 9 "scripts/genksyms/keywords.gperf"
108+
#line 11 "scripts/genksyms/keywords.gperf"
104109
{"__asm__", ASM_KEYW},
105110
{""}, {""},
106-
#line 52 "scripts/genksyms/keywords.gperf"
111+
#line 54 "scripts/genksyms/keywords.gperf"
107112
{"__typeof__", TYPEOF_KEYW},
108113
{""},
109-
#line 12 "scripts/genksyms/keywords.gperf"
114+
#line 14 "scripts/genksyms/keywords.gperf"
110115
{"__const", CONST_KEYW},
111-
#line 11 "scripts/genksyms/keywords.gperf"
112-
{"__attribute__", ATTRIBUTE_KEYW},
113116
#line 13 "scripts/genksyms/keywords.gperf"
117+
{"__attribute__", ATTRIBUTE_KEYW},
118+
#line 15 "scripts/genksyms/keywords.gperf"
114119
{"__const__", CONST_KEYW},
115-
#line 18 "scripts/genksyms/keywords.gperf"
120+
#line 20 "scripts/genksyms/keywords.gperf"
116121
{"__signed__", SIGNED_KEYW},
117-
#line 44 "scripts/genksyms/keywords.gperf"
122+
#line 46 "scripts/genksyms/keywords.gperf"
118123
{"static", STATIC_KEYW},
119-
#line 20 "scripts/genksyms/keywords.gperf"
124+
#line 22 "scripts/genksyms/keywords.gperf"
120125
{"__volatile__", VOLATILE_KEYW},
121-
#line 39 "scripts/genksyms/keywords.gperf"
126+
#line 41 "scripts/genksyms/keywords.gperf"
122127
{"int", INT_KEYW},
123-
#line 32 "scripts/genksyms/keywords.gperf"
128+
#line 34 "scripts/genksyms/keywords.gperf"
124129
{"char", CHAR_KEYW},
125-
#line 33 "scripts/genksyms/keywords.gperf"
130+
#line 35 "scripts/genksyms/keywords.gperf"
126131
{"const", CONST_KEYW},
127-
#line 45 "scripts/genksyms/keywords.gperf"
132+
#line 47 "scripts/genksyms/keywords.gperf"
128133
{"struct", STRUCT_KEYW},
129-
#line 24 "scripts/genksyms/keywords.gperf"
134+
#line 26 "scripts/genksyms/keywords.gperf"
130135
{"__restrict__", RESTRICT_KEYW},
131-
#line 25 "scripts/genksyms/keywords.gperf"
136+
#line 27 "scripts/genksyms/keywords.gperf"
132137
{"restrict", RESTRICT_KEYW},
133-
#line 23 "scripts/genksyms/keywords.gperf"
138+
#line 25 "scripts/genksyms/keywords.gperf"
134139
{"_restrict", RESTRICT_KEYW},
135-
#line 16 "scripts/genksyms/keywords.gperf"
140+
#line 18 "scripts/genksyms/keywords.gperf"
136141
{"__inline__", INLINE_KEYW},
137-
#line 10 "scripts/genksyms/keywords.gperf"
142+
#line 12 "scripts/genksyms/keywords.gperf"
138143
{"__attribute", ATTRIBUTE_KEYW},
139144
{""},
140-
#line 14 "scripts/genksyms/keywords.gperf"
145+
#line 16 "scripts/genksyms/keywords.gperf"
141146
{"__extension__", EXTENSION_KEYW},
142-
#line 35 "scripts/genksyms/keywords.gperf"
147+
#line 37 "scripts/genksyms/keywords.gperf"
143148
{"enum", ENUM_KEYW},
144-
#line 19 "scripts/genksyms/keywords.gperf"
149+
#line 21 "scripts/genksyms/keywords.gperf"
145150
{"__volatile", VOLATILE_KEYW},
146-
#line 36 "scripts/genksyms/keywords.gperf"
151+
#line 38 "scripts/genksyms/keywords.gperf"
147152
{"extern", EXTERN_KEYW},
148153
{""},
149-
#line 17 "scripts/genksyms/keywords.gperf"
154+
#line 19 "scripts/genksyms/keywords.gperf"
150155
{"__signed", SIGNED_KEYW},
151-
#line 7 "scripts/genksyms/keywords.gperf"
156+
#line 9 "scripts/genksyms/keywords.gperf"
152157
{"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW},
153158
{""},
154-
#line 51 "scripts/genksyms/keywords.gperf"
159+
#line 53 "scripts/genksyms/keywords.gperf"
155160
{"typeof", TYPEOF_KEYW},
156-
#line 46 "scripts/genksyms/keywords.gperf"
161+
#line 48 "scripts/genksyms/keywords.gperf"
157162
{"typedef", TYPEDEF_KEYW},
158-
#line 15 "scripts/genksyms/keywords.gperf"
163+
#line 17 "scripts/genksyms/keywords.gperf"
159164
{"__inline", INLINE_KEYW},
160-
#line 31 "scripts/genksyms/keywords.gperf"
165+
#line 33 "scripts/genksyms/keywords.gperf"
161166
{"auto", AUTO_KEYW},
162-
#line 47 "scripts/genksyms/keywords.gperf"
167+
#line 49 "scripts/genksyms/keywords.gperf"
163168
{"union", UNION_KEYW},
164169
{""}, {""},
165-
#line 48 "scripts/genksyms/keywords.gperf"
170+
#line 50 "scripts/genksyms/keywords.gperf"
166171
{"unsigned", UNSIGNED_KEYW},
167-
#line 49 "scripts/genksyms/keywords.gperf"
172+
#line 51 "scripts/genksyms/keywords.gperf"
168173
{"void", VOID_KEYW},
169-
#line 42 "scripts/genksyms/keywords.gperf"
174+
#line 44 "scripts/genksyms/keywords.gperf"
170175
{"short", SHORT_KEYW},
171176
{""}, {""},
172-
#line 50 "scripts/genksyms/keywords.gperf"
177+
#line 52 "scripts/genksyms/keywords.gperf"
173178
{"volatile", VOLATILE_KEYW},
174179
{""},
175-
#line 37 "scripts/genksyms/keywords.gperf"
180+
#line 39 "scripts/genksyms/keywords.gperf"
176181
{"float", FLOAT_KEYW},
177-
#line 34 "scripts/genksyms/keywords.gperf"
182+
#line 36 "scripts/genksyms/keywords.gperf"
178183
{"double", DOUBLE_KEYW},
179184
{""},
180-
#line 5 "scripts/genksyms/keywords.gperf"
185+
#line 7 "scripts/genksyms/keywords.gperf"
181186
{"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW},
182187
{""}, {""},
183-
#line 38 "scripts/genksyms/keywords.gperf"
188+
#line 40 "scripts/genksyms/keywords.gperf"
184189
{"inline", INLINE_KEYW},
185-
#line 6 "scripts/genksyms/keywords.gperf"
190+
#line 8 "scripts/genksyms/keywords.gperf"
186191
{"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW},
187-
#line 41 "scripts/genksyms/keywords.gperf"
192+
#line 43 "scripts/genksyms/keywords.gperf"
188193
{"register", REGISTER_KEYW},
189194
{""},
190-
#line 22 "scripts/genksyms/keywords.gperf"
195+
#line 24 "scripts/genksyms/keywords.gperf"
191196
{"_Bool", BOOL_KEYW},
192-
#line 43 "scripts/genksyms/keywords.gperf"
197+
#line 45 "scripts/genksyms/keywords.gperf"
193198
{"signed", SIGNED_KEYW},
194199
{""}, {""},
195-
#line 40 "scripts/genksyms/keywords.gperf"
200+
#line 42 "scripts/genksyms/keywords.gperf"
196201
{"long", LONG_KEYW}
197202
};
198203

‎scripts/genksyms/keywords.gperf‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
%{
2+
struct resword;
3+
static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
24
%}
35
struct resword { const char *name; int token; }
46
%%

0 commit comments

Comments
 (0)