This commit is contained in:
nitsuja 2011-12-14 21:34:55 -08:00
commit 1ad05f7440
2 changed files with 8 additions and 4 deletions

View File

@ -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<unsigned long>(0x100000000ull)
&& value <= static_cast<unsigned long>(0xFFFFFFFF00000000ull))
return false;
}

View File

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