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
@@ -369,14 +369,14 @@ dDlst_GameOverScrnDraw_c::dDlst_GameOverScrnDraw_c(JKRArchive* i_archive) {
mFadeColor.set(0, 0, 0, 0);
if (dMeter2Info_getGameOverType() != 0) {
mpScreen->search('n_base')->hide();
mpScreen->search(MULTI_CHAR('n_base'))->hide();
if (mDoGph_gInf_c::getFadeRate() == 1.0f) {
mFadeColor = mDoGph_gInf_c::getFadeColor();
}
}
mpScreen->search('base_b')->hide();
mpScreen->search(MULTI_CHAR('base_b'))->hide();
JUtility::TColor img_white(mFadeColor);
JUtility::TColor img_black(mFadeColor);
@@ -385,10 +385,10 @@ dDlst_GameOverScrnDraw_c::dDlst_GameOverScrnDraw_c(JKRArchive* i_archive) {
ResTIMG* img = (ResTIMG*)dComIfGp_getMain2DArchive()->getResource('TIMG', "tt_block8x8.bti");
mpBackImg =
new J2DPicture('PICT01', JGeometry::TBox2<f32>(0.0f, 486.0f, 0.0f, 660.0f), img, NULL);
new J2DPicture(MULTI_CHAR('PICT01'), JGeometry::TBox2<f32>(0.0f, 486.0f, 0.0f, 660.0f), img, NULL);
mpBackImg->setBlackWhite(img_white, img_black);
J2DTextBox* gold_tbox = (J2DTextBox*)mpScreen->search('gold_00');
J2DTextBox* gold_tbox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('gold_00'));
gold_tbox->setFont(mDoExt_getSubFont());
char string[64];