all repos — mgba @ 11b18311b7ae40b75098aef7be65da709358e635

mGBA Game Boy Advance Emulator

All: Fix some warnings
Vicki Pfau vi@endrift.com
Mon, 06 May 2019 17:30:48 -0700
commit

11b18311b7ae40b75098aef7be65da709358e635

parent

db8bb29c5a7b7efcd4d086ee383870a2565792e2

3 files changed, 4 insertions(+), 4 deletions(-)

jump to
M src/core/cheats.csrc/core/cheats.c

@@ -230,7 +230,7 @@ for (d = 0; d < StringListSize(&directives); ++d) {

char directive[64]; ssize_t len = snprintf(directive, sizeof(directive) - 1, "!%s\n", *StringListGetPointer(&directives, d)); if (len > 1) { - vf->write(vf, directive, (size_t) len > sizeof(directive) ? sizeof(directive) : len); + vf->write(vf, directive, (size_t) len > sizeof(directive) ? sizeof(directive) : (size_t) len); } }
M src/core/core.csrc/core/core.c

@@ -217,13 +217,13 @@ return success;

} struct VFile* mCoreGetState(struct mCore* core, int slot, bool write) { - char name[PATH_MAX]; + char name[PATH_MAX + 14]; // Quash warning snprintf(name, sizeof(name), "%s.ss%i", core->dirs.baseName, slot); return core->dirs.state->openFile(core->dirs.state, name, write ? (O_CREAT | O_TRUNC | O_RDWR) : O_RDONLY); } void mCoreDeleteState(struct mCore* core, int slot) { - char name[PATH_MAX]; + char name[PATH_MAX + 14]; // Quash warning snprintf(name, sizeof(name), "%s.ss%i", core->dirs.baseName, slot); core->dirs.state->deleteFile(core->dirs.state, name); }
M src/core/library.csrc/core/library.c

@@ -341,7 +341,7 @@ sqlite3_step(library->insertPath);

} void mLibraryClear(struct mLibrary* library) { - int result = sqlite3_exec(library->db, + sqlite3_exec(library->db, " BEGIN TRANSACTION;" "\n DELETE FROM roots;" "\n DELETE FROM roms;"