SW: Fix const correctness issues.

Patch from Striker.

git-svn-id: https://svn.eduke32.com/eduke32@7499 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-04-08 06:25:22 +00:00 committed by Christoph Oelckers
parent b6d794ddba
commit 61446c0995
29 changed files with 113 additions and 112 deletions

View file

@ -34,7 +34,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#ifndef function_private_ #ifndef function_private_
#define function_private_ #define function_private_
char *gamefunctions[] = const char *gamefunctions[] =
{ {
"Move_Forward", "Move_Forward",
"Move_Backward", "Move_Backward",
@ -91,7 +91,7 @@ char *gamefunctions[] =
#define NUMKEYENTRIES 50 #define NUMKEYENTRIES 50
static char *keydefaults[] = static const char *keydefaults[] =
{ {
"Move_Forward", "Up", "Kpad8", "Move_Forward", "Up", "Kpad8",
"Move_Backward", "Down", "Kpad2", "Move_Backward", "Down", "Kpad2",
@ -145,7 +145,7 @@ static char *keydefaults[] =
"Show_Console", "NumLck", "", "Show_Console", "NumLck", "",
}; };
static char *keydefaults_modern[] = static const char *keydefaults_modern[] =
{ {
"Move_Forward", "W", "", "Move_Forward", "W", "",
"Move_Backward", "S", "", "Move_Backward", "S", "",
@ -200,7 +200,7 @@ static char *keydefaults_modern[] =
}; };
static char *mousedefaults[] = static const char *mousedefaults[] =
{ {
"Fire", "Fire",
"Strafe", "Strafe",
@ -209,7 +209,7 @@ static char *mousedefaults[] =
"" ""
}; };
static char *mousedefaults_modern[] = static const char *mousedefaults_modern[] =
{ {
"Fire", "Fire",
"Open", "Open",
@ -220,7 +220,7 @@ static char *mousedefaults_modern[] =
}; };
static char *mouseclickeddefaults[] = static const char *mouseclickeddefaults[] =
{ {
"", "",
"Open", "Open",
@ -229,7 +229,7 @@ static char *mouseclickeddefaults[] =
"" ""
}; };
static char *mouseclickeddefaults_modern[] = static const char *mouseclickeddefaults_modern[] =
{ {
"", "",
"", "",
@ -240,7 +240,7 @@ static char *mouseclickeddefaults_modern[] =
}; };
static char *joystickdefaults[] = static const char *joystickdefaults[] =
{ {
"Fire", "Fire",
"Strafe", "Strafe",
@ -281,7 +281,7 @@ static char *joystickdefaults[] =
}; };
static char *joystickclickeddefaults[] = static const char *joystickclickeddefaults[] =
{ {
"", "",
"Inventory", "Inventory",
@ -322,14 +322,14 @@ static char *joystickclickeddefaults[] =
}; };
static char *mouseanalogdefaults[] = static const char *mouseanalogdefaults[] =
{ {
"analog_turning", "analog_turning",
"analog_moving", "analog_moving",
}; };
static char *mousedigitaldefaults[] = static const char *mousedigitaldefaults[] =
{ {
"", "",
"", "",
@ -339,7 +339,7 @@ static char *mousedigitaldefaults[] =
#if 0 #if 0
static char *gamepaddigitaldefaults[] = static const char *gamepaddigitaldefaults[] =
{ {
"Turn_Left", "Turn_Left",
"Turn_Right", "Turn_Right",
@ -349,7 +349,7 @@ static char *gamepaddigitaldefaults[] =
#endif #endif
static char *joystickanalogdefaults[] = static const char *joystickanalogdefaults[] =
{ {
"analog_turning", "analog_turning",
"analog_moving", "analog_moving",
@ -362,7 +362,7 @@ static char *joystickanalogdefaults[] =
}; };
static char *joystickdigitaldefaults[] = static const char *joystickdigitaldefaults[] =
{ {
"", "",
"", "",

View file

@ -54,7 +54,7 @@ unsigned char ANIMpal[3*256];
unsigned char ANIMnum = 0; unsigned char ANIMnum = 0;
short SoundState; short SoundState;
char *ANIMname[] = const char *ANIMname[] =
{ {
"sw.anm", "sw.anm",
"swend.anm", "swend.anm",

View file

@ -48,7 +48,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
============================================================================= =============================================================================
*/ */
void Error(char *error, ...) void Error(const char *error, ...)
{ {
va_list argptr; va_list argptr;
@ -84,7 +84,7 @@ SWBOOL tokenready; // only TRUE if UnGetToken was just ca
============== ==============
*/ */
SWBOOL LoadScriptFile(char *filename) SWBOOL LoadScriptFile(const char *filename)
{ {
int size, readsize; int size, readsize;
int fp; int fp;
@ -396,7 +396,7 @@ extern int nextvoxid;
// 1804 1 shotgun.kvx // 1804 1 shotgun.kvx
// etc.... // etc....
void LoadKVXFromScript(char *filename) void LoadKVXFromScript(const char *filename)
{ {
int lNumber=0,lTile=0; // lNumber is the voxel no. and lTile is the editart tile being int lNumber=0,lTile=0; // lNumber is the voxel no. and lTile is the editart tile being
// replaced. // replaced.

View file

@ -39,11 +39,11 @@ extern int qsetmode;
SWBOOL FindCeilingView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* sectnum); SWBOOL FindCeilingView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* sectnum);
SWBOOL FindFloorView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* sectnum); SWBOOL FindFloorView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* sectnum);
short ViewSectorInScene(short cursectnum, short type, short level); short ViewSectorInScene(short cursectnum, short type, short level);
void Message(char *string, char color); void Message(const char *string, char color);
void void
_Assert(char *expr, char *strFile, unsigned uLine) _Assert(const char *expr, const char *strFile, unsigned uLine)
{ {
printf(ds, "Assertion failed: %s %s, line %u\n", expr, strFile, uLine); printf(ds, "Assertion failed: %s %s, line %u\n", expr, strFile, uLine);
//DSPRINTF(ds, "Assertion failed: %s %s, line %u", expr, strFile, uLine); //DSPRINTF(ds, "Assertion failed: %s %s, line %u", expr, strFile, uLine);

View file

@ -261,10 +261,10 @@ void BlackburnFunc(PLAYERp pp, char *UNUSED(cheat_string))
PlayerSound(DIGI_TAUNTAI3,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_doppler|v3df_follow,pp); PlayerSound(DIGI_TAUNTAI3,&pp->posx,&pp->posy,&pp->posz,v3df_dontpan|v3df_doppler|v3df_follow,pp);
} }
int cheatcmp(char *str1, char *str2, int len) int cheatcmp(const char *str1, const char *str2, int len)
{ {
char *cp1 = str1; const char *cp1 = str1;
char *cp2 = str2; const char *cp2 = str2;
do do
{ {
@ -288,7 +288,7 @@ int cheatcmp(char *str1, char *str2, int len)
typedef struct typedef struct
{ {
char *CheatInputCode; const char *CheatInputCode;
void (*CheatInputFunc)(PLAYERp, char *); void (*CheatInputFunc)(PLAYERp, char *);
char flags; char flags;
} CHEAT_INFO, *CHEAT_INFOp; } CHEAT_INFO, *CHEAT_INFOp;

View file

@ -269,7 +269,7 @@ void CONFIG_SetDefaults(void)
void SetDefaultKeyDefinitions(int style) void SetDefaultKeyDefinitions(int style)
{ {
int numkeydefaults; int numkeydefaults;
char **keydefaultset; const char **keydefaultset;
int i, f, k1, k2; int i, f, k1, k2;
if (style) if (style)
@ -301,7 +301,7 @@ void SetDefaultKeyDefinitions(int style)
void SetMouseDefaults(int style) void SetMouseDefaults(int style)
{ {
int nummousedefaults; int nummousedefaults;
char **mousedefaultset, **mouseclickeddefaultset; const char **mousedefaultset, **mouseclickeddefaultset;
int i; int i;
if (style) if (style)

View file

@ -1163,7 +1163,7 @@ void CON_LoadSetup(void)
CON_ConMessage("JonoF: Maybe later"); CON_ConMessage("JonoF: Maybe later");
} }
char *damagename[] = const char *damagename[] =
{ {
"WPN_STAR","WPN_UZI", "WPN_STAR","WPN_UZI",
"WPN_SHOTGUN","WPN_MICRO", "WPN_SHOTGUN","WPN_MICRO",

View file

@ -37,7 +37,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#define NUMGAMEFUNCTIONS 51 #define NUMGAMEFUNCTIONS 51
extern char *gamefunctions[]; extern const char *gamefunctions[];
enum enum
{ {

View file

@ -691,7 +691,7 @@ TerminateGame(void)
} }
void void
LoadLevel(char *filename) LoadLevel(const char *filename)
{ {
int pos; int pos;
@ -712,7 +712,7 @@ LoadLevel(char *filename)
} }
void void
LoadImages(char *filename) LoadImages(const char *filename)
{ {
short ndx; short ndx;
FILE *fin; FILE *fin;
@ -2905,7 +2905,7 @@ Control(int32_t argc, char const * const * argv)
void void
_Assert(char *expr, char *strFile, unsigned uLine) _Assert(const char *expr, const char *strFile, unsigned uLine)
{ {
sprintf(ds, "Assertion failed: %s %s, line %u", expr, strFile, uLine); sprintf(ds, "Assertion failed: %s %s, line %u", expr, strFile, uLine);
MONO_PRINT(ds); MONO_PRINT(ds);
@ -2920,7 +2920,7 @@ _Assert(char *expr, char *strFile, unsigned uLine)
void void
_ErrMsg(char *strFile, unsigned uLine, char *format, ...) _ErrMsg(const char *strFile, unsigned uLine, const char *format, ...)
{ {
va_list arglist; va_list arglist;
@ -2960,7 +2960,7 @@ dsprintf(char *str, char *format, ...)
} }
void void
dsprintf_null(char *str, char *format, ...) dsprintf_null(char *str, const char *format, ...)
{ {
va_list arglist; va_list arglist;
} }
@ -3262,10 +3262,10 @@ void AlphaMessage(void)
typedef struct typedef struct
{ {
char notshareware; char notshareware;
char *arg_switch; const char *arg_switch;
short arg_match_len; short arg_match_len;
char *arg_fmt; const char *arg_fmt;
char *arg_descr; const char *arg_descr;
} CLI_ARG; } CLI_ARG;
#if DEBUG #if DEBUG

View file

@ -56,7 +56,7 @@ extern char isShareware, useDarts;
void HeapCheck(char *, int); void HeapCheck(char *, int);
#define HEAP_CHECK() HeapCheck(__FILE__, __LINE__) #define HEAP_CHECK() HeapCheck(__FILE__, __LINE__)
void _Assert(char *, char *, unsigned); void _Assert(const char *expr, const char *strFile, unsigned uLine);
#define ASSERT(f) \ #define ASSERT(f) \
if (f) \ if (f) \
do { } while(0); \ do { } while(0); \
@ -74,7 +74,7 @@ void PokeStringMono(uint8_t Attr, uint8_t* String);
extern int DispMono; extern int DispMono;
#define MONO_PRINT(str) if (DispMono) PokeStringMono(/*MDA_NORMAL*/ 0, str) #define MONO_PRINT(str) if (DispMono) PokeStringMono(/*MDA_NORMAL*/ 0, str)
#else #else
void adduserquote(char *daquote); void adduserquote(const char *daquote);
extern int DispMono; extern int DispMono;
#define MONO_PRINT(str) if (DispMono) CON_ConMessage(str); // Put it in my userquote stuff! #define MONO_PRINT(str) if (DispMono) CON_ConMessage(str); // Put it in my userquote stuff!
//#define MONO_PRINT(str) if (DispMono) printf(str); //#define MONO_PRINT(str) if (DispMono) printf(str);
@ -85,14 +85,14 @@ extern int DispMono;
#define ASSERT(f) do { } while(0) #define ASSERT(f) do { } while(0)
#define MONO_PRINT(str) #define MONO_PRINT(str)
void _Assert(char *, char *, unsigned); void _Assert(const char *expr, const char *strFile, unsigned uLine);
#define PRODUCTION_ASSERT(f) \ #define PRODUCTION_ASSERT(f) \
if (f) \ if (f) \
do { } while(0); \ do { } while(0); \
else \ else \
_Assert(#f,ERR_STD_ARG); _Assert(#f,ERR_STD_ARG);
void dsprintf_null(char *, char *, ...); void dsprintf_null(char *str, const char *format, ...);
#define DSPRINTF dsprintf_null #define DSPRINTF dsprintf_null
//#define DSPRINTF() //#define DSPRINTF()
@ -855,7 +855,7 @@ extern char con_quote[MAXCONQUOTES][256];
int minitext(int x,int y,char *t,char p,char sb); int minitext(int x,int y,char *t,char p,char sb);
int minitextshade(int x,int y,char *t,char s,char p,char sb); int minitextshade(int x,int y,char *t,char s,char p,char sb);
void operatefta(void); void operatefta(void);
void adduserquote(char *daquote); void adduserquote(const char *daquote);
void operateconfta(void); void operateconfta(void);
void addconquote(char *daquote); void addconquote(char *daquote);
@ -898,8 +898,8 @@ typedef struct
int16_t max_ammo; int16_t max_ammo;
int16_t min_ammo; int16_t min_ammo;
int16_t with_weapon; int16_t with_weapon;
char *weapon_name; const char *weapon_name;
char *ammo_name; const char *ammo_name;
int16_t weapon_pickup; int16_t weapon_pickup;
int16_t ammo_pickup; int16_t ammo_pickup;
} DAMAGE_DATA, *DAMAGE_DATAp; } DAMAGE_DATA, *DAMAGE_DATAp;
@ -958,11 +958,11 @@ typedef struct
typedef struct typedef struct
{ {
char *LevelName; const char *LevelName;
char *SongName; const char *SongName;
char *Description; const char *Description;
char *BestTime; const char *BestTime;
char *ParTime; const char *ParTime;
} LEVEL_INFO, *LEVEL_INFOp, * *LEVEL_INFOpp; } LEVEL_INFO, *LEVEL_INFOp, * *LEVEL_INFOpp;
extern LEVEL_INFO LevelInfo[MAX_LEVELS_REG+2]; extern LEVEL_INFO LevelInfo[MAX_LEVELS_REG+2];
@ -977,11 +977,11 @@ extern char EpisodeSubtitles[2][MAX_EPISODE_SUBTITLE_LEN+1];
extern char SkillNames[4][MAX_SKILL_NAME_LEN+2]; extern char SkillNames[4][MAX_SKILL_NAME_LEN+2];
#define MAX_FORTUNES 16 #define MAX_FORTUNES 16
extern char *ReadFortune[MAX_FORTUNES]; extern const char *ReadFortune[MAX_FORTUNES];
#define MAX_KEYS 8 #define MAX_KEYS 8
extern char *KeyMsg[MAX_KEYS]; extern const char *KeyMsg[MAX_KEYS];
extern char *KeyDoorMessage[MAX_KEYS]; extern const char *KeyDoorMessage[MAX_KEYS];
typedef struct typedef struct
{ {
@ -2275,7 +2275,7 @@ extern unsigned char palette_data[256][3];
extern SWBOOL NightVision; extern SWBOOL NightVision;
#endif #endif
int _PlayerSound(char *file, int line, int num, int *x, int *y, int *z, Voc3D_Flags flags, PLAYERp pp); int _PlayerSound(const char *file, int line, int num, int *x, int *y, int *z, Voc3D_Flags flags, PLAYERp pp);
#define PlayerSound(num, x, y, z, flags, pp) _PlayerSound(__FILE__, __LINE__, (num), (x), (y), (z), (flags), (pp)) #define PlayerSound(num, x, y, z, flags, pp) _PlayerSound(__FILE__, __LINE__, (num), (x), (y), (z), (flags), (pp))
#define MAXSO (MAXLONG) #define MAXSO (MAXLONG)
@ -2321,7 +2321,7 @@ void post_analyzesprites(void); // draw.c
int COVERsetgamemode(int mode, int xdim, int ydim, int bpp); // draw.c int COVERsetgamemode(int mode, int xdim, int ydim, int bpp); // draw.c
void ScreenCaptureKeys(void); // draw.c void ScreenCaptureKeys(void); // draw.c
int minigametext(int x,int y,char *t,char s,short dabits); // jplayer.c int minigametext(int x,int y,const char *t,char s,short dabits); // jplayer.c
void computergetinput(int snum,SW_PACKET *syn); // jplayer.c void computergetinput(int snum,SW_PACKET *syn); // jplayer.c
void DrawOverlapRoom(int tx,int ty,int tz,short tang,int thoriz,short tsectnum); // rooms.c void DrawOverlapRoom(int tx,int ty,int tz,short tang,int thoriz,short tsectnum); // rooms.c
@ -2333,9 +2333,9 @@ void TermSetup(void); // swconfig.c
void InitSetup(void); // setup.c void InitSetup(void); // setup.c
void LoadKVXFromScript(char *filename); // scrip2.c void LoadKVXFromScript(const char *filename); // scrip2.c
void LoadPLockFromScript(char *filename); // scrip2.c void LoadPLockFromScript(const char *filename); // scrip2.c
void LoadCustomInfoFromScript(char *filename); // scrip2.c void LoadCustomInfoFromScript(const char *filename); // scrip2.c
void EveryCheatToggle(PLAYERp pp,char *cheat_string); // cheats.c void EveryCheatToggle(PLAYERp pp,char *cheat_string); // cheats.c

View file

@ -38,7 +38,7 @@ enum InventoryNames
typedef struct typedef struct
{ {
char *Name; const char *Name;
void (*Init)(PLAYERp); void (*Init)(PLAYERp);
void (*Stop)(PLAYERp, short); void (*Stop)(PLAYERp, short);
PANEL_STATEp State; PANEL_STATEp State;

View file

@ -46,7 +46,7 @@ static char tempbuf[256];
// Prototypes // Prototypes
void Message(char *string, char color); void Message(const char *string, char color);
long GetAToken(char *name, char *tc, long length); long GetAToken(char *name, char *tc, long length);
uint8_t* BKeyPressed(void); uint8_t* BKeyPressed(void);
void ResetKeys(void); void ResetKeys(void);
@ -54,7 +54,7 @@ void ResetKeys(void);
// Functions // Functions
void Msg(char *string, char color) void Msg(const char *string, char color)
{ {
clearmidstatbar16(); clearmidstatbar16();

View file

@ -84,7 +84,7 @@ short FindSpriteNum = 0;
// My Function Prototypes // My Function Prototypes
void ContextHelp(short spritenum); void ContextHelp(short spritenum);
void LoadKVXFromScript(char *filename); void LoadKVXFromScript(const char *filename);
//void LogUserTime( SWBOOL bIsLoggingIn ); //void LogUserTime( SWBOOL bIsLoggingIn );
@ -112,7 +112,7 @@ typedef struct
STAG_INFO StagInfo[MAX_STAG_INFO]; STAG_INFO StagInfo[MAX_STAG_INFO];
void PrintStatus(char *string, int num, char x, char y, char color); void PrintStatus(const char *string, int num, char x, char y, char color);
#define NUMOPTIONS 8 #define NUMOPTIONS 8
char option[NUMOPTIONS] = {0, 0, 0, 0, 0, 0, 1, 0}; char option[NUMOPTIONS] = {0, 0, 0, 0, 0, 0, 1, 0};
@ -159,7 +159,7 @@ void SectorMoveFloorZ(int);
void SectorMoveCeilingZ(int); void SectorMoveCeilingZ(int);
void BuildStagTable(void); void BuildStagTable(void);
void Message(char *string, char color); void Message(const char *string, char color);
void ShowMessage(void); void ShowMessage(void);
void ShadeMenu(void); void ShadeMenu(void);
void FindNextTag(void); void FindNextTag(void);
@ -647,7 +647,7 @@ ExtInit(void)
#endif #endif
char *startwin_labeltext = "Starting Build Editor for Shadow Warrior..."; const char *startwin_labeltext = "Starting Build Editor for Shadow Warrior...";
int int
ExtInit(void) ExtInit(void)
@ -1360,7 +1360,7 @@ Keys3D(void)
// Used to help print out the item status list // Used to help print out the item status list
void void
PrintStatus(char *string, int num, char x, char y, char color) PrintStatus(const char *string, int num, char x, char y, char color)
{ {
sprintf(tempbuf, "%s %d", string, num); sprintf(tempbuf, "%s %d", string, num);
printext16(x * 8, ydim16+y * 8, color, -1, tempbuf, 0); printext16(x * 8, ydim16+y * 8, color, -1, tempbuf, 0);
@ -2280,7 +2280,7 @@ const char *
ExtGetSpriteCaption(short spritenum) ExtGetSpriteCaption(short spritenum)
{ {
SPRITEp sp = &sprite[spritenum]; SPRITEp sp = &sprite[spritenum];
char *p = ""; const char *p = "";
char name[64]; char name[64];
char tp[30]; char tp[30];
char multi_str[30] = ""; char multi_str[30] = "";
@ -3668,7 +3668,7 @@ static unsigned short messagedelay = 0;
static char messagebuf[1024]; static char messagebuf[1024];
void void
Message(char *string, char color) Message(const char *string, char color)
{ {
sprintf(messagebuf, string, 0); sprintf(messagebuf, string, 0);
messagedelay = 512; messagedelay = 512;
@ -3728,7 +3728,7 @@ dsprintf(char *str, char *format, ...)
} }
void void
dsprintf_null(char *str, char *format, ...) dsprintf_null(char *str, const char *format, ...)
{ {
va_list arglist; va_list arglist;
} }

View file

@ -122,10 +122,11 @@ int gametext(int x,int y,char *t,char s,short dabits)
return x; return x;
} }
int minigametext(int x,int y,char *t,char s,short dabits) int minigametext(int x,int y,const char *t,char s,short dabits)
{ {
short ac,newx; short ac,newx;
char centre, *oldt; char centre;
const char *oldt;
centre = (x == (320>>1)); centre = (x == (320>>1));
newx = 0; newx = 0;
@ -215,7 +216,7 @@ int quotebot, quotebotgoal;
short user_quote_time[MAXUSERQUOTES]; short user_quote_time[MAXUSERQUOTES];
char user_quote[MAXUSERQUOTES][256]; char user_quote[MAXUSERQUOTES][256];
void adduserquote(char *daquote) void adduserquote(const char *daquote)
{ {
int i; int i;

View file

@ -539,7 +539,7 @@ MenuGroup *menuarray[MaxLayers], *currentmenu;
SWBOOL UsingMenus = FALSE; SWBOOL UsingMenus = FALSE;
#define MAXDIALOG 2 // Maximum number of dialog strings allowed #define MAXDIALOG 2 // Maximum number of dialog strings allowed
char *dialog[MAXDIALOG]; const char *dialog[MAXDIALOG];
// Global menu setting values //////////////////////////////////////////////////////////////////// // Global menu setting values ////////////////////////////////////////////////////////////////////
// Mouse slider vars // Mouse slider vars
@ -564,7 +564,7 @@ MenuItem_p cust_callback_item;
static void MNU_ClearDialog(void); static void MNU_ClearDialog(void);
static SWBOOL MNU_Dialog(void); static SWBOOL MNU_Dialog(void);
void LoadSaveMsg(char *msg); void LoadSaveMsg(const char *msg);
static void MNU_ItemPreProcess(MenuGroup *group); static void MNU_ItemPreProcess(MenuGroup *group);
static void MNU_SelectItem(MenuGroup *group, short index, SWBOOL draw); static void MNU_SelectItem(MenuGroup *group, short index, SWBOOL draw);
static void MNU_PushItem(MenuItem *item, SWBOOL draw); static void MNU_PushItem(MenuItem *item, SWBOOL draw);
@ -611,7 +611,7 @@ MNU_DoParentalPassword(UserCall call, MenuItem_p item)
signed char MNU_InputString(char *, short); signed char MNU_InputString(char *, short);
static SWBOOL cur_show; static SWBOOL cur_show;
char TempString[80]; char TempString[80];
char *extra_text; const char *extra_text;
extra_text = "This mode should remove most of the"; extra_text = "This mode should remove most of the";
@ -776,7 +776,7 @@ SWBOOL MNU_KeySetupCustom(UserCall call, MenuItem *item)
{ {
short w, h = 0; short w, h = 0;
char *s = "Keys Setup"; const char *s = "Keys Setup";
rotatesprite(10 << 16, (5-3) << 16, MZ, 0, 2427, rotatesprite(10 << 16, (5-3) << 16, MZ, 0, 2427,
m_defshade, 0, MenuDrawFlags|ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1); m_defshade, 0, MenuDrawFlags|ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1);
MNU_MeasureStringLarge(s, &w, &h); MNU_MeasureStringLarge(s, &w, &h);
@ -786,8 +786,8 @@ SWBOOL MNU_KeySetupCustom(UserCall call, MenuItem *item)
if (currentmode) if (currentmode)
{ {
// customising a key // customising a key
char *strs[] = { "Press the key to assign to", "\"%s\" %s", "or ESCAPE to cancel." }; const char *strs[] = { "Press the key to assign to", "\"%s\" %s", "or ESCAPE to cancel." };
char *col[2] = { "(primary)", "(secondary)" }; const char *col[2] = { "(primary)", "(secondary)" };
short w, h = 8; short w, h = 8;
int i, j, y; int i, j, y;
@ -836,7 +836,7 @@ SWBOOL MNU_KeySetupCustom(UserCall call, MenuItem *item)
#define PGSIZ 14 #define PGSIZ 14
int topitem = 0, botitem = NUMGAMEFUNCTIONS; int topitem = 0, botitem = NUMGAMEFUNCTIONS;
int i,j; int i,j;
char *morestr = "More..."; const char *morestr = "More...";
const char *p; const char *p;
UserInput inpt = {FALSE,FALSE,dir_None}; UserInput inpt = {FALSE,FALSE,dir_None};
@ -1764,8 +1764,8 @@ MNU_OrderCustom(UserCall call, MenuItem *item)
{ {
// Jonathon's credits page hack :-) // Jonathon's credits page hack :-)
static char *jtitle = "^Port Credits"; static const char *jtitle = "^Port Credits";
static char *jtext[] = static const char *jtext[] =
{ {
"*GAME AND ENGINE PORT", "*GAME AND ENGINE PORT",
" Jonathon \"JonoF\" Fowler", " Jonathon \"JonoF\" Fowler",
@ -1777,7 +1777,7 @@ MNU_OrderCustom(UserCall call, MenuItem *item)
" Visit http://www.jonof.id.au/jfsw for the", " Visit http://www.jonof.id.au/jfsw for the",
" source code, latest news, and updates of this port." " source code, latest news, and updates of this port."
}; };
static char *scroller[] = static const char *scroller[] =
{ {
"This program is free software; you can redistribute it", "This program is free software; you can redistribute it",
"and/or modify it under the terms of the GNU General", "and/or modify it under the terms of the GNU General",
@ -2695,7 +2695,7 @@ MNU_InputString(char *name, short pix_width)
#define SS_YSTART SD_YSTART #define SS_YSTART SD_YSTART
#define SS_BORDER_SIZE 5L #define SS_BORDER_SIZE 5L
void LoadSaveMsg(char *msg) void LoadSaveMsg(const char *msg)
{ {
short w,h; short w,h;
@ -3058,7 +3058,7 @@ MNU_CheckUserMap(MenuItem *item)
SWBOOL SWBOOL
MNU_ShareWareMessage(MenuItem *item) MNU_ShareWareMessage(MenuItem *item)
{ {
char *extra_text; const char *extra_text;
short w,h; short w,h;
if (SW_SHAREWARE) if (SW_SHAREWARE)
@ -3340,7 +3340,7 @@ MNU_DoButton(MenuItem_p item, SWBOOL draw)
int last_value; int last_value;
short shade = MENU_SHADE_DEFAULT; short shade = MENU_SHADE_DEFAULT;
extern char LevelSong[]; extern char LevelSong[];
char *extra_text = NULL; const char *extra_text = NULL;
PLAYERp pp = &Player[myconnectindex]; PLAYERp pp = &Player[myconnectindex];
int button_x,zero=0; int button_x,zero=0;
int handle=0; int handle=0;
@ -3606,9 +3606,9 @@ MNU_DoButton(MenuItem_p item, SWBOOL draw)
} }
//char *gametype[] = {"War [Respawn]","Cooperative","War [No Respawn]"}; //char *gametype[] = {"War [Respawn]","Cooperative","War [No Respawn]"};
char *gametype[] = {"WangBang (spawn)","WangBang (no spawn)","Cooperative"}; const char *gametype[] = {"WangBang (spawn)","WangBang (no spawn)","Cooperative"};
char *playercolors[] = {"Brown","Gray","Purple","Red","Yellow","Olive","Green","Blue"}; const char *playercolors[] = {"Brown","Gray","Purple","Red","Yellow","Olive","Green","Blue"};
char *monsterskills[] = {"No Monsters","Easy","Normal","Hard","Insane!"}; const char *monsterskills[] = {"No Monsters","Easy","Normal","Hard","Insane!"};
void void
MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw)
@ -3616,7 +3616,7 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw)
short offset, i, barwidth; short offset, i, barwidth;
int x, y, knobx; int x, y, knobx;
short shade = MENU_SHADE_DEFAULT; short shade = MENU_SHADE_DEFAULT;
char *extra_text=NULL; const char *extra_text=NULL;
char tmp_text[256]; char tmp_text[256];
memset(tmp_text,0,256); memset(tmp_text,0,256);

View file

@ -252,7 +252,7 @@ typedef struct MENU_ITEM
SLDRType slider; // Slider type, if any SLDRType slider; // Slider type, if any
BTNType button; // Button state, if any BTNType button; // Button state, if any
unsigned char hotkey; // First letter of item unsigned char hotkey; // First letter of item
char *text; // Text appearing in item, if any. const char *text; // Text appearing in item, if any.
void *child; // Should be menugroup, used to spawn void *child; // Should be menugroup, used to spawn
// sub-groups from items. // sub-groups from items.
int x, y; // x,y position on screen. int x, y; // x,y position on screen.
@ -268,7 +268,7 @@ typedef struct MENU_ITEM
typedef struct typedef struct
{ {
int x, y; // Menu x,y position on screen. int x, y; // Menu x,y position on screen.
char *text; const char *text;
MenuItem_p items; // Array of menu items for this menu. MenuItem_p items; // Array of menu items for this menu.
short titlepic; // Used to draw title on menu with. short titlepic; // Used to draw title on menu with.
short cursorpic; // Pic used for menu cursor, 1st in short cursorpic; // Pic used for menu cursor, 1st in

View file

@ -434,7 +434,7 @@ ResumeAction(void)
} }
void void
SW_SendMessage(short pnum, char *text) SW_SendMessage(short pnum, const char *text)
{ {
if (!CommEnabled) if (!CommEnabled)
return; return;

View file

@ -200,7 +200,7 @@ SWBOOL MenuCommPlayerQuit(short quit_player);
void SendVersion(int version); void SendVersion(int version);
void InitNetPlayerOptions(void); void InitNetPlayerOptions(void);
void CheckVersion(int GameVersion); void CheckVersion(int GameVersion);
void SW_SendMessage(short pnum,char *text); void SW_SendMessage(short pnum,const char *text);
void PauseGame(void); void PauseGame(void);
void ResumeGame(void); void ResumeGame(void);

View file

@ -486,8 +486,8 @@ PlayerUpdateWeaponSummary(PLAYERp pp, short UpdateWeaponNum)
#define WSUM_YOFF 6 #define WSUM_YOFF 6
static short wsum_xoff[3] = {0,36,66}; static short wsum_xoff[3] = {0,36,66};
static char *wsum_fmt1[3] = {"%d:", "%d:", "%d:"}; static const char *wsum_fmt1[3] = {"%d:", "%d:", "%d:"};
static char *wsum_fmt2[3] = {"%3d/%-3d", "%2d/%-2d", "%2d/%-2d"}; static const char *wsum_fmt2[3] = {"%3d/%-3d", "%2d/%-2d", "%2d/%-2d"};
static short wsum_back_pic[3] = {2405, 2406, 2406}; static short wsum_back_pic[3] = {2405, 2406, 2406};
if (Prediction) if (Prediction)

View file

@ -35,7 +35,7 @@ extern int scriptline;
extern SWBOOL endofscript; extern SWBOOL endofscript;
SWBOOL LoadScriptFile(char *filename); SWBOOL LoadScriptFile(const char *filename);
void GetToken(SWBOOL crossline); void GetToken(SWBOOL crossline);
void UnGetToken(void); void UnGetToken(void);
SWBOOL TokenAvailable(void); SWBOOL TokenAvailable(void);

View file

@ -6374,7 +6374,7 @@ DoPlayerDeathFall(PLAYERp pp)
} }
#define MAX_SUICIDE 11 #define MAX_SUICIDE 11
char *SuicideNote[MAX_SUICIDE] = const char *SuicideNote[MAX_SUICIDE] =
{ {
"decided to do the graveyard tour.", "decided to do the graveyard tour.",
"had enough and checked out.", "had enough and checked out.",

View file

@ -30,7 +30,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "game.h" #include "game.h"
#include "warp.h" #include "warp.h"
void _ErrMsg(char *strFile, unsigned uLine, char *format, ...); void _ErrMsg(const char *strFile, unsigned uLine, const char *format, ...);
void FAF_DrawRooms(int posx, int posy, int posz, short ang, int horiz, short cursectnum); void FAF_DrawRooms(int posx, int posy, int posz, short ang, int horiz, short cursectnum);
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////

View file

@ -70,7 +70,7 @@ SWBOOL tokenready; // only TRUE if UnGetToken was just ca
============== ==============
*/ */
SWBOOL LoadScriptFile(char *filename) SWBOOL LoadScriptFile(const char *filename)
{ {
int size, readsize; int size, readsize;
int fp; int fp;
@ -261,7 +261,7 @@ SWBOOL TokenAvailable(void)
// 1804 1 shotgun.kvx // 1804 1 shotgun.kvx
// etc.... // etc....
void LoadKVXFromScript(char *filename) void LoadKVXFromScript(const char *filename)
{ {
int lNumber=0,lTile=0; // lNumber is the voxel no. and lTile is the editart tile being int lNumber=0,lTile=0; // lNumber is the voxel no. and lTile is the editart tile being
// replaced. // replaced.
@ -328,7 +328,7 @@ void LoadKVXFromScript(char *filename)
// Ex. 1803 -1 -1 = No tile replacement // Ex. 1803 -1 -1 = No tile replacement
// 1804 2000 // 1804 2000
// etc.... // etc....
void LoadPLockFromScript(char *filename) void LoadPLockFromScript(const char *filename)
{ {
int lNumber=0,lTile=0; // lNumber is the voxel no. and lTile is the editart tile being int lNumber=0,lTile=0; // lNumber is the voxel no. and lTile is the editart tile being
// replaced. // replaced.
@ -405,7 +405,7 @@ enum
static const struct _tokset static const struct _tokset
{ {
char *str; const char *str;
int tokn; int tokn;
} cm_tokens[] = } cm_tokens[] =
{ {
@ -546,7 +546,7 @@ static char *customweaponname[2][MAX_WEAPONS]; // weapon, ammo
#define WM_AMMO 4 #define WM_AMMO 4
static struct static struct
{ {
char *sym; const char *sym;
int dmgid; int dmgid;
int editable; int editable;
} weaponmap[] = } weaponmap[] =
@ -568,7 +568,7 @@ static struct
}; };
// FIXME: yes, we are leaking memory here at the end of the program by not freeing anything // FIXME: yes, we are leaking memory here at the end of the program by not freeing anything
void LoadCustomInfoFromScript(char *filename) void LoadCustomInfoFromScript(const char *filename)
{ {
scriptfile *script; scriptfile *script;
char *token; char *token;

View file

@ -88,17 +88,17 @@ SWBOOL LoadSong(const char *track);
#define NUM_SAMPLES 10 #define NUM_SAMPLES 10
char *BitNames[2] = const char *BitNames[2] =
{ {
"8-bit", "16-bit" "8-bit", "16-bit"
}; };
char *ChannelNames[2] = const char *ChannelNames[2] =
{ {
"Mono", "Stereo" "Mono", "Stereo"
}; };
char *VoiceNames[8] = const char *VoiceNames[8] =
{ {
"1", "2", "3", "4", "5", "6", "7", "8" "1", "2", "3", "4", "5", "6", "7", "8"
}; };
@ -662,7 +662,7 @@ SoundAngle(int x, int y)
return delta_angle >> 6; return delta_angle >> 6;
} }
int _PlayerSound(char *file, int line, int num, int *x, int *y, int *z, Voc3D_Flags flags, PLAYERp pp) int _PlayerSound(const char *file, int line, int num, int *x, int *y, int *z, Voc3D_Flags flags, PLAYERp pp)
//PlayerSound(int num, int *x, int *y, int *z, Voc3D_Flags flags, PLAYERp pp) //PlayerSound(int num, int *x, int *y, int *z, Voc3D_Flags flags, PLAYERp pp)
{ {
int handle; int handle;

View file

@ -5495,7 +5495,7 @@ void ChoosePlayerGetSound(PLAYERp pp)
//#define MAX_FORTUNES 16 //#define MAX_FORTUNES 16
// With PLOCK on, max = 11 // With PLOCK on, max = 11
char *ReadFortune[MAX_FORTUNES] = const char *ReadFortune[MAX_FORTUNES] =
{ {
"You never going to score.", "You never going to score.",
"26-31-43-82-16-29", "26-31-43-82-16-29",
@ -5551,7 +5551,7 @@ SWBOOL CanGetWeapon(PLAYERp pp, short SpriteNum, int WPN)
return TRUE; return TRUE;
} }
char *KeyMsg[MAX_KEYS] = const char *KeyMsg[MAX_KEYS] =
{ {
"Got the RED key!", "Got the RED key!",
"Got the BLUE key!", "Got the BLUE key!",

View file

@ -75,7 +75,7 @@ enum
struct InventoryDecl_t struct InventoryDecl_t
{ {
char *name; const char *name;
int amount; int amount;
}; };
extern struct InventoryDecl_t InventoryDecls[InvDecl_TOTAL]; extern struct InventoryDecl_t InventoryDecls[InvDecl_TOTAL];

View file

@ -277,7 +277,7 @@ RandomSync(void)
#define STAT_SKIP4_END 8 #define STAT_SKIP4_END 8
*/ */
char *SyncNames[] = const char *SyncNames[] =
{ {
"RandomSync", "RandomSync",
"PlayerSync", "PlayerSync",

View file

@ -46,7 +46,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#define PANEL_SM_FONT_Y 3613 #define PANEL_SM_FONT_Y 3613
#define PANEL_SM_FONT_R 3625 #define PANEL_SM_FONT_R 3625
char *KeyDoorMessage[MAX_KEYS] = const char *KeyDoorMessage[MAX_KEYS] =
{ {
"You need a RED key for this door.", "You need a RED key for this door.",
"You need a BLUE key for this door.", "You need a BLUE key for this door.",

View file

@ -7444,7 +7444,7 @@ DoDamage(short SpriteNum, short Weapon)
#if 1 #if 1
// Select death text based on ID // Select death text based on ID
char *DeathString(short SpriteNum) const char *DeathString(short SpriteNum)
{ {
USERp ku = User[SpriteNum]; USERp ku = User[SpriteNum];