summaryrefslogtreecommitdiff
path: root/src/sym.c
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2015-05-14 11:16:04 -0700
committerWill Estes <westes575@gmail.com>2015-11-19 19:26:07 -0500
commit0f7b9136ed566f4a79b2d6ca33299babcce3049e (patch)
tree4d7e50ccc92c0917ec491c23aadaf93b5b0c5047 /src/sym.c
parent09eae589d3954a1e1206aa01108ee75ef57776da (diff)
Switch function definitions from mixed K&R to consistent ANSI C.
flex was using K&R function definitions for some functions and ANSI C style in others, sometimes even in the same file. Change the code to consistently use ANSI C. Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/sym.c')
-rw-r--r--src/sym.c39
1 files changed, 10 insertions, 29 deletions
diff --git a/src/sym.c b/src/sym.c
index 232cd0a..d55701f 100644
--- a/src/sym.c
+++ b/src/sym.c
@@ -72,12 +72,7 @@ static int hashfunct PROTO ((const char *, int));
* -1 is returned if the symbol already exists, and the change not made.
*/
-static int addsym (sym, str_def, int_def, table, table_size)
- char sym[];
- char *str_def;
- int int_def;
- hash_table table;
- int table_size;
+static int addsym (char sym[], char *str_def, int int_def, hash_table table, int table_size)
{
int hash_val = hashfunct (sym, table_size);
struct hash_entry *sym_entry = table[hash_val];
@@ -119,9 +114,7 @@ static int addsym (sym, str_def, int_def, table, table_size)
/* cclinstal - save the text of a character class */
-void cclinstal (ccltxt, cclnum)
- Char ccltxt[];
- int cclnum;
+void cclinstal (Char ccltxt[], int cclnum)
{
/* We don't bother checking the return status because we are not
* called unless the symbol is new.
@@ -137,8 +130,7 @@ void cclinstal (ccltxt, cclnum)
* Returns 0 if there's no CCL associated with the text.
*/
-int ccllookup (ccltxt)
- Char ccltxt[];
+int ccllookup (Char ccltxt[])
{
return findsym ((char *) ccltxt, ccltab, CCL_HASH_SIZE)->int_val;
}
@@ -146,10 +138,7 @@ int ccllookup (ccltxt)
/* findsym - find symbol in symbol table */
-static struct hash_entry *findsym (sym, table, table_size)
- const char *sym;
- hash_table table;
- int table_size;
+static struct hash_entry *findsym (const char *sym, hash_table table, int table_size)
{
static struct hash_entry empty_entry = {
(struct hash_entry *) 0, (struct hash_entry *) 0,
@@ -170,9 +159,7 @@ static struct hash_entry *findsym (sym, table, table_size)
/* hashfunct - compute the hash value for "str" and hash size "hash_size" */
-static int hashfunct (str, hash_size)
- const char *str;
- int hash_size;
+static int hashfunct (const char *str, int hash_size)
{
int hashval;
int locstr;
@@ -191,9 +178,7 @@ static int hashfunct (str, hash_size)
/* ndinstal - install a name definition */
-void ndinstal (name, definition)
- const char *name;
- Char definition[];
+void ndinstal (const char *name, Char definition[])
{
if (addsym (copy_string (name),
@@ -208,8 +193,7 @@ void ndinstal (name, definition)
* Returns a nil pointer if the name definition does not exist.
*/
-Char *ndlookup (nd)
- const char *nd;
+Char *ndlookup (const char *nd)
{
return (Char *) findsym (nd, ndtbl, NAME_TABLE_HASH_SIZE)->str_val;
}
@@ -217,7 +201,7 @@ Char *ndlookup (nd)
/* scextend - increase the maximum number of start conditions */
-void scextend ()
+void scextend (void)
{
current_max_scs += MAX_SCS_INCREMENT;
@@ -237,9 +221,7 @@ void scextend ()
* The start condition is "exclusive" if xcluflg is true.
*/
-void scinstal (str, xcluflg)
- const char *str;
- int xcluflg;
+void scinstal (const char *str, int xcluflg)
{
if (++lastsc >= current_max_scs)
@@ -265,8 +247,7 @@ str);
* Returns 0 if no such start condition.
*/
-int sclookup (str)
- const char *str;
+int sclookup (const char *str)
{
return findsym (str, sctbl, START_COND_HASH_SIZE)->int_val;
}