Merge pull request #1041 from turol/const

Fix const correctness in dehacked
This commit is contained in:
Simon Howard 2018-05-25 22:34:53 -04:00 committed by GitHub
commit 052d6e3ba9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 29 additions and 29 deletions

View file

@ -30,7 +30,7 @@ typedef void (*deh_sha1_hash_t)(sha1_context_t *context);
struct deh_section_s
{
char *name;
const char *name;
// Called on startup to initialize code

View file

@ -445,7 +445,7 @@ int DEH_LoadLump(int lumpnum, boolean allow_long, boolean allow_error)
return 1;
}
int DEH_LoadLumpByName(char *name, boolean allow_long, boolean allow_error)
int DEH_LoadLumpByName(const char *name, boolean allow_long, boolean allow_error)
{
int lumpnum;

View file

@ -32,7 +32,7 @@
void DEH_ParseCommandLine(void);
int DEH_LoadFile(const char *filename);
int DEH_LoadLump(int lumpnum, boolean allow_long, boolean allow_error);
int DEH_LoadLumpByName(char *name, boolean allow_long, boolean allow_error);
int DEH_LoadLumpByName(const char *name, boolean allow_long, boolean allow_error);
boolean DEH_ParseAssignment(char *line, char **variable_name, char **value);

View file

@ -60,7 +60,7 @@ struct deh_mapping_entry_s
{
// field name
char *name;
const char *name;
// location relative to the base in the deh_mapping_t struct
// If this is NULL, it is an unsupported mapping

View file

@ -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;
@ -366,9 +366,9 @@ static boolean ValidFormatReplacement(const char *original, const char *replacem
// Get replacement format string, checking arguments.
static const char *FormatStringReplacement(char *s)
static const char *FormatStringReplacement(const char *s)
{
char *repl;
const char *repl;
repl = DEH_String(s);
@ -385,7 +385,7 @@ static const char *FormatStringReplacement(char *s)
// printf(), performing a replacement on the format string.
void DEH_printf(char *fmt, ...)
void DEH_printf(const char *fmt, ...)
{
va_list args;
const char *repl;
@ -401,7 +401,7 @@ void DEH_printf(char *fmt, ...)
// fprintf(), performing a replacement on the format string.
void DEH_fprintf(FILE *fstream, char *fmt, ...)
void DEH_fprintf(FILE *fstream, const char *fmt, ...)
{
va_list args;
const char *repl;
@ -417,7 +417,7 @@ void DEH_fprintf(FILE *fstream, char *fmt, ...)
// snprintf(), performing a replacement on the format string.
void DEH_snprintf(char *buffer, size_t len, char *fmt, ...)
void DEH_snprintf(char *buffer, size_t len, const char *fmt, ...)
{
va_list args;
const char *repl;

View file

@ -24,10 +24,10 @@
// Used to do dehacked text substitutions throughout the program
char *DEH_String(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);
const char *DEH_String(const char *s) PRINTF_ARG_ATTR(1);
void DEH_printf(const char *fmt, ...) PRINTF_ATTR(1, 2);
void DEH_fprintf(FILE *fstream, const char *fmt, ...) PRINTF_ATTR(2, 3);
void DEH_snprintf(char *buffer, size_t len, const char *fmt, ...) PRINTF_ATTR(3, 4);
void DEH_AddStringReplacement(const char *from_text, const char *to_text);

View file

@ -26,8 +26,8 @@
#include "dstrings.h"
typedef struct {
char *macro;
char *string;
const char *macro;
const char *string;
} bex_string_t;
// mnemonic keys table

View file

@ -28,7 +28,7 @@
typedef struct
{
char *name;
const char *name;
cheatseq_t *seq;
} deh_cheat_t;

View file

@ -19,7 +19,7 @@
#include "deh_defs.h"
#include "deh_main.h"
char *deh_signatures[] =
const char *deh_signatures[] =
{
"Patch File for DeHackEd v2.3",
"Patch File for DeHackEd v3.0",

View file

@ -132,7 +132,7 @@ int deh_species_infighting = DEH_DEFAULT_SPECIES_INFIGHTING;
static struct
{
char *deh_name;
const char *deh_name;
int *value;
} misc_settings[] = {
{"Initial Health", &deh_initial_health},

View file

@ -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)
{

View file

@ -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)

View file

@ -370,7 +370,7 @@ void HU_Start(void)
{
int i;
char* s;
const char *s;
if (headsupactive)
HU_Stop();

View file

@ -2246,7 +2246,7 @@ char *M_GetSaveGameDir(char *iwadname)
else if (M_ParmExists("-cdrom"))
{
savegamedir = configdir;
savegamedir = M_StringDuplicate(configdir);
}
#endif
// If not "doing" a configuration directory (Windows), don't "do"

View file

@ -1934,7 +1934,7 @@ G_InitNew
( skill_t skill,
int map )
{
char *skytexturename;
const char *skytexturename;
int i;
if (paused)

View file

@ -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)

View file

@ -1015,7 +1015,7 @@ boolean P_UseSpecialLine(mobj_t* thing, line_t* line, int side)
P_GiveItemToPlayer(thing->player, SPR_TOKN, MT_TOKEN_NEW_ACCURACY);
P_ChangeSwitchTexture(line, 0);
DEH_snprintf(usemessage, sizeof(usemessage),
DEH_String("Congratulations! You have completed the training area."));
"Congratulations! You have completed the training area.");
thing->player->message = usemessage;
}
break;