mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Renamed OVERFLOW and UNDERFLOW to INT64_OVERFLOW and INT64_UNDERFLOW.
This commit is contained in:
parent
2ba46fa2dd
commit
eac1dced8f
@ -115,8 +115,8 @@ char_value (char c, int base)
|
|||||||
__int64
|
__int64
|
||||||
str_to_int64 (const char *nptr, char **endptr, int base)
|
str_to_int64 (const char *nptr, char **endptr, int base)
|
||||||
{
|
{
|
||||||
#define OVERFLOW 9223372036854775807I64
|
#define INT64_OVERFLOW 9223372036854775807I64
|
||||||
#define UNDERFLOW (-OVERFLOW - 1)
|
#define INT64_UNDERFLOW (-INT64_OVERFLOW - 1)
|
||||||
|
|
||||||
__int64 result = 0;
|
__int64 result = 0;
|
||||||
int negative;
|
int negative;
|
||||||
@ -169,7 +169,7 @@ str_to_int64 (const char *nptr, char **endptr, int base)
|
|||||||
__int64 newresult = base * result + val;
|
__int64 newresult = base * result + val;
|
||||||
if (newresult < result)
|
if (newresult < result)
|
||||||
{
|
{
|
||||||
result = OVERFLOW;
|
result = INT64_OVERFLOW;
|
||||||
errno = ERANGE;
|
errno = ERANGE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -185,7 +185,7 @@ str_to_int64 (const char *nptr, char **endptr, int base)
|
|||||||
__int64 newresult = base * result - val;
|
__int64 newresult = base * result - val;
|
||||||
if (newresult > result)
|
if (newresult > result)
|
||||||
{
|
{
|
||||||
result = UNDERFLOW;
|
result = INT64_UNDERFLOW;
|
||||||
errno = ERANGE;
|
errno = ERANGE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user