mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-05 10:47:27 -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:
+20
-20
@@ -1,4 +1,4 @@
|
||||
#include "d/dolzel.h"
|
||||
#include "d/dolzel.h" // IWYU pragma: keep
|
||||
|
||||
#include "d/d_demo.h"
|
||||
#include "d/d_msg_class.h"
|
||||
@@ -24,7 +24,7 @@ void jstudio_tAdaptor_message::adaptor_do_MESSAGE(JStudio::data::TEOperationData
|
||||
const void* pContent, u32 uSize) {
|
||||
switch (iType) {
|
||||
case JStudio::data::UNK_0x19:
|
||||
JUT_ASSERT(107, pContent!=0);
|
||||
JUT_ASSERT(107, pContent!=NULL);
|
||||
JUT_ASSERT(108, uSize==4);
|
||||
u32 content = *(u32*)pContent;
|
||||
dMsgObject_setDemoMessage(content);
|
||||
@@ -50,7 +50,7 @@ jstudio_tCreateObject_message::~jstudio_tCreateObject_message() {}
|
||||
bool
|
||||
jstudio_tCreateObject_message::create(JStudio::TObject** ppObject,
|
||||
const JStudio::stb::data::TParse_TBlock_object& iBlock) {
|
||||
JUT_ASSERT(168, ppObject!=0);
|
||||
JUT_ASSERT(168, ppObject!=NULL);
|
||||
|
||||
u32 type = iBlock.get_type();
|
||||
switch (type) {
|
||||
@@ -329,7 +329,7 @@ int dDemo_setDemoData(fopAc_ac_c* i_actor, u8 i_flags, mDoExt_McaMorf* i_morf, c
|
||||
demo_actor->setOldAnmId(anmID);
|
||||
|
||||
J3DAnmTransform* i_key = (J3DAnmTransform*)dComIfG_getObjectIDRes(a_name, anmID & 0xffff);
|
||||
JUT_ASSERT(272, i_key != 0);
|
||||
JUT_ASSERT(272, i_key != NULL);
|
||||
|
||||
ptr = dDemo_getJaiPointer(a_name, anmID & 0xffff, param_4, param_5);
|
||||
|
||||
@@ -359,7 +359,7 @@ int dDemo_setDemoData(fopAc_ac_c* i_actor, u8 i_flags, mDoExt_McaMorf* i_morf, c
|
||||
/* 800387A8-800387EC 0330E8 0044+00 1/1 0/0 0/0 .text branchFile__FPCc */
|
||||
static void branchFile(char const* resName) {
|
||||
u8* branchData = (u8*)dComIfG_getObjectRes(dStage_roomControl_c::getDemoArcName(), resName);
|
||||
JUT_ASSERT(712, branchData != 0);
|
||||
JUT_ASSERT(712, branchData != NULL);
|
||||
|
||||
dDemo_c::setBranchData(branchData);
|
||||
}
|
||||
@@ -429,7 +429,7 @@ void dDemo_actor_c::JSGSetTranslation(Vec const& i_trans) {
|
||||
} else {
|
||||
// "\n\n!!JSGSetTranslation outside of range. x[%f]y[%f]z[%f]\n"
|
||||
OS_REPORT("\n\n!!JSGSetTranslationで範囲外の指定がされました。x[%f]y[%f]z[%f]\n", i_trans.x, i_trans.y, i_trans.z);
|
||||
JUT_ASSERT(789, 0);
|
||||
JUT_ASSERT(789, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -930,7 +930,7 @@ int dDemo_system_c::JSGFindObject(JStage::TObject** p_TObj, char const* actorNam
|
||||
} else {
|
||||
// "Strange Demo Object type!! Type<%d>\n"
|
||||
OS_REPORT("へんなデモオブジェクトタイプです!! タイプ<%d>\n");
|
||||
JUT_ASSERT(1755, 0);
|
||||
JUT_ASSERT(1755, FALSE);
|
||||
}
|
||||
|
||||
return *p_TObj == NULL ? TRUE : FALSE;
|
||||
@@ -939,32 +939,32 @@ int dDemo_system_c::JSGFindObject(JStage::TObject** p_TObj, char const* actorNam
|
||||
/* 80039678-80039910 033FB8 0298+00 0/0 1/1 0/0 .text create__7dDemo_cFv */
|
||||
void dDemo_c::create() {
|
||||
m_system = new dDemo_system_c();
|
||||
JUT_ASSERT(0, m_system != 0);
|
||||
JUT_ASSERT(0, m_system != NULL);
|
||||
|
||||
m_control = new JStudio::TControl();
|
||||
JUT_ASSERT(0, m_control != 0);
|
||||
JUT_ASSERT(0, m_control != NULL);
|
||||
|
||||
m_mesgControl = new jmessage_tControl();
|
||||
JUT_ASSERT(0, m_mesgControl != 0);
|
||||
JUT_ASSERT(0, m_mesgControl != NULL);
|
||||
|
||||
m_stage = new JStudio_JStage::TCreateObject(m_system);
|
||||
JUT_ASSERT(0, m_stage != 0);
|
||||
JUT_ASSERT(0, m_stage != NULL);
|
||||
|
||||
m_audio = new JStudio_JAudio2::TCreateObject(Z2GetSoundStarter(), m_system);
|
||||
JUT_ASSERT(0, m_audio != 0);
|
||||
JUT_ASSERT(0, m_audio != NULL);
|
||||
m_audio->mPermit_onExit_notEnd = true;
|
||||
|
||||
m_particle = new dDemo_particle_c(dPa_control_c::getEmitterManager(), m_system);
|
||||
JUT_ASSERT(0, m_particle != 0);
|
||||
JUT_ASSERT(0, m_particle != NULL);
|
||||
|
||||
m_message = new jstudio_tCreateObject_message();
|
||||
JUT_ASSERT(0, m_message != 0);
|
||||
JUT_ASSERT(0, m_message != NULL);
|
||||
|
||||
m_factory = new JStudio::TFactory();
|
||||
JUT_ASSERT(0, m_factory != 0);
|
||||
JUT_ASSERT(0, m_factory != NULL);
|
||||
|
||||
m_object = new dDemo_object_c();
|
||||
JUT_ASSERT(0, m_object != 0);
|
||||
JUT_ASSERT(0, m_object != NULL);
|
||||
|
||||
m_control->setSecondPerFrame(1.0f / 30.0f);
|
||||
m_control->setFactory(m_factory);
|
||||
@@ -1037,7 +1037,7 @@ jmessage_tControl::~jmessage_tControl() {}
|
||||
|
||||
/* 80039B6C-80039CF8 0344AC 018C+00 1/1 1/1 0/0 .text start__7dDemo_cFPCUcP4cXyzf */
|
||||
int dDemo_c::start(u8 const* p_data, cXyz* p_translation, f32 rotationY) {
|
||||
JUT_ASSERT(0, m_system != 0);
|
||||
JUT_ASSERT(0, m_system != NULL);
|
||||
|
||||
m_control->reset();
|
||||
JStudio::TParse parser(m_control);
|
||||
@@ -1075,7 +1075,7 @@ int dDemo_c::start(u8 const* p_data, cXyz* p_translation, f32 rotationY) {
|
||||
|
||||
/* 80039CF8-80039D4C 034638 0054+00 1/1 2/2 0/0 .text end__7dDemo_cFv */
|
||||
void dDemo_c::end() {
|
||||
JUT_ASSERT(0, m_system != 0);
|
||||
JUT_ASSERT(0, m_system != NULL);
|
||||
|
||||
m_control->destroyObject_all();
|
||||
m_object->remove();
|
||||
@@ -1085,7 +1085,7 @@ void dDemo_c::end() {
|
||||
|
||||
/* 80039D4C-80039DA4 03468C 0058+00 1/1 0/0 0/0 .text branch__7dDemo_cFv */
|
||||
void dDemo_c::branch() {
|
||||
JUT_ASSERT(0, m_system != 0);
|
||||
JUT_ASSERT(0, m_system != NULL);
|
||||
|
||||
m_control->destroyObject_all();
|
||||
const u8* branchData = m_branchData;
|
||||
@@ -1097,7 +1097,7 @@ void dDemo_c::branch() {
|
||||
|
||||
/* 80039DA4-80039EDC 0346E4 0138+00 0/0 1/1 0/0 .text update__7dDemo_cFv */
|
||||
int dDemo_c::update() {
|
||||
JUT_ASSERT(0, m_system != 0);
|
||||
JUT_ASSERT(0, m_system != NULL);
|
||||
|
||||
if (m_data == NULL) {
|
||||
if (m_branchData == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user