From 26784d7453ab7f7bada5a30fe4afe205ad65c43d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 5 Jan 2020 00:17:58 +0100 Subject: [PATCH] - reverted the clamping when assigning to FScanner::Number. This broke unsigned integer parsing without explicitly declaring the constant unsigned. --- src/utility/sc_man.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utility/sc_man.cpp b/src/utility/sc_man.cpp index 3901a1f44..faea890a2 100644 --- a/src/utility/sc_man.cpp +++ b/src/utility/sc_man.cpp @@ -600,13 +600,13 @@ bool FScanner::GetToken () { TokenType = TK_UIntConst; BigNumber = (int64_t)strtoull(String, &stopper, 0); - Number = (int)clamp(BigNumber, 0, UINT_MAX); + Number = (int)BigNumber;// clamp(BigNumber, 0, UINT_MAX); Float = (unsigned)Number; } else { BigNumber = strtoll(String, &stopper, 0); - Number = (int)clamp(BigNumber, INT_MIN, INT_MAX); + Number = (int)BigNumber;// clamp(BigNumber, 0, UINT_MAX); Float = Number; } } @@ -708,7 +708,7 @@ bool FScanner::GetNumber () else { BigNumber = strtoll(String, &stopper, 0); - Number = (int)clamp(BigNumber, INT_MIN, INT_MAX); + Number = (int)BigNumber;// clamp(BigNumber, 0, UINT_MAX); if (*stopper != 0) { ScriptError ("SC_GetNumber: Bad numeric constant \"%s\".", String); @@ -765,7 +765,7 @@ bool FScanner::CheckNumber () else { BigNumber = strtoll (String, &stopper, 0); - Number = (int)clamp(BigNumber, INT_MIN, INT_MAX); + Number = (int)BigNumber;// clamp(BigNumber, 0, UINT_MAX); if (*stopper != 0) { UnGet();