More GCC compatibility/warning fixes (#3118)

* Wrap >4-char literals in a MULTI_CHAR macro

Modern compilers do not support CW's non-standard behavior with
>4 char literals. We can, however, use a constexpr function to
compute the u64 values directly. This leaves <=4 char literals
unchanged.

* Replace non-pointer usages of NULL with 0

* Define NULL to nullptr on C++11 and above

* Fix more -Wpointer-arith and -Woverflow warnings

* Replace u32/s32 with uintptr_t/intptr_t where appropriate

* JSUOutputStream: Overload all standard int types
This commit is contained in:
Luke Street
2026-02-28 21:19:17 -07:00
committed by GitHub
parent b5d3b8c059
commit 6a48380461
169 changed files with 1849 additions and 1818 deletions
+1 -1
View File
@@ -199,7 +199,7 @@ public:
BOOL chkCondition(u16 condition) { return (mCondition & condition) == condition; }
void suspendProc(void* actor) {
if (field_0x10 != NULL) {
if (field_0x10 != 0) {
field_0x14(actor);
}
}
+8 -1
View File
@@ -423,7 +423,14 @@ inline BOOL fopAcM_CULLSIZE_IS_BOX(int i_culltype) {
i_culltype == fopAc_CULLBOX_CUSTOM_e;
}
inline const cXyz& fopAcM_getCullSizeSphereCenter(const fopAc_ac_c* i_actor) {
inline
#ifdef __MWERKS__
// In the original code, this constructs a temporary and returns a reference to it
const cXyz&
#else
const Vec&
#endif
fopAcM_getCullSizeSphereCenter(const fopAc_ac_c* i_actor) {
return i_actor->cull.sphere.center;
}
+3 -2
View File
@@ -4,14 +4,15 @@
#include "f_op/f_op_scene_pause.h"
#include "f_pc/f_pc_manager.h"
#include "f_op/f_op_scene.h"
#include <cstdint>
typedef struct base_process_class base_process_class;
scene_class* fopScnM_SearchByID(fpc_ProcID id);
int fopScnM_ChangeReq(scene_class* i_scene, s16 i_procName, s16 param_3, u16 param_4);
fpc_ProcID fopScnM_DeleteReq(scene_class* i_scene);
int fopScnM_CreateReq(s16 i_procName, s16 param_2, u16 param_3, u32 i_data);
u32 fopScnM_ReRequest(s16 i_procName, u32 i_data);
int fopScnM_CreateReq(s16 i_procName, s16 param_2, u16 param_3, uintptr_t i_data);
u32 fopScnM_ReRequest(s16 i_procName, uintptr_t i_data);
void fopScnM_Management();
void fopScnM_Init();