From 6411ed3dc5fdca782fcbb7b6bf1e7808cd53679a Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 16 May 2011 13:15:57 +0000 Subject: [PATCH] warning fixes git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6444 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 8 ++++---- source/src/clients2c.cpp | 2 +- source/src/protos.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index afc58871..b07c5b9b 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -1273,7 +1273,7 @@ void flagmsg(int flag, int message, int actor, int flagtime) void dropflag() { tryflagdrop(true); } COMMAND(dropflag, ARG_NONE); -char *votestring(int type, char *arg1, char *arg2) +char *votestring(int type, const char *arg1, const char *arg2) { const char *msgs[] = { "kick player %s, reason: %s", "ban player %s, reason: %s", "remove all bans", "set mastermode to %s", "%s autoteam", "force player %s to the enemy team", "give admin to player %s", "load map %s in mode %s%s", "%s demo recording for the next match", "stop demo recording", "clear all demos", "set server description to '%s'", "shuffle teams"}; const char *msg = msgs[type]; @@ -1323,7 +1323,7 @@ char *votestring(int type, char *arg1, char *arg2) return out; } -votedisplayinfo *newvotedisplayinfo(playerent *owner, int type, char *arg1, char *arg2) +votedisplayinfo *newvotedisplayinfo(playerent *owner, int type, const char *arg1, const char *arg2) { if(type < 0 || type >= SA_NUM) return NULL; votedisplayinfo *v = new votedisplayinfo(); @@ -1338,7 +1338,7 @@ votedisplayinfo *newvotedisplayinfo(playerent *owner, int type, char *arg1, char votedisplayinfo *curvote = NULL, *calledvote = NULL; -void callvote(int type, char *arg1, char *arg2) +void callvote(int type, const char *arg1, const char *arg2) { if(calledvote) return; votedisplayinfo *v = newvotedisplayinfo(player1, type, arg1, arg2); @@ -1380,7 +1380,7 @@ void callvote(int type, char *arg1, char *arg2) else conoutf(_("%c3invalid vote"), CC); } -void scallvote(char *type, char *arg1, char *arg2) +void scallvote(char *type, const char *arg1, const char *arg2) { if(type && inmainloop) { diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index dd5f53f3..e3b8c786 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -1271,7 +1271,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) string demofile; extern char *curdemofile; getstring(demofile, p, MAXSTRLEN); - watchingdemo = demoplayback = demofile && demofile[0]; + watchingdemo = demoplayback = demofile[0] != '\0'; delete[] curdemofile; if(demoplayback) { diff --git a/source/src/protos.h b/source/src/protos.h index 13ec3e24..41e8afde 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -388,7 +388,7 @@ extern playerent *newclient(int cn); extern void timeupdate(int milliscur, int millismax); // was (int timeremain); extern void respawnself(); extern void setskin(playerent *pl, int skin, int team = -1); -extern void callvote(int type, char *arg1 = NULL, char *arg2 = NULL); +extern void callvote(int type, const char *arg1 = NULL, const char *arg2 = NULL); extern void addsleep(int msec, const char *cmd, bool persist = false); extern void resetsleep(bool force = false); //game mode extras @@ -423,7 +423,7 @@ struct votedisplayinfo votedisplayinfo() : owner(NULL), result(VOTE_NEUTRAL), millis(0), localplayervoted(false) { loopi(VOTE_NUM) stats[i] = VOTE_NEUTRAL; } }; -extern votedisplayinfo *newvotedisplayinfo(playerent *owner, int type, char *arg1, char *arg2); +extern votedisplayinfo *newvotedisplayinfo(playerent *owner, int type, const char *arg1, const char *arg2); extern void callvotesuc(); extern void callvoteerr(int e); extern void displayvote(votedisplayinfo *v);