From 1a0b53034e03fa88a0d572f3f3229fd480d454b3 Mon Sep 17 00:00:00 2001 From: danij Date: Tue, 25 Feb 2014 19:24:58 +0000 Subject: [PATCH] Fixed|libcommon: Various compiler warnings --- doomsday/plugins/common/src/d_netcl.cpp | 16 +++++++--------- doomsday/plugins/common/src/d_netsv.cpp | 14 +++++++------- doomsday/plugins/common/src/gamerules.cpp | 2 +- doomsday/plugins/heretic/src/p_inter.c | 2 +- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/doomsday/plugins/common/src/d_netcl.cpp b/doomsday/plugins/common/src/d_netcl.cpp index 29822109e1..a934caccb6 100644 --- a/doomsday/plugins/common/src/d_netcl.cpp +++ b/doomsday/plugins/common/src/d_netcl.cpp @@ -652,7 +652,7 @@ void NetCl_UpdatePlayerState(Reader *msg, int plrNum) #endif } -void NetCl_UpdatePSpriteState(Reader *msg) +void NetCl_UpdatePSpriteState(Reader * /*msg*/) { // Not used. /* @@ -664,16 +664,14 @@ void NetCl_UpdatePSpriteState(Reader *msg) */ } -void NetCl_Intermission(Reader* msg) +void NetCl_Intermission(Reader *msg) { int flags = Reader_ReadByte(msg); if(flags & IMF_BEGIN) { - uint i; - // Close any HUDs left open at the end of the previous map. - for(i = 0; i < MAXPLAYERS; ++i) + for(uint i = 0; i < MAXPLAYERS; ++i) { ST_AutomapOpen(i, false, true); #if __JHERETIC__ || __JHEXEN__ @@ -695,14 +693,14 @@ void NetCl_Intermission(Reader* msg) wmInfo.nextMap = Reader_ReadByte(msg); wmInfo.currentMap = Reader_ReadByte(msg); wmInfo.didSecret = Reader_ReadByte(msg); - wmInfo.episode = gameEpisode; + wmInfo.episode = gameEpisode; G_PrepareWIData(); #elif __JHERETIC__ - wmInfo.episode = gameEpisode; + wmInfo.episode = gameEpisode; #elif __JHEXEN__ - nextMap = Reader_ReadByte(msg); - nextMapEntrance = Reader_ReadByte(msg); + nextMap = Reader_ReadByte(msg); + nextMapEntrance = Reader_ReadByte(msg); #endif #if __JDOOM__ || __JDOOM64__ diff --git a/doomsday/plugins/common/src/d_netsv.cpp b/doomsday/plugins/common/src/d_netsv.cpp index 656e3ad74a..313d96e06f 100644 --- a/doomsday/plugins/common/src/d_netsv.cpp +++ b/doomsday/plugins/common/src/d_netsv.cpp @@ -76,7 +76,7 @@ void NetSv_MapCycleTicker(void); void NetSv_SendPlayerClass(int pnum, char cls); char cyclingMaps; -char *mapCycle = ""; +char *mapCycle = (char *)""; char mapCycleNoExit = true; int netSvAllowSendMsg = true; int netSvAllowCheats; @@ -388,7 +388,7 @@ void NetSv_TellCycleRulesToPlayerAfterTics(int destPlr, int tics) { cycleRulesCounter[destPlr] = tics; } - else if(destPlr == DDSP_ALL_PLAYERS) + else if((unsigned)destPlr == DDSP_ALL_PLAYERS) { for(int i = 0; i < MAXPLAYERS; ++i) { @@ -680,7 +680,7 @@ void NetSv_SendGameState(int flags, int to) for(int i = 0; i < MAXPLAYERS; ++i) { if(!players[i].plr->inGame) continue; - if(to != DDSP_ALL_PLAYERS && to != i) continue; + if((unsigned)to != DDSP_ALL_PLAYERS && to != i) continue; Writer *writer = D_NetWrite(); Writer_WriteByte(writer, flags); @@ -1139,9 +1139,9 @@ void NetSv_KillMessage(player_t *killer, player_t *fragged, dd_bool stomping) tmp[1] = 0; // Choose the right kill message template. - char *in = GET_TXT(stomping ? TXT_KILLMSG_STOMP : killer == - fragged ? TXT_KILLMSG_SUICIDE : TXT_KILLMSG_WEAPON0 + - killer->readyWeapon); + char const *in = GET_TXT(stomping ? TXT_KILLMSG_STOMP : killer == + fragged ? TXT_KILLMSG_SUICIDE : TXT_KILLMSG_WEAPON0 + + killer->readyWeapon); for(; *in; in++) { @@ -1429,7 +1429,7 @@ void NetSv_SendMessageEx(int plrNum, char const *msg, dd_bool yellow) App_Log(DE2_DEV_NET_VERBOSE, "NetSv_SendMessageEx: '%s'", msg); - if(plrNum == DDSP_ALL_PLAYERS) + if((unsigned)plrNum == DDSP_ALL_PLAYERS) { // Also show locally. No sound is played! D_NetMessageNoSound(CONSOLEPLAYER, msg); diff --git a/doomsday/plugins/common/src/gamerules.cpp b/doomsday/plugins/common/src/gamerules.cpp index 63e27be34d..243c9b72bc 100644 --- a/doomsday/plugins/common/src/gamerules.cpp +++ b/doomsday/plugins/common/src/gamerules.cpp @@ -68,6 +68,7 @@ GameRuleset &GameRuleset::operator = (GameRuleset const &other) void GameRuleset::write(Writer *writer) const { DENG2_ASSERT(writer != 0); + Writer_WriteByte(writer, skill); Writer_WriteByte(writer, deathmatch); #if !__JHEXEN__ @@ -106,7 +107,6 @@ void GameRuleset::read(Reader *reader) // C wrapper API --------------------------------------------------------------- - skillmode_t GameRuleset_Skill(GameRuleset const *rules) { DENG2_ASSERT(rules != 0); diff --git a/doomsday/plugins/heretic/src/p_inter.c b/doomsday/plugins/heretic/src/p_inter.c index b99b99ae9e..de76ffe2f8 100644 --- a/doomsday/plugins/heretic/src/p_inter.c +++ b/doomsday/plugins/heretic/src/p_inter.c @@ -78,7 +78,7 @@ static dd_bool giveOneAmmo(player_t *plr, ammotype_t ammoType, int numRounds) numRounds += numRounds / 1; } - // Given the new ammo the player may want to change weapon atomatically. + // Given the new ammo the player may want to change weapon automatically. P_MaybeChangeWeapon(plr, WT_NOCHANGE, ammoType, false /*don't force*/); // Restock the player.