mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 10:35:50 +00:00
static builds / change overflow to overflow_float for some compilers
This commit is contained in:
@@ -206,7 +206,7 @@ namespace hook_api
|
|||||||
MANTISSA_UNDERSIZED = -27,
|
MANTISSA_UNDERSIZED = -27,
|
||||||
EXPONENT_OVERSIZED = -28,
|
EXPONENT_OVERSIZED = -28,
|
||||||
EXPONENT_UNDERSIZED = -29,
|
EXPONENT_UNDERSIZED = -29,
|
||||||
OVERFLOW = -30, // if an operation with a float results in an overflow
|
OVERFLOW_FLOAT = -30, // if an operation with a float results in an overflow
|
||||||
NOT_IOU_AMOUNT = -31,
|
NOT_IOU_AMOUNT = -31,
|
||||||
NOT_AN_AMOUNT = -32,
|
NOT_AN_AMOUNT = -32,
|
||||||
CANT_RETURN_NEGATIVE = -33,
|
CANT_RETURN_NEGATIVE = -33,
|
||||||
|
|||||||
@@ -4050,7 +4050,7 @@ inline int64_t mulratio_internal
|
|||||||
}
|
}
|
||||||
catch (std::overflow_error& e)
|
catch (std::overflow_error& e)
|
||||||
{
|
{
|
||||||
return OVERFLOW;
|
return OVERFLOW_FLOAT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4084,7 +4084,7 @@ inline int64_t float_multiply_internal_parts(
|
|||||||
while (man_lo > maxMantissa)
|
while (man_lo > maxMantissa)
|
||||||
{
|
{
|
||||||
if (exp_out > maxExponent)
|
if (exp_out > maxExponent)
|
||||||
return OVERFLOW;
|
return OVERFLOW_FLOAT;
|
||||||
man_lo /= 10;
|
man_lo /= 10;
|
||||||
exp_out++;
|
exp_out++;
|
||||||
}
|
}
|
||||||
@@ -4096,11 +4096,11 @@ inline int64_t float_multiply_internal_parts(
|
|||||||
{
|
{
|
||||||
man_shifted -=32;
|
man_shifted -=32;
|
||||||
if (mulratio_internal(man_out, exp_out, false, 0xFFFFFFFFU, 1) < 0)
|
if (mulratio_internal(man_out, exp_out, false, 0xFFFFFFFFU, 1) < 0)
|
||||||
return OVERFLOW;
|
return OVERFLOW_FLOAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mulratio_internal(man_out, exp_out, false, 1U << man_shifted, 1) < 0)
|
if (mulratio_internal(man_out, exp_out, false, 1U << man_shifted, 1) < 0)
|
||||||
return OVERFLOW;
|
return OVERFLOW_FLOAT;
|
||||||
|
|
||||||
// now we have our product
|
// now we have our product
|
||||||
return make_float(man_out, exp_out);
|
return make_float(man_out, exp_out);
|
||||||
@@ -4136,7 +4136,7 @@ DEFINE_HOOK_FUNCTION(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (exp1 > dp)
|
if (exp1 > dp)
|
||||||
return OVERFLOW;
|
return OVERFLOW_FLOAT;
|
||||||
|
|
||||||
while (exp1 < dp && man1 > 0)
|
while (exp1 < dp && man1 > 0)
|
||||||
{
|
{
|
||||||
@@ -4195,7 +4195,7 @@ DEFINE_HOOK_FUNCTION(
|
|||||||
int32_t exp1 = get_exponent(float1);
|
int32_t exp1 = get_exponent(float1);
|
||||||
|
|
||||||
if (mulratio_internal(man1, exp1, round_up > 0, numerator, denominator) < 0)
|
if (mulratio_internal(man1, exp1, round_up > 0, numerator, denominator) < 0)
|
||||||
return OVERFLOW;
|
return OVERFLOW_FLOAT;
|
||||||
|
|
||||||
return make_float(man1, exp1);
|
return make_float(man1, exp1);
|
||||||
}
|
}
|
||||||
@@ -4251,7 +4251,7 @@ DEFINE_HOOK_FUNCTION(
|
|||||||
}
|
}
|
||||||
catch (std::overflow_error& e)
|
catch (std::overflow_error& e)
|
||||||
{
|
{
|
||||||
return OVERFLOW;
|
return OVERFLOW_FLOAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4281,7 +4281,7 @@ DEFINE_HOOK_FUNCTION(
|
|||||||
}
|
}
|
||||||
catch (std::overflow_error& e)
|
catch (std::overflow_error& e)
|
||||||
{
|
{
|
||||||
return OVERFLOW;
|
return OVERFLOW_FLOAT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user