From: Rudolf Polzer Date: Wed, 25 Apr 2012 15:45:46 +0000 (+0200) Subject: fix uses of uninitialized locals X-Git-Tag: xonotic-v0.7.0~330 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3e8c4ad97f2ad40cae0316f463597a2eadffc1b5;p=xonotic%2Fxonotic-data.pk3dir.git fix uses of uninitialized locals --- diff --git a/qcsrc/common/command/generic.qc b/qcsrc/common/command/generic.qc index eaa44b381..b7b8da0e9 100644 --- a/qcsrc/common/command/generic.qc +++ b/qcsrc/common/command/generic.qc @@ -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)); diff --git a/qcsrc/common/command/rpn.qc b/qcsrc/common/command/rpn.qc index c15a8d26e..5cca2db1c 100644 --- a/qcsrc/common/command/rpn.qc +++ b/qcsrc/common/command/rpn.qc @@ -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 +} diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 166acac67..9de5098cb 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -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(;;) { diff --git a/qcsrc/menu/item/borderimage.c b/qcsrc/menu/item/borderimage.c index 1032e805a..4cacfca6b 100644 --- a/qcsrc/menu/item/borderimage.c +++ b/qcsrc/menu/item/borderimage.c @@ -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 { diff --git a/qcsrc/menu/item/dialog.c b/qcsrc/menu/item/dialog.c index da6a4013c..ed73be095 100644 --- a/qcsrc/menu/item/dialog.c +++ b/qcsrc/menu/item/dialog.c @@ -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) diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index b541a7f06..b4c7ce746 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -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); diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index f1d45ab5b..44ca1b227 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -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) == "")