Rename local variables that were named s like the SDL_Surface

This commit is contained in:
Franck STAUFFER 2020-08-03 19:10:55 +02:00
parent 912c59580a
commit a7af00d1b1
Signed by: franck.stauffer
GPG Key ID: AAF5A94045CEC261
1 changed files with 9 additions and 9 deletions

View File

@ -147,15 +147,15 @@ get_file_size(FILE* f)
return 0;
}
const long s = ftell(f);
if (s == -1) {
const long size = ftell(f);
if (size == -1) {
fputs("ERROR: Failed to get file size\n", stderr);
return 0;
}
rewind(f);
return s;
return size;
}
uint_fast8_t
@ -167,21 +167,21 @@ load_rom(const char* path)
return 0;
}
const long s = get_file_size(f);
if (!s) {
const long size = get_file_size(f);
if (!size) {
if (fclose(f))
fputs("ERROR: Failed to close rom file\n", stderr);
return 0;
}
if (s > 3072) {
if (size > 3072) {
fputs("ERROR: Rom file too big\n", stderr);
if (fclose(f))
fputs("ERROR: Failed to close rom file\n", stderr);
return 0;
}
fread(memory + 0x200, sizeof(byte), s, f);
fread(memory + 0x200, sizeof(byte), size, f);
if (ferror(f)) {
fputs("ERROR: Failed to read rom file\n", stderr);
if (fclose(f))
@ -194,11 +194,11 @@ load_rom(const char* path)
return 0;
}
fprintf(stderr, "INFO: %ldB loaded from %s/%s\n", s, getenv("PWD"), path);
fprintf(stderr, "INFO: %ldB loaded from %s/%s\n", size, getenv("PWD"), path);
fputs("Loaded ROM:\n", stderr);
uint_fast8_t c = 0;
for (long t = 0; t < s; t += 2) {
for (long t = 0; t < size; t += 2) {
fprintf(
stderr, "%04X ", (memory[t + 0x200] << 8) + memory[t + 0x200 + 1]);
if (++c == 8) {