[coreboot-gerrit] Change in coreboot[master]: util/blobtool: cleanups: use static whenever possible
Denis 'GNUtoo' Carikli (Code Review)
gerrit at coreboot.org
Fri Jan 12 15:22:31 CET 2018
Denis 'GNUtoo' Carikli has uploaded this change for review. ( https://review.coreboot.org/23243
Change subject: util/blobtool: cleanups: use static whenever possible
......................................................................
util/blobtool: 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 at no-log.org>
---
M util/bincfg/bincfg.y
1 file changed, 10 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/23243/1
diff --git a/util/bincfg/bincfg.y b/util/bincfg/bincfg.y
index 28feb59..701de6f 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 *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 @@
#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 @@
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 @@
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 @@
%%
/* Called by yyparse on error. */
-void yyerror (char const *s)
+static void yyerror (char const *s)
{
fprintf (stderr, "yyerror: %s\n", s);
}
--
To view, visit https://review.coreboot.org/23243
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I753e99c4a8290f9edd9abcda9af8e33b6ccfe406
Gerrit-Change-Number: 23243
Gerrit-PatchSet: 1
Gerrit-Owner: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180112/bfd95a23/attachment-0001.html>
More information about the coreboot-gerrit
mailing list