Skip to content

Commit

Permalink
Fixed|libcommon: Compiler warnings (missing initializer, string const…
Browse files Browse the repository at this point in the history
…ant -> char *)
  • Loading branch information
danij-deng committed Feb 18, 2014
1 parent 695e5ca commit 5219f93
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 34 deletions.
4 changes: 2 additions & 2 deletions doomsday/plugins/common/include/hu_lib.h
Expand Up @@ -583,15 +583,15 @@ typedef struct mndata_button_s {
/// @ref mnButtonFlags
int flags;

#ifdef __cpluplus
#ifdef __cplusplus
mndata_button_s(dd_bool staydownMode = false, void *data = 0, char const *text = 0,
patchid_t *patch = 0, char const *yes = 0, char const *no = 0, int flags = 0)
: staydownMode(staydownMode)
, data(data)
, text(text)
, patch(patch)
, yes(yes)
, no(node)
, no(no)
, flags(flags)
{}
#endif
Expand Down
22 changes: 12 additions & 10 deletions doomsday/plugins/common/src/g_game.cpp
Expand Up @@ -213,9 +213,9 @@ int bodyQueueSlot;
// vars used with game status cvars
int gsvEpisode;
int gsvMap;
char *gsvMapAuthor = "Unknown";
char *gsvMapAuthor;// = "Unknown";
int gsvMapMusic = -1;
char *gsvMapTitle = "Unknown";
char *gsvMapTitle;// = "Unknown";

int gsvInMap;
int gsvCurrentMusic;
Expand Down Expand Up @@ -384,7 +384,7 @@ cvartemplate_t gamestatusCVars[] =
{"player-artifact-gear3", READONLYCVAR, CVT_INT, &gsvInvItems[IIT_PUZZGEAR3], 0, 0},
{"player-artifact-gear4", READONLYCVAR, CVT_INT, &gsvInvItems[IIT_PUZZGEAR4], 0, 0},
#endif
{NULL}
{"", 0, CVT_NULL, 0, 0, 0}
};

ccmdtemplate_t gameCmds[] = {
Expand All @@ -404,7 +404,7 @@ ccmdtemplate_t gameCmds[] = {
{ "savegame", "s", CCmdSaveGame },
{ "savegame", "", CCmdOpenSaveMenu },
{ "togglegamma", "", CCmdCycleTextureGamma },
{ NULL }
{ "", "", 0 }
};

// Deferred new game arguments:
Expand All @@ -419,10 +419,10 @@ void G_Register()
{
int i;

for(i = 0; gamestatusCVars[i].path; ++i)
for(i = 0; gamestatusCVars[i].path[0]; ++i)
Con_AddVariable(gamestatusCVars + i);

for(i = 0; gameCmds[i].name; ++i)
for(i = 0; gameCmds[i].name[0]; ++i)
Con_AddCommand(gameCmds + i);

C_CMD("warp", "i", WarpMap);
Expand Down Expand Up @@ -1201,7 +1201,7 @@ void G_BeginMap()
S_PauseMusic(false);
}

int G_EndGameResponse(msgresponse_t response, int userValue, void *userPointer)
int G_EndGameResponse(msgresponse_t response, int /*userValue*/, void * /*context*/)
{
if(response == MSG_YES)
{
Expand Down Expand Up @@ -2277,7 +2277,9 @@ static void G_ApplyNewGameRules()
void G_LeaveMap(uint newMap, uint _entryPoint, dd_bool _secretExit)
{
#if __JHEXEN__
DENG_UNUSED(_secretExit);
DENG2_UNUSED(_secretExit);
#else
DENG2_UNUSED2(newMap, _entryPoint);
#endif

if(IS_CLIENT) return;
Expand Down Expand Up @@ -4110,7 +4112,7 @@ dd_bool G_DeleteSaveGame(int slot)
return true;
}

int deleteSaveGameConfirmResponse(msgresponse_t response, int userValue, void * /*userPointer*/)
static int deleteSaveGameConfirmResponse(msgresponse_t response, int userValue, void * /*context*/)
{
if(response == MSG_YES)
{
Expand All @@ -4122,7 +4124,7 @@ int deleteSaveGameConfirmResponse(msgresponse_t response, int userValue, void *

D_CMD(DeleteGameSave)
{
DENG_UNUSED(src);
DENG2_UNUSED(src);

bool const confirm = (argc >= 3 && !stricmp(argv[argc-1], "confirm"));

Expand Down
44 changes: 22 additions & 22 deletions doomsday/plugins/common/src/hu_menu.cpp
Expand Up @@ -496,41 +496,41 @@ mndata_text_t txt_hud_full_show_readyitem("Show Ready-Item");
mndata_text_t txt_hud_cntr_mapopen("Automap Only");
#endif

mndata_button_t btn_hud_single_key_display = { true, (void *)"hud-keys-combine" };
mndata_button_t btn_hud_unhide_receive_damage = { true, (void *)"hud-unhide-damage" };
mndata_button_t btn_hud_unhide_pickup_health = { true, (void *)"hud-unhide-pickup-health" };
mndata_button_t btn_hud_unhide_pickup_armor = { true, (void *)"hud-unhide-pickup-armor" };
mndata_button_t btn_hud_unhide_pickup_powerup = { true, (void *)"hud-unhide-pickup-powerup" };
mndata_button_t btn_hud_unhide_pickup_weapon = { true, (void *)"hud-unhide-pickup-weapon" };
mndata_button_t btn_hud_unhide_pickup_ammo = { true, (void *)"hud-unhide-pickup-ammo" };
mndata_button_t btn_hud_unhide_pickup_key = { true, (void *)"hud-unhide-pickup-key" };
mndata_button_t btn_hud_single_key_display(true, (void *)"hud-keys-combine");
mndata_button_t btn_hud_unhide_receive_damage(true, (void *)"hud-unhide-damage");
mndata_button_t btn_hud_unhide_pickup_health(true, (void *)"hud-unhide-pickup-health");
mndata_button_t btn_hud_unhide_pickup_armor(true, (void *)"hud-unhide-pickup-armor");
mndata_button_t btn_hud_unhide_pickup_powerup(true, (void *)"hud-unhide-pickup-powerup");
mndata_button_t btn_hud_unhide_pickup_weapon(true, (void *)"hud-unhide-pickup-weapon");
mndata_button_t btn_hud_unhide_pickup_ammo(true, (void *)"hud-unhide-pickup-ammo");
mndata_button_t btn_hud_unhide_pickup_key(true, (void *)"hud-unhide-pickup-key");
#if __JHERETIC__ || __JHEXEN__
mndata_button_t btn_hud_unhide_pickup_item = { true, (void *)"hud-unhide-pickup-invitem" };
mndata_button_t btn_hud_unhide_pickup_item(true, (void *)"hud-unhide-pickup-invitem");
#endif
mndata_button_t btn_hud_msg_shown = { true, (void *)"msg-show" };
mndata_button_t btn_hud_xhair_vitality_color = { true, (void *)"view-cross-vitality" };
mndata_button_t btn_hud_msg_shown(true, (void *)"msg-show");
mndata_button_t btn_hud_xhair_vitality_color(true, (void *)"view-cross-vitality");
#if __JHEXEN__
mndata_button_t btn_hud_full_show_mana = { true, (void *)"hud-mana" };
mndata_button_t btn_hud_full_show_mana(true, (void *)"hud-mana");
#endif
#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
mndata_button_t btn_hud_full_show_ammo = { true, (void *)"hud-ammo" };
mndata_button_t btn_hud_full_show_armor = { true, (void *)"hud-armor" };
mndata_button_t btn_hud_full_show_ammo(true, (void *)"hud-ammo");
mndata_button_t btn_hud_full_show_armor(true, (void *)"hud-armor");
#endif
#if __JDOOM64__
mndata_button_t btn_hud_full_show_powerkeys = { true, (void *)"hud-power" };
mndata_button_t btn_hud_full_show_powerkeys(true, (void *)"hud-power");
#endif
#if __JDOOM__
mndata_button_t btn_hud_full_show_face = { true, (void *)"hud-face" };
mndata_button_t btn_hud_full_show_face(true, (void *)"hud-face");
#endif
mndata_button_t btn_hud_full_show_health = { true, (void *)"hud-health" };
mndata_button_t btn_hud_full_show_health(true, (void *)"hud-health");
#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
mndata_button_t btn_hud_full_show_keys = { true, (void *)"hud-keys" };
mndata_button_t btn_hud_full_show_keys(true, (void *)"hud-keys");
#endif
#if __JHERETIC__ || __JHEXEN__
mndata_button_t btn_hud_full_show_readyitem = { true, (void *)"hud-currentitem" };
mndata_button_t btn_hud_full_show_readyitem(true, (void *)"hud-currentitem");
#endif
#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
mndata_button_t btn_hud_cntr_mapopen = { true, (void *)"hud-cheat-counter-show-mapopen" };
mndata_button_t btn_hud_cntr_mapopen(true, (void *)"hud-cheat-counter-show-mapopen");
#endif

static mn_object_t HudMenuObjects[] = {
Expand Down Expand Up @@ -712,10 +712,10 @@ ccmdtemplate_t menuCCmds[] = {
void Hu_MenuRegister()
{
int i;
for(i = 0; menuCVars[i].path; ++i)
for(i = 0; menuCVars[i].path[0]; ++i)
Con_AddVariable(menuCVars + i);

for(i = 0; menuCCmds[i].name; ++i)
for(i = 0; menuCCmds[i].name[0]; ++i)
Con_AddCommand(menuCCmds + i);
}

Expand Down

0 comments on commit 5219f93

Please sign in to comment.