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
+7 -7
View File
@@ -3,7 +3,7 @@
*
*/
#include "d/dolzel_rel.h"
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_npc_cdn3.h"
#include "d/d_msg_object.h"
@@ -76,13 +76,13 @@ void daNpcCdn3_c::setAction(daNpcCdn3_c::Mode_e i_action) {
/* 80978E18-80978E40 0001B8 0028+00 1/1 0/0 0/0 .text callInit__11daNpcCdn3_cFv */
void daNpcCdn3_c::callInit() {
JUT_ASSERT(408, mAction != 0);
JUT_ASSERT(408, mAction != NULL);
(this->*(mAction[0]))();
}
/* 80978E40-80978E6C 0001E0 002C+00 1/1 0/0 0/0 .text callExecute__11daNpcCdn3_cFv */
void daNpcCdn3_c::callExecute() {
JUT_ASSERT(421, mAction != 0);
JUT_ASSERT(421, mAction != NULL);
(this->*(mAction[1]))();
}
@@ -556,7 +556,7 @@ void daNpcCdn3_c::initTalk() {
field_0xb92 = shape_angle.y;
field_0xb80 = mpMorf->getAnm();
field_0xb7c = mSeqNum;
JUT_ASSERT(658, 0 != m_targetAct.getActorP());
JUT_ASSERT(658, NULL != m_targetAct.getActorP());
if (!isInShop() && !isNoTurnTalk()) {
int uVar2;
if (isChairStyle()) {
@@ -635,7 +635,7 @@ void daNpcCdn3_c::executeTalk() {
field_0xb97 = 0;
field_0xb94 = 1;
}
JUT_ASSERT(726, m_funcTbl[mSeqNum][field_0xb97] != 0);
JUT_ASSERT(726, m_funcTbl[mSeqNum][field_0xb97] != NULL);
if ((this->*(m_funcTbl[mSeqNum][field_0xb97]))(NULL) != 0) {
field_0xb97 = (m_funcTbl[mSeqNum][field_0xb97 + 1] == NULL) ? 0 : field_0xb97 + 1;
field_0xb94 = 1;
@@ -657,7 +657,7 @@ void daNpcCdn3_c::executeTalk() {
/* 80979F08-8097A028 0012A8 0120+00 1/0 0/0 0/0 .text initEscape__11daNpcCdn3_cFv */
void daNpcCdn3_c::initEscape() {
mEscapeTag = getEscapeTag();
JUT_ASSERT(816, mEscapeTag != 0);
JUT_ASSERT(816, mEscapeTag != NULL);
JUT_ASSERT(817, mEscapeTag->getPathID() != 0xff);
m_path.setPath(mEscapeTag->getPathID(), fopAcM_GetRoomNo(this), 1, &current.pos, true);
JUT_ASSERT(819, m_path.isPath());
@@ -906,7 +906,7 @@ int daNpcCdn3_c::ctrlMsgAnm() {
}
if (dComIfGp_event_getTalkPartner() == this) {
msg_class* msg_p = dMsgObject_c::getActor();
JUT_ASSERT(1524, 0 != msg_p);
JUT_ASSERT(1524, NULL != msg_p);
if (msg_p->mode == 2 || msg_p->mode == 3) {
mMsgIndex = -1;
} else if (msg_p->mode == 6) {