diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> | 2018-01-11 16:47:33 +0100 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2018-01-23 05:20:45 +0000 |
commit | 3cb25bbbc31ec1a53149c2c8f3dc6d70bda0c335 (patch) | |
tree | 65d5c892cdc81867f522b6770102b11eee52e79e | |
parent | 8324d87bf4f8900971be5584f11110dc261f14e5 (diff) | |
download | coreboot-3cb25bbbc31ec1a53149c2c8f3dc6d70bda0c335.tar.gz coreboot-3cb25bbbc31ec1a53149c2c8f3dc6d70bda0c335.tar.bz2 coreboot-3cb25bbbc31ec1a53149c2c8f3dc6d70bda0c335.zip |
util/bincfg: cleanups: use static whenever possible
Some non-static declaration remains. If they were made
static, the compiler would output some warnings:
bincfg.y:30:1: warning: useless storage class specifier in empty declaration
};
^
bincfg.y:47:1: warning: useless storage class specifier in empty declaration
};
^
bincfg.y:22:12: warning: ‘yylex’ used but never defined
static int yylex (void);
^~~~~
bincfg.y:456:13: warning: ‘set_input_string’ used but never defined
static void set_input_string(char* in);
^~~~~~~~~~~~~~~~
Change-Id: I753e99c4a8290f9edd9abcda9af8e33b6ccfe406
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Reviewed-on: https://review.coreboot.org/23243
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | util/bincfg/bincfg.y | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/util/bincfg/bincfg.y b/util/bincfg/bincfg.y index 28feb599b191..701de6f73c9a 100644 --- a/util/bincfg/bincfg.y +++ b/util/bincfg/bincfg.y @@ -20,7 +20,7 @@ #include <string.h> //#define YYDEBUG 1 int yylex (void); -void yyerror (char const *); +static void yyerror (char const *); struct field { char *name; @@ -29,14 +29,13 @@ struct field { struct field *next; }; -extern struct field *sym_table; -struct field *putsym (char const *, unsigned int); -struct field *getsym (char const *); +static struct field *sym_table; +static struct field *putsym (char const *, unsigned int); +static struct field *getsym (char const *); -struct field *sym_table; -struct field *sym_table_tail; +static struct field *sym_table_tail; -FILE* fp; +static FILE* fp; /* Bit array intermediary representation */ struct blob { @@ -51,7 +50,7 @@ struct blob { #define MAX_WIDTH 32 #define CHECKSUM_SIZE 16 -struct blob *binary; +static struct blob *binary; static void check_pointer (void *ptr) { @@ -144,7 +143,7 @@ static void create_new_bitfields(char *name, unsigned int n, unsigned int width) free(namen); } -struct field *putsym (char const *sym_name, unsigned int w) +static struct field *putsym (char const *sym_name, unsigned int w) { if (getsym(sym_name)) { fprintf(stderr, "Cannot add duplicate named bitfield `%s`\n", @@ -168,7 +167,7 @@ struct field *putsym (char const *sym_name, unsigned int w) return ptr; } -struct field *getsym (char const *sym_name) +static struct field *getsym (char const *sym_name) { struct field *ptr; for (ptr = sym_table; ptr != (struct field *) 0; @@ -448,7 +447,7 @@ setpair: %% /* Called by yyparse on error. */ -void yyerror (char const *s) +static void yyerror (char const *s) { fprintf (stderr, "yyerror: %s\n", s); } |