mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
Clean up code, remove fakematches, add UNUSED, enable warnings (#2992)
* Remove NDEBUG_DEFINED fakematch, clean up getName temps * Fix ifdef * Fix bad JSystem pch ifdef breaking decomp.me * Remove Acch Chk fakematches * Private Acch fields * Fix some clangd errors in headers * Add UNUSED macro for matching debug parameters * Enable clangd unused-parameter warning * Remove extern from initializers Probably added by dol2asm? * Fix process profile definitions * Remove leftover dol2asm address comments * Remove some unnecessary double casts * Enable some more clangd warnings * Fix missing usages of fopAcM_ct * Fix wrong enum usage * Fix more fakematches
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
CompileFlags:
|
||||
Add: [
|
||||
"-Wno-c++11-compat-deprecated-writable-strings",
|
||||
"-Wno-extern-initializer",
|
||||
"-Wno-multichar",
|
||||
"-fdeclspec",
|
||||
"-Wno-c++11-extensions",
|
||||
"-Wuninitialized",
|
||||
"-Wsometimes-uninitialized",
|
||||
"-Wlogical-op-parentheses",
|
||||
"-Wbitwise-op-parentheses",
|
||||
# "-Wunused-variable",
|
||||
# "-Wunused-but-set-variable",
|
||||
"-Wunused-parameter",
|
||||
"-Wunused-but-set-parameter",
|
||||
"-Wself-assign",
|
||||
]
|
||||
Diagnostics:
|
||||
Suppress:
|
||||
|
||||
Vendored
+1
@@ -49,6 +49,7 @@
|
||||
"clangd.arguments": [
|
||||
"--function-arg-placeholders=0",
|
||||
"-header-insertion=never",
|
||||
// "--log=verbose",
|
||||
],
|
||||
"clangd.detectExtensionConflicts": true,
|
||||
}
|
||||
|
||||
+2
-4
@@ -287,11 +287,9 @@ if config.version in USE_REVOLUTION_SDK_VERSIONS:
|
||||
# Debug flags
|
||||
if args.debug:
|
||||
# Or -sym dwarf-2 for Wii compilers
|
||||
cflags_base.extend(["-sym on", "-DDEBUG=1", "-DDEBUG_DEFINED=1", "-DNDEBUG_DEFINED=0"])
|
||||
cflags_base.extend(["-sym on", "-DDEBUG=1"])
|
||||
elif config.version == "ShieldD":
|
||||
cflags_base.extend(["-DDEBUG=1", "-DDEBUG_DEFINED=1", "-DNDEBUG_DEFINED=0"])
|
||||
else:
|
||||
cflags_base.extend(["-DNDEBUG=1", "-DNDEBUG_DEFINED=1", "-DDEBUG_DEFINED=0"])
|
||||
cflags_base.extend(["-DDEBUG=1"])
|
||||
|
||||
# Warning flags
|
||||
if args.warn == "all":
|
||||
|
||||
@@ -270,7 +270,11 @@ struct TLinkList_factory : public TLinkList<T, I> {
|
||||
|
||||
template <typename T, int I>
|
||||
TLinkList_factory<T, I>::~TLinkList_factory() {
|
||||
#ifdef __MWERKS__
|
||||
JGADGET_ASSERTWARN(934, empty());
|
||||
#else
|
||||
JGADGET_ASSERTWARN(934, this->empty());
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef JSYSTEM_H
|
||||
#define JSYSTEM_H
|
||||
|
||||
#ifdef __MWERKS__
|
||||
#if __MWERKS__ && !defined(DECOMPCTX)
|
||||
#include "JSystem/JSystem.mch" // IWYU pragma: export
|
||||
#else
|
||||
#include "JSystem/JSystem.pch" // IWYU pragma: export
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
/* 0x6C */ const IsLeadByte_func* mIsLeadByte;
|
||||
};
|
||||
|
||||
extern u8 const JUTResFONT_Ascfont_fix12[16736];
|
||||
extern u8 const JUTResFONT_Ascfont_fix16[16736];
|
||||
extern u8 const JUTResFONT_Ascfont_fix12[];
|
||||
extern u8 const JUTResFONT_Ascfont_fix16[];
|
||||
|
||||
#endif /* JUTRESFONT_H */
|
||||
|
||||
@@ -409,18 +409,18 @@ public:
|
||||
/* vt[7] */ virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const = 0;
|
||||
/* vt[8] */ virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const = 0;
|
||||
/* vt[9] */ virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const = 0;
|
||||
/* 802649E0 vt[10]*/ virtual bool CrossCo(cCcD_ShapeAttr const&, f32*) const { return false; }
|
||||
/* vt[10]*/ virtual bool CrossCo(cCcD_ShapeAttr const&, f32*) const { return false; }
|
||||
/* vt[11]*/ virtual bool CrossCo(cCcD_PntAttr const&, f32*) const = 0;
|
||||
/* vt[12]*/ virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const = 0;
|
||||
/* vt[13]*/ virtual bool CrossCo(cCcD_TriAttr const&, f32*) const = 0;
|
||||
/* vt[14]*/ virtual bool CrossCo(cCcD_AabAttr const&, f32*) const = 0;
|
||||
/* vt[15]*/ virtual bool CrossCo(cCcD_CylAttr const&, f32*) const = 0;
|
||||
/* vt[16]*/ virtual bool CrossCo(cCcD_SphAttr const&, f32*) const = 0;
|
||||
/* 80084E38 vt[17]*/ virtual const cXyz& GetCoCP() const { return m_virtual_center; }
|
||||
/* 80084E2C vt[18]*/ virtual cXyz& GetCoCP() { return m_virtual_center; }
|
||||
/* vt[17]*/ virtual const cXyz& GetCoCP() const { return m_virtual_center; }
|
||||
/* vt[18]*/ virtual cXyz& GetCoCP() { return m_virtual_center; }
|
||||
/* vt[19]*/ virtual void CalcAabBox() = 0;
|
||||
/* vt[20]*/ virtual bool GetNVec(cXyz const&, cXyz*) const = 0;
|
||||
/* 80263A64 vt[21]*/ virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const;
|
||||
/* vt[21]*/ virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const;
|
||||
|
||||
cM3dGAab& GetWorkAab() { return mAab; }
|
||||
cM3dGAab const& GetWorkAab() const { return mAab; }
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
virtual void CalcTgPlusDmg(cCcD_Obj*, cCcD_Obj*, cCcD_Stts*, cCcD_Stts*);
|
||||
void SetAtTgCommonHitInf(cCcD_Obj*, cCcD_Obj*, cXyz*);
|
||||
void SetCoCommonHitInf(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32);
|
||||
/* 80265750 vt[3]*/ virtual void SetPosCorrect(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32);
|
||||
/* vt[3]*/ virtual void SetPosCorrect(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32);
|
||||
void CalcArea();
|
||||
void Move();
|
||||
void DrawClear();
|
||||
|
||||
@@ -3,4 +3,8 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
void* TRK_memset(void* dest, int val, size_t count);
|
||||
void* TRK_memcpy(void* dest, const void* src, size_t count);
|
||||
void TRK_fill_mem(void* dest, int val, size_t count);
|
||||
|
||||
#endif /* METROTRK_PORTABLE_MEM_TRK_H */
|
||||
|
||||
@@ -11,6 +11,25 @@ DSError TRKSetBufferPosition(TRKBuffer* msg, u32 pos);
|
||||
void* TRKGetBuffer(int);
|
||||
void TRKResetBuffer(TRKBuffer* msg, BOOL keepData);
|
||||
|
||||
DSError TRKAppendBuffer1_ui16(TRKBuffer* buffer, const u16 data);
|
||||
DSError TRKAppendBuffer1_ui32(TRKBuffer* buffer, const u32 data);
|
||||
DSError TRKAppendBuffer1_ui64(TRKBuffer* buffer, const u64 data);
|
||||
|
||||
DSError TRKAppendBuffer_ui8(TRKBuffer* buffer, const u8* data, int count);
|
||||
DSError TRKAppendBuffer_ui16(TRKBuffer* buffer, const u16* data, int count);
|
||||
DSError TRKAppendBuffer_ui32(TRKBuffer* buffer, const u32* data, int count);
|
||||
DSError TRKAppendBuffer_ui64(TRKBuffer* buffer, const u64* data, int count);
|
||||
|
||||
DSError TRKReadBuffer1_ui8(TRKBuffer* buffer, u8* data);
|
||||
DSError TRKReadBuffer1_ui16(TRKBuffer* buffer, u16* data);
|
||||
DSError TRKReadBuffer1_ui32(TRKBuffer* buffer, u32* data);
|
||||
DSError TRKReadBuffer1_ui64(TRKBuffer* buffer, u64* data);
|
||||
|
||||
DSError TRKReadBuffer_ui8(TRKBuffer* buffer, u8* data, int count);
|
||||
DSError TRKReadBuffer_ui16(TRKBuffer* buffer, u16* data, int count);
|
||||
DSError TRKReadBuffer_ui32(TRKBuffer* buffer, u32* data, int count);
|
||||
DSError TRKReadBuffer_ui64(TRKBuffer* buffer, u64* data, int count);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef METROTRK_PORTABLE_MUTEX_TRK_H
|
||||
#define METROTRK_PORTABLE_MUTEX_TRK_H
|
||||
|
||||
#include "revolution/types.h"
|
||||
|
||||
u8 TRKReleaseMutex();
|
||||
u8 TRKAcquireMutex();
|
||||
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
}
|
||||
|
||||
void setSpeed(f32 param_0, f32 param_1, f32* param_2, int param_3) {
|
||||
(void)param_3;
|
||||
UNUSED(param_3);
|
||||
f32 target = field_0xb5c * (param_1 * field_0xb5c);
|
||||
f32 step = field_0xb5c * (param_0 * field_0xb5c);
|
||||
if (param_1 < target) {
|
||||
|
||||
@@ -29,33 +29,26 @@ public:
|
||||
void setActionMode(int);
|
||||
f32 setAddCalcSpeedXZ(cXyz&, cXyz const&, f32, f32, f32);
|
||||
cXyz chaseTargetPos(cXyz, f32, f32, s16);
|
||||
/* 80B01D84 */
|
||||
fopAc_ac_c* getMasterPointer();
|
||||
void setMasterShoulder(cXyz*);
|
||||
void setAwayAction(int);
|
||||
void setFlySE();
|
||||
void executeFly();
|
||||
void initPerchDemo(int);
|
||||
/* 80B02B5C */
|
||||
bool executePerchDemo(int);
|
||||
void executePerch();
|
||||
void executeHandOn();
|
||||
/* 80B039A8 */
|
||||
bool checkWaterSurface(f32);
|
||||
void executeAttack();
|
||||
void executeAway();
|
||||
void setCarryActorMtx();
|
||||
/* 80B04F64 */
|
||||
f32 getTakePosY();
|
||||
/* 80B04FA8 */
|
||||
f32 getTakeOffPosY();
|
||||
void executeBack();
|
||||
/* 80B05BD0 */
|
||||
cXyz getHanjoHandPos();
|
||||
void executeStayHanjo();
|
||||
void executeAttackLink();
|
||||
void executeBackHanjo();
|
||||
/* 80B07114 */
|
||||
bool checkAttackDemo();
|
||||
void executeAttackDemo();
|
||||
void executeBackHanjoDemo();
|
||||
@@ -74,7 +67,6 @@ public:
|
||||
void cc_set();
|
||||
int execute();
|
||||
int _delete();
|
||||
/* 80B0B9AC */
|
||||
int ctrlJoint(J3DJoint*, J3DModel*);
|
||||
static int JointCallBack(J3DJoint*, int);
|
||||
int CreateHeap();
|
||||
|
||||
@@ -57,7 +57,6 @@ STATIC_ASSERT(sizeof(daLv6SwGate_c) == 0x14f8);
|
||||
|
||||
class daLv6SwGate_HIO_c : public fOpAcm_HIO_entry_c {
|
||||
public:
|
||||
/* 80C73F0C */
|
||||
daLv6SwGate_HIO_c();
|
||||
|
||||
void genMessage(JORMContext*);
|
||||
|
||||
@@ -81,7 +81,7 @@ private:
|
||||
/* 0x094E */ bool mIsInWater;
|
||||
/* 0x094F */ u8 field_0x094f;
|
||||
/* 0x0950 */ u8 field_0x0950;
|
||||
/* 0x0951 */ u8 field_0x0951;
|
||||
/* 0x0951 */ bool field_0x0951;
|
||||
/* 0x0954 */ u32 field_0x0954;
|
||||
/* 0x0954 */ u32 field_0x0958;
|
||||
/* 0x0954 */ u32 field_0x095c;
|
||||
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
f32 GetCx() const { return pm_pos->x; }
|
||||
f32 GetCz() const { return pm_pos->z; }
|
||||
|
||||
public:
|
||||
private:
|
||||
/* 0x02C */ u32 m_flags;
|
||||
/* 0x030 */ cXyz* pm_pos;
|
||||
/* 0x034 */ cXyz* pm_old_pos;
|
||||
@@ -231,9 +231,11 @@ public:
|
||||
/* 0x0E4 */ cXyz unk_0xe4;
|
||||
#endif
|
||||
/* 0x0D8 */ f32 field_0xd8;
|
||||
public:
|
||||
/* 0x0DC */ dBgS_GndChk m_gnd;
|
||||
/* 0x130 */ dBgS_RoofChk m_roof;
|
||||
/* 0x180 */ dBgS_WtrChk m_wtr;
|
||||
private:
|
||||
/* 0x1D4 */ u8 m_wtr_mode;
|
||||
}; // Size: 0x1D8
|
||||
|
||||
|
||||
@@ -840,7 +840,7 @@ public:
|
||||
~dComIfG_inf_c() {}
|
||||
void ct();
|
||||
void createBaseCsr();
|
||||
dComIfG_play_c& getPlay() { return play; }
|
||||
dComIfG_play_c& getPlay() { return play; } // fake inline
|
||||
|
||||
#if PLATFORM_WII || VERSION == VERSION_SHIELD_DEBUG
|
||||
class baseCsr_c : public mDoGph_gInf_c::csr_c {
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
/* 0x1C */ f32 mBank;
|
||||
struct {
|
||||
/* 0x20 */ fpc_ProcID id;
|
||||
/* 0x24 */ char name[8];
|
||||
/* 0x24 */ char name[dStage_NAME_LENGTH];
|
||||
} mActorInfo;
|
||||
/* 0x2C */ int mAction;
|
||||
/* 0x30 */ int mTimer;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef D_MENU_D_MENU_FMAP_H
|
||||
#define D_MENU_D_MENU_FMAP_H
|
||||
|
||||
#include "JSystem/JHostIO/JORReflexible.h"
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
#include "d/d_menu_map_common.h"
|
||||
#include "d/d_msg_flow.h"
|
||||
|
||||
@@ -141,13 +141,13 @@ public:
|
||||
virtual void genMessage(JORMContext*);
|
||||
virtual u32 addString(char* param_1, u32 param_2, u32 param_3) { return field_0xc.addString(param_1, param_2, param_3); }
|
||||
virtual u32 addData(char* param_1, u32 param_2, u32 param_3) {
|
||||
(void)param_2;
|
||||
(void)param_3;
|
||||
UNUSED(param_2);
|
||||
UNUSED(param_3);
|
||||
memcpy(param_1, dMfm_HIO_prm_res_dst_s::m_res, 366);
|
||||
return 366;
|
||||
}
|
||||
virtual void copyReadBufToData(const char* param_1, s32 param_2) {
|
||||
(void)param_2;
|
||||
UNUSED(param_2);
|
||||
field_0xc.copyBufToHio(param_1);
|
||||
}
|
||||
virtual u32 addStringBinary(char* param_1, u32 param_2, u32 param_3) { return field_0xc.addStringBinary(param_1, param_2, param_3); }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user