From 73dfcc15a51e230f8cbfa0fb1cb807db9bd0e722 Mon Sep 17 00:00:00 2001 From: Minty-Meeo <45425365+Minty-Meeo@users.noreply.github.com> Date: Thu, 22 Sep 2022 11:30:32 -0500 Subject: [PATCH] Use std::llround in MapFloat I don't see why not. --- Source/Core/InputCommon/ControllerEmu/ControllerEmu.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Core/InputCommon/ControllerEmu/ControllerEmu.h b/Source/Core/InputCommon/ControllerEmu/ControllerEmu.h index 104240023d..32b755eb30 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControllerEmu.h +++ b/Source/Core/InputCommon/ControllerEmu/ControllerEmu.h @@ -206,9 +206,9 @@ public: static_assert(std::is_integral(), "T is only sane for int types."); static_assert(std::is_floating_point(), "F is only sane for float types."); - static_assert(std::numeric_limits::min() <= std::numeric_limits::min() && - std::numeric_limits::max() >= std::numeric_limits::max(), - "long is not a superset of T. use of std::lround is not sane."); + static_assert(std::numeric_limits::min() <= std::numeric_limits::min() && + std::numeric_limits::max() >= std::numeric_limits::max(), + "long long is not a superset of T. use of std::llround is not sane."); // Here we round when converting from float to int. // After applying our deadzone, resizing, and reshaping math @@ -216,9 +216,9 @@ public: // Casting would round down but rounding will yield our "zero_value". if (input_value > 0) - return T(std::lround((pos_1_value - zero_value) * input_value + zero_value)); + return T(std::llround((pos_1_value - zero_value) * input_value + zero_value)); else - return T(std::lround((zero_value - neg_1_value) * input_value + zero_value)); + return T(std::llround((zero_value - neg_1_value) * input_value + zero_value)); } protected: