From 3e512bcd514b163e67a4a50649d8cd06068646e6 Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Thu, 14 Nov 2024 15:28:10 +0100 Subject: [PATCH] Fixed clang and added a const keyword for mac --- src/common/config.cpp | 4 ++-- src/input/input_handler.cpp | 8 ++++---- src/input/input_handler.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index 8764bed39..d3bdc7895 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -801,10 +801,10 @@ std::filesystem::path getFoolproofKbmConfigFile(const std::string& game_id) { } // if empty, we only need to execute the function up until this point - if(game_id.empty()) { + if (game_id.empty()) { return default_config_file; } - + // If game-specific config doesn't exist, create it from the default config if (!std::filesystem::exists(config_file)) { std::filesystem::copy(default_config_file, config_file); diff --git a/src/input/input_handler.cpp b/src/input/input_handler.cpp index 556ce3e97..0e6e36f62 100644 --- a/src/input/input_handler.cpp +++ b/src/input/input_handler.cpp @@ -343,13 +343,13 @@ void ControllerOutput::update(bool pressed, u32 param) { case Axis::TriggerRight: // todo: verify this works (This probably works from testing, // but needs extra info (multiple input to the same trigger?)) - axis_value = SDL_clamp((pressed ? (int)param : 0) * multiplier, 0, 127); + axis_value = SDL_clamp((pressed ? (s32)param : 0) * multiplier, 0, 127); controller->Axis(0, axis, GetAxis(0, 0x80, axis_value)); return; default: break; } - axis_value = SDL_clamp((pressed ? (int)param : 0) * multiplier, -127, 127); + axis_value = SDL_clamp((pressed ? (s32)param : 0) * multiplier, -127, 127); int ax = GetAxis(-0x80, 0x80, axis_value); controller->Axis(0, axis, ax); } else { @@ -400,13 +400,13 @@ void ControllerOutput::addUpdate(bool pressed, u32 param) { case Axis::TriggerLeft: case Axis::TriggerRight: // todo: verify this works - axis_value = SDL_clamp((pressed ? (int)param : 0) * multiplier + axis_value, 0, 127); + axis_value = SDL_clamp((pressed ? (s32)param : 0) * multiplier + axis_value, 0, 127); controller->Axis(0, axis, GetAxis(0, 0x80, axis_value)); return; default: break; } - axis_value = SDL_clamp((pressed ? (int)param : 0) * multiplier + axis_value, -127, 127); + axis_value = SDL_clamp((pressed ? (s32)param : 0) * multiplier + axis_value, -127, 127); controller->Axis(0, axis, GetAxis(-0x80, 0x80, axis_value)); // LOG_INFO(Input, "Axis value delta: {} final value: {}", (pressed ? a_value : 0), // axis_value); diff --git a/src/input/input_handler.h b/src/input/input_handler.h index cd752e967..f22c7e28e 100644 --- a/src/input/input_handler.h +++ b/src/input/input_handler.h @@ -299,7 +299,7 @@ public: // todo: check if out is in the allowed array output = out; } - bool operator<(const BindingConnection& other) { + bool operator<(const BindingConnection& other) const { return binding < other.binding; } };