Permalink
Browse files

Merge pull request #1072 from turol/const

More const correctness
  • Loading branch information...
fragglet committed Aug 2, 2018
2 parents f177dcb + ef9843f commit 82ff0b70095060015274ae80c8dd66bb55011c26
View
@@ -914,7 +914,7 @@ const char *D_SaveGameIWADName(GameMission_t gamemission)
return "unknown.wad";
}
char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode)
const char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode)
{
int i;
@@ -929,7 +929,7 @@ char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode)
return "unknown.wad";
}
char *D_SuggestGameName(GameMission_t mission, GameMode_t mode)
const char *D_SuggestGameName(GameMission_t mission, GameMode_t mode)
{
int i;
View
@@ -33,19 +33,19 @@
typedef struct
{
char *name;
const char *name;
GameMission_t mission;
GameMode_t mode;
char *description;
const char *description;
} iwad_t;
char *D_FindWADByName(const char *filename);
char *D_TryFindWADByName(const char *filename);
char *D_FindIWAD(int mask, GameMission_t *mission);
const iwad_t **D_FindAllIWADs(int mask);
const char *D_SaveGameIWADName(GameMission_t gamemission);
char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode);
char *D_SuggestGameName(GameMission_t mission, GameMode_t mode);
const char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode);
const char *D_SuggestGameName(GameMission_t mission, GameMode_t mode);
void D_CheckCorrectIWAD(GameMission_t mission);
#endif
View
@@ -709,12 +709,12 @@ static char *GetGameName(char *gamename)
return gamename;
}
static void SetMissionForPackName(char *pack_name)
static void SetMissionForPackName(const char *pack_name)
{
int i;
static const struct
{
char *name;
const char *name;
int mission;
} packs[] = {
{ "doom2", doom2 },
@@ -948,8 +948,8 @@ void PrintDehackedBanners(void)
static struct
{
char *description;
char *cmdline;
const char *description;
const char *cmdline;
GameVersion_t version;
} gameversions[] = {
{"Doom 1.666", "1.666", exe_doom_1_666},
View
@@ -26,7 +26,7 @@ GameMode_t gamemode = indetermined;
GameMission_t gamemission = doom;
GameVersion_t gameversion = exe_final2;
GameVariant_t gamevariant = vanilla;
char *gamedescription;
const char *gamedescription;
// Set if homebrew PWAD stuff has been added.
boolean modifiedgame;
View
@@ -57,7 +57,7 @@ extern GameMode_t gamemode;
extern GameMission_t gamemission;
extern GameVersion_t gameversion;
extern GameVariant_t gamevariant;
extern char *gamedescription;
extern const char *gamedescription;
// Convenience macro.
// 'gamemission' can be equal to pack_chex or pack_hacx, but these are
@@ -244,7 +244,7 @@ extern wbstartstruct_t wminfo;
//
// File handling stuff.
extern char * savegamedir;
extern char *savegamedir;
extern char basedefault[1024];
// if true, load all graphics at level load
View
@@ -61,8 +61,8 @@ typedef struct
{
GameMission_t mission;
int episode, level;
char *background;
char *text;
const char *background;
const char *text;
} textscreen_t;
static textscreen_t textscreens[] =
@@ -299,7 +299,7 @@ void F_TextWrite (void)
//
typedef struct
{
char *name;
const char *name;
mobjtype_t type;
} castinfo_t;
View
@@ -2123,7 +2123,7 @@ void G_DeferedPlayDemo(const char *name)
// Generate a string describing a demo version
static char *DemoVersionDescription(int version)
static const char *DemoVersionDescription(int version)
{
static char resultbuf[16];
@@ -2186,14 +2186,14 @@ void G_DoPlayDemo (void)
}
else if (demoversion != G_VanillaVersionCode())
{
char *message = "Demo is from a different game version!\n"
"(read %i, should be %i)\n"
"\n"
"*** You may need to upgrade your version "
"of Doom to v1.9. ***\n"
" See: https://www.doomworld.com/classicdoom"
"/info/patches.php\n"
" This appears to be %s.";
const char *message = "Demo is from a different game version!\n"
"(read %i, should be %i)\n"
"\n"
"*** You may need to upgrade your version "
"of Doom to v1.9. ***\n"
" See: https://www.doomworld.com/classicdoom"
"/info/patches.php\n"
" This appears to be %s.";
I_Error(message, demoversion, G_VanillaVersionCode(),
DemoVersionDescription(demoversion));
View
@@ -76,7 +76,7 @@ char *chat_macros[10] =
HUSTR_CHATMACRO9
};
char* player_names[] =
const char *player_names[] =
{
HUSTR_PLRGREEN,
HUSTR_PLRINDIGO,
@@ -110,7 +110,7 @@ static boolean headsupactive = false;
// The actual names can be found in DStrings.h.
//
char* mapnames[] = // DOOM shareware/registered/retail (Ultimate) names.
const char *mapnames[] = // DOOM shareware/registered/retail (Ultimate) names.
{
HUSTR_E1M1,
@@ -164,7 +164,7 @@ char* mapnames[] = // DOOM shareware/registered/retail (Ultimate) names.
"NEWLEVEL"
};
char* mapnames_chex[] = // Chex Quest names.
const char *mapnames_chex[] = // Chex Quest names.
{
HUSTR_E1M1,
@@ -224,7 +224,7 @@ char* mapnames_chex[] = // Chex Quest names.
// the layout in the Vanilla executable, where it is possible to
// overflow the end of one array into the next.
char *mapnames_commercial[] =
const char *mapnames_commercial[] =
{
// DOOM 2 map names.
@@ -591,7 +591,7 @@ boolean HU_Responder(event_t *ev)
{
static char lastmessage[HU_MAXLINELENGTH+1];
char* macromessage;
const char *macromessage;
boolean eatkey = false;
static boolean altdown = false;
unsigned char c;
View
@@ -29,7 +29,7 @@
#include "p_mobj.h"
char *sprnames[] = {
const char *sprnames[] = {
"TROO","SHTG","PUNG","PISG","PISF","SHTF","SHT2","CHGG","CHGF","MISG",
"MISF","SAWG","PLSG","PLSF","BFGG","BFGF","BLUD","PUFF","BAL1","BAL2",
"PLSS","PLSE","MISL","BFS1","BFE1","BFE2","TFOG","IFOG","PLAY","POSS",
View
@@ -1154,7 +1154,7 @@ typedef struct
} state_t;
extern state_t states[NUMSTATES];
extern char *sprnames[];
extern const char *sprnames[];
typedef enum {
MT_PLAYER,
View
@@ -167,7 +167,7 @@ short whichSkull; // which skull to draw
// graphic name of skulls
// warning: initializer-string for array of chars is too long
char *skullName[2] = {"M_SKULL1","M_SKULL2"};
const char *skullName[2] = {"M_SKULL1","M_SKULL2"};
// current menudef
menu_t* currentMenu;
@@ -214,8 +214,8 @@ static void M_DrawSave(void);
static void M_DrawSaveLoadBorder(int x,int y);
static void M_SetupNextMenu(menu_t *menudef);
static void M_DrawThermo(int x,int y,int thermWidth,int thermDot);
static void M_WriteText(int x, int y, char *string);
static int M_StringWidth(char *string);
static void M_WriteText(int x, int y, const char *string);
static int M_StringWidth(const char *string);
static int M_StringHeight(const char *string);
static void M_StartMessage(const char *string, void *routine, boolean input);
static void M_ClearMenus (void);
@@ -938,8 +938,8 @@ void M_Episode(int choice)
//
// M_Options
//
static char *detailNames[2] = {"M_GDHIGH","M_GDLOW"};
static char *msgNames[2] = {"M_MSGOFF","M_MSGON"};
static const char *detailNames[2] = {"M_GDHIGH","M_GDLOW"};
static const char *msgNames[2] = {"M_MSGOFF","M_MSGON"};
void M_DrawOptions(void)
{
@@ -1229,7 +1229,7 @@ M_StartMessage
//
// Find string width from hu_font chars
//
int M_StringWidth(char* string)
int M_StringWidth(const char *string)
{
size_t i;
int w = 0;
@@ -1274,10 +1274,10 @@ void
M_WriteText
( int x,
int y,
char* string)
const char *string)
{
int w;
char* ch;
const char *ch;
int c;
int cx;
int cy;
View
@@ -168,9 +168,9 @@ R_InstallSpriteLump
// letter/number appended.
// The rotation character can be 0 to signify no rotations.
//
void R_InitSpriteDefs (char** namelist)
void R_InitSpriteDefs(const char **namelist)
{
char** check;
const char **check;
int i;
int l;
int frame;
@@ -288,7 +288,7 @@ int newvissprite;
// R_InitSprites
// Called at program start.
//
void R_InitSprites (char** namelist)
void R_InitSprites(const char **namelist)
{
int i;
View
@@ -51,7 +51,7 @@ void R_SortVisSprites (void);
void R_AddSprites (sector_t* sec);
void R_AddPSprites (void);
void R_DrawSprites (void);
void R_InitSprites (char** namelist);
void R_InitSprites(const char **namelist);
void R_ClearSprites (void);
void R_DrawMasked (void);

0 comments on commit 82ff0b7

Please sign in to comment.