diff options
| author | Jcw87 <Jcw87@users.noreply.github.com> | 2023-04-29 17:32:56 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-29 17:32:56 -0700 |
| commit | 4a29d25e65b1e03f1b776375dc75d44e3ec478da (patch) | |
| tree | 34435ecd6f03843e2c05c2e8f2d3adcee7a291a5 /include | |
| parent | 0c4e853e4bc94bfe736c5575075334cc6e3d6397 (diff) | |
improve const correctness (#325)
Diffstat (limited to 'include')
| -rw-r--r-- | include/c/c_dylink.h | 2 | ||||
| -rw-r--r-- | include/d/a/d_a_shop_item_static.h | 4 | ||||
| -rw-r--r-- | include/d/d_item_data.h | 8 | ||||
| -rw-r--r-- | include/d/d_timer.h | 2 | ||||
| -rw-r--r-- | include/d/kankyo/d_kankyo_data.h | 4 | ||||
| -rw-r--r-- | include/d/meter/d_meter2_info.h | 2 | ||||
| -rw-r--r-- | include/dolphin/os/OS.h | 18 |
7 files changed, 20 insertions, 20 deletions
diff --git a/include/c/c_dylink.h b/include/c/c_dylink.h index 53294d9a26..d2e7ca3869 100644 --- a/include/c/c_dylink.h +++ b/include/c/c_dylink.h @@ -14,7 +14,7 @@ struct cDylPhs { struct DynamicNameTableEntry { s16 mKey; - char* name; + const char* name; }; int cDyl_InitAsyncIsDone(); diff --git a/include/d/a/d_a_shop_item_static.h b/include/d/a/d_a_shop_item_static.h index 2c61c9b615..b9e3edf2bd 100644 --- a/include/d/a/d_a_shop_item_static.h +++ b/include/d/a/d_a_shop_item_static.h @@ -4,7 +4,7 @@ #include "d/a/d_a_itembase.h" struct ResourceData { - char* get_arcName() const { return mArcName; } + const char* get_arcName() const { return mArcName; } s16 get_bmdName() const { return mBmdName; } s16 get_btk1Name() const { return mBtkName; } s16 get_bpk1Name() const { return mBpkName; } @@ -13,7 +13,7 @@ struct ResourceData { s16 get_brk1Name() const { return mBrkName; } s16 get_btp1Name() const { return mBtpName; } - /* 0x00 */ char* mArcName; + /* 0x00 */ const char* mArcName; /* 0x04 */ s16 mBmdName; /* 0x06 */ s16 mBtkName; /* 0x08 */ s16 mBpkName; diff --git a/include/d/d_item_data.h b/include/d/d_item_data.h index b7158748af..8e33cd7287 100644 --- a/include/d/d_item_data.h +++ b/include/d/d_item_data.h @@ -11,7 +11,7 @@ struct dItem_itemInfo { }; struct dItem_itemResource { - /* 0x00 */ char* mArcName; + /* 0x00 */ const char* mArcName; /* 0x04 */ s16 mBmdName; /* 0x06 */ s16 mBtkName; /* 0x08 */ s16 mBckName; @@ -25,7 +25,7 @@ struct dItem_itemResource { }; // Size: 0x18 struct dItem_fieldItemResource { - /* 0x0 */ char* mFieldArc; + /* 0x0 */ const char* mFieldArc; /* 0x4 */ s16 mItemBmdName; /* 0x6 */ s16 mItemBckName; /* 0x8 */ s16 mItemBrkName; @@ -34,7 +34,7 @@ struct dItem_fieldItemResource { }; // Size: 0x10 struct dItem_data { - static char* getArcName(u8 index) { return item_resource[index].mArcName; } + static const char* getArcName(u8 index) { return item_resource[index].mArcName; } static s16 getBtpName(u8 index) { return item_resource[index].mBtpName; } @@ -56,7 +56,7 @@ struct dItem_data { static s16 getTexture(u8 index) { return item_resource[index].mTexture; } - static char* getFieldArc(u8 index) { return field_item_res[index].mFieldArc; } + static const char* getFieldArc(u8 index) { return field_item_res[index].mFieldArc; } static s16 getItemBmdName(u8 index) { return field_item_res[index].mItemBmdName; } diff --git a/include/d/d_timer.h b/include/d/d_timer.h index ef75f4045d..397de45ce7 100644 --- a/include/d/d_timer.h +++ b/include/d/d_timer.h @@ -34,7 +34,7 @@ public: /* 8025EB20 */ void hideDenominator(); /* 8025EC5C */ void deleteScreen(); /* 8025EE24 */ void changeNumberTexture(J2DPane*, int); - /* 8025EECC */ char* getNumber(int); + /* 8025EECC */ const char* getNumber(int); /* 8025EEF0 */ void setTimer(int); /* 8025F180 */ void setCounter(u8, u8); /* 8025FA00 */ void setParentPos(f32, f32); diff --git a/include/d/kankyo/d_kankyo_data.h b/include/d/kankyo/d_kankyo_data.h index a77b19347a..77bac70413 100644 --- a/include/d/kankyo/d_kankyo_data.h +++ b/include/d/kankyo/d_kankyo_data.h @@ -21,13 +21,13 @@ enum dKyd_DARKLV { class dKydata_darkworldInfo_c { public: - /* 0x0 */ char* stageName; + /* 0x0 */ const char* stageName; /* 0x4 */ u8 darkLv; }; // Size: 0x8 class dKydata_lightsizeInfo_c { public: - /* 0x0 */ char* stageName; + /* 0x0 */ const char* stageName; /* 0x4 */ u8 size; }; // Size: 0x8 diff --git a/include/d/meter/d_meter2_info.h b/include/d/meter/d_meter2_info.h index c7be57cb59..27a9d90192 100644 --- a/include/d/meter/d_meter2_info.h +++ b/include/d/meter/d_meter2_info.h @@ -542,7 +542,7 @@ inline void dMeter2Info_resetDirectUseItem() { g_meter2_info.resetDirectUseItem(); } -char* dMeter2Info_getNumberTextureName(int pIndex); +const char* dMeter2Info_getNumberTextureName(int pIndex); void dMeter2Info_recieveLetter(); u8 dMeter2Info_getNewLetterNum(); int dMeter2Info_setNewLetterSender(); diff --git a/include/dolphin/os/OS.h b/include/dolphin/os/OS.h index ec036ea8b8..21bbc49797 100644 --- a/include/dolphin/os/OS.h +++ b/include/dolphin/os/OS.h @@ -78,19 +78,19 @@ BOOL OSIsThreadSuspended(OSThread* thread); u32 OSGetConsoleType(void); -void OSAttention(char* msg, ...); -void OSPanic(char* file, s32 line, char* fmt, ...); -void OSReport(char* fmt, ...); -void OSReport_Error(char* fmt, ...); -void OSReport_FatalError(char* fmt, ...); -void OSReport_System(char* fmt, ...); -void OSReport_Warning(char* fmt, ...); +void OSAttention(const char* msg, ...); +void OSPanic(const char* file, s32 line, const char* fmt, ...); +void OSReport(const char* fmt, ...); +void OSReport_Error(const char* fmt, ...); +void OSReport_FatalError(const char* fmt, ...); +void OSReport_System(const char* fmt, ...); +void OSReport_Warning(const char* fmt, ...); void OSReportDisable(void); void OSReportEnable(void); void OSReportForceEnableOff(void); void OSReportForceEnableOn(void); -void OSVReport(char* format, va_list list); -void OSVAttention(char* fmt, va_list args); +void OSVReport(const char* format, va_list list); +void OSVAttention(const char* fmt, va_list args); void OSReportInit(void); extern u8 __OSReport_disable; |
