mirror of https://github.com/mgba-emu/mgba.git
Fix valgrind-found uninitialized values
This commit is contained in:
parent
3acabb01c8
commit
a55b4dc87f
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ void GBAInit(struct GBA* gba) {
|
|||
|
||||
GBAIOInit(gba);
|
||||
|
||||
gba->timersEnabled = 0;
|
||||
memset(gba->timers, 0, sizeof(gba->timers));
|
||||
|
||||
gba->springIRQ = 0;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue