From 2e7070a942555b7bcb0643bcd908d8c7976f5a43 Mon Sep 17 00:00:00 2001 From: k3tamina Date: Thu, 2 Jun 2022 10:44:12 +0200 Subject: [PATCH] ISO C++ forbids converting a string constant to char* (#26) --- src/color.cc | 2 +- src/color.h | 4 ++-- src/game_movie.cc | 4 ++-- src/game_movie.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/color.cc b/src/color.cc index bac5c2d..75f81e8 100644 --- a/src/color.cc +++ b/src/color.cc @@ -354,7 +354,7 @@ void _setMixTableColor(int a1) } // 0x4C78E4 -bool colorPaletteLoad(char* path) +bool colorPaletteLoad(const char* path) { if (gColorFileNameMangler != NULL) { path = gColorFileNameMangler(path); diff --git a/src/color.h b/src/color.h index 0ad16c7..9ddf65d 100644 --- a/src/color.h +++ b/src/color.h @@ -5,7 +5,7 @@ #include -typedef char*(ColorFileNameManger)(char*); +typedef const char*(ColorFileNameManger)(const char*); typedef void(ColorTransitionCallback)(); typedef int(ColorPaletteFileOpenProc)(const char* path, int mode); @@ -54,7 +54,7 @@ void _setSystemPaletteEntries(unsigned char* a1, int a2, int a3); void _setIntensityTableColor(int a1); void _setIntensityTables(); void _setMixTableColor(int a1); -bool colorPaletteLoad(char* path); +bool colorPaletteLoad(const char* path); char* _colorError(); void _buildBlendTable(unsigned char* ptr, unsigned char ch); void _rebuildColorBlendTables(); diff --git a/src/game_movie.cc b/src/game_movie.cc index 8dd2ca3..8bce85e 100644 --- a/src/game_movie.cc +++ b/src/game_movie.cc @@ -46,7 +46,7 @@ const char* gMovieFileNames[MOVIE_COUNT] = { }; // 0x518DE4 -char* gMoviePaletteFilePaths[MOVIE_COUNT] = { +const char* gMoviePaletteFilePaths[MOVIE_COUNT] = { NULL, "art\\cuts\\introsub.pal", "art\\cuts\\eldersub.pal", @@ -209,7 +209,7 @@ int gameMoviePlay(int movie, int flags) int oldTextColor; int oldFont; if (subtitlesEnabled) { - char* subtitlesPaletteFilePath; + const char* subtitlesPaletteFilePath; if (gMoviePaletteFilePaths[movie] != NULL) { subtitlesPaletteFilePath = gMoviePaletteFilePaths[movie]; } else { diff --git a/src/game_movie.h b/src/game_movie.h index 7ca8cb0..a85bad9 100644 --- a/src/game_movie.h +++ b/src/game_movie.h @@ -35,7 +35,7 @@ typedef enum GameMovie { extern const float flt_50352A; extern const char* gMovieFileNames[MOVIE_COUNT]; -extern char* gMoviePaletteFilePaths[MOVIE_COUNT]; +extern const char* gMoviePaletteFilePaths[MOVIE_COUNT]; extern bool gGameMovieIsPlaying; extern bool gGameMovieFaded;