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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
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(¤t_vfc_line);
+ skip_whitespace((char **)¤t_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: