From bb27c3c62a61d8c2893b3f589b653c81d5ed227e Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Wed, 2 May 2012 10:50:12 +0200 Subject: [PATCH] fix a few unuseds --- qcsrc/common/command/markup.qc | 1 + qcsrc/common/mapinfo.qc | 2 +- qcsrc/menu/anim/keyframe.c | 3 +- qcsrc/menu/item/inputbox.c | 1 - qcsrc/menu/item/inputcontainer.c | 3 +- qcsrc/menu/item/listbox.c | 1 - .../dialog_multiplayer_create_advanced.c | 28 ++++++------- qcsrc/menu/xonotic/dialog_settings_audio.c | 39 +++++-------------- qcsrc/menu/xonotic/util.qc | 2 + 9 files changed, 30 insertions(+), 50 deletions(-) diff --git a/qcsrc/common/command/markup.qc b/qcsrc/common/command/markup.qc index cb1a8cc37..d1562aaac 100644 --- a/qcsrc/common/command/markup.qc +++ b/qcsrc/common/command/markup.qc @@ -51,6 +51,7 @@ void GenericCommand_markup_init() markup_from[i] = "&.."; markup_to[i] = "\x9e"; ++i; markup_from[i] = "&.)"; markup_to[i] = "\x9f"; ++i; markup_from[i] = "&<|"; markup_to[i] = "\xff"; ++i; + unused_float = i; } string GenericCommand_markup(string s2) diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 9de5098cb..05c93865d 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -945,7 +945,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, flo MapInfo_Map_author = s; else if(t == "has") { - t = car(s); s = cdr(s); + t = car(s); // s = cdr(s); if (t == "weapons") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_WEAPONS; else if(t == "turrets") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_TURRETS; else if(t == "vehicles") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_VEHICLES; diff --git a/qcsrc/menu/anim/keyframe.c b/qcsrc/menu/anim/keyframe.c index de5d54ae1..3bcda94e6 100644 --- a/qcsrc/menu/anim/keyframe.c +++ b/qcsrc/menu/anim/keyframe.c @@ -75,8 +75,7 @@ void Keyframe_addAnim(entity me, entity other) other.parent = me; - entity f, l; - f = me.firstChild; + entity l; l = me.lastChild; if(l) diff --git a/qcsrc/menu/item/inputbox.c b/qcsrc/menu/item/inputbox.c index af6587b5a..572d3a071 100644 --- a/qcsrc/menu/item/inputbox.c +++ b/qcsrc/menu/item/inputbox.c @@ -226,7 +226,6 @@ void InputBox_draw(entity me) else if(ch2 == "x") // ^x found { theColor = '1 1 1'; - theTempColor = '0 0 0'; component = HEXDIGIT_TO_DEC(substring(me.text, i+2, 1)); if (component >= 0) // ^xr found diff --git a/qcsrc/menu/item/inputcontainer.c b/qcsrc/menu/item/inputcontainer.c index e1b14d3b1..65129b294 100644 --- a/qcsrc/menu/item/inputcontainer.c +++ b/qcsrc/menu/item/inputcontainer.c @@ -153,8 +153,7 @@ float InputContainer_mousePress(entity me, vector pos) } float InputContainer_mouseRelease(entity me, vector pos) { - float r; - r = SUPER(InputContainer).mouseRelease(me, pos); + SUPER(InputContainer).mouseRelease(me, pos); // return value? if(me.focused) // am I still eligible for this? (UGLY HACK, but a mouse event could have changed focus away) if(me._changeFocusXY(me, pos)) return 1; diff --git a/qcsrc/menu/item/listbox.c b/qcsrc/menu/item/listbox.c index 4f8dca622..0c4f34902 100644 --- a/qcsrc/menu/item/listbox.c +++ b/qcsrc/menu/item/listbox.c @@ -182,7 +182,6 @@ float ListBox_mouseRelease(entity me, vector pos) // and give it a nice click event if(me.nItems > 0) { - absSize = boxToGlobalSize(me.size, eX * (1 - me.controlWidth) + eY * me.itemHeight); me.clickListBoxItem(me, me.selectedItem, globalToBox(pos, eY * (me.selectedItem * me.itemHeight - me.scrollPos), eX * (1 - me.controlWidth) + eY * me.itemHeight)); } } diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_advanced.c b/qcsrc/menu/xonotic/dialog_multiplayer_create_advanced.c index 226f346b6..3fcabaaab 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_advanced.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_advanced.c @@ -25,36 +25,36 @@ void XonoticAdvancedDialog_fill(entity me) me.TD(me, 1, 3, makeXonoticTextLabel(0, _("Game settings:"))); me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "sv_spectate", _("Allow spectating"))); + me.TD(me, 1, 2.8, makeXonoticCheckBox(0, "sv_spectate", _("Allow spectating"))); me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Spawn shield:"))); - me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 15, 0.5, "g_spawnshieldtime")); + me.TD(me, 1, 1.2, makeXonoticTextLabel(0, _("Spawn shield:"))); + me.TD(me, 1, 1.6, makeXonoticSlider(0, 15, 0.5, "g_spawnshieldtime")); me.TR(me); me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Game speed:"))); - me.TD(me, 1, 1.6, e = makeXonoticSlider(0.5, 2.0, 0.1, "slowmo")); + me.TD(me, 1, 1.2, makeXonoticTextLabel(0, _("Game speed:"))); + me.TD(me, 1, 1.6, makeXonoticSlider(0.5, 2.0, 0.1, "slowmo")); me.TR(me); me.TR(me); me.TD(me, 1, 3, makeXonoticTextLabel(0, _("Teamplay settings:"))); me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Friendly fire scale:"))); - me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 1.0, 0.05, "g_friendlyfire")); + me.TD(me, 1, 1.2, makeXonoticTextLabel(0, _("Friendly fire scale:"))); + me.TD(me, 1, 1.6, makeXonoticSlider(0, 1.0, 0.05, "g_friendlyfire")); me.TR(me); me.TDempty(me, 0.4); - me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "g_friendlyfire_virtual", _("Virtual friendly fire (effect only)"))); + me.TD(me, 1, 2.6, makeXonoticCheckBox(0, "g_friendlyfire_virtual", _("Virtual friendly fire (effect only)"))); me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Friendly fire penalty:"))); - me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 1.0, 0.05, "g_mirrordamage")); + me.TD(me, 1, 1.2, makeXonoticTextLabel(0, _("Friendly fire penalty:"))); + me.TD(me, 1, 1.6, makeXonoticSlider(0, 1.0, 0.05, "g_mirrordamage")); me.TR(me); me.TDempty(me, 0.4); - me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "g_mirrordamage_virtual", _("Virtual penalty (effect only)"))); + me.TD(me, 1, 2.6, makeXonoticCheckBox(0, "g_mirrordamage_virtual", _("Virtual penalty (effect only)"))); me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Teams:"))); + me.TD(me, 1, 1.2, makeXonoticTextLabel(0, _("Teams:"))); me.TD(me, 1, 1.6, e = makeXonoticTextSlider("g_tdm_teams_override g_domination_teams_override g_keyhunt_teams_override")); e.addValue(e, "Default", "0"); e.addValue(e, "2 teams", "2"); @@ -63,7 +63,7 @@ void XonoticAdvancedDialog_fill(entity me) e.configureXonoticTextSliderValues(e); me.TR(me); me.TR(me); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Map voting:"))); + me.TD(me, 1, 1, makeXonoticTextLabel(0, _("Map voting:"))); me.TD(me, 1, 2, e = makeXonoticTextSlider("g_maplist_votable")); e.addValue(e, _("No voting"), "0"); e.addValue(e, _("2 choices"), "2"); @@ -76,7 +76,7 @@ void XonoticAdvancedDialog_fill(entity me) e.addValue(e, _("9 choices"), "9"); e.configureXonoticTextSliderValues(e); me.TR(me); - me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "sv_vote_simple_majority_factor", _("Simple majority wins vcall"))); + me.TD(me, 1, 3, makeXonoticCheckBoxEx(0.5, 0, "sv_vote_simple_majority_factor", _("Simple majority wins vcall"))); me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0')); diff --git a/qcsrc/menu/xonotic/dialog_settings_audio.c b/qcsrc/menu/xonotic/dialog_settings_audio.c index 1f1ee385b..174873fe7 100644 --- a/qcsrc/menu/xonotic/dialog_settings_audio.c +++ b/qcsrc/menu/xonotic/dialog_settings_audio.c @@ -114,12 +114,12 @@ void XonoticAudioSettingsTab_fill(entity me) setDependentStringNotEqual(s, "mastervolume", "0"); me.TR(me); me.TR(me); - me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "menu_snd_attenuation_method", _("New style sound attenuation"))); + me.TD(me, 1, 3, makeXonoticCheckBox(0, "menu_snd_attenuation_method", _("New style sound attenuation"))); me.TR(me); - me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "snd_mutewhenidle", _("Mute sounds when not active"))); + me.TD(me, 1, 3, makeXonoticCheckBox(0, "snd_mutewhenidle", _("Mute sounds when not active"))); me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Frequency:"))); + me.TD(me, 1, 1, makeXonoticTextLabel(0, _("Frequency:"))); me.TD(me, 1, 2, e = makeXonoticTextSlider("snd_speed")); e.addValue(e, _("8 kHz"), "8000"); e.addValue(e, _("11.025 kHz"), "11025"); @@ -131,7 +131,7 @@ void XonoticAudioSettingsTab_fill(entity me) e.addValue(e, _("48 kHz"), "48000"); e.configureXonoticTextSliderValues(e); me.TR(me); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Channels:"))); + me.TD(me, 1, 1, makeXonoticTextLabel(0, _("Channels:"))); me.TD(me, 1, 2, e = makeXonoticTextSlider("snd_channels")); e.addValue(e, _("Mono"), "1"); e.addValue(e, _("Stereo"), "2"); @@ -148,33 +148,15 @@ void XonoticAudioSettingsTab_fill(entity me) me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "snd_spatialization_control", _("Headphone friendly mode"))); setDependent(e, "snd_channels", 1.5, 0.5); me.TR(me); - /*me.TR(me); // Samual: I REALLY don't think these are relevant to anyone, and just clutter up the menu pointlessly. The defaults are fine. - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Spatial voices:"))); - me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "cl_voice_directional", "0", ZCTX(_("VOCS^None")))); - me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "cl_voice_directional", "2", ZCTX(_("VOCS^Taunts")))); - me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "cl_voice_directional", "1", ZCTX(_("VOCS^All")))); me.TR(me); - me.TDempty(me, 0.2); - me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Taunt range:"))); - setDependent(e, "cl_voice_directional", 0.5, -0.5); - me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_voice_directional_taunt_attenuation")); - e.addValue(e, ZCTX(_("RNG^Very short")), "3"); - e.addValue(e, ZCTX(_("RNG^Short")), "2"); - e.addValue(e, ZCTX(_("RNG^Normal")), "0.5"); - e.addValue(e, ZCTX(_("RNG^Long")), "0.25"); - e.addValue(e, ZCTX(_("RNG^Full")), "0.015625"); - e.configureXonoticTextSliderValues(e); - setDependent(e, "cl_voice_directional", 0.5, -0.5); - me.TR(me);*/ + me.TD(me, 1, 3, makeXonoticCheckBox(0, "cl_hitsound", _("Hit indication sound"))); me.TR(me); - me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_hitsound", _("Hit indication sound"))); + me.TD(me, 1, 3, makeXonoticCheckBox(0, "con_chatsound", _("Chat message sound"))); me.TR(me); - me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "con_chatsound", _("Chat message sound"))); + me.TD(me, 1, 3, makeXonoticCheckBoxEx(2, 0, "menu_sounds", _("Menu sounds"))); me.TR(me); - me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "menu_sounds", _("Menu sounds"))); me.TR(me); - me.TR(me); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Time announcer:"))); + me.TD(me, 1, 1, makeXonoticTextLabel(0, _("Time announcer:"))); me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_announcer_maptime")); e.addValue(e, ZCTX(_("WRN^Disabled")), "0"); e.addValue(e, _("1 minute"), "1"); @@ -191,13 +173,12 @@ void XonoticAudioSettingsTab_fill(entity me) e.savedValue = 0.65; // default me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Frequency:"))); + me.TD(me, 1, 0.8, makeXonoticTextLabel(0, _("Frequency:"))); me.TD(me, 1, 2, sl); me.TR(me); me.TR(me); if(cvar("developer")) - me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "showsound", _("Debug info about sounds"))); - + me.TD(me, 1, 3, makeXonoticCheckBox(0, "showsound", _("Debug info about sounds"))); me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "snd_restart; snd_attenuation_method_$menu_snd_attenuation_method; sendcvar cl_hitsound; sendcvar cl_autotaunt; sendcvar cl_voice_directional; sendcvar cl_voice_directional_taunt_attenuation", COMMANDBUTTON_APPLY)); diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 78ac9de46..4c03eaa5f 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -622,6 +622,8 @@ float GameType_GetID(float cnt) #define GAMETYPE(id) if(i++ == cnt) return id; GAMETYPES #undef GAMETYPE + + unused_float = i; return 0; } -- 2.39.2