From: Rudolf Polzer Date: Thu, 20 Dec 2012 15:01:09 +0000 (+0100) Subject: fix lots of uninitialized X-Git-Tag: xonotic-v0.7.0~166 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=55c74eb054a0204f8f12f231ea070d62aa004605;p=xonotic%2Fxonotic-data.pk3dir.git fix lots of uninitialized --- diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 857cdab4a..eb70262ea 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -421,8 +421,8 @@ void CSQC_UpdateView(float w, float h) vid_width = vf_size_x; vid_height = vf_size_y; - vector reticle_pos, reticle_size; - vector splash_pos, splash_size; + vector reticle_pos = '0 0 0', reticle_size = '0 0 0'; + vector splash_pos = '0 0 0', splash_size = '0 0 0'; WaypointSprite_Load(); @@ -1085,7 +1085,7 @@ void CSQC_UpdateView(float w, float h) else shottype = SHOTTYPE_HITWORLD; - vector wcross_color, wcross_size; + vector wcross_color = '0 0 0', wcross_size = '0 0 0'; string wcross_wep = "", wcross_name; float wcross_scale, wcross_blur; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 1f0288a79..607130ea2 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1011,7 +1011,7 @@ void HUD_Ammo(void) void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float theAlpha, float fadelerp) { - vector newPos, newSize; + vector newPos = '0 0 0', newSize = '0 0 0'; vector picpos, numpos; if (vertical) @@ -3011,7 +3011,7 @@ void HUD_RaceTimer (void) } // always force 4:1 aspect - vector newSize; + vector newSize = '0 0 0'; if(mySize_x/mySize_y > 4) { newSize_x = 4 * mySize_y; @@ -3222,7 +3222,7 @@ void HUD_VoteWindow(void) } // always force 3:1 aspect - vector newSize; + vector newSize = '0 0 0'; if(mySize_x/mySize_y > 3) { newSize_x = 3 * mySize_y; @@ -3482,7 +3482,7 @@ void HUD_Mod_KH(vector pos, vector mySize) float kh_keys; float keyteam; float a, aa; - vector p, pa, kh_size, kh_asize; + vector p = '0 0 0', pa, kh_size = '0 0 0', kh_asize = '0 0 0'; kh_keys = getstati(STAT_KH_KEYS); @@ -4035,7 +4035,7 @@ void HUD_DrawPressedKeys(void) float aspect = autocvar_hud_panel_pressedkeys_aspect; if(aspect) { - vector newSize; + vector newSize = '0 0 0'; if(mySize_x/mySize_y > aspect) { newSize_x = aspect * mySize_y; @@ -4245,7 +4245,7 @@ void HUD_InfoMessages(void) } // always force 5:1 aspect - vector newSize; + vector newSize = '0 0 0'; if(mySize_x/mySize_y > 5) { newSize_x = 5 * mySize_y; @@ -4549,7 +4549,7 @@ void HUD_Physics(void) HUD_Panel_GetProgressBarColor(speed); HUD_Panel_DrawProgressBar(panel_pos + speed_offset, panel_size, "progressbar", speed/max_speed, 0, speed_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } - vector tmp_offset = '0 0 0', tmp_size; + vector tmp_offset = '0 0 0', tmp_size = '0 0 0'; if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 2) { tmp_size_x = panel_size_x * 0.75; @@ -4608,7 +4608,7 @@ void HUD_Physics(void) if(autocvar_hud_panel_physics_progressbar == 1 || autocvar_hud_panel_physics_progressbar == 2) { float peak_offset_x; - vector peak_size; + vector peak_size = '0 0 0'; if (speed_baralign == 0) peak_offset_x = min(top_speed, max_speed)/max_speed * panel_size_x; else if (speed_baralign == 1) diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc index b8473e142..d4bb5de23 100644 --- a/qcsrc/client/hud_config.qc +++ b/qcsrc/client/hud_config.qc @@ -1142,7 +1142,7 @@ void HUD_Panel_Mouse() HUD_Panel_SetPos(mousepos - panel_click_distance); else if(highlightedAction == 2) { - vector mySize; + vector mySize = '0 0 0'; if(resizeCorner == 1) { mySize_x = panel_click_resizeorigin_x - (mousepos_x - panel_click_distance_x); mySize_y = panel_click_resizeorigin_y - (mousepos_y - panel_click_distance_y); diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 0a8e6f0b2..192817bbc 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -171,7 +171,7 @@ void MapVote_Draw() float center; float columns, rows; float tsize; - vector dist; + vector dist = '0 0 0'; if(!mv_active) return; diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index 72bb9c5c4..e103fabe7 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -149,7 +149,7 @@ float PreviewExists(string name) vector rotate(vector v, float a) { - vector w; + vector w = '0 0 0'; // FTEQCC SUCKS AGAIN w_x = v_x * cos(a) + v_y * sin(a); w_y = -1 * v_x * sin(a) + v_y * cos(a); @@ -231,7 +231,7 @@ vector expandingbox_resize_centered_box_offset(float sz, vector boxsize, float b void drawborderlines(float thickness, vector pos, vector dim, vector color, float theAlpha, float drawflag) { - vector line_dim; + vector line_dim = '0 0 0'; // left and right lines pos_x -= thickness; @@ -250,7 +250,7 @@ void drawborderlines(float thickness, vector pos, vector dim, vector color, floa void drawpic_tiled(vector pos, string pic, vector sz, vector area, vector color, float theAlpha, float drawflag) { - vector current_pos, end_pos, new_size, ratio; + vector current_pos = '0 0 0', end_pos, new_size = '0 0 0', ratio = '0 0 0'; end_pos = pos + area; current_pos_y = pos_y; diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index b927112c8..0bd57d311 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -791,7 +791,7 @@ void HUD_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_numb vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_size) { float body_table_height, i; - vector tmp, column_dim; + vector tmp = '0 0 0', column_dim = '0 0 0'; entity pl; body_table_height = 1.25 * hud_fontsize_y * max(1, tm.team_size); // no player? show 1 empty line @@ -955,7 +955,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) drawstring(pos, sprintf(_("Accuracy stats (average %d%%)"), average_accuracy), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL); pos_y += 1.25 * hud_fontsize_y + autocvar_scoreboard_border_thickness; - vector tmp; + vector tmp = '0 0 0'; tmp_x = sbwidth; tmp_y = height * rows; @@ -1092,7 +1092,7 @@ vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) { pos_y += 1.25 * hud_fontsize_y + autocvar_scoreboard_border_thickness; // draw table - vector tmp; + vector tmp = '0 0 0'; tmp_x = sbwidth; tmp_y = hud_fontsize_y * rows; @@ -1133,7 +1133,7 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl, vector rgb, vector bg_ pos_y += hud_fontsize_y; drawstring(pos, _("Rankings"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL); pos_y += hud_fontsize_y + autocvar_scoreboard_border_thickness; - vector tmp; + vector tmp = '0 0 0'; tmp_x = sbwidth; tmp_y = 1.25 * hud_fontsize_y * RANKINGS_RECEIVED_CNT; diff --git a/qcsrc/client/vehicles/vehicles.qc b/qcsrc/client/vehicles/vehicles.qc index 3a4597ab2..177c9b535 100644 --- a/qcsrc/client/vehicles/vehicles.qc +++ b/qcsrc/client/vehicles/vehicles.qc @@ -231,7 +231,7 @@ void CSQC_BUMBLE_HUD() if(autocvar_r_letterbox) return; - vector picsize, hudloc, pic2size, picloc; + vector picsize, hudloc = '0 0 0', pic2size, picloc; // Fetch health & ammo stats HUD_GETSTATS @@ -382,7 +382,7 @@ void CSQC_BUMBLE_GUN_HUD() if(autocvar_r_letterbox) return; - vector picsize, hudloc, pic2size, picloc; + vector picsize, hudloc = '0 0 0', pic2size, picloc; // Fetch health & ammo stats HUD_GETSTATS @@ -503,7 +503,7 @@ void CSQC_SPIDER_HUD() if(autocvar_r_letterbox) return; - vector picsize, hudloc, pic2size, picloc; + vector picsize, hudloc = '0 0 0', pic2size, picloc; float i; // Fetch health & ammo stats @@ -666,7 +666,7 @@ void CSQC_RAPTOR_HUD() if(autocvar_r_letterbox) return; - vector picsize, hudloc, pic2size, picloc; + vector picsize, hudloc = '0 0 0', pic2size, picloc; // Fetch health & ammo stats HUD_GETSTATS @@ -860,7 +860,7 @@ void CSQC_WAKIZASHI_HUD() if(autocvar_r_letterbox) return; - vector picsize, hudloc, pic2size, picloc; + vector picsize, hudloc = '0 0 0', pic2size, picloc; // Fetch health & ammo stats HUD_GETSTATS diff --git a/qcsrc/common/net_notice.qc b/qcsrc/common/net_notice.qc index 869a44bc8..6d786fb69 100644 --- a/qcsrc/common/net_notice.qc +++ b/qcsrc/common/net_notice.qc @@ -72,7 +72,7 @@ float cl_notice_run() #define M1 30 #define M2 10 - vector v1, v2, v3; + vector v1, v2 = '0 0 0', v3; v1 = '1 1 0' * M1; v2_x = vid_conwidth - (2 * M1); v2_y = vid_conheight - (2 * M1); diff --git a/qcsrc/menu/classes.c b/qcsrc/menu/classes.c index f838257c5..0a3a55c5f 100644 --- a/qcsrc/menu/classes.c +++ b/qcsrc/menu/classes.c @@ -19,7 +19,6 @@ #include "item/textslider.c" #include "item/listbox.c" #include "item/inputbox.c" -#include "item/gecko.c" #include "xonotic/dialog.c" #include "xonotic/tab.c" #include "xonotic/mainwindow.c" @@ -67,7 +66,6 @@ #include "xonotic/image.c" #include "xonotic/crosshairbutton.c" #include "xonotic/playermodel.c" -#include "xonotic/dialog_news.c" #include "xonotic/checkbox_slider_invalid.c" #include "xonotic/charmap.c" #include "xonotic/keybinder.c" diff --git a/qcsrc/menu/item/gecko.c b/qcsrc/menu/item/gecko.c deleted file mode 100644 index 5a69c3b87..000000000 --- a/qcsrc/menu/item/gecko.c +++ /dev/null @@ -1,97 +0,0 @@ -// Andreas Kirsch Gecko item (to test it) -#ifdef INTERFACE -CLASS(Gecko) EXTENDS(Item) - METHOD(Gecko, configureBrowser, void( entity, string ) ) - METHOD(Gecko, draw, void(entity)) - METHOD(Gecko, keyDown, float(entity, float, float, float)) - METHOD(Gecko, keyUp, float(entity, float, float, float)) - METHOD(Gecko, mouseMove, float(entity, vector)) - METHOD(Gecko, mouseDrag, float(entity, vector)) - METHOD(Gecko, resizeNotify, void(entity, vector, vector, vector, vector)) - ATTRIB(Gecko, texturePath, string, string_null ) - ATTRIB(Gecko, textureExtent, vector, '0 0 0') -ENDCLASS(Gecko) -#endif - -#ifdef IMPLEMENTATION -// define static members -float _gecko_instanceNumber; - -void Gecko_configureBrowser( entity me, string URI ) { - me.focusable = 1; - - //create a new gecko object if needed - if( !me.texturePath ) { - me.texturePath = strzone( strcat( "_dynamic/gecko/menu/", ftos( _gecko_instanceNumber ) ) ); - _gecko_instanceNumber+=1; - // TODO: add error checks - gecko_create( me.texturePath ); - } - gecko_navigate( me.texturePath, URI ); -} - -void Gecko_draw(entity me) -{ - vector drawSize; - - if( me.texturePath ) { - /* The gecko browser is actually only drawn to a part of the - texture. Correct scaling so that part fills up the whole - item area. */ - drawSize_x = 1.0 / me.textureExtent_x; - drawSize_y = 1.0 / me.textureExtent_y; - draw_Picture( '0 0 0', strcat( "/", me.texturePath ), - drawSize, '1 1 1', 1.0 ); - } else { - vector fontsize; - fontsize_x = fontsize_y = 1.0 / 30.0; - fontsize_z = 0.0; - draw_Text( '0 0 0', _("Browser not initialized!"), fontsize, '1 1 1', 1.0, 0 ); - } - SUPER(Gecko).draw(me); -} - -float Gecko_keyDown(entity me, float scan, float ascii, float shift) -{ - if( scan == K_ESCAPE ) { - return 0; - } - if (ascii >= 32) - return gecko_keyevent( me.texturePath, ascii, GECKO_BUTTON_DOWN ); - else - return gecko_keyevent( me.texturePath, scan, GECKO_BUTTON_DOWN ); -} - -float Gecko_keyUp(entity me, float scan, float ascii, float shift) -{ - if (ascii >= 32) - return gecko_keyevent( me.texturePath, ascii, GECKO_BUTTON_UP ); - else - return gecko_keyevent( me.texturePath, scan, GECKO_BUTTON_UP ); -} - -float Gecko_mouseMove(entity me, vector pos) -{ - gecko_mousemove( me.texturePath, pos_x, pos_y ); - return 1; -} - -float Gecko_mouseDrag(entity me, vector pos) -{ - gecko_mousemove( me.texturePath, pos_x, pos_y ); - return 1; -} - -void Gecko_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) -{ - SUPER(Gecko).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); - gecko_resize( me.texturePath, absSize_x, absSize_y ); - me.textureExtent = gecko_get_texture_extent( me.texturePath ); -} - -string toStringGecko(entity me) -{ - return me.texturePath; -} - -#endif diff --git a/qcsrc/menu/item/listbox.c b/qcsrc/menu/item/listbox.c index 60da88a09..c32057da8 100644 --- a/qcsrc/menu/item/listbox.c +++ b/qcsrc/menu/item/listbox.c @@ -247,7 +247,7 @@ void ListBox_updateControlTopBottom(entity me) void ListBox_draw(entity me) { float i; - vector absSize, fillSize; + vector absSize, fillSize = '0 0 0'; vector oldshift, oldscale; if(me.pressed == 2) me.mouseDrag(me, me.dragScrollPos); // simulate mouseDrag event diff --git a/qcsrc/menu/xonotic/colorpicker.c b/qcsrc/menu/xonotic/colorpicker.c index 66f292a03..eb9590827 100644 --- a/qcsrc/menu/xonotic/colorpicker.c +++ b/qcsrc/menu/xonotic/colorpicker.c @@ -53,7 +53,7 @@ vector hslimage_color(vector v, vector margin) vector color_hslimage(vector v, vector margin) { - vector pos; + vector pos = '0 0 0'; v = rgb_to_hsl(v); if (v_y) { diff --git a/qcsrc/menu/xonotic/dialog_news.c b/qcsrc/menu/xonotic/dialog_news.c deleted file mode 100644 index f638c770d..000000000 --- a/qcsrc/menu/xonotic/dialog_news.c +++ /dev/null @@ -1,20 +0,0 @@ -#ifdef INTERFACE -CLASS(XonoticNewsDialog) EXTENDS(XonoticDialog) - METHOD(XonoticNewsDialog, fill, void(entity)) - ATTRIB(XonoticNewsDialog, title, string, _("News")) - ATTRIB(XonoticNewsDialog, color, vector, SKINCOLOR_DIALOG_SETTINGS) - ATTRIB(XonoticNewsDialog, intendedWidth, float, 0.96) - ATTRIB(XonoticNewsDialog, rows, float, 24) - ATTRIB(XonoticNewsDialog, columns, float, 1) -ENDCLASS(XonoticNewsDialog) -#endif - -#ifdef IMPLEMENTATION -void XonoticNewsDialog_fill(entity me) -{ - entity e; - me.TR(me); - me.TD(me, 24, 1, e = spawnGecko()); - e.configureBrowser( e, _("http://www.xonotic.org/team/blog/") ); -} -#endif diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index c7f733a19..9e4962602 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -733,11 +733,11 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float // 5: AES required { - vector iconSize; + vector iconSize = '0 0 0'; iconSize_y = me.realFontSize_y * me.iconsSizeFactor; iconSize_x = me.realFontSize_x * me.iconsSizeFactor; - vector iconPos; + vector iconPos = '0 0 0'; iconPos_x = (me.columnIconsSize - 3 * iconSize_x) * 0.5; iconPos_y = (1 - iconSize_y) * 0.5; diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 459b2155f..449885974 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -479,7 +479,7 @@ void postMenuDraw() } void preMenuDraw() { - vector fs, sz, line, mid; + vector fs, sz = '0 0 0', line, mid; updateCheck(); diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index b58830ac1..8f510edff 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -1197,7 +1197,7 @@ vector findperpendicular(vector v) vector W_CalculateProjectileSpread(vector forward, float spread) { float sigma; - vector v1, v2; + vector v1 = '0 0 0', v2; float dx, dy, r; float sstyle; spread *= g_weaponspreadfactor; diff --git a/qcsrc/server/runematch.qc b/qcsrc/server/runematch.qc index 952bb342e..ba8f648c8 100644 --- a/qcsrc/server/runematch.qc +++ b/qcsrc/server/runematch.qc @@ -165,7 +165,7 @@ void rune_respawn(); void RuneCarriedThink() { float rcount, rnum; - vector ang; + vector ang = '0 0 0'; entity rune; if(self.owner.classname != "player" || time < game_starttime) diff --git a/qcsrc/server/tturrets/system/system_misc.qc b/qcsrc/server/tturrets/system/system_misc.qc index 5a94b4423..2e3a00688 100644 --- a/qcsrc/server/tturrets/system/system_misc.qc +++ b/qcsrc/server/tturrets/system/system_misc.qc @@ -45,7 +45,7 @@ vector shortangle_v(vector ang1, vector ang2) vector shortangle_vxy(vector ang1, vector ang2) { - vector vtmp; + vector vtmp = '0 0 0'; vtmp_x = shortangle_f(ang1_x,ang2_x); vtmp_y = shortangle_f(ang1_y,ang2_y);