mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-19 21:11:59 -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:
@@ -191,19 +191,19 @@ struct TLinkList : public TNodeLinkList {
|
||||
};
|
||||
|
||||
static TLinkListNode* Element_toNode(T* p) {
|
||||
JUT_ASSERT(0x2F1, p!=0);
|
||||
JUT_ASSERT(0x2F1, p!=NULL);
|
||||
return reinterpret_cast<TLinkListNode*>(reinterpret_cast<char*>(p) - I);
|
||||
}
|
||||
static const TLinkListNode* Element_toNode(const T* p) {
|
||||
JUT_ASSERT(0x2F6, p!=0);
|
||||
JUT_ASSERT(0x2F6, p!=NULL);
|
||||
return reinterpret_cast<const TLinkListNode*>(reinterpret_cast<const char*>(p) - I);
|
||||
}
|
||||
static T* Element_toValue(TLinkListNode* p) {
|
||||
JUT_ASSERT(0x2FB, p!=0);
|
||||
JUT_ASSERT(0x2FB, p!=NULL);
|
||||
return reinterpret_cast<T*>(reinterpret_cast<char*>(p) + I);
|
||||
}
|
||||
static const T* Element_toValue(const TLinkListNode* p) {
|
||||
JUT_ASSERT(0x300, p!=0);
|
||||
JUT_ASSERT(0x300, p!=NULL);
|
||||
return reinterpret_cast<const T*>(reinterpret_cast<const char*>(p) + I);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ struct TExpandStride_<s32> {
|
||||
//! Target: toValueFromIndex<PFdd_d>__7JGadgetFiPCPFdd_dUlRCPFdd_d_RCPFdd_d
|
||||
template <typename T>
|
||||
inline const T& toValueFromIndex(int idx, const T* pValue, u32 count, const T& fallback) {
|
||||
JUT_ASSERT(200, pValue!=0);
|
||||
JUT_ASSERT(200, pValue!=NULL);
|
||||
u32 index = idx;
|
||||
if (index >= count) {
|
||||
return fallback;
|
||||
|
||||
@@ -23,7 +23,7 @@ struct TAllocator {
|
||||
}
|
||||
|
||||
void destroy(T* p) {
|
||||
JUT_ASSERT(68, p!=0);
|
||||
JUT_ASSERT(68, p!=NULL);
|
||||
}
|
||||
|
||||
/* 0x0 */ u8 mAllocator;
|
||||
|
||||
@@ -125,7 +125,7 @@ struct TVector {
|
||||
u32 capacity() { return mCapacity; }
|
||||
|
||||
u32 GetSize_extend_(u32 count) {
|
||||
JUT_ASSERT(0x22B, pfnExtend_!=0);
|
||||
JUT_ASSERT(0x22B, pfnExtend_!=NULL);
|
||||
|
||||
u32 oldSize = size();
|
||||
u32 neededNewSpace = oldSize + count;
|
||||
|
||||
Reference in New Issue
Block a user