From 25e68bfb9d92d048009d3f062862b8c0e9e70b8c Mon Sep 17 00:00:00 2001 From: Clownacy Date: Mon, 6 May 2019 20:18:24 +0100 Subject: [PATCH] Mark string pointers as const --- src/Ending.cpp | 2 +- src/Ending.h | 2 +- src/NpChar.cpp | 2 +- src/NpChar.h | 2 +- src/Profile.cpp | 4 ++-- src/Profile.h | 4 ++-- src/TextScr.cpp | 2 +- src/TextScr.h | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Ending.cpp b/src/Ending.cpp index f9a13118..37612a6f 100644 --- a/src/Ending.cpp +++ b/src/Ending.cpp @@ -59,7 +59,7 @@ void PutStripper() } //Create a cast object -void SetStripper(int x, int y, char *text, int cast) +void SetStripper(int x, int y, const char *text, int cast) { for (int s = 0; s < MAX_STRIP; s++) { diff --git a/src/Ending.h b/src/Ending.h index b9bdfeb9..b5a4d693 100644 --- a/src/Ending.h +++ b/src/Ending.h @@ -37,7 +37,7 @@ struct ISLAND_SPRITE void ActionStripper(); void PutStripper(); -void SetStripper(int x, int y, char *text, int cast); +void SetStripper(int x, int y, const char *text, int cast); void RestoreStripper(); void ActionIllust(); void PutIllust(); diff --git a/src/NpChar.cpp b/src/NpChar.cpp index 2522b10f..062773ca 100644 --- a/src/NpChar.cpp +++ b/src/NpChar.cpp @@ -53,7 +53,7 @@ void SetUniqueParameter(NPCHAR *npc) npc->view.bottom = gNpcTable[code].view.bottom << 9; } -bool LoadEvent(char *path_event) +bool LoadEvent(const char *path_event) { char path[PATH_LENGTH]; sprintf(path, "%s/%s", gDataPath, path_event); diff --git a/src/NpChar.h b/src/NpChar.h index 2a39f345..ac3e0886 100644 --- a/src/NpChar.h +++ b/src/NpChar.h @@ -83,7 +83,7 @@ extern int gSuperXpos; extern int gSuperYpos; void InitNpChar(); -bool LoadEvent(char *path_event); +bool LoadEvent(const char *path_event); void SetNpChar(int code_char, int x, int y, int xm, int ym, int dir, NPCHAR *npc, int start_index); void SetDestroyNpChar(int x, int y, int w, int num); void SetDestroyNpCharUp(int x, int y, int w, int num); diff --git a/src/Profile.cpp b/src/Profile.cpp index 597219da..73e419e4 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -40,7 +40,7 @@ bool IsProfile() return true; } -bool SaveProfile(char *name) +bool SaveProfile(const char *name) { //Get path char path[PATH_LENGTH]; @@ -119,7 +119,7 @@ bool SaveProfile(char *name) return true; } -bool LoadProfile(char *name) +bool LoadProfile(const char *name) { //Get path char path[PATH_LENGTH]; diff --git a/src/Profile.h b/src/Profile.h index 3b70c1c5..cdd0ec90 100644 --- a/src/Profile.h +++ b/src/Profile.h @@ -31,6 +31,6 @@ struct PROFILE }; bool IsProfile(); -bool SaveProfile(char *name); -bool LoadProfile(char *name); +bool SaveProfile(const char *name); +bool LoadProfile(const char *name); bool InitializeGame(); diff --git a/src/TextScr.cpp b/src/TextScr.cpp index f502cfd3..8d90f8bf 100644 --- a/src/TextScr.cpp +++ b/src/TextScr.cpp @@ -141,7 +141,7 @@ bool LoadTextScript2(const char *name) } //Load stage .tsc -bool LoadTextScript_Stage(char *name) +bool LoadTextScript_Stage(const char *name) { //Open Head.tsc char path[PATH_LENGTH]; diff --git a/src/TextScr.h b/src/TextScr.h index 77553220..1b47b67d 100644 --- a/src/TextScr.h +++ b/src/TextScr.h @@ -61,7 +61,7 @@ BOOL InitTextScript2(); void EndTextScript(); void EncryptionBinaryData2(uint8_t *pData, int size); bool LoadTextScript2(const char *name); -bool LoadTextScript_Stage(char *name); +bool LoadTextScript_Stage(const char *name); void GetTextScriptPath(char *path); BOOL StartTextScript(int no); void StopTextScript();