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
+3 -4
View File
@@ -6,7 +6,6 @@
#include "SSystem/SComponent/c_cc_d.h"
#include "JSystem/JUtility/JUTAssert.h"
#define CHECK_FLOAT_CLASS(line, x) JUT_ASSERT(line, !(((sizeof(x) == sizeof(float)) ? __fpclassifyf((float)(x)) : __fpclassifyd((double)(x)) ) == 1));
#define CHECK_FLOAT_RANGE(line, x) JUT_ASSERT(line, -1.0e32f < x && x < 1.0e32f);
/* 80430CB4-80430CC0 05D9D4 000C+00 1/1 2/2 0/0 .bss m_virtual_center__14cCcD_ShapeAttr
@@ -224,9 +223,9 @@ void cCcD_Stts::PlusCcMove(f32 x, f32 y, f32 z) {
m_cc_move.y += y;
m_cc_move.z += z;
CHECK_FLOAT_CLASS(422, m_cc_move.x);
CHECK_FLOAT_CLASS(423, m_cc_move.y);
CHECK_FLOAT_CLASS(424, m_cc_move.z);
JUT_ASSERT(422, !isnan(m_cc_move.x));
JUT_ASSERT(423, !isnan(m_cc_move.y));
JUT_ASSERT(424, !isnan(m_cc_move.z));
CHECK_FLOAT_RANGE(426, m_cc_move.x);
CHECK_FLOAT_RANGE(427, m_cc_move.y);