From f83c4bda686c010449f123de9adc96f3a66fb585 Mon Sep 17 00:00:00 2001 From: no Date: Tue, 5 Jan 2016 19:09:10 -0500 Subject: [PATCH] [core] fixed strtoul() for more compile errors --- Source/Project64-core/N64System/CheatClass.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Project64-core/N64System/CheatClass.cpp b/Source/Project64-core/N64System/CheatClass.cpp index 5905cf8fa..26d2d7748 100644 --- a/Source/Project64-core/N64System/CheatClass.cpp +++ b/Source/Project64-core/N64System/CheatClass.cpp @@ -40,7 +40,7 @@ bool CCheats::LoadCode(int CheatNo, const char * CheatString) { GAMESHARK_CODE CodeEntry; - CodeEntry.Command = std::strtoul(ReadPos, 0, 16); + CodeEntry.Command = strtoul(ReadPos, 0, 16); ReadPos = strchr(ReadPos, ' '); if (ReadPos == NULL) { break; } ReadPos += 1; @@ -50,27 +50,27 @@ bool CCheats::LoadCode(int CheatNo, const char * CheatString) if (CheatNo < 0 || CheatNo > MaxCheats) { return false; } stdstr CheatExt = g_Settings->LoadStringIndex(Cheat_Extension, CheatNo); if (CheatExt.empty()) { return false; } - CodeEntry.Value = CheatExt[0] == '$' ? (uint16_t)std::strtoul(&CheatExt.c_str()[1], 0, 16) : (uint16_t)atol(CheatExt.c_str()); + CodeEntry.Value = CheatExt[0] == '$' ? (uint16_t)strtoul(&CheatExt.c_str()[1], 0, 16) : (uint16_t)atol(CheatExt.c_str()); } else if (strncmp(ReadPos, "??", 2) == 0) { if (CheatNo < 0 || CheatNo > MaxCheats) { return false; } stdstr CheatExt = g_Settings->LoadStringIndex(Cheat_Extension, CheatNo); if (CheatExt.empty()) { return false; } - CodeEntry.Value = (uint8_t)(std::strtoul(ReadPos, 0, 16)); - CodeEntry.Value |= (CheatExt[0] == '$' ? (uint8_t)std::strtoul(&CheatExt.c_str()[1], 0, 16) : (uint8_t)atol(CheatExt.c_str())) << 16; + CodeEntry.Value = (uint8_t)(strtoul(ReadPos, 0, 16)); + CodeEntry.Value |= (CheatExt[0] == '$' ? (uint8_t)strtoul(&CheatExt.c_str()[1], 0, 16) : (uint8_t)atol(CheatExt.c_str())) << 16; } else if (strncmp(&ReadPos[2], "??", 2) == 0) { if (CheatNo < 0 || CheatNo > MaxCheats) { return false; } stdstr CheatExt = g_Settings->LoadStringIndex(Cheat_Extension, CheatNo); if (CheatExt.empty()) { return false; } - CodeEntry.Value = (uint16_t)(std::strtoul(ReadPos, 0, 16) << 16); - CodeEntry.Value |= CheatExt[0] == '$' ? (uint8_t)std::strtoul(&CheatExt.c_str()[1], 0, 16) : (uint8_t)atol(CheatExt.c_str()); + CodeEntry.Value = (uint16_t)(strtoul(ReadPos, 0, 16) << 16); + CodeEntry.Value |= CheatExt[0] == '$' ? (uint8_t)strtoul(&CheatExt.c_str()[1], 0, 16) : (uint8_t)atol(CheatExt.c_str()); } else { - CodeEntry.Value = (uint16_t)std::strtoul(ReadPos, 0, 16); + CodeEntry.Value = (uint16_t)strtoul(ReadPos, 0, 16); } Code.push_back(CodeEntry); @@ -264,7 +264,7 @@ bool CCheats::IsValid16BitCode(const char * CheatString) { GAMESHARK_CODE CodeEntry; - CodeEntry.Command = std::strtoul(ReadPos, 0, 16); + CodeEntry.Command = strtoul(ReadPos, 0, 16); ReadPos = strchr(ReadPos, ' '); if (ReadPos == NULL) { break; } ReadPos += 1;