diff options
Diffstat (limited to 'src/input_common')
| -rw-r--r-- | src/input_common/CMakeLists.txt | 19 | ||||
| -rwxr-xr-x | src/input_common/analog_from_button.cpp | 1 | ||||
| -rw-r--r-- | src/input_common/gcadapter/gc_adapter.cpp | 7 | ||||
| -rw-r--r-- | src/input_common/main.cpp | 4 | ||||
| -rw-r--r-- | src/input_common/mouse/mouse_poller.cpp | 3 | ||||
| -rw-r--r-- | src/input_common/touch_from_button.cpp | 2 | ||||
| -rw-r--r-- | src/input_common/udp/client.cpp | 4 | ||||
| -rw-r--r-- | src/input_common/udp/protocol.h | 7 |
8 files changed, 12 insertions, 35 deletions
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt index 7c5763f9c..c4283a952 100644 --- a/src/input_common/CMakeLists.txt +++ b/src/input_common/CMakeLists.txt | |||
| @@ -34,28 +34,17 @@ if (MSVC) | |||
| 34 | /W4 | 34 | /W4 |
| 35 | /WX | 35 | /WX |
| 36 | 36 | ||
| 37 | # 'expression' : signed/unsigned mismatch | 37 | /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data |
| 38 | /we4018 | 38 | /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data |
| 39 | # 'argument' : conversion from 'type1' to 'type2', possible loss of data (floating-point) | 39 | /we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch |
| 40 | /we4244 | 40 | /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data |
| 41 | # 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch | ||
| 42 | /we4245 | ||
| 43 | # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data | ||
| 44 | /we4254 | ||
| 45 | # 'var' : conversion from 'size_t' to 'type', possible loss of data | ||
| 46 | /we4267 | ||
| 47 | # 'context' : truncation from 'type1' to 'type2' | ||
| 48 | /we4305 | ||
| 49 | ) | 41 | ) |
| 50 | else() | 42 | else() |
| 51 | target_compile_options(input_common PRIVATE | 43 | target_compile_options(input_common PRIVATE |
| 52 | -Werror | 44 | -Werror |
| 53 | -Werror=conversion | 45 | -Werror=conversion |
| 54 | -Werror=ignored-qualifiers | 46 | -Werror=ignored-qualifiers |
| 55 | -Werror=implicit-fallthrough | ||
| 56 | -Werror=reorder | ||
| 57 | -Werror=shadow | 47 | -Werror=shadow |
| 58 | -Werror=sign-compare | ||
| 59 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> | 48 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> |
| 60 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable> | 49 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable> |
| 61 | -Werror=unused-variable | 50 | -Werror=unused-variable |
diff --git a/src/input_common/analog_from_button.cpp b/src/input_common/analog_from_button.cpp index 100138d11..2fafd077f 100755 --- a/src/input_common/analog_from_button.cpp +++ b/src/input_common/analog_from_button.cpp | |||
| @@ -27,6 +27,7 @@ public: | |||
| 27 | down->SetCallback(callbacks); | 27 | down->SetCallback(callbacks); |
| 28 | left->SetCallback(callbacks); | 28 | left->SetCallback(callbacks); |
| 29 | right->SetCallback(callbacks); | 29 | right->SetCallback(callbacks); |
| 30 | modifier->SetCallback(callbacks); | ||
| 30 | } | 31 | } |
| 31 | 32 | ||
| 32 | bool IsAngleGreater(float old_angle, float new_angle) const { | 33 | bool IsAngleGreater(float old_angle, float new_angle) const { |
diff --git a/src/input_common/gcadapter/gc_adapter.cpp b/src/input_common/gcadapter/gc_adapter.cpp index 320f51ee6..a2f1bb67c 100644 --- a/src/input_common/gcadapter/gc_adapter.cpp +++ b/src/input_common/gcadapter/gc_adapter.cpp | |||
| @@ -5,14 +5,7 @@ | |||
| 5 | #include <chrono> | 5 | #include <chrono> |
| 6 | #include <thread> | 6 | #include <thread> |
| 7 | 7 | ||
| 8 | #ifdef _MSC_VER | ||
| 9 | #pragma warning(push) | ||
| 10 | #pragma warning(disable : 4200) // nonstandard extension used : zero-sized array in struct/union | ||
| 11 | #endif | ||
| 12 | #include <libusb.h> | 8 | #include <libusb.h> |
| 13 | #ifdef _MSC_VER | ||
| 14 | #pragma warning(pop) | ||
| 15 | #endif | ||
| 16 | 9 | ||
| 17 | #include "common/logging/log.h" | 10 | #include "common/logging/log.h" |
| 18 | #include "common/param_package.h" | 11 | #include "common/param_package.h" |
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp index 7399c3648..8de3d4520 100644 --- a/src/input_common/main.cpp +++ b/src/input_common/main.cpp | |||
| @@ -294,8 +294,8 @@ void InputSubsystem::ReloadInputDevices() { | |||
| 294 | impl->udp->ReloadSockets(); | 294 | impl->udp->ReloadSockets(); |
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | std::vector<std::unique_ptr<Polling::DevicePoller>> InputSubsystem::GetPollers( | 297 | std::vector<std::unique_ptr<Polling::DevicePoller>> InputSubsystem::GetPollers([ |
| 298 | Polling::DeviceType type) const { | 298 | [maybe_unused]] Polling::DeviceType type) const { |
| 299 | #ifdef HAVE_SDL2 | 299 | #ifdef HAVE_SDL2 |
| 300 | return impl->sdl->GetPollers(type); | 300 | return impl->sdl->GetPollers(type); |
| 301 | #else | 301 | #else |
diff --git a/src/input_common/mouse/mouse_poller.cpp b/src/input_common/mouse/mouse_poller.cpp index 758f7af1f..45b3d7340 100644 --- a/src/input_common/mouse/mouse_poller.cpp +++ b/src/input_common/mouse/mouse_poller.cpp | |||
| @@ -84,7 +84,8 @@ public: | |||
| 84 | std::lock_guard lock{mutex}; | 84 | std::lock_guard lock{mutex}; |
| 85 | const auto axis_value = | 85 | const auto axis_value = |
| 86 | static_cast<float>(mouse_input->GetMouseState(button).axis.at(axis)); | 86 | static_cast<float>(mouse_input->GetMouseState(button).axis.at(axis)); |
| 87 | return axis_value * Settings::values.mouse_panning_sensitivity / (100.0f * range); | 87 | const float sensitivity = Settings::values.mouse_panning_sensitivity.GetValue(); |
| 88 | return axis_value * sensitivity / (100.0f * range); | ||
| 88 | } | 89 | } |
| 89 | 90 | ||
| 90 | std::pair<float, float> GetAnalog(u32 analog_axis_x, u32 analog_axis_y) const { | 91 | std::pair<float, float> GetAnalog(u32 analog_axis_x, u32 analog_axis_y) const { |
diff --git a/src/input_common/touch_from_button.cpp b/src/input_common/touch_from_button.cpp index 5b24fd8bf..7878a56d7 100644 --- a/src/input_common/touch_from_button.cpp +++ b/src/input_common/touch_from_button.cpp | |||
| @@ -13,7 +13,7 @@ class TouchFromButtonDevice final : public Input::TouchDevice { | |||
| 13 | public: | 13 | public: |
| 14 | TouchFromButtonDevice() { | 14 | TouchFromButtonDevice() { |
| 15 | const auto button_index = | 15 | const auto button_index = |
| 16 | static_cast<std::size_t>(Settings::values.touch_from_button_map_index); | 16 | static_cast<u64>(Settings::values.touch_from_button_map_index.GetValue()); |
| 17 | const auto& buttons = Settings::values.touch_from_button_maps[button_index].buttons; | 17 | const auto& buttons = Settings::values.touch_from_button_maps[button_index].buttons; |
| 18 | 18 | ||
| 19 | for (const auto& config_entry : buttons) { | 19 | for (const auto& config_entry : buttons) { |
diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp index bc1dfab3d..9b0aec797 100644 --- a/src/input_common/udp/client.cpp +++ b/src/input_common/udp/client.cpp | |||
| @@ -201,7 +201,7 @@ bool Client::DeviceConnected(std::size_t pad) const { | |||
| 201 | void Client::ReloadSockets() { | 201 | void Client::ReloadSockets() { |
| 202 | Reset(); | 202 | Reset(); |
| 203 | 203 | ||
| 204 | std::stringstream servers_ss(Settings::values.udp_input_servers); | 204 | std::stringstream servers_ss(static_cast<std::string>(Settings::values.udp_input_servers)); |
| 205 | std::string server_token; | 205 | std::string server_token; |
| 206 | std::size_t client = 0; | 206 | std::size_t client = 0; |
| 207 | while (std::getline(servers_ss, server_token, ',')) { | 207 | while (std::getline(servers_ss, server_token, ',')) { |
| @@ -370,7 +370,7 @@ std::optional<std::size_t> Client::GetUnusedFingerID() const { | |||
| 370 | 370 | ||
| 371 | void Client::UpdateTouchInput(Response::TouchPad& touch_pad, std::size_t client, std::size_t id) { | 371 | void Client::UpdateTouchInput(Response::TouchPad& touch_pad, std::size_t client, std::size_t id) { |
| 372 | // TODO: Use custom calibration per device | 372 | // TODO: Use custom calibration per device |
| 373 | const Common::ParamPackage touch_param(Settings::values.touch_device); | 373 | const Common::ParamPackage touch_param(Settings::values.touch_device.GetValue()); |
| 374 | const u16 min_x = static_cast<u16>(touch_param.Get("min_x", 100)); | 374 | const u16 min_x = static_cast<u16>(touch_param.Get("min_x", 100)); |
| 375 | const u16 min_y = static_cast<u16>(touch_param.Get("min_y", 50)); | 375 | const u16 min_y = static_cast<u16>(touch_param.Get("min_y", 50)); |
| 376 | const u16 max_x = static_cast<u16>(touch_param.Get("max_x", 1800)); | 376 | const u16 max_x = static_cast<u16>(touch_param.Get("max_x", 1800)); |
diff --git a/src/input_common/udp/protocol.h b/src/input_common/udp/protocol.h index a3d276697..1bdc9209e 100644 --- a/src/input_common/udp/protocol.h +++ b/src/input_common/udp/protocol.h | |||
| @@ -8,14 +8,7 @@ | |||
| 8 | #include <optional> | 8 | #include <optional> |
| 9 | #include <type_traits> | 9 | #include <type_traits> |
| 10 | 10 | ||
| 11 | #ifdef _MSC_VER | ||
| 12 | #pragma warning(push) | ||
| 13 | #pragma warning(disable : 4701) | ||
| 14 | #endif | ||
| 15 | #include <boost/crc.hpp> | 11 | #include <boost/crc.hpp> |
| 16 | #ifdef _MSC_VER | ||
| 17 | #pragma warning(pop) | ||
| 18 | #endif | ||
| 19 | 12 | ||
| 20 | #include "common/bit_field.h" | 13 | #include "common/bit_field.h" |
| 21 | #include "common/swap.h" | 14 | #include "common/swap.h" |