From 9efd20d7cd17eb9b9d1756998f360b6f01b9cc90 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Tue, 16 Jul 2019 23:33:07 +0300 Subject: [PATCH] Revert "Silence some GCC warnings" This reverts commit 11a9f1df21288e2d46cbcb224e60fc4ff8816fd2. --- Core/gb.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Core/gb.c b/Core/gb.c index 94e4d57..dec32a9 100644 --- a/Core/gb.c +++ b/Core/gb.c @@ -21,7 +21,7 @@ void GB_attributed_logv(GB_gameboy_t *gb, GB_log_attributes attributes, const char *fmt, va_list args) { char *string = NULL; - (void)vasprintf(&string, fmt, args); + vasprintf(&string, fmt, args); if (string) { if (gb->log_callback) { gb->log_callback(gb, string, attributes); @@ -158,12 +158,9 @@ int GB_load_boot_rom(GB_gameboy_t *gb, const char *path) GB_log(gb, "Could not open boot ROM: %s.\n", strerror(errno)); return errno; } - int ret = 0; - if (fread(gb->boot_rom, sizeof(gb->boot_rom), 1, f) != 1) { - ret = -1; - } + fread(gb->boot_rom, sizeof(gb->boot_rom), 1, f); fclose(f); - return ret; + return 0; } void GB_load_boot_rom_from_buffer(GB_gameboy_t *gb, const unsigned char *buffer, size_t size) @@ -196,7 +193,7 @@ int GB_load_rom(GB_gameboy_t *gb, const char *path) } gb->rom = malloc(gb->rom_size); memset(gb->rom, 0xFF, gb->rom_size); /* Pad with 0xFFs */ - (void) fread(gb->rom, gb->rom_size, 1, f); + fread(gb->rom, gb->rom_size, 1, f); fclose(f); GB_configure_cart(gb);