mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-02 17:48:21 -04:00
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:
@@ -6,9 +6,7 @@
|
||||
#include "SSystem/SComponent/c_cc_s.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_CLASS(line, x) JUT_ASSERT(line, !isnan(x));
|
||||
#define CHECK_FLOAT_RANGE(line, x) JUT_ASSERT(line, -1.0e32f < x && x < 1.0e32f);
|
||||
|
||||
/* 80264A6C-80264A94 25F3AC 0028+00 0/0 1/1 0/0 .text __ct__4cCcSFv */
|
||||
@@ -165,7 +163,7 @@ void cCcS::ChkAtTg() {
|
||||
continue;
|
||||
|
||||
cCcD_ShapeAttr* pat_sa = (*pat_obj)->GetShapeAttr();
|
||||
JUT_ASSERT(0, pat_sa != 0);
|
||||
JUT_ASSERT(0, pat_sa != NULL);
|
||||
|
||||
for (cCcD_Obj** ptg_obj = mpObjTg; ptg_obj < objTgEnd; ++ptg_obj) {
|
||||
if (*ptg_obj == NULL || !(*ptg_obj)->ChkTgSet())
|
||||
@@ -176,7 +174,7 @@ void cCcS::ChkAtTg() {
|
||||
continue;
|
||||
|
||||
cCcD_ShapeAttr* ptg_sa = (*ptg_obj)->GetShapeAttr();
|
||||
JUT_ASSERT(0, ptg_sa != 0);
|
||||
JUT_ASSERT(0, ptg_sa != NULL);
|
||||
|
||||
static cXyz cross;
|
||||
bool didCross = pat_sa->CrossAtTg(*ptg_sa, &cross);
|
||||
@@ -225,7 +223,7 @@ void cCcS::ChkCo() {
|
||||
continue;
|
||||
|
||||
cCcD_ShapeAttr* pco1_sa = (*pco1_obj)->GetShapeAttr();
|
||||
JUT_ASSERT(0, pco1_sa != 0);
|
||||
JUT_ASSERT(0, pco1_sa != NULL);
|
||||
|
||||
for (cCcD_Obj** pco2_obj = pco1_obj + 1; pco2_obj < objCoEnd; ++pco2_obj) {
|
||||
if (*pco2_obj == NULL || !(*pco2_obj)->ChkCoSet())
|
||||
@@ -236,7 +234,7 @@ void cCcS::ChkCo() {
|
||||
continue;
|
||||
|
||||
cCcD_ShapeAttr* pco2_sa = (*pco2_obj)->GetShapeAttr();
|
||||
JUT_ASSERT(0, pco2_sa != 0);
|
||||
JUT_ASSERT(0, pco2_sa != NULL);
|
||||
|
||||
f32 cross_len;
|
||||
if (pco1_sa->CrossCo(*pco2_sa, &cross_len)) {
|
||||
@@ -456,7 +454,7 @@ void cCcS::CalcArea() {
|
||||
for (cCcD_Obj** pset_obj = mpObj; pset_obj < mpObj + mObjCount; ++pset_obj) {
|
||||
if (*pset_obj != NULL) {
|
||||
cCcD_ShapeAttr* pset_sa = (*pset_obj)->GetShapeAttr();
|
||||
JUT_ASSERT(0, pset_sa != 0);
|
||||
JUT_ASSERT(0, pset_sa != NULL);
|
||||
|
||||
pset_sa->CalcAabBox();
|
||||
aab.SetMinMax(pset_sa->GetWorkAab());
|
||||
@@ -467,7 +465,7 @@ void cCcS::CalcArea() {
|
||||
for (cCcD_Obj** pset_obj = mpObj; pset_obj < mpObj + mObjCount; ++pset_obj) {
|
||||
if (*pset_obj != NULL) {
|
||||
const cCcD_ShapeAttr* pset_sa = (*pset_obj)->GetShapeAttr();
|
||||
JUT_ASSERT(0, pset_sa != 0);
|
||||
JUT_ASSERT(0, pset_sa != NULL);
|
||||
|
||||
cCcD_DivideInfo* divideInfo = &(*pset_obj)->GetDivideInfo();
|
||||
mDivideArea.CalcDivideInfo(divideInfo, pset_sa->GetWorkAab(),
|
||||
|
||||
Reference in New Issue
Block a user