All: More warning burndown

This commit is contained in:
Vicki Pfau 2022-06-30 05:55:56 -07:00
parent 96c137c1a2
commit 84e60e99f4
6 changed files with 15 additions and 5 deletions

View File

@ -190,6 +190,9 @@ static int _decodeMemory(struct ARMMemoryAccess memory, struct ARMCore* cpu, con
case 4: case 4:
value = cpu->memory.load32(cpu, addrBase, NULL); value = cpu->memory.load32(cpu, addrBase, NULL);
break; break;
default:
// Should never be reached
abort();
} }
const char* label = NULL; const char* label = NULL;
if (symbols) { if (symbols) {

View File

@ -357,6 +357,8 @@ bool mCoreTakeScreenshotVF(struct mCore* core, struct VFile* vf) {
PNGWriteClose(png, info); PNGWriteClose(png, info);
return success; return success;
#else #else
UNUSED(core);
UNUSED(vf);
return false; return false;
#endif #endif
} }

View File

@ -782,7 +782,8 @@ bool mDebuggerEvaluateParseTree(struct mDebugger* debugger, struct ParseTree* tr
struct IntList stack; struct IntList stack;
int nextBranch; int nextBranch;
bool ok = true; bool ok = true;
int32_t tmpVal, tmpSegment; int32_t tmpVal = 0;
int32_t tmpSegment = -1;
IntListInit(&stack, 0); IntListInit(&stack, 0);
while (ok) { while (ok) {

View File

@ -583,6 +583,10 @@ void GBADebug(struct GBA* gba, uint16_t flags) {
} }
bool GBAIsROM(struct VFile* vf) { bool GBAIsROM(struct VFile* vf) {
if (!vf) {
return false;
}
#ifdef USE_ELF #ifdef USE_ELF
struct ELF* elf = ELFOpen(vf); struct ELF* elf = ELFOpen(vf);
if (elf) { if (elf) {
@ -594,9 +598,6 @@ bool GBAIsROM(struct VFile* vf) {
return isGBA; return isGBA;
} }
#endif #endif
if (!vf) {
return false;
}
uint8_t signature[sizeof(GBA_ROM_MAGIC) + sizeof(GBA_ROM_MAGIC2)]; uint8_t signature[sizeof(GBA_ROM_MAGIC) + sizeof(GBA_ROM_MAGIC2)];
if (vf->seek(vf, GBA_ROM_MAGIC_OFFSET, SEEK_SET) < 0) { if (vf->seek(vf, GBA_ROM_MAGIC_OFFSET, SEEK_SET) < 0) {

View File

@ -295,7 +295,7 @@ void mScriptContextExportNamespace(struct mScriptContext* context, const char* n
} }
void mScriptContextSetDocstring(struct mScriptContext* context, const char* key, const char* docstring) { void mScriptContextSetDocstring(struct mScriptContext* context, const char* key, const char* docstring) {
HashTableInsert(&context->docstrings, key, docstring); HashTableInsert(&context->docstrings, key, (char*) docstring);
} }
const char* mScriptContextGetDocstring(struct mScriptContext* context, const char* key) { const char* mScriptContextGetDocstring(struct mScriptContext* context, const char* key) {

View File

@ -413,6 +413,9 @@ size_t SM83Decode(uint8_t opcode, struct SM83InstructionInfo* info) {
info->op1.immediate |= opcode << ((info->opcodeSize - 2) * 8); info->op1.immediate |= opcode << ((info->opcodeSize - 2) * 8);
} }
return 0; return 0;
default:
// Should never be reached
abort();
} }
++info->opcodeSize; ++info->opcodeSize;
return decoder(opcode, info); return decoder(opcode, info);