Merge pull request #28 from xoddark/Werror_write-strings

Fix write-strings warning
This commit is contained in:
Timothee "TTimo" Besset
2011-12-25 08:47:27 -08:00
12 changed files with 18 additions and 18 deletions

View File

@@ -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",

View File

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

View File

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

View File

@@ -4230,7 +4230,7 @@ idMultiplayerGame::GetTeamFlag
================
*/
void idMultiplayerGame::FindTeamFlags( void ) {
char * flagDefs[2] =
const char * flagDefs[2] =
{
"team_CTF_redflag",
"team_CTF_blueflag"

View File

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

View File

@@ -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[] = {
"+=", "-=", "*=", "/=", "%=", "&=", "|=", "++", "--",
"&&", "||", "<=", ">=", "==", "!=", "::", ";", ",",
"~", "!", "*", "/", "%", "(", ")", "-", "+",

View File

@@ -31,8 +31,8 @@ If you have questions concerning this license or the applicable additional terms
const char * const RESULT_STRING = "<RESULT>";
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;

View File

@@ -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 ];

View File

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

View File

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

View File

@@ -625,7 +625,7 @@ void idParser::AddBuiltinDefines( void ) {
define_t *define;
struct builtin
{
char *string;
const char *string;
int id;
} builtin[] = {
{ "__LINE__", BUILTIN_LINE },

View File

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