Commit cb20c28a authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'hostprogs-wmissing-prototypes' of...

Merge branch 'hostprogs-wmissing-prototypes' of git://git.kernel.org/pub/scm/linux/kernel/git/josh/linux-misc

* 'hostprogs-wmissing-prototypes' of git://git.kernel.org/pub/scm/linux/kernel/git/josh/linux-misc:
  Makefile: Add -Wmising-prototypes to HOSTCFLAGS
  oss: Mark loadhex static in hex2hex.c
  dtc: Mark various internal functions static
  dtc: Set "noinput" in the lexer to avoid an unused function
  drm: radeon: Mark several functions static in mkregtable
  arch/sparc/boot/*.c: Mark various internal functions static
  arch/powerpc/boot/addRamDisk.c: Mark several internal functions static
  arch/alpha/boot/tools/objstrip.c: Mark "usage" static
  Documentation/vm/page-types.c: Declare checked_open static
  genksyms: Mark is_reserved_word static
  kconfig: Mark various internal functions static
  kconfig: Make zconf.y work with current bison
parents a08e37f3 25583d4b
...@@ -218,7 +218,7 @@ static void fatal(const char *x, ...) ...@@ -218,7 +218,7 @@ static void fatal(const char *x, ...)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
int checked_open(const char *pathname, int flags) static int checked_open(const char *pathname, int flags)
{ {
int fd = open(pathname, flags); int fd = open(pathname, flags);
......
...@@ -221,7 +221,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ ...@@ -221,7 +221,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
HOSTCC = gcc HOSTCC = gcc
HOSTCXX = g++ HOSTCXX = g++
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
HOSTCXXFLAGS = -O2 HOSTCXXFLAGS = -O2
# Decide whether to build built-in, modular, or both. # Decide whether to build built-in, modular, or both.
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
const char * prog_name; const char * prog_name;
void static void
usage (void) usage (void)
{ {
fprintf(stderr, fprintf(stderr,
......
...@@ -58,7 +58,7 @@ static int check_elf64(void *p, int size, struct addr_range *r) ...@@ -58,7 +58,7 @@ static int check_elf64(void *p, int size, struct addr_range *r)
return 64; return 64;
} }
void get4k(FILE *file, char *buf ) static void get4k(FILE *file, char *buf )
{ {
unsigned j; unsigned j;
unsigned num = fread(buf, 1, 4096, file); unsigned num = fread(buf, 1, 4096, file);
...@@ -66,12 +66,12 @@ void get4k(FILE *file, char *buf ) ...@@ -66,12 +66,12 @@ void get4k(FILE *file, char *buf )
buf[j] = 0; buf[j] = 0;
} }
void put4k(FILE *file, char *buf ) static void put4k(FILE *file, char *buf )
{ {
fwrite(buf, 1, 4096, file); fwrite(buf, 1, 4096, file);
} }
void death(const char *msg, FILE *fdesc, const char *fname) static void death(const char *msg, FILE *fdesc, const char *fname)
{ {
fprintf(stderr, msg); fprintf(stderr, msg);
fclose(fdesc); fclose(fdesc);
......
...@@ -61,14 +61,14 @@ unsigned long lastfoffset = -1; ...@@ -61,14 +61,14 @@ unsigned long lastfoffset = -1;
unsigned long lastfrelno; unsigned long lastfrelno;
btfixup *lastf; btfixup *lastf;
void fatal(void) __attribute__((noreturn)); static void fatal(void) __attribute__((noreturn));
void fatal(void) static void fatal(void)
{ {
fprintf(stderr, "Malformed output from objdump\n%s\n", buffer); fprintf(stderr, "Malformed output from objdump\n%s\n", buffer);
exit(1); exit(1);
} }
btfixup *find(int type, char *name) static btfixup *find(int type, char *name)
{ {
int i; int i;
for (i = 0; i < last; i++) { for (i = 0; i < last; i++) {
...@@ -88,7 +88,7 @@ btfixup *find(int type, char *name) ...@@ -88,7 +88,7 @@ btfixup *find(int type, char *name)
return array + last - 1; return array + last - 1;
} }
void set_mode (char *buffer) static void set_mode (char *buffer)
{ {
for (mode = 0;; mode++) for (mode = 0;; mode++)
if (buffer[mode] < '0' || buffer[mode] > '9') if (buffer[mode] < '0' || buffer[mode] > '9')
......
...@@ -35,17 +35,17 @@ ...@@ -35,17 +35,17 @@
* as PROM looks for a.out image only. * as PROM looks for a.out image only.
*/ */
unsigned short ld2(char *p) static unsigned short ld2(char *p)
{ {
return (p[0] << 8) | p[1]; return (p[0] << 8) | p[1];
} }
unsigned int ld4(char *p) static unsigned int ld4(char *p)
{ {
return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
} }
void st4(char *p, unsigned int x) static void st4(char *p, unsigned int x)
{ {
p[0] = x >> 24; p[0] = x >> 24;
p[1] = x >> 16; p[1] = x >> 16;
...@@ -53,7 +53,7 @@ void st4(char *p, unsigned int x) ...@@ -53,7 +53,7 @@ void st4(char *p, unsigned int x)
p[3] = x; p[3] = x;
} }
void usage(void) static void usage(void)
{ {
/* fs_img.gz is an image of initial ramdisk. */ /* fs_img.gz is an image of initial ramdisk. */
fprintf(stderr, "Usage: piggyback vmlinux.aout System.map fs_img.gz\n"); fprintf(stderr, "Usage: piggyback vmlinux.aout System.map fs_img.gz\n");
...@@ -61,7 +61,7 @@ void usage(void) ...@@ -61,7 +61,7 @@ void usage(void)
exit(1); exit(1);
} }
void die(char *str) static void die(char *str)
{ {
perror (str); perror (str);
exit(1); exit(1);
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
/* Note: run this on an a.out kernel (use elftoaout for it), as PROM looks for a.out image onlly /* Note: run this on an a.out kernel (use elftoaout for it), as PROM looks for a.out image onlly
usage: piggyback vmlinux System.map tail, where tail is gzipped fs of the initial ramdisk */ usage: piggyback vmlinux System.map tail, where tail is gzipped fs of the initial ramdisk */
void die(char *str) static void die(char *str)
{ {
perror (str); perror (str);
exit(1); exit(1);
......
...@@ -561,7 +561,7 @@ struct table { ...@@ -561,7 +561,7 @@ struct table {
char *gpu_prefix; char *gpu_prefix;
}; };
struct offset *offset_new(unsigned o) static struct offset *offset_new(unsigned o)
{ {
struct offset *offset; struct offset *offset;
...@@ -573,12 +573,12 @@ struct offset *offset_new(unsigned o) ...@@ -573,12 +573,12 @@ struct offset *offset_new(unsigned o)
return offset; return offset;
} }
void table_offset_add(struct table *t, struct offset *offset) static void table_offset_add(struct table *t, struct offset *offset)
{ {
list_add_tail(&offset->list, &t->offsets); list_add_tail(&offset->list, &t->offsets);
} }
void table_init(struct table *t) static void table_init(struct table *t)
{ {
INIT_LIST_HEAD(&t->offsets); INIT_LIST_HEAD(&t->offsets);
t->offset_max = 0; t->offset_max = 0;
...@@ -586,7 +586,7 @@ void table_init(struct table *t) ...@@ -586,7 +586,7 @@ void table_init(struct table *t)
t->table = NULL; t->table = NULL;
} }
void table_print(struct table *t) static void table_print(struct table *t)
{ {
unsigned nlloop, i, j, n, c, id; unsigned nlloop, i, j, n, c, id;
...@@ -611,7 +611,7 @@ void table_print(struct table *t) ...@@ -611,7 +611,7 @@ void table_print(struct table *t)
printf("};\n"); printf("};\n");
} }
int table_build(struct table *t) static int table_build(struct table *t)
{ {
struct offset *offset; struct offset *offset;
unsigned i, m; unsigned i, m;
...@@ -631,7 +631,7 @@ int table_build(struct table *t) ...@@ -631,7 +631,7 @@ int table_build(struct table *t)
} }
static char gpu_name[10]; static char gpu_name[10];
int parser_auth(struct table *t, const char *filename) static int parser_auth(struct table *t, const char *filename)
{ {
FILE *file; FILE *file;
regex_t mask_rex; regex_t mask_rex;
......
...@@ -217,7 +217,7 @@ struct data data_insert_at_marker(struct data d, struct marker *m, ...@@ -217,7 +217,7 @@ struct data data_insert_at_marker(struct data d, struct marker *m,
return d; return d;
} }
struct data data_append_markers(struct data d, struct marker *m) static struct data data_append_markers(struct data d, struct marker *m)
{ {
struct marker **mp = &d.markers; struct marker **mp = &d.markers;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* USA * USA
*/ */
%option noyywrap nounput yylineno %option noyywrap noinput nounput yylineno
%x INCLUDE %x INCLUDE
%x BYTESTRING %x BYTESTRING
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 34 #define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0 #if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA #define FLEX_BETA
#endif #endif
...@@ -54,7 +54,6 @@ typedef int flex_int32_t; ...@@ -54,7 +54,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t; typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t; typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t; typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
/* Limits of integral types. */ /* Limits of integral types. */
#ifndef INT8_MIN #ifndef INT8_MIN
...@@ -85,6 +84,8 @@ typedef unsigned int flex_uint32_t; ...@@ -85,6 +84,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U) #define UINT32_MAX (4294967295U)
#endif #endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */ #endif /* ! FLEXINT_H */
#ifdef __cplusplus #ifdef __cplusplus
...@@ -141,7 +142,15 @@ typedef unsigned int flex_uint32_t; ...@@ -141,7 +142,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.
...@@ -192,13 +201,6 @@ extern FILE *yyin, *yyout; ...@@ -192,13 +201,6 @@ extern FILE *yyin, *yyout;
#define unput(c) yyunput( c, (yytext_ptr) ) #define unput(c) yyunput( c, (yytext_ptr) )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
* Given that the standard has decreed that size_t exists since 1989,
* I guess we can afford to depend on it. Manoj.
*/
#ifndef YY_TYPEDEF_YY_SIZE_T #ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t; typedef size_t yy_size_t;
...@@ -604,6 +606,7 @@ char *yytext; ...@@ -604,6 +606,7 @@ char *yytext;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA * USA
*/ */
#define YY_NO_INPUT 1
...@@ -634,7 +637,7 @@ static int dts_version; /* = 0 */ ...@@ -634,7 +637,7 @@ static int dts_version; /* = 0 */
static void push_input_file(const char *filename); static void push_input_file(const char *filename);
static int pop_input_file(void); static int pop_input_file(void);
#line 638 "dtc-lexer.lex.c" #line 641 "dtc-lexer.lex.c"
#define INITIAL 0 #define INITIAL 0
#define INCLUDE 1 #define INCLUDE 1
...@@ -656,6 +659,35 @@ static int pop_input_file(void); ...@@ -656,6 +659,35 @@ static int pop_input_file(void);
static int yy_init_globals (void ); static int yy_init_globals (void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int yylex_destroy (void );
int yyget_debug (void );
void yyset_debug (int debug_flag );
YY_EXTRA_TYPE yyget_extra (void );
void yyset_extra (YY_EXTRA_TYPE user_defined );
FILE *yyget_in (void );
void yyset_in (FILE * in_str );
FILE *yyget_out (void );
void yyset_out (FILE * out_str );
int yyget_leng (void );
char *yyget_text (void );
int yyget_lineno (void );
void yyset_lineno (int line_number );
/* Macros after this point can all be overridden by user definitions in /* Macros after this point can all be overridden by user definitions in
* section 1. * section 1.
*/ */
...@@ -688,7 +720,12 @@ static int input (void ); ...@@ -688,7 +720,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. */
...@@ -696,7 +733,7 @@ static int input (void ); ...@@ -696,7 +733,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( yytext, yyleng, 1, yyout ) #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } 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,
...@@ -707,7 +744,7 @@ static int input (void ); ...@@ -707,7 +744,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \ { \
int c = '*'; \ int c = '*'; \
int n; \ size_t n; \
for ( n = 0; n < max_size && \ for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \ buf[n] = (char) c; \
...@@ -791,7 +828,7 @@ YY_DECL ...@@ -791,7 +828,7 @@ YY_DECL
#line 64 "dtc-lexer.l" #line 64 "dtc-lexer.l"
#line 795 "dtc-lexer.lex.c" #line 832 "dtc-lexer.lex.c"
if ( !(yy_init) ) if ( !(yy_init) )
{ {
...@@ -1116,7 +1153,7 @@ YY_RULE_SETUP ...@@ -1116,7 +1153,7 @@ YY_RULE_SETUP
#line 222 "dtc-lexer.l" #line 222 "dtc-lexer.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 1120 "dtc-lexer.lex.c" #line 1157 "dtc-lexer.lex.c"
case YY_END_OF_BUFFER: case YY_END_OF_BUFFER:
{ {
...@@ -1840,8 +1877,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) ...@@ -1840,8 +1877,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will /** Setup the input buffer state to scan the given bytes. The next call to yylex() 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.
*/ */
......
...@@ -411,7 +411,7 @@ int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle) ...@@ -411,7 +411,7 @@ int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
&phandle, sizeof(phandle)); &phandle, sizeof(phandle));
} }
int _stringlist_contains(const char *strlist, int listlen, const char *str) static int _stringlist_contains(const char *strlist, int listlen, const char *str)
{ {
int len = strlen(str); int len = strlen(str);
const char *p; const char *p;
......
...@@ -52,7 +52,7 @@ static void write_prefix(FILE *f, int level) ...@@ -52,7 +52,7 @@ static void write_prefix(FILE *f, int level)
fputc('\t', f); fputc('\t', f);
} }
int isstring(char c) static int isstring(char c)
{ {
return (isprint(c) return (isprint(c)
|| (c == '\0') || (c == '\0')
......
/* ANSI-C code produced by gperf version 3.0.2 */ /* ANSI-C code produced by gperf version 3.0.3 */
/* 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 */ /* 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 */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
#line 1 "scripts/genksyms/keywords.gperf" #line 1 "scripts/genksyms/keywords.gperf"
#line 3 "scripts/genksyms/keywords.gperf" struct resword;
static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
#line 5 "scripts/genksyms/keywords.gperf"
struct resword { const char *name; int token; }; struct resword { const char *name; int token; };
/* maximum key range = 62, duplicates = 0 */ /* maximum key range = 62, duplicates = 0 */
...@@ -78,6 +80,9 @@ is_reserved_hash (register const char *str, register unsigned int len) ...@@ -78,6 +80,9 @@ is_reserved_hash (register const char *str, register unsigned int len)
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif #endif
const struct resword * const struct resword *
is_reserved_word (register const char *str, register unsigned int len) 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) ...@@ -94,105 +99,105 @@ is_reserved_word (register const char *str, register unsigned int len)
static const struct resword wordlist[] = static const struct resword wordlist[] =
{ {
{""}, {""}, {""}, {""}, {""}, {""},
#line 26 "scripts/genksyms/keywords.gperf" #line 28 "scripts/genksyms/keywords.gperf"
{"asm", ASM_KEYW}, {"asm", ASM_KEYW},
{""}, {""},
#line 8 "scripts/genksyms/keywords.gperf" #line 10 "scripts/genksyms/keywords.gperf"
{"__asm", ASM_KEYW}, {"__asm", ASM_KEYW},
{""}, {""},
#line 9 "scripts/genksyms/keywords.gperf" #line 11 "scripts/genksyms/keywords.gperf"
{"__asm__", ASM_KEYW}, {"__asm__", ASM_KEYW},
{""}, {""}, {""}, {""},
#line 52 "scripts/genksyms/keywords.gperf" #line 54 "scripts/genksyms/keywords.gperf"
{"__typeof__", TYPEOF_KEYW}, {"__typeof__", TYPEOF_KEYW},
{""}, {""},
#line 12 "scripts/genksyms/keywords.gperf" #line 14 "scripts/genksyms/keywords.gperf"
{"__const", CONST_KEYW}, {"__const", CONST_KEYW},
#line 11 "scripts/genksyms/keywords.gperf"
{"__attribute__", ATTRIBUTE_KEYW},
#line 13 "scripts/genksyms/keywords.gperf" #line 13 "scripts/genksyms/keywords.gperf"
{"__attribute__", ATTRIBUTE_KEYW},
#line 15 "scripts/genksyms/keywords.gperf"
{"__const__", CONST_KEYW}, {"__const__", CONST_KEYW},
#line 18 "scripts/genksyms/keywords.gperf" #line 20 "scripts/genksyms/keywords.gperf"
{"__signed__", SIGNED_KEYW}, {"__signed__", SIGNED_KEYW},
#line 44 "scripts/genksyms/keywords.gperf" #line 46 "scripts/genksyms/keywords.gperf"
{"static", STATIC_KEYW}, {"static", STATIC_KEYW},
#line 20 "scripts/genksyms/keywords.gperf" #line 22 "scripts/genksyms/keywords.gperf"
{"__volatile__", VOLATILE_KEYW}, {"__volatile__", VOLATILE_KEYW},
#line 39 "scripts/genksyms/keywords.gperf" #line 41 "scripts/genksyms/keywords.gperf"
{"int", INT_KEYW}, {"int", INT_KEYW},
#line 32 "scripts/genksyms/keywords.gperf" #line 34 "scripts/genksyms/keywords.gperf"
{"char", CHAR_KEYW}, {"char", CHAR_KEYW},
#line 33 "scripts/genksyms/keywords.gperf" #line 35 "scripts/genksyms/keywords.gperf"
{"const", CONST_KEYW}, {"const", CONST_KEYW},
#line 45 "scripts/genksyms/keywords.gperf" #line 47 "scripts/genksyms/keywords.gperf"
{"struct", STRUCT_KEYW}, {"struct", STRUCT_KEYW},
#line 24 "scripts/genksyms/keywords.gperf" #line 26 "scripts/genksyms/keywords.gperf"
{"__restrict__", RESTRICT_KEYW}, {"__restrict__", RESTRICT_KEYW},
#line 25 "scripts/genksyms/keywords.gperf" #line 27 "scripts/genksyms/keywords.gperf"
{"restrict", RESTRICT_KEYW}, {"restrict", RESTRICT_KEYW},
#line 23 "scripts/genksyms/keywords.gperf" #line 25 "scripts/genksyms/keywords.gperf"
{"_restrict", RESTRICT_KEYW}, {"_restrict", RESTRICT_KEYW},
#line 16 "scripts/genksyms/keywords.gperf" #line 18 "scripts/genksyms/keywords.gperf"
{"__inline__", INLINE_KEYW}, {"__inline__", INLINE_KEYW},
#line 10 "scripts/genksyms/keywords.gperf" #line 12 "scripts/genksyms/keywords.gperf"
{"__attribute", ATTRIBUTE_KEYW}, {"__attribute", ATTRIBUTE_KEYW},
{""}, {""},
#line 14 "scripts/genksyms/keywords.gperf" #line 16 "scripts/genksyms/keywords.gperf"
{"__extension__", EXTENSION_KEYW}, {"__extension__", EXTENSION_KEYW},
#line 35 "scripts/genksyms/keywords.gperf" #line 37 "scripts/genksyms/keywords.gperf"
{"enum", ENUM_KEYW}, {"enum", ENUM_KEYW},
#line 19 "scripts/genksyms/keywords.gperf" #line 21 "scripts/genksyms/keywords.gperf"
{"__volatile", VOLATILE_KEYW}, {"__volatile", VOLATILE_KEYW},
#line 36 "scripts/genksyms/keywords.gperf" #line 38 "scripts/genksyms/keywords.gperf"
{"extern", EXTERN_KEYW}, {"extern", EXTERN_KEYW},
{""}, {""},
#line 17 "scripts/genksyms/keywords.gperf" #line 19 "scripts/genksyms/keywords.gperf"
{"__signed", SIGNED_KEYW}, {"__signed", SIGNED_KEYW},
#line 7 "scripts/genksyms/keywords.gperf" #line 9 "scripts/genksyms/keywords.gperf"
{"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW},
{""}, {""},
#line 51 "scripts/genksyms/keywords.gperf" #line 53 "scripts/genksyms/keywords.gperf"
{"typeof", TYPEOF_KEYW}, {"typeof", TYPEOF_KEYW},
#line 46 "scripts/genksyms/keywords.gperf" #line 48 "scripts/genksyms/keywords.gperf"
{"typedef", TYPEDEF_KEYW}, {"typedef", TYPEDEF_KEYW},
#line 15 "scripts/genksyms/keywords.gperf" #line 17 "scripts/genksyms/keywords.gperf"
{"__inline", INLINE_KEYW}, {"__inline", INLINE_KEYW},
#line 31 "scripts/genksyms/keywords.gperf" #line 33 "scripts/genksyms/keywords.gperf"
{"auto", AUTO_KEYW}, {"auto", AUTO_KEYW},
#line 47 "scripts/genksyms/keywords.gperf" #line 49 "scripts/genksyms/keywords.gperf"
{"union", UNION_KEYW}, {"union", UNION_KEYW},
{""}, {""}, {""}, {""},
#line 48 "scripts/genksyms/keywords.gperf" #line 50 "scripts/genksyms/keywords.gperf"
{"unsigned", UNSIGNED_KEYW}, {"unsigned", UNSIGNED_KEYW},
#line 49 "scripts/genksyms/keywords.gperf" #line 51 "scripts/genksyms/keywords.gperf"
{"void", VOID_KEYW}, {"void", VOID_KEYW},
#line 42 "scripts/genksyms/keywords.gperf" #line 44 "scripts/genksyms/keywords.gperf"
{"short", SHORT_KEYW}, {"short", SHORT_KEYW},
{""}, {""}, {""}, {""},
#line 50 "scripts/genksyms/keywords.gperf" #line 52 "scripts/genksyms/keywords.gperf"
{"volatile", VOLATILE_KEYW}, {"volatile", VOLATILE_KEYW},
{""}, {""},
#line 37 "scripts/genksyms/keywords.gperf" #line 39 "scripts/genksyms/keywords.gperf"
{"float", FLOAT_KEYW}, {"float", FLOAT_KEYW},
#line 34 "scripts/genksyms/keywords.gperf" #line 36 "scripts/genksyms/keywords.gperf"
{"double", DOUBLE_KEYW}, {"double", DOUBLE_KEYW},
{""}, {""},
#line 5 "scripts/genksyms/keywords.gperf" #line 7 "scripts/genksyms/keywords.gperf"
{"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW},
{""}, {""}, {""}, {""},
#line 38 "scripts/genksyms/keywords.gperf" #line 40 "scripts/genksyms/keywords.gperf"
{"inline", INLINE_KEYW}, {"inline", INLINE_KEYW},
#line 6 "scripts/genksyms/keywords.gperf" #line 8 "scripts/genksyms/keywords.gperf"
{"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW},
#line 41 "scripts/genksyms/keywords.gperf" #line 43 "scripts/genksyms/keywords.gperf"
{"register", REGISTER_KEYW}, {"register", REGISTER_KEYW},
{""}, {""},
#line 22 "scripts/genksyms/keywords.gperf" #line 24 "scripts/genksyms/keywords.gperf"
{"_Bool", BOOL_KEYW}, {"_Bool", BOOL_KEYW},
#line 43 "scripts/genksyms/keywords.gperf" #line 45 "scripts/genksyms/keywords.gperf"
{"signed", SIGNED_KEYW}, {"signed", SIGNED_KEYW},
{""}, {""}, {""}, {""},
#line 40 "scripts/genksyms/keywords.gperf" #line 42 "scripts/genksyms/keywords.gperf"
{"long", LONG_KEYW} {"long", LONG_KEYW}
}; };
......
%{ %{
struct resword;
static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
%} %}
struct resword { const char *name; int token; } struct resword { const char *name; int token; }
%% %%
......
...@@ -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);
......
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton implementation for Bison's Yacc-like parsers in C /* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc. Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation, either version 3 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
...@@ -16,9 +17,7 @@ ...@@ -16,9 +17,7 @@
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
...@@ -47,7 +46,7 @@ ...@@ -47,7 +46,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "2.3" #define YYBISON_VERSION "2.4.1"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
...@@ -55,6 +54,12 @@ ...@@ -55,6 +54,12 @@
/* Pure parsers. */ /* Pure parsers. */
#define YYPURE 0 #define YYPURE 0
/* Push parsers. */
#define YYPUSH 0
/* Pull parsers. */
#define YYPULL 1
/* Using locations. */ /* Using locations. */
#define YYLSP_NEEDED 0 #define YYLSP_NEEDED 0
...@@ -68,83 +73,6 @@ ...@@ -68,83 +73,6 @@
#define yynerrs zconfnerrs #define yynerrs zconfnerrs
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
T_MAINMENU = 258,
T_MENU = 259,
T_ENDMENU = 260,
T_SOURCE = 261,
T_CHOICE = 262,
T_ENDCHOICE = 263,
T_COMMENT = 264,
T_CONFIG = 265,
T_MENUCONFIG = 266,
T_HELP = 267,
T_HELPTEXT = 268,
T_IF = 269,
T_ENDIF = 270,
T_DEPENDS = 271,
T_OPTIONAL = 272,
T_PROMPT = 273,
T_TYPE = 274,
T_DEFAULT = 275,
T_SELECT = 276,
T_RANGE = 277,
T_OPTION = 278,
T_ON = 279,
T_WORD = 280,
T_WORD_QUOTE = 281,
T_UNEQUAL = 282,
T_CLOSE_PAREN = 283,
T_OPEN_PAREN = 284,
T_EOL = 285,
T_OR = 286,
T_AND = 287,
T_EQUAL = 288,
T_NOT = 289
};
#endif
/* Tokens. */
#define T_MAINMENU 258
#define T_MENU 259
#define T_ENDMENU 260
#define T_SOURCE 261
#define T_CHOICE 262
#define T_ENDCHOICE 263
#define T_COMMENT 264
#define T_CONFIG 265
#define T_MENUCONFIG 266
#define T_HELP 267
#define T_HELPTEXT 268
#define T_IF 269
#define T_ENDIF 270
#define T_DEPENDS 271
#define T_OPTIONAL 272
#define T_PROMPT 273
#define T_TYPE 274
#define T_DEFAULT 275
#define T_SELECT 276
#define T_RANGE 277
#define T_OPTION 278
#define T_ON 279
#define T_WORD 280
#define T_WORD_QUOTE 281
#define T_UNEQUAL 282
#define T_CLOSE_PAREN 283
#define T_OPEN_PAREN 284
#define T_EOL 285
#define T_OR 286
#define T_AND 287
#define T_EQUAL 288
#define T_NOT 289
/* Copy the first part of user declarations. */ /* Copy the first part of user declarations. */
...@@ -163,8 +91,6 @@ ...@@ -163,8 +91,6 @@
#define LKC_DIRECT_LINK #define LKC_DIRECT_LINK
#include "lkc.h" #include "lkc.h"
#include "zconf.hash.c"
#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
#define PRINTD 0x0001 #define PRINTD 0x0001
...@@ -188,6 +114,7 @@ static struct menu *current_menu, *current_entry; ...@@ -188,6 +114,7 @@ static struct menu *current_menu, *current_entry;
#endif #endif
/* Enabling traces. */ /* Enabling traces. */
#ifndef YYDEBUG #ifndef YYDEBUG
# define YYDEBUG 0 # define YYDEBUG 0
...@@ -206,31 +133,77 @@ static struct menu *current_menu, *current_entry; ...@@ -206,31 +133,77 @@ static struct menu *current_menu, *current_entry;
# define YYTOKEN_TABLE 0 # define YYTOKEN_TABLE 0
#endif #endif
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
T_MAINMENU = 258,
T_MENU = 259,
T_ENDMENU = 260,
T_SOURCE = 261,
T_CHOICE = 262,
T_ENDCHOICE = 263,
T_COMMENT = 264,
T_CONFIG = 265,
T_MENUCONFIG = 266,
T_HELP = 267,
T_HELPTEXT = 268,
T_IF = 269,
T_ENDIF = 270,
T_DEPENDS = 271,
T_OPTIONAL = 272,
T_PROMPT = 273,
T_TYPE = 274,
T_DEFAULT = 275,
T_SELECT = 276,
T_RANGE = 277,
T_OPTION = 278,
T_ON = 279,
T_WORD = 280,
T_WORD_QUOTE = 281,
T_UNEQUAL = 282,
T_CLOSE_PAREN = 283,
T_OPEN_PAREN = 284,
T_EOL = 285,
T_OR = 286,
T_AND = 287,
T_EQUAL = 288,
T_NOT = 289
};
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
{ {
char *string; char *string;
struct file *file; struct file *file;
struct symbol *symbol; struct symbol *symbol;
struct expr *expr; struct expr *expr;
struct menu *menu; struct menu *menu;
struct kconf_id *id; struct kconf_id *id;
}
/* Line 187 of yacc.c. */
YYSTYPE;
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
/* Line 216 of yacc.c. */ /* Include zconf.hash.c here so it can see the token constants. */
#include "zconf.hash.c"
#ifdef short #ifdef short
...@@ -306,14 +279,14 @@ typedef short int yytype_int16; ...@@ -306,14 +279,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static int static int
YYID (int i) YYID (int yyi)
#else #else
static int static int
YYID (i) YYID (yyi)
int i; int yyi;
#endif #endif
{ {
return i; return yyi;
} }
#endif #endif
...@@ -394,9 +367,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ ...@@ -394,9 +367,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */ /* A type that is properly aligned for any stack member. */
union yyalloc union yyalloc
{ {
yytype_int16 yyss; yytype_int16 yyss_alloc;
YYSTYPE yyvs; YYSTYPE yyvs_alloc;
}; };
/* The size of the maximum gap between one aligned stack and the next. */ /* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
...@@ -430,12 +403,12 @@ union yyalloc ...@@ -430,12 +403,12 @@ union yyalloc
elements in the stack, and YYPTR gives the new location of the elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next stack. Advance YYPTR to a properly aligned location for the next
stack. */ stack. */
# define YYSTACK_RELOCATE(Stack) \ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \ do \
{ \ { \
YYSIZE_T yynewbytes; \ YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack; \ Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \ yyptr += yynewbytes / sizeof (*yyptr); \
} \ } \
...@@ -558,18 +531,18 @@ static const yytype_int8 yyrhs[] = ...@@ -558,18 +531,18 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = static const yytype_uint16 yyrline[] =
{ {
0, 104, 104, 106, 108, 109, 110, 111, 112, 113, 0, 107, 107, 109, 111, 112, 113, 114, 115, 116,
114, 118, 122, 122, 122, 122, 122, 122, 122, 126, 117, 121, 125, 125, 125, 125, 125, 125, 125, 129,
127, 128, 129, 130, 131, 135, 136, 142, 150, 156, 130, 131, 132, 133, 134, 138, 139, 145, 153, 159,
164, 174, 176, 177, 178, 179, 180, 181, 184, 192, 167, 177, 179, 180, 181, 182, 183, 184, 187, 195,
198, 208, 214, 220, 223, 225, 236, 237, 242, 251, 201, 211, 217, 223, 226, 228, 239, 240, 245, 254,
256, 264, 267, 269, 270, 271, 272, 273, 276, 282, 259, 267, 270, 272, 273, 274, 275, 276, 279, 285,
293, 299, 309, 311, 316, 324, 332, 335, 337, 338, 296, 302, 312, 314, 319, 327, 335, 338, 340, 341,
339, 344, 351, 356, 364, 367, 369, 370, 371, 374, 342, 347, 354, 359, 367, 370, 372, 373, 374, 377,
382, 389, 396, 402, 409, 411, 412, 413, 416, 424, 385, 392, 399, 405, 412, 414, 415, 416, 419, 427,
426, 431, 432, 435, 436, 437, 441, 442, 445, 446, 429, 434, 435, 438, 439, 440, 444, 445, 448, 449,
449, 450, 451, 452, 453, 454, 455, 458, 459, 462, 452, 453, 454, 455, 456, 457, 458, 461, 462, 465,
463 466
}; };
#endif #endif
...@@ -985,17 +958,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) ...@@ -985,17 +958,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep)
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static void static void
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else #else
static void static void
yy_stack_print (bottom, top) yy_stack_print (yybottom, yytop)
yytype_int16 *bottom; yytype_int16 *yybottom;
yytype_int16 *top; yytype_int16 *yytop;
#endif #endif
{ {
YYFPRINTF (stderr, "Stack now"); YYFPRINTF (stderr, "Stack now");
for (; bottom <= top; ++bottom) for (; yybottom <= yytop; yybottom++)
YYFPRINTF (stderr, " %d", *bottom); {
int yybot = *yybottom;
YYFPRINTF (stderr, " %d", yybot);
}
YYFPRINTF (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
...@@ -1029,11 +1005,11 @@ yy_reduce_print (yyvsp, yyrule) ...@@ -1029,11 +1005,11 @@ yy_reduce_print (yyvsp, yyrule)
/* The symbols being reduced. */ /* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++) for (yyi = 0; yyi < yynrhs; yyi++)
{ {
fprintf (stderr, " $%d = ", yyi + 1); YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)]) &(yyvsp[(yyi + 1) - (yynrhs)])
); );
fprintf (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
} }
...@@ -1343,10 +1319,8 @@ yydestruct (yymsg, yytype, yyvaluep) ...@@ -1343,10 +1319,8 @@ yydestruct (yymsg, yytype, yyvaluep)
break; break;
} }
} }
/* Prevent warnings from -Wmissing-prototypes. */ /* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus #if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM); int yyparse (void *YYPARSE_PARAM);
...@@ -1362,11 +1336,10 @@ int yyparse (); ...@@ -1362,11 +1336,10 @@ int yyparse ();
#endif /* ! YYPARSE_PARAM */ #endif /* ! YYPARSE_PARAM */
/* The lookahead symbol. */
/* The look-ahead symbol. */
int yychar; int yychar;
/* The semantic value of the look-ahead symbol. */ /* The semantic value of the lookahead symbol. */
YYSTYPE yylval; YYSTYPE yylval;
/* Number of syntax errors so far. */ /* Number of syntax errors so far. */
...@@ -1374,9 +1347,9 @@ int yynerrs; ...@@ -1374,9 +1347,9 @@ int yynerrs;
/*----------. /*-------------------------.
| yyparse. | | yyparse or yypush_parse. |
`----------*/ `-------------------------*/
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
...@@ -1401,53 +1374,56 @@ yyparse () ...@@ -1401,53 +1374,56 @@ yyparse ()
#endif #endif
{ {
int yystate; int yystate;
int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */ /* Number of tokens to shift before error messages enabled. */
int yyerrstatus; int yyerrstatus;
/* Look-ahead token as an internal (translated) token number. */
int yytoken = 0;
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
char *yymsg = yymsgbuf;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
/* Three stacks and their tools: /* The stacks and their tools:
`yyss': related to states, `yyss': related to states.
`yyvs': related to semantic values, `yyvs': related to semantic values.
`yyls': related to locations.
Refer to the stacks thru separate pointers, to allow yyoverflow Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */ to reallocate them elsewhere. */
/* The state stack. */ /* The state stack. */
yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 yyssa[YYINITDEPTH];
yytype_int16 *yyss = yyssa; yytype_int16 *yyss;
yytype_int16 *yyssp; yytype_int16 *yyssp;
/* The semantic value stack. */ /* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvs;
YYSTYPE *yyvsp; YYSTYPE *yyvsp;
YYSIZE_T yystacksize;
int yyn;
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) int yyresult;
/* Lookahead token as an internal (translated) token number. */
YYSIZE_T yystacksize = YYINITDEPTH; int yytoken;
/* The variables used to return semantic value and location from the /* The variables used to return semantic value and location from the
action routines. */ action routines. */
YYSTYPE yyval; YYSTYPE yyval;
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
char *yymsg = yymsgbuf;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
/* The number of symbols on the RHS of the reduced rule. /* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */ Keep to zero when no symbol should be popped. */
int yylen = 0; int yylen = 0;
yytoken = 0;
yyss = yyssa;
yyvs = yyvsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n")); YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0; yystate = 0;
...@@ -1459,7 +1435,6 @@ yyparse () ...@@ -1459,7 +1435,6 @@ yyparse ()
Waste one element of value and location stack Waste one element of value and location stack
so that they stay on the same level as the state stack. so that they stay on the same level as the state stack.
The wasted elements are never initialized. */ The wasted elements are never initialized. */
yyssp = yyss; yyssp = yyss;
yyvsp = yyvs; yyvsp = yyvs;
...@@ -1489,7 +1464,6 @@ yyparse () ...@@ -1489,7 +1464,6 @@ yyparse ()
YYSTYPE *yyvs1 = yyvs; YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss; yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the /* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might conditional around just the two extra args, but that might
...@@ -1497,7 +1471,6 @@ yyparse () ...@@ -1497,7 +1471,6 @@ yyparse ()
yyoverflow (YY_("memory exhausted"), yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp), &yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp), &yyvs1, yysize * sizeof (*yyvsp),
&yystacksize); &yystacksize);
yyss = yyss1; yyss = yyss1;
...@@ -1520,9 +1493,8 @@ yyparse () ...@@ -1520,9 +1493,8 @@ yyparse ()
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr) if (! yyptr)
goto yyexhaustedlab; goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs); YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE # undef YYSTACK_RELOCATE
if (yyss1 != yyssa) if (yyss1 != yyssa)
YYSTACK_FREE (yyss1); YYSTACK_FREE (yyss1);
...@@ -1533,7 +1505,6 @@ yyparse () ...@@ -1533,7 +1505,6 @@ yyparse ()
yyssp = yyss + yysize - 1; yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1; yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n", YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize)); (unsigned long int) yystacksize));
...@@ -1543,6 +1514,9 @@ yyparse () ...@@ -1543,6 +1514,9 @@ yyparse ()
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup; goto yybackup;
/*-----------. /*-----------.
...@@ -1551,16 +1525,16 @@ yyparse () ...@@ -1551,16 +1525,16 @@ yyparse ()
yybackup: yybackup:
/* Do appropriate processing given the current state. Read a /* Do appropriate processing given the current state. Read a
look-ahead token if we need one and don't already have one. */ lookahead token if we need one and don't already have one. */
/* First try to decide what to do without reference to look-ahead token. */ /* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate]; yyn = yypact[yystate];
if (yyn == YYPACT_NINF) if (yyn == YYPACT_NINF)
goto yydefault; goto yydefault;
/* Not known => get a look-ahead token if don't already have one. */ /* Not known => get a lookahead token if don't already have one. */
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY) if (yychar == YYEMPTY)
{ {
YYDPRINTF ((stderr, "Reading a token: ")); YYDPRINTF ((stderr, "Reading a token: "));
...@@ -1592,19 +1566,15 @@ yybackup: ...@@ -1592,19 +1566,15 @@ yybackup:
goto yyreduce; goto yyreduce;
} }
if (yyn == YYFINAL)
YYACCEPT;
/* Count tokens shifted since error; after three, turn off error /* Count tokens shifted since error; after three, turn off error
status. */ status. */
if (yyerrstatus) if (yyerrstatus)
yyerrstatus--; yyerrstatus--;
/* Shift the look-ahead token. */ /* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the shifted token unless it is eof. */ /* Discard the shifted token. */
if (yychar != YYEOF)
yychar = YYEMPTY; yychar = YYEMPTY;
yystate = yyn; yystate = yyn;
...@@ -2029,7 +1999,6 @@ yyreduce: ...@@ -2029,7 +1999,6 @@ yyreduce:
break; break;
/* Line 1267 of yacc.c. */
default: break; default: break;
} }
...@@ -2041,7 +2010,6 @@ yyreduce: ...@@ -2041,7 +2010,6 @@ yyreduce:
*++yyvsp = yyval; *++yyvsp = yyval;
/* Now `shift' the result of the reduction. Determine what state /* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule that goes to, based on the state we popped back to and the rule
number reduced by. */ number reduced by. */
...@@ -2106,7 +2074,7 @@ yyerrlab: ...@@ -2106,7 +2074,7 @@ yyerrlab:
if (yyerrstatus == 3) if (yyerrstatus == 3)
{ {
/* If just tried and failed to reuse look-ahead token after an /* If just tried and failed to reuse lookahead token after an
error, discard it. */ error, discard it. */
if (yychar <= YYEOF) if (yychar <= YYEOF)
...@@ -2123,7 +2091,7 @@ yyerrlab: ...@@ -2123,7 +2091,7 @@ yyerrlab:
} }
} }
/* Else will try to reuse look-ahead token after shifting the error /* Else will try to reuse lookahead token after shifting the error
token. */ token. */
goto yyerrlab1; goto yyerrlab1;
...@@ -2180,9 +2148,6 @@ yyerrlab1: ...@@ -2180,9 +2148,6 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
} }
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval; *++yyvsp = yylval;
...@@ -2207,7 +2172,7 @@ yyabortlab: ...@@ -2207,7 +2172,7 @@ yyabortlab:
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturn;
#ifndef yyoverflow #if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------. /*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. | | yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/ `-------------------------------------------------*/
...@@ -2218,7 +2183,7 @@ yyexhaustedlab: ...@@ -2218,7 +2183,7 @@ yyexhaustedlab:
#endif #endif
yyreturn: yyreturn:
if (yychar != YYEOF && yychar != YYEMPTY) if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead", yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval); yytoken, &yylval);
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
...@@ -2284,7 +2249,7 @@ void conf_parse(const char *name) ...@@ -2284,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";
...@@ -2348,7 +2313,7 @@ static void zconferror(const char *err) ...@@ -2348,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;
...@@ -2365,7 +2330,7 @@ void print_quoted_string(FILE *out, const char *str) ...@@ -2365,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;
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#define LKC_DIRECT_LINK #define LKC_DIRECT_LINK
#include "lkc.h" #include "lkc.h"
#include "zconf.hash.c"
#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
#define PRINTD 0x0001 #define PRINTD 0x0001
...@@ -100,6 +98,11 @@ static struct menu *current_menu, *current_entry; ...@@ -100,6 +98,11 @@ static struct menu *current_menu, *current_entry;
menu_end_menu(); menu_end_menu();
} if_entry menu_entry choice_entry } if_entry menu_entry choice_entry
%{
/* Include zconf.hash.c here so it can see the token constants. */
#include "zconf.hash.c"
%}
%% %%
input: stmt_list; input: stmt_list;
...@@ -501,7 +504,7 @@ void conf_parse(const char *name) ...@@ -501,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";
...@@ -565,7 +568,7 @@ static void zconferror(const char *err) ...@@ -565,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;
...@@ -582,7 +585,7 @@ void print_quoted_string(FILE *out, const char *str) ...@@ -582,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;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#define MAX_SIZE (256*1024) #define MAX_SIZE (256*1024)
unsigned char buf[MAX_SIZE]; unsigned char buf[MAX_SIZE];
int loadhex(FILE *inf, unsigned char *buf) static int loadhex(FILE *inf, unsigned char *buf)
{ {
int l=0, c, i; int l=0, c, i;
......
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