Commit 9b6a8a4270d5904748ceda8f56bbb09aaf984b23

Stefan Reinauer 2010-04-26T17:01:01

warning free build on OS X 10.5.8 git-svn-id: svn://coreboot.org/openbios/trunk/fcode-utils-devel@759 f158a5a8-5612-0410-a976-696ce0be7e32

diff --git a/detok/Makefile b/detok/Makefile
index b48f60e..2626098 100644
--- a/detok/Makefile
+++ b/detok/Makefile
@@ -29,7 +29,7 @@ STRIP	= strip
 INCLUDES = -I../shared
 
 # Normal Flags:
-CFLAGS  = -O2 -Wall -Wextra
+CFLAGS  = -O2 -Wall -ansi #-Wextra
 LDFLAGS = 
 
 # Coverage:
diff --git a/detok/addfcodes.c b/detok/addfcodes.c
index 7ea2c38..8f09036 100644
--- a/detok/addfcodes.c
+++ b/detok/addfcodes.c
@@ -98,9 +98,9 @@
  **************************************************************************** */
 
 static char *current_vfc_line;
-static char *vfc_remainder;
+static u8 *vfc_remainder;
 static int vfc_line_no = 0;
-static char *vfc_buf_end;
+static u8 *vfc_buf_end;
 
 /*  Special Functions List  */
 /*  Initial fcode-field value of  -1  guarantees they won't be used  */
@@ -173,12 +173,12 @@ static bool get_next_vfc_line(void)
 {
 	bool retval = FALSE;	/*  TRUE = not at end yet  */
 	while (vfc_remainder < vfc_buf_end) {
-		current_vfc_line = vfc_remainder;
-		vfc_remainder = strchr(current_vfc_line, '\n');
+		current_vfc_line = (char *)vfc_remainder;
+		vfc_remainder = (u8 *)strchr((const char *)current_vfc_line, '\n');
 		*vfc_remainder = 0;
 		vfc_remainder++;
 		vfc_line_no++;
-		skip_whitespace(&current_vfc_line);
+		skip_whitespace((char **)&current_vfc_line);
 		if (*current_vfc_line == 0)
 			continue;	/*  Blank line */
 		if (*current_vfc_line == '#')
diff --git a/detok/decode.c b/detok/decode.c
index e51083a..0a25ac7 100644
--- a/detok/decode.c
+++ b/detok/decode.c
@@ -357,7 +357,7 @@ static void named_token(void)
 {
 	u16 token;
 	u8 len;
-	u8 *string;
+	char *string;
 
 	output_token();
 	/* get forth string ( [len] [char0] ... [charn] ) */
diff --git a/detok/pcihdr.c b/detok/pcihdr.c
index fa681b3..4a5f3ed 100644
--- a/detok/pcihdr.c
+++ b/detok/pcihdr.c
@@ -461,7 +461,7 @@ void handle_pci_filler(u8 * filler_ptr)
 	} else {
 		sprintf(temp_buf, "PCI Image padding-field of %d bytes "
 			"had first non-zero byte at offset %ld",
-			filler_len, scan_ptr - filler_ptr);
+			filler_len, (unsigned long)(scan_ptr - filler_ptr));
 	}
 	printremark(temp_buf);
 }
diff --git a/detok/stream.c b/detok/stream.c
index dd5093f..f4c279a 100644
--- a/detok/stream.c
+++ b/detok/stream.c
@@ -236,7 +236,7 @@ static u8 *get_bytes(int nbytes)
 		throw_eof(TRUE);
 	}
 	pc += nbytes;
-	return (retval);
+	return retval;
 }
 
 
@@ -252,7 +252,7 @@ bool more_to_go(void)
 {
 	bool retval;
 	retval = INVERSE(pc == max);
-	return (retval);
+	return retval;
 }
 
 
@@ -282,7 +282,7 @@ u16 next_token(void)
 		tok |= *(get_bytes(1));
 	}
 	fcode = tok;
-	return (tok);
+	return tok;
 }
 
 u32 get_num32(void)
@@ -293,7 +293,7 @@ u32 get_num32(void)
 	num_str = get_bytes(4);
 	retval = BIG_ENDIAN_LONG_FETCH(num_str);
 
-	return (retval);
+	return retval;
 }
 
 u16 get_num16(void)
@@ -304,7 +304,7 @@ u16 get_num16(void)
 	num_str = get_bytes(2);
 	retval = BIG_ENDIAN_WORD_FETCH(num_str);
 
-	return (retval);
+	return retval;
 }
 
 u8 get_num8(void)
@@ -326,7 +326,7 @@ s16 get_offset(void)
 		retval |= (retval & 0x80) ? 0xff00 : 0;
 	}
 
-	return (retval);
+	return retval;
 }
 
 /* **************************************************************************
@@ -356,12 +356,12 @@ s16 get_offset(void)
 
 u8 *get_string(u8 * len)
 {
-	char *retval;
+	u8 *retval;
 
 	*len = get_num8();
 	retval = get_bytes((int) *len);
 
-	return (retval);
+	return retval;
 }
 
 
@@ -405,7 +405,7 @@ char *get_name(u8 * len)
 	char *retval;
 	u8 sav_byt;
 
-	str_start = get_string(len);
+	str_start = (char *)get_string(len);
 
 	sav_byt = *pc;
 	*pc = 0;
@@ -413,7 +413,7 @@ char *get_name(u8 * len)
 	retval = strdup(str_start);
 	*pc = sav_byt;
 
-	return (retval);
+	return retval;
 }
 
 /* **************************************************************************
@@ -462,7 +462,7 @@ u16 calc_checksum(void)
 	}
 
 	pc = save_pc;
-	return (retval);
+	return retval;
 }
 
 
diff --git a/romheaders/Makefile b/romheaders/Makefile
index f8c862b..a63edf2 100644
--- a/romheaders/Makefile
+++ b/romheaders/Makefile
@@ -24,7 +24,7 @@
 
 CC	 ?= gcc
 STRIP    = strip
-CFLAGS   = -O2 -Wall -W -ansi
+CFLAGS   = -O2 -Wall -Wextra -ansi
 INCLUDES = -I../shared
 
 SOURCES = romheaders.c ../shared/classcodes.c
diff --git a/toke/Makefile b/toke/Makefile
index dc748eb..9fbb6c0 100644
--- a/toke/Makefile
+++ b/toke/Makefile
@@ -29,7 +29,7 @@ STRIP	= strip
 INCLUDES = -I../shared
 
 # Normal flags
-CFLAGS  = -O2 -Wall -Wextra 
+CFLAGS  = -O2 -Wall -ansi -Wno-pointer-sign #-Wextra 
 LDFLAGS =
 
 # Coverage: