]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix uses of uninitialized locals
authorRudolf Polzer <divverent@xonotic.org>
Wed, 25 Apr 2012 15:45:46 +0000 (17:45 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 25 Apr 2012 15:45:46 +0000 (17:45 +0200)
qcsrc/common/command/generic.qc
qcsrc/common/command/rpn.qc
qcsrc/common/mapinfo.qc
qcsrc/menu/item/borderimage.c
qcsrc/menu/item/dialog.c
qcsrc/menu/menu.qc
qcsrc/menu/xonotic/serverlist.c

index eaa44b3813c38bc3f533691105074b0e4dd32b35..b7b8da0e9f407f64da0bab06bc3dae90c7d4c528 100644 (file)
@@ -351,6 +351,7 @@ void GenericCommand_removefromlist(float request, float argc)
                                
                                argc = tokenizebyseparator(cvar_string(original_cvar), " ");
                                
+                               tmp_string = "";
                                for(i = 0; i < argc; ++i)
                                        if(argv(i) != removal)
                                                tmp_string = strcat(tmp_string, " ", argv(i));
index c15a8d26ef79f0094de66fb91b95d2e8dc11798d..5cca2db1ce666145fb7f339925daacaf3ce8f756 100644 (file)
@@ -236,9 +236,9 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                        i = stof(db_get(rpn_db, "stack.pointer"));
                                                        db_put(rpn_db, "stack.pointer", ftos(i+1));
                                                        db_put(rpn_db, strcat("stack.", ftos(i)), s);
+                                                       if(!i)
+                                                               db_put(rpn_db, "stack.pos", "0");
                                                }
-                                               if(!i)
-                                                       db_put(rpn_db, "stack.pos", "0");
                                        } else if(rpncmd == "dbpop") {
                                                i = stof(db_get(rpn_db, "stack.pointer"));
                                                if(i)
@@ -556,4 +556,4 @@ void GenericCommand_rpn(float request, float argc, string command)
                        return;
                }
        }
-}
\ No newline at end of file
+}
index 166acac675b08c52bf38988e23ea46bc534a7f19..9de5098cb349febadfccd332700803fb69abd337 100644 (file)
@@ -242,6 +242,8 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
        spawnpoints = 0;
        spawnplaces = 0;
        _MapInfo_Map_worldspawn_music = "";
+       mapMins = '0 0 0';
+       mapMaxs = '0 0 0';
 
        for(;;)
        {
index 1032e805a5017cabe92eba152d8a8f40ac4661fb..4cacfca6b9f42477d52e5af360b6554f7c831c2f 100644 (file)
@@ -71,15 +71,16 @@ void BorderImage_draw(entity me)
 {
        if(me.src)
                draw_BorderPicture('0 0 0', me.src, '1 1 0', me.color, 1, me.borderVec);
+
        if(me.fontSize > 0)
        {
-               vector ro, rf, df;
-
                if(me.recalcPos)
                        me.recalcPositionWithText(me, me.text);
 
                if(me.isNexposeeTitleBar)
                {
+                       vector ro, rf, df;
+
                        // me.parent.Nexposee_animationFactor 0 (small) or 1 (full)
                        // default values are for 1
                        ro = me.realOrigin;
@@ -88,18 +89,17 @@ void BorderImage_draw(entity me)
                        me.realOrigin = ro * me.parent.Nexposee_animationFactor + me.realOrigin_Nexposeed * (1 - me.parent.Nexposee_animationFactor);
                        me.realFontSize = rf * me.parent.Nexposee_animationFactor + me.realFontSize_Nexposeed * (1 - me.parent.Nexposee_animationFactor);
                        draw_fontscale = globalToBoxSize(boxToGlobalSize(df, me.realFontSize), rf);
-               }
 
-               SUPER(BorderImage).draw(me);
+                       SUPER(BorderImage).draw(me);
 
-               if(me.isNexposeeTitleBar)
-               {
                        // me.Nexposee_animationState 0 (small) or 1 (full)
                        // default values are for 1
                        me.realOrigin = ro;
                        me.realFontSize = rf;
                        draw_fontscale = df;
                }
+               else
+                       SUPER(BorderImage).draw(me);
        }
        else
        {
index da6a4013cecd772051b12c76aac0f0a74a681a1c..ed73be09501a6a81db14751e73d824b5cd1a618e 100644 (file)
@@ -124,7 +124,6 @@ void Dialog_TDempty(entity me, float colspan)
 
 void Dialog_configureDialog(entity me)
 {
-       entity closebutton;
        float absWidth, absHeight;
 
        me.frame = spawnBorderImage();
@@ -154,14 +153,13 @@ void Dialog_configureDialog(entity me)
 
        if(me.closable && me.borderLines > 0)
        {
-               closebutton = me.closeButton = spawnButton();
+               entity closebutton;
+               closebutton = me.closeButton = me.frame.closeButton = spawnButton();
                closebutton.configureButton(closebutton, "", 0, me.closeButtonImage);
                closebutton.onClick = Dialog_Close; closebutton.onClickEntity = me;
                closebutton.srcMulti = 0;
                me.addItem(me, closebutton, '0 0 0', '1 1 0', 1); // put it as LAST
        }
-
-       me.frame.closeButton = closebutton;
 }
 
 void Dialog_close(entity me)
index b541a7f0639f973e1063ba0c90f3af994973c21d..b4c7ce746a8cd749a1eeed4cfd8d2d9b08b23da3 100644 (file)
@@ -344,6 +344,7 @@ void drawBackground(string img, float a, string algn, float force1)
 
        scalemode = SCALEMODE_CROP;
 
+       l = 0;
        for(i = 0; i < strlen(algn); ++i)
        {
                c = substring(algn, i, 1);
index f1d45ab5b08f88c0b0a23c5fd7fb52407ce8ac9a..44ca1b227943cf7da354dbe5219f72b387f3fa48 100644 (file)
@@ -608,6 +608,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
 
        s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
        m = tokenizebyseparator(s, ":");
+       typestr = "";
        if(m >= 2)
        {
                typestr = argv(0);
@@ -616,6 +617,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
        freeslots = -1;
        sflags = -1;
        modname = "";
+       pure = 0;
        for(j = 2; j < m; ++j)
        {
                if(argv(j) == "")