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
+4 -4
View File
@@ -1340,7 +1340,7 @@ void daNPC_TK_c::executeBack() {
if (current.pos.y > unkXyz1.y) {
cLib_chaseAngleS(&shape_angle.x, 0x2000, 0x400);
} else {
cLib_chaseAngleS(&shape_angle.x, 0xffffe000, 0x400);
cLib_chaseAngleS(&shape_angle.x, -8192, 0x400);
}
} else {
cLib_chaseAngleS(&field_0x69c, 0x200, 0x10);
@@ -1379,7 +1379,7 @@ void daNPC_TK_c::executeBack() {
if (current.pos.y > unkXyz1.y) {
cLib_chaseAngleS(&shape_angle.x, 0x2000, 0x400);
} else {
cLib_chaseAngleS(&shape_angle.x, 0xffffe000, 0x400);
cLib_chaseAngleS(&shape_angle.x, -8192, 0x400);
}
} else {
cLib_chaseAngleS(&field_0x69c, 0x200, 0x10);
@@ -2456,7 +2456,7 @@ void daNPC_TK_c::executeWolfPerch() {
void daNPC_TK_c::executeResistanceDemo() {
daNpcMoiR_c* npcMoiR;
if (fopAcM_SearchByName(PROC_NPC_MOIR, (fopAc_ac_c**)&npcMoiR) == NULL || npcMoiR == NULL) {
if (fopAcM_SearchByName(PROC_NPC_MOIR, (fopAc_ac_c**)&npcMoiR) == 0 || npcMoiR == NULL) {
return;
}
@@ -2623,7 +2623,7 @@ void daNPC_TK_c::executeResistanceDemo() {
// fallthrough
case 8: {
cLib_addCalcAngleS2(&field_0x6a2, 0xffffdc00, 8, 0x200);
cLib_addCalcAngleS2(&field_0x6a2, -9216, 8, 0x200);
cLib_addCalcAngleS2(&field_0x6a0, 0x1000, 8, 0x200);
cLib_addCalcAngleS2(&field_0x6aa, 0x2000, 8, 0x200);