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
+27 -27
View File
@@ -3,7 +3,7 @@
* UI Button handling
*/
#include "d/dolzel.h"
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_meter_button.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
@@ -1035,7 +1035,7 @@ void dMeterButton_c::screenInitButton() {
OS_REPORT("enter dMeterButton_c::screenInitButton\n");
mpButtonScreen = new J2DScreen();
JUT_ASSERT(0, mpButtonScreen != 0);
JUT_ASSERT(0, mpButtonScreen != NULL);
OS_REPORT("load zelda_game_image_button_info.blo");
@@ -1052,7 +1052,7 @@ void dMeterButton_c::screenInitButton() {
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
}
JUT_ASSERT(0, mpParent != 0);
JUT_ASSERT(0, mpParent != NULL);
for (int i = 0; i < BUTTON_NUM; i++) {
field_0x18c[i] = 0.0f;
@@ -1078,7 +1078,7 @@ void dMeterButton_c::screenInitButton() {
if (mpButtonA == NULL) {
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
}
JUT_ASSERT(0, mpButtonA != 0);
JUT_ASSERT(0, mpButtonA != NULL);
mpButtonA->setAlphaRate(0.0f);
mpButtonA->show();
@@ -1086,7 +1086,7 @@ void dMeterButton_c::screenInitButton() {
if (mpButtonB == NULL) {
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
}
JUT_ASSERT(0, mpButtonB != 0);
JUT_ASSERT(0, mpButtonB != NULL);
mpButtonB->setAlphaRate(0.0f);
mpButtonB->show();
@@ -1094,12 +1094,12 @@ void dMeterButton_c::screenInitButton() {
if (mpButtonR == NULL) {
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
}
JUT_ASSERT(0, mpButtonR != 0);
JUT_ASSERT(0, mpButtonR != NULL);
mpButtonR->setAlphaRate(0.0f);
mpButtonR->show();
mpMidona = new CPaneMgr(mpButtonScreen, 'midona', 0, NULL);
JUT_ASSERT(0, mpMidona != 0);
JUT_ASSERT(0, mpMidona != NULL);
if (mpMidona == NULL) {
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
}
@@ -1115,12 +1115,12 @@ void dMeterButton_c::screenInitButton() {
if (mpButtonZ == NULL) {
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
}
JUT_ASSERT(0, mpButtonZ != 0);
JUT_ASSERT(0, mpButtonZ != NULL);
mpButtonZ->setAlphaRate(0.0f);
mpButtonZ->show();
mpButton3D = new CPaneMgr(mpButtonScreen, 'asbtn_n', 2, NULL);
JUT_ASSERT(0, mpButton3D != 0);
JUT_ASSERT(0, mpButton3D != NULL);
mpButton3D->setAlphaRate(0.0f);
mpButton3D->show();
@@ -1130,7 +1130,7 @@ void dMeterButton_c::screenInitButton() {
mpButtonScreen->search('yaji_r_n')->hide();
mpButtonC = new CPaneMgr(mpButtonScreen, 'cbtn_n', 2, NULL);
JUT_ASSERT(0, mpButtonC != 0);
JUT_ASSERT(0, mpButtonC != NULL);
mpButtonC->setAlphaRate(0.0f);
mpButtonC->show();
@@ -1140,15 +1140,15 @@ void dMeterButton_c::screenInitButton() {
mpButtonScreen->search('yaji_rn')->hide();
mpButtonS = new CPaneMgr(mpButtonScreen, 'sbtn_n', 2, NULL);
JUT_ASSERT(0, mpButtonS != 0);
JUT_ASSERT(0, mpButtonS != NULL);
mpButtonS->setAlphaRate(0.0f);
mpButtonX = new CPaneMgr(mpButtonScreen, 'xbtn_n', 2, NULL);
JUT_ASSERT(0, mpButtonX != 0);
JUT_ASSERT(0, mpButtonX != NULL);
mpButtonX->setAlphaRate(0.0f);
mpButtonY = new CPaneMgr(mpButtonScreen, 'ybtn_n', 2, NULL);
JUT_ASSERT(0, mpButtonY != 0);
JUT_ASSERT(0, mpButtonY != NULL);
mpButtonY->setAlphaRate(0.0f);
mpButtonNun = NULL;
@@ -1157,7 +1157,7 @@ void dMeterButton_c::screenInitButton() {
mpButtonAR = NULL;
mpButton3DB = new CPaneMgr(mpButtonScreen, 'as_b_n', 2, NULL);
JUT_ASSERT(0, mpButton3DB != 0);
JUT_ASSERT(0, mpButton3DB != NULL);
mpButton3DB->setAlphaRate(0.0f);
mpButtonNURE = NULL;
@@ -1169,24 +1169,24 @@ void dMeterButton_c::screenInitButton() {
mpButtonNunC = NULL;
mpButtonBin = new CPaneMgr(mpButtonScreen, 'bottl_n', 2, NULL);
JUT_ASSERT(0, mpButtonBin != 0);
JUT_ASSERT(0, mpButtonBin != NULL);
mpButtonBin->setAlphaRate(0.0f);
mpText[0] = new CPaneMgr(mpButtonScreen, 'text_n', 2, NULL);
JUT_ASSERT(0, mpText[0] != 0);
JUT_ASSERT(0, mpText[0] != NULL);
mpText[0]->setAlphaRate(0.0f);
mpText[1] = new CPaneMgr(mpButtonScreen, 'text2_n', 2, NULL);
JUT_ASSERT(0, mpText[1] != 0);
JUT_ASSERT(0, mpText[1] != NULL);
mpText[1]->setAlphaRate(0.0f);
mpItem_c = new CPaneMgr(mpButtonScreen, 'fishing', 0, NULL);
JUT_ASSERT(0, mpItem_c != 0);
JUT_ASSERT(0, mpItem_c != NULL);
mpItem_c->setAlphaRate(0.0f);
mpHeap = mDoExt_getCurrentHeap();
mpFishingTex = mpHeap->alloc(0xC00, 0x20);
JUT_ASSERT(0, mpFishingTex != 0);
JUT_ASSERT(0, mpFishingTex != NULL);
u8 fishing_item = dComIfGs_getItem(SLOT_20, false);
if (dMeter2Info_getMeterClass()->getMeterDrawPtr()->getCanoeFishing()) {
@@ -1433,7 +1433,7 @@ void dMeterButton_c::screenInitButton() {
*/
void dMeterButton_c::screenInitText() {
mpScreen = new J2DScreen();
JUT_ASSERT(0, mpScreen != 0);
JUT_ASSERT(0, mpScreen != NULL);
OS_REPORT("enter dMeterButton_c::screenInitText(void)\n");
@@ -1445,7 +1445,7 @@ void dMeterButton_c::screenInitText() {
mpFkAll_c = new CPaneMgr(mpScreen, 'n_all', 2, NULL);
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
JUT_ASSERT(0, mpFkAll_c != 0);
JUT_ASSERT(0, mpFkAll_c != NULL);
mpFkAll_c->setAlphaRate(0.0f);
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
@@ -1455,11 +1455,11 @@ void dMeterButton_c::screenInitText() {
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
mpFkRoot_c = new CPaneMgr(mpScreen, 'mg_null', 0, NULL);
JUT_ASSERT(0, mpFkRoot_c != 0);
JUT_ASSERT(0, mpFkRoot_c != NULL);
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
mpTextScreen = new J2DScreen();
JUT_ASSERT(0, mpTextScreen != 0);
JUT_ASSERT(0, mpTextScreen != NULL);
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
fg = mpTextScreen->setPriority("zelda_message_window_text.blo", 0x20000,
@@ -1470,7 +1470,7 @@ void dMeterButton_c::screenInitText() {
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
mpTmRoot_c = new CPaneMgr(mpTextScreen, 'mg_null', 0, NULL);
JUT_ASSERT(0, mpTmRoot_c != 0);
JUT_ASSERT(0, mpTmRoot_c != NULL);
#if VERSION == VERSION_GCN_JPN
if (dComIfGs_getOptUnk0() == 0) {
@@ -1500,10 +1500,10 @@ void dMeterButton_c::screenInitText() {
}
#else
mpTm_c[0] = new CPaneMgr(mpTextScreen, 'mg_e4lin', 0, NULL);
JUT_ASSERT(0, mpTm_c[0] != 0);
JUT_ASSERT(0, mpTm_c[0] != NULL);
mpTm_c[1] = new CPaneMgr(mpTextScreen, 't4_s', 0, NULL);
JUT_ASSERT(0, mpTm_c[1] != 0);
JUT_ASSERT(0, mpTm_c[1] != NULL);
field_0x0ec[0] = NULL;
field_0x0ec[1] = NULL;
@@ -1544,7 +1544,7 @@ void dMeterButton_c::screenInitText() {
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
mpOutFont = new COutFont_c(0);
JUT_ASSERT(0, mpOutFont != 0);
JUT_ASSERT(0, mpOutFont != NULL);
mpOutFont->createPane();
OS_REPORT("exit dMeterButton_c::screenInitText(void)\n");