Another round of GCC fixes (#3115)

* Fix remaining <string> -> <cstring> for GCC compilation (#3114 follow-up)

MWerks' <string> header transitively includes C string functions
(memcpy, strlen, strcmp, etc.), but GCC/Clang's <string> is the C++
std::string header. These files all use C string functions and should
include <cstring> instead.

* Use std::isnan instead of isnan for GCC compilation

GCC's <cmath> places isnan in the std namespace. Using the unqualified
isnan fails to compile with GCC/Clang.

* Fix cCcD_Src types: s32 -> u32 for bitmask fields

cCcD_SrcObjCommonBase::mSPrm, cCcD_SrcObjTg::mType, and
cCcD_SrcObjAt::mType are used as bitmasks (SetType/SetSPrm take u32,
MskType/MskSPrm use u32, values like 0xFFFFFFFF are common in
aggregate inits). Change from s32 to u32 to match usage.

Also fix AT_TYPE_WOLF_ATTACK/AT_TYPE_UNK to use unsigned literals,
and remove now-unnecessary (s32) casts on hex literals in collision
source data.

* Mark dummy() functions as static to avoid multiple definition errors

These decomp artifact functions have the same name and signature across
TUs, causing linker errors when building as a single binary.
This commit is contained in:
Luke Street
2026-02-28 14:35:07 -07:00
committed by GitHub
parent 06ebc176c2
commit b5d3b8c059
67 changed files with 96 additions and 75 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
#define JASGADGET_H
#include "JSystem/JUtility/JUTAssert.h"
#include <string>
#include <cstring>
#ifdef __MWERKS__
#define JAS_GLOBAL_INSTANCE_INIT
+1 -1
View File
@@ -2,7 +2,7 @@
#define JUTFONT_H
#include "JSystem/JUtility/TColor.h"
#include <string>
#include <cstring>
/**
* @ingroup jsystem-jutility
+5 -5
View File
@@ -62,8 +62,8 @@ enum cCcD_ObjAtType {
/* 0x10000000 */ AT_TYPE_10000000 = (1 << 28),
/* 0x10000000 */ AT_TYPE_20000000 = (1 << 29),
/* 0x40000000 */ AT_TYPE_WOLF_CUT_TURN = (1 << 30),
/* 0x80000000 */ AT_TYPE_WOLF_ATTACK = (1 << 31),
/* 0xD8000000 */ AT_TYPE_UNK = 0xD8000000
/* 0x80000000 */ AT_TYPE_WOLF_ATTACK = (1u << 31),
/* 0xD8000000 */ AT_TYPE_UNK = 0xD8000000u
};
struct cCcD_SrcTriAttr {
@@ -120,16 +120,16 @@ public:
STATIC_ASSERT(0x40 == sizeof(cCcD_DivideArea));
struct cCcD_SrcObjCommonBase {
/* 0x0 */ s32 mSPrm;
/* 0x0 */ u32 mSPrm;
};
struct cCcD_SrcObjTg {
/* 0x0 */ s32 mType;
/* 0x0 */ u32 mType;
/* 0x4 */ cCcD_SrcObjCommonBase mBase;
}; // Size: 0x8
struct cCcD_SrcObjAt {
/* 0x0 */ s32 mType;
/* 0x0 */ u32 mType;
/* 0x4 */ u8 mAtp;
/* 0x8 */ cCcD_SrcObjCommonBase mBase;
}; // Size: 0xC
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef D_SAVE_D_SAVE_H
#define D_SAVE_D_SAVE_H
#include <string>
#include <cstring>
#include "SSystem/SComponent/c_xyz.h"
#include <dolphin/os.h>
#include "global.h"
+1 -1
View File
@@ -6,7 +6,7 @@
#include "JSystem/JFramework/JFWDisplay.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "CaptureScreen.h"
#include <string>
#include <cstring>
void fapGm_After();
void fapGm_Create();
+5
View File
@@ -152,4 +152,9 @@ static const float INF = 2000000000.0f;
#define FABSF std::fabsf
#endif
#ifndef __MWERKS__
#include <cmath>
using std::isnan;
#endif
#endif