shithub: cstory

Download patch

ref: 25e68bfb9d92d048009d3f062862b8c0e9e70b8c
parent: 421a3c46cd3e00bbb58ccb0432110b9a193e706e
author: Clownacy <[email protected]>
date: Mon May 6 16:18:24 EDT 2019

Mark string pointers as const

--- a/src/Ending.cpp
+++ b/src/Ending.cpp
@@ -59,7 +59,7 @@
 }
 
 //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++)
 	{
--- a/src/Ending.h
+++ b/src/Ending.h
@@ -37,7 +37,7 @@
 
 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();
--- a/src/NpChar.cpp
+++ b/src/NpChar.cpp
@@ -53,7 +53,7 @@
 	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);
--- a/src/NpChar.h
+++ b/src/NpChar.h
@@ -83,7 +83,7 @@
 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);
--- a/src/Profile.cpp
+++ b/src/Profile.cpp
@@ -40,7 +40,7 @@
 	return true;
 }
 
-bool SaveProfile(char *name)
+bool SaveProfile(const char *name)
 {
 	//Get path
 	char path[PATH_LENGTH];
@@ -119,7 +119,7 @@
 	return true;
 }
 
-bool LoadProfile(char *name)
+bool LoadProfile(const char *name)
 {
 	//Get path
 	char path[PATH_LENGTH];
--- a/src/Profile.h
+++ b/src/Profile.h
@@ -31,6 +31,6 @@
 };
 
 bool IsProfile();
-bool SaveProfile(char *name);
-bool LoadProfile(char *name);
+bool SaveProfile(const char *name);
+bool LoadProfile(const char *name);
 bool InitializeGame();
--- a/src/TextScr.cpp
+++ b/src/TextScr.cpp
@@ -141,7 +141,7 @@
 }
 
 //Load stage .tsc
-bool LoadTextScript_Stage(char *name)
+bool LoadTextScript_Stage(const char *name)
 {
 	//Open Head.tsc
 	char path[PATH_LENGTH];
--- a/src/TextScr.h
+++ b/src/TextScr.h
@@ -61,7 +61,7 @@
 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();