Fix JUT_ASSERT and several other macros (#2711)

* Fix JUT_ASSERT to be a nested define

* Switch names that appear in asserts to be constants instead of defines

* Replace `0` in asserts with `NULL` or `FALSE`

* Fix fpclassify

* Fix ARRAY_SIZE

* Use G_CM3D_F_INF

* More fixes for fpclassify

* Remove FLOAT_LABEL

* Remove incorrect FLAG_ON macro

* Remove UNK_BSS macro

* Silence clangd unused header warning for PCH
This commit is contained in:
LagoLunatic
2025-09-28 16:11:07 -04:00
committed by GitHub
parent 737250d7f5
commit 6ec6fce8cb
1008 changed files with 3172 additions and 3237 deletions
+13 -13
View File
@@ -3,7 +3,7 @@
*
*/
#include "d/dolzel_rel.h"
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_b_mgn.h"
#include "d/actor/d_a_obj_bhashi.h"
@@ -304,7 +304,7 @@ int daB_MGN_c::draw() {
dBgS_GndChk gndchk;
f32 gnd_height;
if (mAcch.GetGroundH() == -1000000000.0f) {
if (mAcch.GetGroundH() == -G_CM3D_F_INF) {
cXyz spC(current.pos);
gndchk.SetPos(&spC);
gnd_height = dComIfG_Bgsp().GroundCross(&gndchk);
@@ -406,7 +406,7 @@ void daB_MGN_c::setDashSmokeEffect() {
gndchk.SetPos(&effpos);
effpos.y = dComIfG_Bgsp().GroundCross(&gndchk);
if (effpos.y != -1000000000.0f) {
if (effpos.y != -G_CM3D_F_INF) {
fopAcM_effSmokeSet1(&field_0x25f8[var_r27], &field_0x2608[var_r27], &effpos, NULL, 3.0f, &tevStr, 1);
}
}
@@ -448,7 +448,7 @@ void daB_MGN_c::setBackJumpEffect() {
gndchk.SetPos(&effpos);
effpos.y = dComIfG_Bgsp().GroundCross(&gndchk);
if (effpos.y != -1000000000.0f) {
if (effpos.y != -G_CM3D_F_INF) {
fopAcM_effSmokeSet1(&field_0x25f8[var_r27], &field_0x2608[var_r27], &effpos, NULL, 3.0f, &tevStr, 1);
}
}
@@ -469,7 +469,7 @@ void daB_MGN_c::setSlideSmokeEffect() {
gndchk.SetPos(&effpos);
effpos.y = dComIfG_Bgsp().GroundCross(&gndchk);
if (effpos.y != -1000000000.0f) {
if (effpos.y != -G_CM3D_F_INF) {
fopAcM_effSmokeSet2(&field_0x25f8[i], &field_0x2608[i], &effpos, NULL, 3.0f, &tevStr);
}
}
@@ -496,7 +496,7 @@ void daB_MGN_c::setBodySlideEffect() {
gndchk.SetPos(&effpos);
effpos.y = dComIfG_Bgsp().GroundCross(&gndchk);
if (effpos.y != -1000000000.0f) {
if (effpos.y != -G_CM3D_F_INF) {
fopAcM_effSmokeSet2(&field_0x25f8[i], &field_0x2608[i], &effpos, NULL, 10.0f, &tevStr);
}
}
@@ -514,7 +514,7 @@ void daB_MGN_c::setOpeningEffect() {
gndchk.SetPos(&effpos);
effpos.y = dComIfG_Bgsp().GroundCross(&gndchk);
if (effpos.y != -1000000000.0f) {
if (effpos.y != -G_CM3D_F_INF) {
fopAcM_effSmokeSet1(&field_0x25f8[0], &field_0x2608[0], &effpos, NULL, 15.0f, &tevStr, 1);
}
@@ -524,7 +524,7 @@ void daB_MGN_c::setOpeningEffect() {
gndchk.SetPos(&effpos);
effpos.y = dComIfG_Bgsp().GroundCross(&gndchk);
if (effpos.y != -1000000000.0f) {
if (effpos.y != -G_CM3D_F_INF) {
fopAcM_effSmokeSet1(&field_0x25f8[1], &field_0x2608[1], &effpos, NULL, 15.0f, &tevStr, 1);
}
}
@@ -546,7 +546,7 @@ void daB_MGN_c::setStepEffect() {
effpos.y = dComIfG_Bgsp().GroundCross(&gndchk);
if (effpos.y != -1000000000.0f) {
if (effpos.y != -G_CM3D_F_INF) {
fopAcM_effSmokeSet1(&field_0x25f8[i], &field_0x2608[i], &effpos, NULL, 3.0f, &tevStr, 1);
}
}
@@ -573,7 +573,7 @@ void daB_MGN_c::setFallAttackEffect() {
effpos.y = dComIfG_Bgsp().GroundCross(&gndchk);
if (effpos.y != -1000000000.0f) {
if (effpos.y != -G_CM3D_F_INF) {
fopAcM_effSmokeSet1(&field_0x25f8[i], &field_0x2608[i], &effpos, NULL, 10.0f, &tevStr, 1);
}
}
@@ -3348,7 +3348,7 @@ static int daB_MGN_Delete(daB_MGN_c* i_this) {
/* 8060EAE0-8060F068 0094A0 0588+00 1/1 0/0 0/0 .text CreateHeap__9daB_MGN_cFv */
int daB_MGN_c::CreateHeap() {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("B_mgn", BMDR_MGN);
JUT_ASSERT(4010, modelData != 0);
JUT_ASSERT(4010, modelData != NULL);
mpMgnModelMorf = new mDoExt_McaMorfSO(modelData, NULL, NULL,
(J3DAnmTransform*)dComIfG_getObjectRes("B_mgn", BCK_MGN_WAIT), 2,
1.0f, 0, -1, &mSound, 0x80000, 0x11000284);
@@ -3389,7 +3389,7 @@ int daB_MGN_c::CreateHeap() {
}
modelData = (J3DModelData*)dComIfG_getObjectRes("B_mgn", BMDR_MGN_TAIEKI);
JUT_ASSERT(4068, modelData != 0);
JUT_ASSERT(4068, modelData != NULL);
for (int i = 0; i < 20; i++) {
mpMgnTaiekiModel[i] = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
@@ -3399,7 +3399,7 @@ int daB_MGN_c::CreateHeap() {
}
modelData = (J3DModelData*)dComIfG_getObjectRes("B_mgne", BMDR_EF_GDGATE);
JUT_ASSERT(4084, modelData != 0);
JUT_ASSERT(4084, modelData != NULL);
for (int i = 0; i < 4; i++) {
mpGdgateModelMorf[i] = new mDoExt_McaMorfSO(modelData, NULL, NULL,