Commit 65166571 authored by Josh Triplett's avatar Josh Triplett

kconfig: Mark various internal functions static

kconfig's keyword hash, lexer, and parser define various functions used
only locally.  Declare these functions as static, and regenerate the
corresponding generated files.
Signed-off-by: default avatarJosh Triplett <josh@joshtriplett.org>
parent 1456edbb
...@@ -160,7 +160,15 @@ typedef unsigned int flex_uint32_t; ...@@ -160,7 +160,15 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */ /* Size of default input buffer. */
#ifndef YY_BUF_SIZE #ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384 #define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif #endif
/* The state buf must be large enough to hold one state per character in the main buffer. /* The state buf must be large enough to hold one state per character in the main buffer.
...@@ -802,7 +810,7 @@ static int last_ts, first_ts; ...@@ -802,7 +810,7 @@ static int last_ts, first_ts;
static void zconf_endhelp(void); static void zconf_endhelp(void);
static void zconf_endfile(void); static void zconf_endfile(void);
void new_string(void) static void new_string(void)
{ {
text = malloc(START_STRSIZE); text = malloc(START_STRSIZE);
text_asize = START_STRSIZE; text_asize = START_STRSIZE;
...@@ -810,7 +818,7 @@ void new_string(void) ...@@ -810,7 +818,7 @@ void new_string(void)
*text = 0; *text = 0;
} }
void append_string(const char *str, int size) static void append_string(const char *str, int size)
{ {
int new_size = text_size + size + 1; int new_size = text_size + size + 1;
if (new_size > text_asize) { if (new_size > text_asize) {
...@@ -824,7 +832,7 @@ void append_string(const char *str, int size) ...@@ -824,7 +832,7 @@ void append_string(const char *str, int size)
text[text_size] = 0; text[text_size] = 0;
} }
void alloc_string(const char *str, int size) static void alloc_string(const char *str, int size)
{ {
text = malloc(size + 1); text = malloc(size + 1);
memcpy(text, str, size); memcpy(text, str, size);
...@@ -914,7 +922,12 @@ static int input (void ); ...@@ -914,7 +922,12 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */ /* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE #ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192 #define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif #endif
/* Copy whatever the last rule matched to the standard output. */ /* Copy whatever the last rule matched to the standard output. */
...@@ -922,7 +935,7 @@ static int input (void ); ...@@ -922,7 +935,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's, /* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite(). * we now use fwrite().
*/ */
#define ECHO fwrite( zconftext, zconfleng, 1, zconfout ) #define ECHO do { if (fwrite( zconftext, zconfleng, 1, zconfout )) {} } while (0)
#endif #endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
...@@ -2060,8 +2073,8 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr ) ...@@ -2060,8 +2073,8 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will /** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
* scan from a @e copy of @a bytes. * scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan * @param yybytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes. * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* *
* @return the newly allocated buffer state object. * @return the newly allocated buffer state object.
*/ */
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
struct kconf_id; struct kconf_id;
static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
%% %%
mainmenu, T_MAINMENU, TF_COMMAND mainmenu, T_MAINMENU, TF_COMMAND
menu, T_MENU, TF_COMMAND menu, T_MENU, TF_COMMAND
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#endif #endif
struct kconf_id; struct kconf_id;
static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
/* maximum key range = 47, duplicates = 0 */ /* maximum key range = 47, duplicates = 0 */
#ifdef __GNUC__ #ifdef __GNUC__
......
...@@ -39,7 +39,7 @@ static int last_ts, first_ts; ...@@ -39,7 +39,7 @@ static int last_ts, first_ts;
static void zconf_endhelp(void); static void zconf_endhelp(void);
static void zconf_endfile(void); static void zconf_endfile(void);
void new_string(void) static void new_string(void)
{ {
text = malloc(START_STRSIZE); text = malloc(START_STRSIZE);
text_asize = START_STRSIZE; text_asize = START_STRSIZE;
...@@ -47,7 +47,7 @@ void new_string(void) ...@@ -47,7 +47,7 @@ void new_string(void)
*text = 0; *text = 0;
} }
void append_string(const char *str, int size) static void append_string(const char *str, int size)
{ {
int new_size = text_size + size + 1; int new_size = text_size + size + 1;
if (new_size > text_asize) { if (new_size > text_asize) {
...@@ -61,7 +61,7 @@ void append_string(const char *str, int size) ...@@ -61,7 +61,7 @@ void append_string(const char *str, int size)
text[text_size] = 0; text[text_size] = 0;
} }
void alloc_string(const char *str, int size) static void alloc_string(const char *str, int size)
{ {
text = malloc(size + 1); text = malloc(size + 1);
memcpy(text, str, size); memcpy(text, str, size);
......
...@@ -2249,7 +2249,7 @@ void conf_parse(const char *name) ...@@ -2249,7 +2249,7 @@ void conf_parse(const char *name)
sym_set_change_count(1); sym_set_change_count(1);
} }
const char *zconf_tokenname(int token) static const char *zconf_tokenname(int token)
{ {
switch (token) { switch (token) {
case T_MENU: return "menu"; case T_MENU: return "menu";
...@@ -2313,7 +2313,7 @@ static void zconferror(const char *err) ...@@ -2313,7 +2313,7 @@ static void zconferror(const char *err)
#endif #endif
} }
void print_quoted_string(FILE *out, const char *str) static void print_quoted_string(FILE *out, const char *str)
{ {
const char *p; const char *p;
int len; int len;
...@@ -2330,7 +2330,7 @@ void print_quoted_string(FILE *out, const char *str) ...@@ -2330,7 +2330,7 @@ void print_quoted_string(FILE *out, const char *str)
putc('"', out); putc('"', out);
} }
void print_symbol(FILE *out, struct menu *menu) static void print_symbol(FILE *out, struct menu *menu)
{ {
struct symbol *sym = menu->sym; struct symbol *sym = menu->sym;
struct property *prop; struct property *prop;
......
...@@ -504,7 +504,7 @@ void conf_parse(const char *name) ...@@ -504,7 +504,7 @@ void conf_parse(const char *name)
sym_set_change_count(1); sym_set_change_count(1);
} }
const char *zconf_tokenname(int token) static const char *zconf_tokenname(int token)
{ {
switch (token) { switch (token) {
case T_MENU: return "menu"; case T_MENU: return "menu";
...@@ -568,7 +568,7 @@ static void zconferror(const char *err) ...@@ -568,7 +568,7 @@ static void zconferror(const char *err)
#endif #endif
} }
void print_quoted_string(FILE *out, const char *str) static void print_quoted_string(FILE *out, const char *str)
{ {
const char *p; const char *p;
int len; int len;
...@@ -585,7 +585,7 @@ void print_quoted_string(FILE *out, const char *str) ...@@ -585,7 +585,7 @@ void print_quoted_string(FILE *out, const char *str)
putc('"', out); putc('"', out);
} }
void print_symbol(FILE *out, struct menu *menu) static void print_symbol(FILE *out, struct menu *menu)
{ {
struct symbol *sym = menu->sym; struct symbol *sym = menu->sym;
struct property *prop; struct property *prop;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment