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>
This commit is contained in:
Denis 'GNUtoo' Carikli 2018-01-11 16:47:33 +01:00 committed by Martin Roth
parent 8324d87bf4
commit 3cb25bbbc3
1 changed files with 10 additions and 11 deletions

View File

@ -20,7 +20,7 @@
#include <string.h> #include <string.h>
//#define YYDEBUG 1 //#define YYDEBUG 1
int yylex (void); int yylex (void);
void yyerror (char const *); static void yyerror (char const *);
struct field { struct field {
char *name; char *name;
@ -29,14 +29,13 @@ struct field {
struct field *next; struct field *next;
}; };
extern struct field *sym_table; static struct field *sym_table;
struct field *putsym (char const *, unsigned int); static struct field *putsym (char const *, unsigned int);
struct field *getsym (char const *); static struct field *getsym (char const *);
struct field *sym_table; static struct field *sym_table_tail;
struct field *sym_table_tail;
FILE* fp; static FILE* fp;
/* Bit array intermediary representation */ /* Bit array intermediary representation */
struct blob { struct blob {
@ -51,7 +50,7 @@ struct blob {
#define MAX_WIDTH 32 #define MAX_WIDTH 32
#define CHECKSUM_SIZE 16 #define CHECKSUM_SIZE 16
struct blob *binary; static struct blob *binary;
static void check_pointer (void *ptr) 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); 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)) { if (getsym(sym_name)) {
fprintf(stderr, "Cannot add duplicate named bitfield `%s`\n", 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; return ptr;
} }
struct field *getsym (char const *sym_name) static struct field *getsym (char const *sym_name)
{ {
struct field *ptr; struct field *ptr;
for (ptr = sym_table; ptr != (struct field *) 0; for (ptr = sym_table; ptr != (struct field *) 0;
@ -448,7 +447,7 @@ setpair:
%% %%
/* Called by yyparse on error. */ /* Called by yyparse on error. */
void yyerror (char const *s) static void yyerror (char const *s)
{ {
fprintf (stderr, "yyerror: %s\n", s); fprintf (stderr, "yyerror: %s\n", s);
} }