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
+1 -1
View File
@@ -286,7 +286,7 @@ u32 JKRAramArchive::fetchResource_subroutine(u32 entryNum, u32 length, JKRHeap*
case COMPRESSION_NONE:
{
buffer = (u8*)(JKRAllocFromHeap(pHeap, alignedLen, 0x20));
JUT_ASSERT(677, buffer != 0);
JUT_ASSERT(677, buffer != NULL);
JKRAramToMainRam(entryNum, buffer, alignedLen, EXPAND_SWITCH_UNKNOWN0, alignedLen, NULL, -1, NULL);
*out = buffer;
return length;
+3 -3
View File
@@ -295,7 +295,7 @@ void JKRArchive::removeResourceAll() {
/* 802D603C-802D609C 2D097C 0060+00 1/0 2/0 0/0 .text removeResource__10JKRArchiveFPv */
bool JKRArchive::removeResource(void* resource) {
JUT_ASSERT(678, resource != 0);
JUT_ASSERT(678, resource != NULL);
SDIFileEntry* fileEntry = findPtrResource(resource);
if (fileEntry == NULL)
return false;
@@ -307,7 +307,7 @@ bool JKRArchive::removeResource(void* resource) {
/* 802D609C-802D60D8 2D09DC 003C+00 1/0 4/0 0/0 .text detachResource__10JKRArchiveFPv */
bool JKRArchive::detachResource(void* resource) {
JUT_ASSERT(707, resource != 0);
JUT_ASSERT(707, resource != NULL);
SDIFileEntry* fileEntry = findPtrResource(resource);
if (fileEntry == NULL)
return false;
@@ -318,7 +318,7 @@ bool JKRArchive::detachResource(void* resource) {
/* 802D60D8-802D610C 2D0A18 0034+00 1/0 4/0 0/0 .text getResSize__10JKRArchiveCFPCv */
u32 JKRArchive::getResSize(const void* resource) const {
JUT_ASSERT(732, resource != 0);
JUT_ASSERT(732, resource != NULL);
SDIFileEntry* fileEntry = findPtrResource(resource);
if (fileEntry == NULL)
return -1;
+1 -1
View File
@@ -290,7 +290,7 @@ u32 JKRDvdArchive::fetchResource_subroutine(s32 entryNum, u32 offset, u32 size,
switch (fileCompression) {
case COMPRESSION_NONE:
buffer = (u8*)JKRAllocFromHeap(heap, alignedSize, sizeof(SArcHeader));
JUT_ASSERT(675, buffer != 0);
JUT_ASSERT(675, buffer != NULL);
JKRDvdToMainRam(entryNum, buffer, EXPAND_SWITCH_UNKNOWN0, alignedSize, NULL,
JKRDvdRipper::ALLOC_DIRECTION_FORWARD, offset, NULL, NULL);
+1 -1
View File
@@ -492,7 +492,7 @@ void operator delete[](void* ptr) {
/* 802CED84-802CED88 2C96C4 0004+00 1/0 1/0 0/0 .text
* state_register__7JKRHeapCFPQ27JKRHeap6TStateUl */
void JKRHeap::state_register(JKRHeap::TState* p, u32 id) const {
JUT_ASSERT(1213, p != 0);
JUT_ASSERT(1213, p != NULL);
JUT_ASSERT(1214, p->getHeap() == this);
}
+1 -1
View File
@@ -252,7 +252,7 @@ bool JKRSolidHeap::dump(void) {
/* 802D11FC-802D1258 2CBB3C 005C+00 1/0 0/0 0/0 .text
* state_register__12JKRSolidHeapCFPQ27JKRHeap6TStateUl */
void JKRSolidHeap::state_register(JKRHeap::TState* p, u32 id) const {
JUT_ASSERT(604, p != 0);
JUT_ASSERT(604, p != NULL);
JUT_ASSERT(605, p->getHeap() == this);
getState_(p);
+1 -1
View File
@@ -141,7 +141,7 @@ JKRThreadSwitch::JKRThreadSwitch(JKRHeap* param_0) {
/* 802D1A14-802D1A70 2CC354 005C+00 0/0 1/1 0/0 .text createManager__15JKRThreadSwitchFP7JKRHeap
*/
JKRThreadSwitch* JKRThreadSwitch::createManager(JKRHeap* heap) {
JUT_ASSERT(343, sManager == 0);
JUT_ASSERT(343, sManager == NULL);
if (!heap) {
heap = JKRGetCurrentHeap();