From b4d2ea72af07a0481994333be517c267aa285d54 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 24 Dec 2024 01:11:38 +0100 Subject: [PATCH] Fix -Wwrite-strings warnings (#1267) warning: ISO C++ forbids converting a string constant to 'LegoChar*' --- LEGO1/lego/legoomni/include/act2brick.h | 2 +- LEGO1/lego/legoomni/include/legoanimationmanager.h | 2 +- LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp | 2 +- LEGO1/lego/legoomni/src/entity/act2brick.cpp | 2 +- LEGO1/lego/legoomni/src/race/carrace.cpp | 4 ++-- LEGO1/lego/legoomni/src/worlds/legoact2.cpp | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/LEGO1/lego/legoomni/include/act2brick.h b/LEGO1/lego/legoomni/include/act2brick.h index 55efc96733..26c51f8c8d 100644 --- a/LEGO1/lego/legoomni/include/act2brick.h +++ b/LEGO1/lego/legoomni/include/act2brick.h @@ -41,7 +41,7 @@ class Act2Brick : public LegoPathActor { void Mute(MxBool p_muted); private: - static LegoChar* g_lodNames[]; + static const LegoChar* g_lodNames[]; static MxLong g_lastHitActorTime; LegoCacheSound* m_whistleSound; // 0x154 diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index 49fd41554a..56f6d0a795 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -166,7 +166,7 @@ class LegoAnimationManager : public MxCore { MxBool FindVehicle(const char* p_name, MxU32& p_index); MxResult ReadAnimInfo(LegoFile* p_file, AnimInfo* p_info); MxResult ReadModelInfo(LegoFile* p_file, ModelInfo* p_info); - void FUN_10060480(LegoChar* p_characterNames[], MxU32 p_numCharacterNames); + void FUN_10060480(const LegoChar* p_characterNames[], MxU32 p_numCharacterNames); void FUN_100604d0(MxBool p_unk0x08); void FUN_100604f0(MxS32 p_objectIds[], MxU32 p_numObjectIds); void FUN_10060540(MxBool p_unk0x29); diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 5c5400a764..783b1eeeeb 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -881,7 +881,7 @@ void LegoAnimationManager::DeleteAnimations() // FUNCTION: LEGO1 0x10060480 // FUNCTION: BETA10 0x100412a9 -void LegoAnimationManager::FUN_10060480(LegoChar* p_characterNames[], MxU32 p_numCharacterNames) +void LegoAnimationManager::FUN_10060480(const LegoChar* p_characterNames[], MxU32 p_numCharacterNames) { for (MxS32 i = 0; i < p_numCharacterNames; i++) { for (MxS32 j = 0; j < sizeOfArray(g_characters); j++) { diff --git a/LEGO1/lego/legoomni/src/entity/act2brick.cpp b/LEGO1/lego/legoomni/src/entity/act2brick.cpp index f7f478393f..b0b6f67e89 100644 --- a/LEGO1/lego/legoomni/src/entity/act2brick.cpp +++ b/LEGO1/lego/legoomni/src/entity/act2brick.cpp @@ -19,7 +19,7 @@ DECOMP_SIZE_ASSERT(Act2Brick, 0x194) // GLOBAL: LEGO1 0x100f7a38 -LegoChar* Act2Brick::g_lodNames[] = +const LegoChar* Act2Brick::g_lodNames[] = {"xchbase1", "xchblad1", "xchseat1", "xchtail1", "xhback1", "xhljet1", "xhmidl1", "xhmotr1", "xhsidl1", "xhsidr1"}; // GLOBAL: LEGO1 0x100f7a60 diff --git a/LEGO1/lego/legoomni/src/race/carrace.cpp b/LEGO1/lego/legoomni/src/race/carrace.cpp index 9c5d6d4c9e..4b4f0acd8b 100644 --- a/LEGO1/lego/legoomni/src/race/carrace.cpp +++ b/LEGO1/lego/legoomni/src/race/carrace.cpp @@ -59,11 +59,11 @@ MxS32 CarRace::g_unk0x100d5d60[] = // GLOBAL: LEGO1 0x100f0c70 // STRING: LEGO1 0x100f0c48 -LegoChar* g_strCRCFRNTY6 = "C_RCFRNTY6"; +const LegoChar* g_strCRCFRNTY6 = "C_RCFRNTY6"; // GLOBAL: LEGO1 0x100f0c74 // STRING: LEGO1 0x100f0c3c -LegoChar* g_strCRCEDGEY0 = "C_RCEDGEY0"; +const LegoChar* g_strCRCEDGEY0 = "C_RCEDGEY0"; // GLOBAL: LEGO1 0x100f0c7c MxS32 g_unk0x100f0c7c = 2; diff --git a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp index ea400a24db..71a7c590a2 100644 --- a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp +++ b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp @@ -49,7 +49,7 @@ MxS32 g_unk0x100f43f0[] = { }; // GLOBAL: LEGO1 0x100f4410 -LegoChar* g_unk0x100f4410[] = {"bd", "pg", "rd", "sy", "ro", "cl"}; +const LegoChar* g_unk0x100f4410[] = {"bd", "pg", "rd", "sy", "ro", "cl"}; // GLOBAL: LEGO1 0x100f4428 MxS32 g_unk0x100f4428[] = { @@ -68,7 +68,7 @@ MxS32 g_unk0x100f4428[] = { }; // GLOBAL: LEGO1 0x100f4458 -LegoChar* g_unk0x100f4458[] = {"papa", "nick", "laura", "cl", "pg", "rd", "sy"}; +const LegoChar* g_unk0x100f4458[] = {"papa", "nick", "laura", "cl", "pg", "rd", "sy"}; // FUNCTION: LEGO1 0x1004fce0 // FUNCTION: BETA10 0x1003a5a0