mirror of
https://github.com/aaru-dps/Aaru.Compression.Native.git
synced 2025-12-16 19:24:31 +00:00
Update to lzma 23.01.
This commit is contained in:
27
3rdparty/lzma/CPP/Common/StringToInt.cpp
vendored
27
3rdparty/lzma/CPP/Common/StringToInt.cpp
vendored
@@ -26,6 +26,33 @@ CONVERT_STRING_TO_UINT_FUNC(UInt32, wchar_t, wchar_t)
|
||||
CONVERT_STRING_TO_UINT_FUNC(UInt64, char, Byte)
|
||||
CONVERT_STRING_TO_UINT_FUNC(UInt64, wchar_t, wchar_t)
|
||||
|
||||
/*
|
||||
Int32 ConvertStringToInt32(const char *s, const char **end) throw()
|
||||
{
|
||||
if (end)
|
||||
*end = s;
|
||||
const char *s2 = s;
|
||||
if (*s == '-')
|
||||
s2++;
|
||||
if (*s2 == 0)
|
||||
return 0;
|
||||
const char *end2;
|
||||
UInt32 res = ConvertStringToUInt32(s2, &end2);
|
||||
if (*s == '-')
|
||||
{
|
||||
if (res > ((UInt32)1 << (32 - 1)))
|
||||
return 0;
|
||||
}
|
||||
else if ((res & ((UInt32)1 << (32 - 1))) != 0)
|
||||
return 0;
|
||||
if (end)
|
||||
*end = end2;
|
||||
if (*s == '-')
|
||||
return -(Int32)res;
|
||||
return (Int32)res;
|
||||
}
|
||||
*/
|
||||
|
||||
Int32 ConvertStringToInt32(const wchar_t *s, const wchar_t **end) throw()
|
||||
{
|
||||
if (end)
|
||||
|
||||
Reference in New Issue
Block a user