Mercurial > hg > index.cgi
comparison lwlink/objdump.c @ 2:7317fbe024af
Clean up insane number of compiler warnings under -Wall
author | lost@l-w.ca |
---|---|
date | Thu, 20 Jan 2011 22:39:46 -0700 |
parents | 2c24602be78f |
children | fdc11ef4115b |
comparison
equal
deleted
inserted
replaced
1:96c4dc89016e | 2:7317fbe024af |
---|---|
21 A standalone program to dump an object file in a text form to stdout | 21 A standalone program to dump an object file in a text form to stdout |
22 | 22 |
23 */ | 23 */ |
24 #include <stdio.h> | 24 #include <stdio.h> |
25 #include <stdlib.h> | 25 #include <stdlib.h> |
26 #include <string.h> | |
26 | 27 |
27 #include "util.h" | 28 #include "util.h" |
28 | 29 |
29 #ifdef HAVE_CONFIG_H | 30 #ifdef HAVE_CONFIG_H |
30 #include "config.h" | 31 #include "config.h" |
74 names in the file are NUL terminated strings and can be used directly without | 75 names in the file are NUL terminated strings and can be used directly without |
75 making additional copies. | 76 making additional copies. |
76 */ | 77 */ |
77 int main(int argc, char **argv) | 78 int main(int argc, char **argv) |
78 { | 79 { |
79 int i; | |
80 long size; | 80 long size; |
81 FILE *f; | 81 FILE *f; |
82 long bread; | 82 long bread; |
83 unsigned char *filedata; | 83 unsigned char *filedata; |
84 | 84 |
218 NEXTBYTE(); | 218 NEXTBYTE(); |
219 val |= (CURBYTE()); | 219 val |= (CURBYTE()); |
220 NEXTBYTE(); | 220 NEXTBYTE(); |
221 // val is now the symbol value | 221 // val is now the symbol value |
222 | 222 |
223 printf(" %s=%04X\n", string_cleanup(fp), val); | 223 printf(" %s=%04X\n", string_cleanup((char *)fp), val); |
224 | 224 |
225 } | 225 } |
226 // skip terminating NUL | 226 // skip terminating NUL |
227 NEXTBYTE(); | 227 NEXTBYTE(); |
228 | 228 |
238 NEXTBYTE(); | 238 NEXTBYTE(); |
239 val |= (CURBYTE()); | 239 val |= (CURBYTE()); |
240 NEXTBYTE(); | 240 NEXTBYTE(); |
241 // val is now the symbol value | 241 // val is now the symbol value |
242 | 242 |
243 printf(" %s=%04X\n", string_cleanup(fp), val); | 243 printf(" %s=%04X\n", string_cleanup((char *)fp), val); |
244 } | 244 } |
245 // skip terminating NUL | 245 // skip terminating NUL |
246 NEXTBYTE(); | 246 NEXTBYTE(); |
247 | 247 |
248 // now parse the incomplete references and make a list of | 248 // now parse the incomplete references and make a list of |
270 printf(" I16=%d", tt); | 270 printf(" I16=%d", tt); |
271 break; | 271 break; |
272 | 272 |
273 case 0x02: | 273 case 0x02: |
274 // external symbol reference | 274 // external symbol reference |
275 printf(" ES=%s", string_cleanup(CURSTR())); | 275 printf(" ES=%s", string_cleanup((char *)CURSTR())); |
276 break; | 276 break; |
277 | 277 |
278 case 0x03: | 278 case 0x03: |
279 // internal symbol reference | 279 // internal symbol reference |
280 printf(" IS=%s", string_cleanup(CURSTR())); | 280 printf(" IS=%s", string_cleanup((char *)CURSTR())); |
281 break; | 281 break; |
282 | 282 |
283 case 0x04: | 283 case 0x04: |
284 // operator | 284 // operator |
285 if (CURBYTE() > 0 && CURBYTE() <= numopers) | 285 if (CURBYTE() > 0 && CURBYTE() <= numopers) |