diff --git a/Source/Core/Common/Src/StringUtil.cpp b/Source/Core/Common/Src/StringUtil.cpp index 94f01e66f8..cdd1016210 100644 --- a/Source/Core/Common/Src/StringUtil.cpp +++ b/Source/Core/Common/Src/StringUtil.cpp @@ -130,12 +130,13 @@ bool TryParse(const std::string &str, u32 *const output) if (!endptr || *endptr) return false; - if (value == ULONG_MAX && errno == ERANGE) + if (errno == ERANGE) return false; if (ULONG_MAX > UINT_MAX) { - // Leading bits must be either all 0 or all 1. - if ((~value | UINT_MAX) != ULONG_MAX && (value | UINT_MAX) != ULONG_MAX) + // Note: The typecasts avoid GCC warnings when long is 32 bits wide. + if (value >= static_cast(0x100000000ull) + && value <= static_cast(0xFFFFFFFF00000000ull)) return false; } diff --git a/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp index a995ae415a..82cfe2469e 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp @@ -18,7 +18,10 @@ #include "Thread.h" -#define INPUT_DETECT_THRESHOLD 0.85f +namespace +{ +const float INPUT_DETECT_THRESHOLD = 0.55f; +} ControllerInterface g_controller_interface;