Skip to content

Commit

Permalink
Fixed|libheretic: Compiler warnings (unused var/arg)
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Feb 25, 2014
1 parent 2f77b7d commit b02662c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 14 deletions.
2 changes: 2 additions & 0 deletions doomsday/plugins/common/src/d_netcl.cpp
Expand Up @@ -1047,5 +1047,7 @@ void NetCl_UpdateTotalCounts(Reader *msg)

App_Log(DE2_DEV_NET_MSG, "NetCl_UpdateTotalCounts: kills=%i, items=%i, secrets=%i",
totalKills, totalItems, totalSecret);
#else
DENG2_UNUSED(msg);
#endif
}
2 changes: 2 additions & 0 deletions doomsday/plugins/common/src/p_inventory.cpp
Expand Up @@ -440,6 +440,8 @@ int P_InventoryGive(int player, inventoryitemtype_t type, int silent)
{
ST_HUDUnHide(player, HUE_ON_PICKUP_INVITEM);
}
#else
DENG2_UNUSED(silent);
#endif

return 1;
Expand Down
48 changes: 34 additions & 14 deletions doomsday/plugins/heretic/src/m_cheat.cpp
Expand Up @@ -77,8 +77,8 @@ void G_RegisterCheats(void)

CHEAT_FUNC(InvItem)
{
DENG_UNUSED(args);
DENG_ASSERT(player >= 0 && player < MAXPLAYERS);
DENG2_UNUSED2(args, numArgs);
DENG2_ASSERT(player >= 0 && player < MAXPLAYERS);

P_SetMessage(&players[player], LMF_NO_HIDE, TXT_CHEATINVITEMS1);
S_LocalSound(SFX_DORCLS, NULL);
Expand All @@ -88,7 +88,7 @@ CHEAT_FUNC(InvItem)

CHEAT_FUNC(InvItem2)
{
DENG2_UNUSED(args);
DENG2_UNUSED2(args, numArgs);
DENG2_ASSERT(player >= 0 && player < MAXPLAYERS);

P_SetMessage(&players[player], LMF_NO_HIDE, TXT_CHEATINVITEMS2);
Expand All @@ -99,6 +99,7 @@ CHEAT_FUNC(InvItem2)

CHEAT_FUNC(InvItem3)
{
DENG2_UNUSED(numArgs);
DENG2_ASSERT(player >= 0 && player < MAXPLAYERS);

player_t *plr = &players[player];
Expand Down Expand Up @@ -136,18 +137,17 @@ CHEAT_FUNC(InvItem3)
CHEAT_FUNC(IDKFA)
{
player_t *plr = &players[player];
int i;

DENG_UNUSED(args);
DENG_ASSERT(player >= 0 && player < MAXPLAYERS);
DENG2_UNUSED2(args, numArgs);
DENG2_ASSERT(player >= 0 && player < MAXPLAYERS);

if(G_Rules().skill == SM_NIGHTMARE) return false;
// Dead players can't cheat.
if(plr->health <= 0) return false;
if(plr->morphTics) return false;

plr->update |= PSF_OWNED_WEAPONS;
for(i = 0; i < NUM_WEAPON_TYPES; ++i)
for(int i = 0; i < NUM_WEAPON_TYPES; ++i)
{
plr->weapons[i].owned = false;
}
Expand All @@ -165,8 +165,8 @@ CHEAT_FUNC(IDDQD)
{
player_t *plr = &players[player];

DENG_UNUSED(args);
DENG_ASSERT(player >= 0 && player < MAXPLAYERS);
DENG2_UNUSED2(args, numArgs);
DENG2_ASSERT(player >= 0 && player < MAXPLAYERS);

if(G_Rules().skill == SM_NIGHTMARE) return false;
// Dead players can't cheat.
Expand All @@ -184,8 +184,8 @@ CHEAT_FUNC(Reveal)
{
player_t *plr = &players[player];

DENG_UNUSED(args);
DENG_ASSERT(player >= 0 && player < MAXPLAYERS);
DENG2_UNUSED2(args, numArgs);
DENG2_ASSERT(player >= 0 && player < MAXPLAYERS);

if(IS_NETGAME && G_Rules().deathmatch) return false;
// Dead players can't cheat.
Expand All @@ -203,9 +203,11 @@ CHEAT_FUNC(Reveal)
*/
D_CMD(Cheat)
{
DENG2_UNUSED2(src, argc);

// Give each of the characters in argument two to the SB event handler.
int i, len = (int) strlen(argv[1]);
for(i = 0; i < len; ++i)
int const len = (int) strlen(argv[1]);
for(int i = 0; i < len; ++i)
{
event_t ev;
ev.type = EV_KEY;
Expand All @@ -219,6 +221,8 @@ D_CMD(Cheat)

D_CMD(CheatGod)
{
DENG2_UNUSED(src);

if(G_GameState() == GS_MAP)
{
if(IS_CLIENT)
Expand Down Expand Up @@ -258,6 +262,8 @@ D_CMD(CheatGod)

D_CMD(CheatNoClip)
{
DENG2_UNUSED(src);

if(G_GameState() == GS_MAP)
{
if(IS_CLIENT)
Expand Down Expand Up @@ -295,7 +301,7 @@ D_CMD(CheatNoClip)
return true;
}

static int suicideResponse(msgresponse_t response, int userValue, void *userPointer)
static int suicideResponse(msgresponse_t response, int /*userValue*/, void * /*context*/)
{
if(response == MSG_YES)
{
Expand All @@ -314,6 +320,8 @@ static int suicideResponse(msgresponse_t response, int userValue, void *userPoin

D_CMD(CheatSuicide)
{
DENG2_UNUSED(src);

if(G_GameState() == GS_MAP)
{
player_t *plr;
Expand Down Expand Up @@ -353,6 +361,8 @@ D_CMD(CheatSuicide)

D_CMD(CheatReveal)
{
DENG2_UNUSED2(src, argc);

int option, i;

// Server operator can always reveal.
Expand Down Expand Up @@ -381,6 +391,8 @@ D_CMD(CheatReveal)

D_CMD(CheatGive)
{
DENG2_UNUSED(src);

char buf[100];
int player = CONSOLEPLAYER;
player_t *plr;
Expand Down Expand Up @@ -641,6 +653,8 @@ D_CMD(CheatGive)

D_CMD(CheatMassacre)
{
DENG2_UNUSED3(src, argc, argv);

if(G_GameState() == GS_MAP)
{
if(IS_CLIENT)
Expand All @@ -663,6 +677,8 @@ D_CMD(CheatMassacre)

D_CMD(CheatWhere)
{
DENG2_UNUSED3(src, argc, argv);

player_t *plr = &players[CONSOLEPLAYER];
char textBuffer[256];
Sector *sector;
Expand Down Expand Up @@ -706,6 +722,8 @@ D_CMD(CheatWhere)
*/
D_CMD(CheatLeaveMap)
{
DENG2_UNUSED3(src, argc, argv);

// Only the server operator can end the map this way.
if(IS_NETGAME && !IS_NETWORK_SERVER)
return false;
Expand All @@ -723,6 +741,8 @@ D_CMD(CheatLeaveMap)

D_CMD(CheatMorph)
{
DENG2_UNUSED(src);

if(G_GameState() == GS_MAP)
{
if(IS_CLIENT)
Expand Down

0 comments on commit b02662c

Please sign in to comment.