diff --git a/neo/d3xp/Game_local.cpp b/neo/d3xp/Game_local.cpp index af14c75..d759202 100644 --- a/neo/d3xp/Game_local.cpp +++ b/neo/d3xp/Game_local.cpp @@ -71,7 +71,7 @@ const char *idGameLocal::sufaceTypeNames[ MAX_SURFACE_TYPES ] = { #ifdef _D3XP // List of all defs used by the player that will stay on the fast timeline -static char* fastEntityList[] = { +static const char* fastEntityList[] = { "player_doommarine", "weapon_chainsaw", "weapon_fists", diff --git a/neo/d3xp/Item.cpp b/neo/d3xp/Item.cpp index f1357bd..17521c6 100644 --- a/neo/d3xp/Item.cpp +++ b/neo/d3xp/Item.cpp @@ -772,7 +772,7 @@ void idItemTeam::Spawn( void ) { idItemTeam::LoadScript =============== */ -function_t * idItemTeam::LoadScript( char * script ) { +function_t * idItemTeam::LoadScript( const char * script ) { function_t * function = NULL; idStr funcname = spawnArgs.GetString( script, "" ); if ( funcname.Length() ) { diff --git a/neo/d3xp/Item.h b/neo/d3xp/Item.h index e609e22..f7583a5 100644 --- a/neo/d3xp/Item.h +++ b/neo/d3xp/Item.h @@ -257,7 +257,7 @@ private: void Event_FlagCapture( void ); void PrivateReturn( void ); - function_t * LoadScript( char * script ); + function_t * LoadScript( const char * script ); void SpawnNugget( idVec3 pos ); void UpdateGuis( void ); diff --git a/neo/d3xp/MultiplayerGame.cpp b/neo/d3xp/MultiplayerGame.cpp index 1105268..62a7a10 100644 --- a/neo/d3xp/MultiplayerGame.cpp +++ b/neo/d3xp/MultiplayerGame.cpp @@ -4230,7 +4230,7 @@ idMultiplayerGame::GetTeamFlag ================ */ void idMultiplayerGame::FindTeamFlags( void ) { - char * flagDefs[2] = + const char * flagDefs[2] = { "team_CTF_redflag", "team_CTF_blueflag" diff --git a/neo/d3xp/gamesys/SysCmds.cpp b/neo/d3xp/gamesys/SysCmds.cpp index 7b32cef..9a0f8ef 100644 --- a/neo/d3xp/gamesys/SysCmds.cpp +++ b/neo/d3xp/gamesys/SysCmds.cpp @@ -446,7 +446,7 @@ argv(0) god ================== */ void Cmd_God_f( const idCmdArgs &args ) { - char *msg; + const char *msg; idPlayer *player; player = gameLocal.GetLocalPlayer(); @@ -475,7 +475,7 @@ argv(0) notarget ================== */ void Cmd_Notarget_f( const idCmdArgs &args ) { - char *msg; + const char *msg; idPlayer *player; player = gameLocal.GetLocalPlayer(); @@ -502,7 +502,7 @@ argv(0) noclip ================== */ void Cmd_Noclip_f( const idCmdArgs &args ) { - char *msg; + const char *msg; idPlayer *player; player = gameLocal.GetLocalPlayer(); diff --git a/neo/d3xp/script/Script_Compiler.cpp b/neo/d3xp/script/Script_Compiler.cpp index 183c9dd..48af6e0 100644 --- a/neo/d3xp/script/Script_Compiler.cpp +++ b/neo/d3xp/script/Script_Compiler.cpp @@ -38,7 +38,7 @@ If you have questions concerning this license or the applicable additional terms #define TOP_PRIORITY 7 bool idCompiler::punctuationValid[ 256 ]; -char *idCompiler::punctuation[] = { +const char *idCompiler::punctuation[] = { "+=", "-=", "*=", "/=", "%=", "&=", "|=", "++", "--", "&&", "||", "<=", ">=", "==", "!=", "::", ";", ",", "~", "!", "*", "/", "%", "(", ")", "-", "+", diff --git a/neo/d3xp/script/Script_Compiler.h b/neo/d3xp/script/Script_Compiler.h index 51b5918..5a62ddc 100644 --- a/neo/d3xp/script/Script_Compiler.h +++ b/neo/d3xp/script/Script_Compiler.h @@ -31,8 +31,8 @@ If you have questions concerning this license or the applicable additional terms const char * const RESULT_STRING = ""; typedef struct opcode_s { - char *name; - char *opname; + const char *name; + const char *opname; int priority; bool rightAssociative; idVarDef *type_a; @@ -197,7 +197,7 @@ enum { class idCompiler { private: static bool punctuationValid[ 256 ]; - static char *punctuation[]; + static const char *punctuation[]; idParser parser; idParser *parserPtr; diff --git a/neo/d3xp/script/Script_Interpreter.cpp b/neo/d3xp/script/Script_Interpreter.cpp index 6e07931..de63e7b 100644 --- a/neo/d3xp/script/Script_Interpreter.cpp +++ b/neo/d3xp/script/Script_Interpreter.cpp @@ -425,7 +425,7 @@ idInterpreter::Error Aborts the currently executing function ============ */ -void idInterpreter::Error( char *fmt, ... ) const { +void idInterpreter::Error( const char *fmt, ... ) const { va_list argptr; char text[ 1024 ]; @@ -450,7 +450,7 @@ idInterpreter::Warning Prints file and line number information with warning. ============ */ -void idInterpreter::Warning( char *fmt, ... ) const { +void idInterpreter::Warning( const char *fmt, ... ) const { va_list argptr; char text[ 1024 ]; diff --git a/neo/d3xp/script/Script_Interpreter.h b/neo/d3xp/script/Script_Interpreter.h index d0ab7a9..a1e650a 100644 --- a/neo/d3xp/script/Script_Interpreter.h +++ b/neo/d3xp/script/Script_Interpreter.h @@ -93,8 +93,8 @@ public: int CurrentLine( void ) const; const char *CurrentFile( void ) const; - void Error( char *fmt, ... ) const id_attribute((format(printf,2,3))); - void Warning( char *fmt, ... ) const id_attribute((format(printf,2,3))); + void Error( const char *fmt, ... ) const id_attribute((format(printf,2,3))); + void Warning( const char *fmt, ... ) const id_attribute((format(printf,2,3))); void DisplayInfo( void ) const; bool BeginMultiFrameEvent( idEntity *ent, const idEventDef *event ); diff --git a/neo/idlib/Lexer.h b/neo/idlib/Lexer.h index ea73cf1..9ff408c 100644 --- a/neo/idlib/Lexer.h +++ b/neo/idlib/Lexer.h @@ -129,7 +129,7 @@ typedef enum { // punctuation typedef struct punctuation_s { - char *p; // punctuation character(s) + const char *p; // punctuation character(s) int n; // punctuation id } punctuation_t; diff --git a/neo/idlib/Parser.cpp b/neo/idlib/Parser.cpp index b3cb717..33af7a8 100644 --- a/neo/idlib/Parser.cpp +++ b/neo/idlib/Parser.cpp @@ -625,7 +625,7 @@ void idParser::AddBuiltinDefines( void ) { define_t *define; struct builtin { - char *string; + const char *string; int id; } builtin[] = { { "__LINE__", BUILTIN_LINE }, diff --git a/neo/idlib/math/Simd.cpp b/neo/idlib/math/Simd.cpp index d887052..989a450 100644 --- a/neo/idlib/math/Simd.cpp +++ b/neo/idlib/math/Simd.cpp @@ -312,7 +312,7 @@ TIME_TYPE time_in_millisec( void ) { PrintClocks ============ */ -void PrintClocks( char *string, int dataCount, int clocks, int otherClocks = 0 ) { +void PrintClocks( const char *string, int dataCount, int clocks, int otherClocks = 0 ) { int i; idLib::common->Printf( string );