From 843e54de2efd15802c55ea9e7d94e5aad4c04080 Mon Sep 17 00:00:00 2001 From: Snowdream Date: Fri, 22 Jul 2022 13:12:29 -0400 Subject: [PATCH] deal with a couple warnings, make sure xcode project still builds --- binding/input-binding.cpp | 8 ++++---- macos/Dependencies/dependencies.make | 2 +- macos/mkxp-z.xcodeproj/project.pbxproj | 13 ++++++------- src/display/bitmap.cpp | 2 +- src/input/input.cpp | 2 +- src/settingsmenu.cpp | 2 +- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/binding/input-binding.cpp b/binding/input-binding.cpp index e8eda806..3bb8163d 100644 --- a/binding/input-binding.cpp +++ b/binding/input-binding.cpp @@ -88,7 +88,7 @@ static int getControllerButtonArg(VALUE *argv) { try { btn = strToGCButton[button]; } catch (...) { - rb_raise(rb_eRuntimeError, "%s is not a valid name of an SDL Controller button."); + rb_raise(rb_eRuntimeError, "%s is not a valid name of an SDL Controller button.", button); } return btn; @@ -300,7 +300,7 @@ RB_METHOD(inputRawKeyStates) { uint8_t *states = shState->input().rawKeyStates(); - for (int i = 0; i < shState->input().rawKeyStatesLength(); i++) + for (unsigned int i = 0; i < shState->input().rawKeyStatesLength(); i++) rb_ary_push(ret, rb_bool_new(states[i])); return ret; @@ -460,7 +460,7 @@ RB_METHOD(inputControllerRawButtonStates) { VALUE ret = rb_ary_new(); uint8_t *states = shState->input().rawButtonStates(); - for (int i = 0; i < shState->input().rawButtonStatesLength(); i++) + for (unsigned int i = 0; i < shState->input().rawButtonStatesLength(); i++) rb_ary_push(ret, rb_bool_new(states[i])); return ret; @@ -472,7 +472,7 @@ RB_METHOD(inputControllerRawAxes) { VALUE ret = rb_ary_new(); int16_t *states = shState->input().rawAxes(); - for (int i = 0; i < shState->input().rawAxesLength(); i++) + for (unsigned int i = 0; i < shState->input().rawAxesLength(); i++) rb_ary_push(ret, rb_float_new(states[i] / 32767.0)); return ret; diff --git a/macos/Dependencies/dependencies.make b/macos/Dependencies/dependencies.make index e9049b8f..47d0b35a 100644 --- a/macos/Dependencies/dependencies.make +++ b/macos/Dependencies/dependencies.make @@ -334,4 +334,4 @@ clean-compiled: -rm -rf build-$(SDK)-$(ARCH) deps-core: libtheora libvorbis pixman libpng physfs uchardet sdl2 sdl2image sdlsound sdl2ttf openal openssl -everything: deps-core autoconf ruby +everything: deps-core ruby diff --git a/macos/mkxp-z.xcodeproj/project.pbxproj b/macos/mkxp-z.xcodeproj/project.pbxproj index 197426d9..17f252c9 100644 --- a/macos/mkxp-z.xcodeproj/project.pbxproj +++ b/macos/mkxp-z.xcodeproj/project.pbxproj @@ -804,7 +804,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 3BBE880D2705AAC900A574AE /* libruby.3.1.dylib in Embed Frameworks */, 3BBE88012705A73400A574AE /* libfluidsynth.dylib in Embed Frameworks */, 3BBE88022705A73400A574AE /* libEGL.dylib in Embed Frameworks */, 3BBE88042705A73400A574AE /* libsteam_api.dylib in Embed Frameworks */, @@ -2954,7 +2953,7 @@ "$(DEPENDENCY_SEARCH_PATH)/include/SDL2", "$(DEPENDENCY_SEARCH_PATH)/include/pixman-1", "$(DEPENDENCY_SEARCH_PATH)/include/ruby-$(MRI_VERSION)", - "$(DEPENDENCY_SEARCH_PATH)/include/ruby-$(MRI_VERSION)/-darwin", + "$(DEPENDENCY_SEARCH_PATH)/include/ruby-$(MRI_VERSION)/arm64-darwin", "$(DEPENDENCY_SEARCH_PATH)/include/AL", "$(DEPENDENCY_SEARCH_PATH)/include/openssl", "$(DEPENDENCY_SEARCH_PATH)/include/uchardet", @@ -3041,7 +3040,7 @@ "$(DEPENDENCY_SEARCH_PATH)/include/SDL2", "$(DEPENDENCY_SEARCH_PATH)/include/pixman-1", "$(DEPENDENCY_SEARCH_PATH)/include/ruby-$(MRI_VERSION)", - "$(DEPENDENCY_SEARCH_PATH)/include/ruby-$(MRI_VERSION)/-darwin", + "$(DEPENDENCY_SEARCH_PATH)/include/ruby-$(MRI_VERSION)/arm64-darwin", "$(DEPENDENCY_SEARCH_PATH)/include/AL", "$(DEPENDENCY_SEARCH_PATH)/include/openssl", "$(DEPENDENCY_SEARCH_PATH)/include/uchardet", @@ -3127,10 +3126,10 @@ "$(DEPENDENCY_SEARCH_PATH)/include/SDL2", "$(DEPENDENCY_SEARCH_PATH)/include/pixman-1", "$(DEPENDENCY_SEARCH_PATH)/include/ruby-$(MRI_VERSION)", - "$(DEPENDENCY_SEARCH_PATH)/include/ruby-$(MRI_VERSION)/-darwin", + "$(DEPENDENCY_SEARCH_PATH)/include/ruby-$(MRI_VERSION)/arm64-darwin", "$(DEPENDENCY_SEARCH_PATH)/include/AL", - "$(DEPENDENCY_SEARCH_PATH)/include/uchardet", "$(DEPENDENCY_SEARCH_PATH)/include/openssl", + "$(DEPENDENCY_SEARCH_PATH)/include/uchardet", "$(PROJECT_DIR)/Dependencies/Frameworks/ANGLE", ); LD_RUNPATH_SEARCH_PATHS = ( @@ -3208,10 +3207,10 @@ "$(DEPENDENCY_SEARCH_PATH)/include/SDL2", "$(DEPENDENCY_SEARCH_PATH)/include/pixman-1", "$(DEPENDENCY_SEARCH_PATH)/include/ruby-$(MRI_VERSION)", - "$(DEPENDENCY_SEARCH_PATH)/include/ruby-$(MRI_VERSION)/-darwin", + "$(DEPENDENCY_SEARCH_PATH)/include/ruby-$(MRI_VERSION)/arm64-darwin", "$(DEPENDENCY_SEARCH_PATH)/include/AL", - "$(DEPENDENCY_SEARCH_PATH)/include/uchardet", "$(DEPENDENCY_SEARCH_PATH)/include/openssl", + "$(DEPENDENCY_SEARCH_PATH)/include/uchardet", "$(PROJECT_DIR)/Dependencies/Frameworks/ANGLE", ); LD_RUNPATH_SEARCH_PATHS = ( diff --git a/src/display/bitmap.cpp b/src/display/bitmap.cpp index f4e2558d..2948f6f7 100644 --- a/src/display/bitmap.cpp +++ b/src/display/bitmap.cpp @@ -2018,7 +2018,7 @@ void Bitmap::nextFrame() GUARD_UNANIMATED; stop(); - if (p->animation.lastFrame >= (uint32_t)p->animation.frames.size() - 1) { + if ((uint32_t)p->animation.lastFrame >= p->animation.frames.size() - 1) { if (!p->animation.loop) return; p->animation.lastFrame = 0; return; diff --git a/src/input/input.cpp b/src/input/input.cpp index 5f753521..e033c38f 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -1412,7 +1412,7 @@ unsigned int Input::rawAxesLength() { } short Input::getControllerAxisValue(SDL_GameControllerAxis axis) { - if (axis < 0 || axis >= rawAxesLength()) + if (axis < 0 || (uint32_t)axis >= rawAxesLength()) return 0; return rawAxes()[axis]; diff --git a/src/settingsmenu.cpp b/src/settingsmenu.cpp index d49f84d0..26169335 100644 --- a/src/settingsmenu.cpp +++ b/src/settingsmenu.cpp @@ -83,7 +83,7 @@ static elementsN(vButtons); std::string sourceDescString(const SourceDesc &src) { char buf[128]; - char pos; + //char pos; switch (src.type) {