Skip to content

Commit 756ac0d

Browse files
markpizzpkoning2
authored andcommitted
BUILDROMS: Fix potential compiler warnings
1 parent 2de790d commit 756ac0d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sim_BuildROMs.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct ROM_File_Descriptor {
9090
#endif
9191

9292
int sim_read_ROM_include(const char *include_filename,
93-
int *psize,
93+
size_t *psize,
9494
unsigned char **pROMData,
9595
unsigned int *pchecksum,
9696
char **prom_array_name,
@@ -227,7 +227,7 @@ return 1;
227227
}
228228

229229
int sim_make_ROM_include(const char *rom_filename,
230-
int expected_size,
230+
size_t expected_size,
231231
unsigned int expected_checksum,
232232
const char *include_filename,
233233
const char *rom_array_name,
@@ -237,7 +237,7 @@ FILE *rFile;
237237
FILE *iFile;
238238
time_t now;
239239
int bytes_written = 0;
240-
int include_bytes;
240+
size_t include_bytes;
241241
int c;
242242
int rom;
243243
struct stat statb;
@@ -275,8 +275,8 @@ if (stat (rom_filename, &statb)) {
275275
fclose (rFile);
276276
return -1;
277277
}
278-
if (statb.st_size != expected_size) {
279-
printf ("Error: ROM file '%s' has an unexpected size: %d vs %d\n", rom_filename, (int)statb.st_size, expected_size);
278+
if ((size_t)statb.st_size != (size_t)expected_size) {
279+
printf ("Error: ROM file '%s' has an unexpected size: %d vs %d\n", rom_filename, (int)statb.st_size, (int)expected_size);
280280
printf ("This can happen if the file was transferred or unpacked incorrectly\n");
281281
printf ("and in the process tried to convert line endings rather than passing\n");
282282
printf ("the file's contents unmodified\n");

0 commit comments

Comments
 (0)