all repos — mgba @ a55b4dc87f31bbb4dc9629d1335270f32b00db29

mGBA Game Boy Advance Emulator

Fix valgrind-found uninitialized values
Jeffrey Pfau jeffrey@endrift.com
Fri, 18 Oct 2013 08:42:15 -0700
commit

a55b4dc87f31bbb4dc9629d1335270f32b00db29

parent

3acabb01c88bcd5f95bb2e9501657e288318675c

4 files changed, 6 insertions(+), 1 deletions(-)

jump to
M src/arm/arm.csrc/arm/arm.c

@@ -106,6 +106,7 @@

cpu->executionMode = MODE_THUMB; _ARMSetMode(cpu, MODE_ARM); + cpu->currentPC = 0; int currentCycles = 0; ARM_WRITE_PC;
M src/gba/gba-savedata.csrc/gba/gba-savedata.c

@@ -46,7 +46,9 @@ break;

default: break; } - close(savedata->fd); + if (savedata->fd >= 0) { + close(savedata->fd); + } savedata->type = SAVEDATA_NONE; }
M src/gba/gba.csrc/gba/gba.c

@@ -58,6 +58,7 @@ GBAAudioInit(&gba->audio);

GBAIOInit(gba); + gba->timersEnabled = 0; memset(gba->timers, 0, sizeof(gba->timers)); gba->springIRQ = 0;
M src/platform/sdl/gl-main.csrc/platform/sdl/gl-main.c

@@ -57,6 +57,7 @@ return 1;

} sigset_t signals; + sigemptyset(&signals); sigaddset(&signals, SIGINT); sigaddset(&signals, SIGTRAP); pthread_sigmask(SIG_BLOCK, &signals, 0);