commit 2f44d86ea23a7737147c1d01622adaf7b7d7f2fe
Author: Turo Lamminen <turotl@gmail.com>
AuthorDate: Sat May 19 14:45:43 2018 +0300
Commit: Turo Lamminen <turotl@gmail.com>
CommitDate: Sat May 19 15:52:48 2018 +0300
dehacked: Make DEH_String parameter and return value const
This can't be broken into smaller pieces because of this kind of code:
lumpname = DEH_String(lumpname);
---
src/deh_str.c | 4 ++--
src/deh_str.h | 2 +-
src/doom/f_finale.c | 6 +++---
src/doom/g_game.c | 4 ++--
src/doom/hu_stuff.c | 2 +-
src/strife/g_game.c | 2 +-
src/strife/hu_stuff.c | 2 +-
7 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/deh_str.c b/src/deh_str.c
index 7f16aa1c..a7b586e1 100644
--- a/src/deh_str.c
+++ b/src/deh_str.c
@@ -80,7 +80,7 @@ static deh_substitution_t *SubstitutionForString(const char *s)
// Look up a string to see if it has been replaced with something else
// This will be used throughout the program to substitute text
-char *DEH_String(char *s)
+const char *DEH_String(const char *s)
{
deh_substitution_t *subst;
@@ -368,7 +368,7 @@ static boolean ValidFormatReplacement(const char *original, const char *replacem
static const char *FormatStringReplacement(char *s)
{
- char *repl;
+ const char *repl;
repl = DEH_String(s);
diff --git a/src/deh_str.h b/src/deh_str.h
index 22b66b2d..1b42feb5 100644
--- a/src/deh_str.h
+++ b/src/deh_str.h
@@ -24,7 +24,7 @@
// Used to do dehacked text substitutions throughout the program
-char *DEH_String(char *s) PRINTF_ARG_ATTR(1);
+const char *DEH_String(const char *s) PRINTF_ARG_ATTR(1);
void DEH_printf(char *fmt, ...) PRINTF_ATTR(1, 2);
void DEH_fprintf(FILE *fstream, char *fmt, ...) PRINTF_ATTR(2, 3);
void DEH_snprintf(char *buffer, size_t len, char *fmt, ...) PRINTF_ATTR(3, 4);
diff --git a/src/doom/f_finale.c b/src/doom/f_finale.c
index cfe7c74f..900cca21 100644
--- a/src/doom/f_finale.c
+++ b/src/doom/f_finale.c
@@ -94,8 +94,8 @@ static textscreen_t textscreens[] =
{ pack_plut, 1, 31, "RROCK19", P6TEXT},
};
-char* finaletext;
-char* finaleflat;
+const char *finaletext;
+const char *finaleflat;
void F_StartCast (void);
void F_CastTicker (void);
@@ -660,7 +660,7 @@ void F_BunnyScroll (void)
static void F_ArtScreenDrawer(void)
{
- char *lumpname;
+ const char *lumpname;
if (gameepisode == 3)
{
diff --git a/src/doom/g_game.c b/src/doom/g_game.c
index 70d3e683..40226ff2 100644
--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -618,7 +618,7 @@ void G_DoLoadLevel (void)
if ((gamemode == commercial)
&& (gameversion == exe_final2 || gameversion == exe_chex))
{
- char *skytexturename;
+ const char *skytexturename;
if (gamemap < 12)
{
@@ -1742,7 +1742,7 @@ G_InitNew
int episode,
int map )
{
- char *skytexturename;
+ const char *skytexturename;
int i;
if (paused)
diff --git a/src/doom/hu_stuff.c b/src/doom/hu_stuff.c
index 4f985f8f..57b10e71 100644
--- a/src/doom/hu_stuff.c
+++ b/src/doom/hu_stuff.c
@@ -370,7 +370,7 @@ void HU_Start(void)
{
int i;
- char* s;
+ const char *s;
if (headsupactive)
HU_Stop();
diff --git a/src/strife/g_game.c b/src/strife/g_game.c
index 69e731a6..c29ca4e6 100644
--- a/src/strife/g_game.c
+++ b/src/strife/g_game.c
@@ -1934,7 +1934,7 @@ G_InitNew
( skill_t skill,
int map )
{
- char *skytexturename;
+ const char *skytexturename;
int i;
if (paused)
diff --git a/src/strife/hu_stuff.c b/src/strife/hu_stuff.c
index 2e08770e..34041e8d 100644
--- a/src/strife/hu_stuff.c
+++ b/src/strife/hu_stuff.c
@@ -214,7 +214,7 @@ void HU_Stop(void)
void HU_Start(void)
{
int i;
- char* s;
+ const char *s;
// haleyjd 20120211: [STRIFE] not called here.
//if (headsupactive)