Better fix for 573e99dd2d
This commit is contained in:
@@ -196,12 +196,12 @@ public:
|
||||
static int32 HexDigit(Char c);
|
||||
|
||||
// Parses text to unsigned integer value. Returns true if failed to convert the value.
|
||||
template<typename CharType>
|
||||
static bool ParseHex(const CharType* str, int32 length, uint32* result)
|
||||
template<typename T>
|
||||
static bool ParseHex(const T* str, int32 length, uint32* result)
|
||||
{
|
||||
uint32 sum = 0;
|
||||
const CharType* p = str;
|
||||
const CharType* end = str + length;
|
||||
const T* p = str;
|
||||
const T* end = str + length;
|
||||
if (*p == '0' && *(p + 1) == 'x')
|
||||
p += 2;
|
||||
while (*p && p < end)
|
||||
@@ -221,10 +221,10 @@ public:
|
||||
}
|
||||
|
||||
// Parses text to unsigned integer value. Returns true if failed to convert the value.
|
||||
template<typename CharType>
|
||||
static bool ParseHex(const CharType* str, uint32* result)
|
||||
template<typename T>
|
||||
static bool ParseHex(const T* str, uint32* result)
|
||||
{
|
||||
return StringUtils::ParseHex(str, StringUtils::Length(str), result);
|
||||
return StringUtils::ParseHex(str, StringUtils::Length((const T*)str), result);
|
||||
}
|
||||
|
||||
// Parses text to the unsigned integer value. Returns true if failed to convert the value.
|
||||
@@ -321,7 +321,7 @@ public:
|
||||
template<typename T, typename U>
|
||||
static bool Parse(const T* str, U* result)
|
||||
{
|
||||
return StringUtils::Parse(str, StringUtils::Length(str), result);
|
||||
return StringUtils::Parse((const T*)str, StringUtils::Length((const T*)str), (U*)result);
|
||||
}
|
||||
|
||||
// Parses text to the scalar value. Returns true if failed to convert the value.
|
||||
|
||||
Reference in New Issue
Block a user