mirror of
https://github.com/simh/simh.git
synced 2026-01-26 04:01:38 +00:00
BUILDROMS: Fix potential compiler warnings and prep for URL ROM downloads
This commit is contained in:
@@ -91,7 +91,7 @@ struct ROM_File_Descriptor {
|
||||
#endif
|
||||
|
||||
int sim_read_ROM_include(const char *include_filename,
|
||||
int *psize,
|
||||
size_t *psize,
|
||||
unsigned char **pROMData,
|
||||
unsigned int *pchecksum,
|
||||
char **prom_array_name,
|
||||
@@ -228,7 +228,7 @@ return 1;
|
||||
}
|
||||
|
||||
int sim_make_ROM_include(const char *rom_filename,
|
||||
int expected_size,
|
||||
size_t expected_size,
|
||||
unsigned int expected_checksum,
|
||||
const char *include_filename,
|
||||
const char *rom_array_name,
|
||||
@@ -238,7 +238,7 @@ FILE *rFile;
|
||||
FILE *iFile;
|
||||
time_t now;
|
||||
int bytes_written = 0;
|
||||
int include_bytes;
|
||||
size_t include_bytes;
|
||||
int c;
|
||||
int rom;
|
||||
struct stat statb;
|
||||
@@ -276,8 +276,8 @@ if (stat (rom_filename, &statb)) {
|
||||
fclose (rFile);
|
||||
return -1;
|
||||
}
|
||||
if (statb.st_size != expected_size) {
|
||||
printf ("Error: ROM file '%s' has an unexpected size: %d vs %d\n", rom_filename, (int)statb.st_size, expected_size);
|
||||
if ((size_t)statb.st_size != expected_size) {
|
||||
printf ("Error: ROM file '%s' has an unexpected size: %d vs %d\n", rom_filename, (int)statb.st_size, (int)expected_size);
|
||||
printf ("This can happen if the file was transferred or unpacked incorrectly\n");
|
||||
printf ("and in the process tried to convert line endings rather than passing\n");
|
||||
printf ("the file's contents unmodified\n");
|
||||
@@ -363,6 +363,7 @@ fprintf (iFile, "#define BOOT_CODE_ARRAY NULL\r\n");
|
||||
fprintf (iFile, "#else\r\n");
|
||||
fprintf (iFile, "#define BOOT_CODE_ARRAY %s\r\n", rom_array_name);
|
||||
fprintf (iFile, "#endif\r\n");
|
||||
fprintf (iFile, "#define BOOT_CODE_URL NULL\r\n");
|
||||
for (rom = 1; rom <= MAX_CONCURRENT_ROMS; rom++) {
|
||||
fprintf (iFile, "%s !defined(BOOT_CODE_SIZE_%d)\r\n", (rom == 1) ? "#if" : "#elif", rom);
|
||||
fprintf (iFile, "#define BOOT_CODE_SIZE_%d 0x%X\r\n", rom, (int)statb.st_size);
|
||||
@@ -374,6 +375,7 @@ for (rom = 1; rom <= MAX_CONCURRENT_ROMS; rom++) {
|
||||
fprintf (iFile, "#else\r\n");
|
||||
fprintf (iFile, "#define BOOT_CODE_ARRAY_%d %s\r\n", rom, rom_array_name);
|
||||
fprintf (iFile, "#endif\r\n");
|
||||
fprintf (iFile, "#define BOOT_CODE_URL_%d NULL\r\n", rom);
|
||||
}
|
||||
fprintf (iFile, "#endif\r\n");
|
||||
fprintf (iFile, "#if !defined(DONT_USE_INTERNAL_ROM)\r\n");
|
||||
|
||||
Reference in New Issue
Block a user