From 626542fd1b563c5b2d1ff7ca40781f8679d387cb Mon Sep 17 00:00:00 2001 From: Carsten Teibes Date: Sun, 29 Dec 2024 02:47:33 +0100 Subject: [PATCH] chore: fix some compiler warnings --- src/io/file.cpp | 2 +- src/io/gfx/video.cpp | 8 ++++++-- src/menu/mainmenu.cpp | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/io/file.cpp b/src/io/file.cpp index 0fc57c24..082fe259 100644 --- a/src/io/file.cpp +++ b/src/io/file.cpp @@ -449,7 +449,7 @@ char * File::loadTerminatedString (int maxSize) { * @return The new string */ char * File::loadFileName () { - int length; + int length = 0; char *string = new char[13]; for (int i = 0; i < 9; i++) { diff --git a/src/io/gfx/video.cpp b/src/io/gfx/video.cpp index f96df4e3..6d7265f7 100644 --- a/src/io/gfx/video.cpp +++ b/src/io/gfx/video.cpp @@ -278,6 +278,8 @@ void Video::deinit () { bool Video::reset (int width, int height) { #ifdef NO_RESIZE + (void)width; + (void)height; screenW = DEFAULT_SCREEN_WIDTH; screenH = DEFAULT_SCREEN_HEIGHT; fullscreen = true; @@ -600,7 +602,6 @@ void Video::expose () { * @param event The system event. Events not affecting video will be ignored */ void Video::update (SDL_Event *event) { - #if !defined(FULLSCREEN_ONLY) || !defined(NO_RESIZE) switch (event->type) { @@ -643,8 +644,9 @@ void Video::update (SDL_Event *event) { #endif } +#else + (void)event; #endif - } @@ -748,6 +750,8 @@ void Video::moviePlayback (bool status) { canvasH = movieH; } SDL_RenderSetLogicalSize(renderer, canvasW, canvasH); +#else + (void)status; #endif } diff --git a/src/menu/mainmenu.cpp b/src/menu/mainmenu.cpp index ccee0209..84c7cf5f 100644 --- a/src/menu/mainmenu.cpp +++ b/src/menu/mainmenu.cpp @@ -58,6 +58,7 @@ MainMenu::MainMenu () { if (res == TINFL_DECOMPRESS_MEM_TO_MEM_FAILED || res != oj_logo.size) { LOG_WARN("Could not uncompress logo (expected: %d, actual: %zu).", oj_logo.size, res); + logo = nullptr; } else {