Fix valgrind-found uninitialized values

This commit is contained in:
Jeffrey Pfau 2013-10-18 08:42:15 -07:00
parent 3acabb01c8
commit a55b4dc87f
4 changed files with 6 additions and 1 deletions

View File

@ -106,6 +106,7 @@ void ARMReset(struct ARMCore* cpu) {
cpu->executionMode = MODE_THUMB;
_ARMSetMode(cpu, MODE_ARM);
cpu->currentPC = 0;
int currentCycles = 0;
ARM_WRITE_PC;

View File

@ -46,7 +46,9 @@ void GBASavedataDeinit(struct GBASavedata* savedata) {
default:
break;
}
close(savedata->fd);
if (savedata->fd >= 0) {
close(savedata->fd);
}
savedata->type = SAVEDATA_NONE;
}

View File

@ -58,6 +58,7 @@ void GBAInit(struct GBA* gba) {
GBAIOInit(gba);
gba->timersEnabled = 0;
memset(gba->timers, 0, sizeof(gba->timers));
gba->springIRQ = 0;

View File

@ -57,6 +57,7 @@ int main(int argc, char** argv) {
}
sigset_t signals;
sigemptyset(&signals);
sigaddset(&signals, SIGINT);
sigaddset(&signals, SIGTRAP);
pthread_sigmask(SIG_BLOCK, &signals, 0);