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 38b7156a8e
commit 6e748ac283
169 changed files with 1849 additions and 1818 deletions
+9 -9
View File
@@ -58,19 +58,19 @@ int dMeterString_c::_create() {
mpGetInBck = (J2DAnmTransformKey*)J2DAnmLoaderDataBase::load(
JKRGetNameResource("zelda_game_image_cow_get_in.bck", mpMapArchive));
mpParentPane = new CPaneMgr(mpScreen, 'get_in_n', 2, NULL);
mpParentPane = new CPaneMgr(mpScreen, MULTI_CHAR('get_in_n'), 2, NULL);
JUT_ASSERT(0, mpParentPane != NULL);
mpRootPane = new CPaneMgr(mpScreen, 'n_all', 0, NULL);
mpRootPane = new CPaneMgr(mpScreen, MULTI_CHAR('n_all'), 0, NULL);
JUT_ASSERT(0, mpRootPane != NULL);
mpTextPane = new CPaneMgr(mpScreen, 'get_in', 0, NULL);
mpTextPane = new CPaneMgr(mpScreen, MULTI_CHAR('get_in'), 0, NULL);
JUT_ASSERT(0, mpTextPane != NULL);
static_cast<J2DTextBox*>(mpScreen->search('get_in_s'))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search('get_in'))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search('get_in_s'))->setString(0x100, "");
static_cast<J2DTextBox*>(mpScreen->search('get_in'))->setString(0x100, "");
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('get_in_s')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('get_in')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('get_in_s')))->setString(0x100, "");
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('get_in')))->setString(0x100, "");
mAnimFrame = 0.0f;
mPikariAnimFrame = 0.0f;
@@ -166,8 +166,8 @@ int dMeterString_c::_delete() {
int dMeterString_c::createString(int i_stringID) {
char str_buf[32];
dMeter2Info_getString(i_stringID, str_buf, NULL);
strcpy(static_cast<J2DTextBox*>(mpScreen->search('get_in_s'))->getStringPtr(), str_buf);
strcpy(static_cast<J2DTextBox*>(mpScreen->search('get_in'))->getStringPtr(), str_buf);
strcpy(static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('get_in_s')))->getStringPtr(), str_buf);
strcpy(static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('get_in')))->getStringPtr(), str_buf);
mAnimFrame = 40.0f;
mPikariAnimFrame = -1.0f;