deal with a couple warnings, make sure xcode project still builds

This commit is contained in:
Snowdream 2022-07-22 13:12:29 -04:00
parent 072d131273
commit 843e54de2e
6 changed files with 14 additions and 15 deletions

View file

@ -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;

View file

@ -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

View file

@ -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 = (

View file

@ -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;

View file

@ -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];

View file

@ -83,7 +83,7 @@ static elementsN(vButtons);
std::string sourceDescString(const SourceDesc &src)
{
char buf[128];
char pos;
//char pos;
switch (src.type)
{