All: Fix some warnings
Vicki Pfau vi@endrift.com
Thu, 27 Feb 2020 21:11:23 -0800
4 files changed,
16 insertions(+),
10 deletions(-)
M
src/debugger/cli-debugger.c
→
src/debugger/cli-debugger.c
@@ -977,7 +977,7 @@ break;
case DEBUGGER_ENTER_BREAKPOINT: if (info) { if (info->pointId > 0) { - cliDebugger->backend->printf(cliDebugger->backend, "Hit breakpoint %zi at 0x%08X\n", info->pointId, info->address); + cliDebugger->backend->printf(cliDebugger->backend, "Hit breakpoint %" PRIz "i at 0x%08X\n", info->pointId, info->address); } else { cliDebugger->backend->printf(cliDebugger->backend, "Hit unknown breakpoint at 0x%08X\n", info->address); }@@ -988,9 +988,9 @@ break;
case DEBUGGER_ENTER_WATCHPOINT: if (info) { if (info->type.wp.accessType & WATCHPOINT_WRITE) { - cliDebugger->backend->printf(cliDebugger->backend, "Hit watchpoint %zi at 0x%08X: (new value = 0x%08X, old value = 0x%08X)\n", info->pointId, info->address, info->type.wp.newValue, info->type.wp.oldValue); + cliDebugger->backend->printf(cliDebugger->backend, "Hit watchpoint %" PRIz "i at 0x%08X: (new value = 0x%08X, old value = 0x%08X)\n", info->pointId, info->address, info->type.wp.newValue, info->type.wp.oldValue); } else { - cliDebugger->backend->printf(cliDebugger->backend, "Hit watchpoint %zi at 0x%08X: (value = 0x%08X)\n", info->pointId, info->address, info->type.wp.oldValue); + cliDebugger->backend->printf(cliDebugger->backend, "Hit watchpoint %" PRIz "i at 0x%08X: (value = 0x%08X)\n", info->pointId, info->address, info->type.wp.oldValue); } } else { cliDebugger->backend->printf(cliDebugger->backend, "Hit watchpoint\n");
M
src/gba/core.c
→
src/gba/core.c
@@ -367,7 +367,6 @@ struct GBAVideoRenderer* renderer = NULL;
if (gbacore->renderer.outputBuffer) { renderer = &gbacore->renderer.d; } - int fakeBool; #if defined(BUILD_GLES2) || defined(BUILD_GLES3) if (gbacore->glRenderer.outputTex != (unsigned) -1 && mCoreConfigGetIntValue(&core->config, "hwaccelVideo", &fakeBool) && fakeBool) { mCoreConfigGetIntValue(&core->config, "videoScale", &gbacore->glRenderer.scale);@@ -552,7 +551,7 @@ struct GBAVideoRenderer* renderer = NULL;
if (gbacore->renderer.outputBuffer) { renderer = &gbacore->renderer.d; } - int fakeBool; + int fakeBool ATTRIBUTE_UNUSED; #if defined(BUILD_GLES2) || defined(BUILD_GLES3) if (gbacore->glRenderer.outputTex != (unsigned) -1 && mCoreConfigGetIntValue(&core->config, "hwaccelVideo", &fakeBool) && fakeBool) { mCoreConfigGetIntValue(&core->config, "videoScale", &gbacore->glRenderer.scale);
M
src/platform/sdl/sdl-events.c
→
src/platform/sdl/sdl-events.c
@@ -249,6 +249,9 @@ }
} --events->playersAttached; CircleBufferDeinit(&player->rotation.zHistory); +#if SDL_VERSION_ATLEAST(2, 0, 0) + CircleBufferDeinit(&player->rumble.history); +#endif } void mSDLPlayerLoadConfig(struct mSDLPlayer* context, const struct Configuration* config) {@@ -352,10 +355,10 @@ if (!sdlJoystick) {
continue; } ssize_t joysticks[MAX_PLAYERS]; - size_t i; + ssize_t i; // Pointers can get invalidated, so we'll need to refresh them for (i = 0; i < events->playersAttached && i < MAX_PLAYERS; ++i) { - joysticks[i] = events->players[i]->joystick ? SDL_JoystickListIndex(&events->joysticks, events->players[i]->joystick) : SIZE_MAX; + joysticks[i] = events->players[i]->joystick ? (ssize_t) SDL_JoystickListIndex(&events->joysticks, events->players[i]->joystick) : -1; events->players[i]->joystick = NULL; } struct SDL_JoystickCombo* joystick = SDL_JoystickListAppend(&events->joysticks);@@ -366,7 +369,7 @@ #if SDL_VERSION_ATLEAST(2, 0, 0)
joystick->haptic = SDL_HapticOpenFromJoystick(joystick->joystick); #endif for (i = 0; i < events->playersAttached && i < MAX_PLAYERS; ++i) { - if (joysticks[i] != SIZE_MAX) { + if (joysticks[i] != -1) { events->players[i]->joystick = SDL_JoystickListGetPointer(&events->joysticks, joysticks[i]); } }@@ -397,7 +400,11 @@ if (events->players[i]->joystick) {
continue; } events->players[i]->joystick = joystick; - if (config && joystickName) { + if (config +#if !SDL_VERSION_ATLEAST(2, 0, 0) + && joystickName +#endif + ) { mInputProfileLoad(events->players[i]->bindings, SDL_BINDING_BUTTON, config, joystickName); } break;
M
src/platform/test/fuzz-main.c
→
src/platform/test/fuzz-main.c
@@ -44,7 +44,7 @@
int main(int argc, char** argv) { signal(SIGINT, _fuzzShutdown); - struct FuzzOpts fuzzOpts = { false, 0, 0, 0, 0 }; + struct FuzzOpts fuzzOpts = { false, 0, 0, 0 }; struct mSubParser subparser = { .usage = FUZZ_USAGE, .parse = _parseFuzzOpts,