Fix more nonmatchings (#2850)

* Fix GetPolyIndex and GetBgIndex, fixing a couple regallocs

* Match daNpcCd2_c::checkFearSituation and daNpcCd2_c::getAnmP

* Match daAlink_c::jointControll

* Clean up float class checks

* Move float constants to global.h
This commit is contained in:
LagoLunatic
2025-11-23 18:23:44 -05:00
committed by GitHub
parent eaf980174f
commit 8d53f6dd59
25 changed files with 219 additions and 224 deletions
@@ -17,7 +17,7 @@
(sizeof(x) == sizeof(double)) ? __fpclassifyd((double)(x)) : \
__fpclassifyl((long double)(x)) )
#define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) : __signbitd(x))
#define isfinite(x) ((fpclassify(x) > 2))
#define isfinite(x) ((fpclassify(x) > FP_INFINITE))
#define isnan(x) (fpclassify(x) == FP_NAN)
#define isinf(x) (fpclassify(x) == FP_INFINITE)
@@ -101,7 +101,7 @@ inline float sqrtf(float mag) {
return mag * tmpd;
} else if (mag < 0.0) {
return NAN;
} else if (fpclassify(mag) == 1) {
} else if (isnan(mag)) {
return NAN;
} else {
return mag;
@@ -522,7 +522,7 @@ void __num2dec_internal(decimal* d, double x) {
d->sign = sign;
d->exp = 0;
d->sig.length = 1;
d->sig.text[0] = fpclassify(x) == 1 ? 'N' : 'I';
d->sig.text[0] = isnan(x)? 'N' : 'I';
return;
}
@@ -570,4 +570,4 @@ void __num2dec(const decform* form, double x, decimal* d) {
for (i = 0; i < d->sig.length; i++) {
d->sig.text[i] += '0';
}
}
}