Small useless optimizations
This commit is contained in:
parent
06b727cbc5
commit
2cccc0597f
@ -154,7 +154,7 @@ init_SDL(const char* path)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
long
|
uint64_t
|
||||||
get_file_size(FILE* f)
|
get_file_size(FILE* f)
|
||||||
{
|
{
|
||||||
if (fseek(f, 0, SEEK_END)) {
|
if (fseek(f, 0, SEEK_END)) {
|
||||||
@ -162,7 +162,7 @@ get_file_size(FILE* f)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const long size = ftell(f);
|
const int64_t size = ftell(f);
|
||||||
if (size == -1) {
|
if (size == -1) {
|
||||||
fputs("ERROR: Failed to get file size\n", stderr);
|
fputs("ERROR: Failed to get file size\n", stderr);
|
||||||
return 0;
|
return 0;
|
||||||
@ -182,7 +182,7 @@ load_rom(const char* path)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const long size = get_file_size(f);
|
const uint64_t size = get_file_size(f);
|
||||||
if (!size) {
|
if (!size) {
|
||||||
if (fclose(f))
|
if (fclose(f))
|
||||||
fputs("ERROR: Failed to close rom file\n", stderr);
|
fputs("ERROR: Failed to close rom file\n", stderr);
|
||||||
@ -214,7 +214,7 @@ load_rom(const char* path)
|
|||||||
|
|
||||||
fputs("Loaded ROM:\n", stderr);
|
fputs("Loaded ROM:\n", stderr);
|
||||||
uint_fast8_t c = 0;
|
uint_fast8_t c = 0;
|
||||||
for (long t = 0; t < size; t += 2) {
|
for (register uint64_t t = 0; t < size; t += 2) {
|
||||||
fprintf(
|
fprintf(
|
||||||
stderr, "%04X ", (memory[t + 0x200] << 8) + memory[t + 0x200 + 1]);
|
stderr, "%04X ", (memory[t + 0x200] << 8) + memory[t + 0x200 + 1]);
|
||||||
if (++c == 8) {
|
if (++c == 8) {
|
||||||
|
Loading…
Reference in New Issue
Block a user