]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix some uninitialized variable use etc.
authorRudolf Polzer <divverent@xonotic.org>
Mon, 17 Dec 2012 15:29:58 +0000 (16:29 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 17 Dec 2012 15:29:58 +0000 (16:29 +0100)
qcsrc/Makefile
qcsrc/common/util.qc
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/item/nexposee.c
qcsrc/menu/xonotic/campaign.c
qcsrc/menu/xonotic/cvarlist.c
qcsrc/menu/xonotic/dialog_singleplayer.c
qcsrc/menu/xonotic/maplist.c
qcsrc/menu/xonotic/serverlist.c

index badc3ac1c2ca5cd0a721278f4647e8ade92fb2e9..8d2279a47f846fc7e929f719c36c9a18c8d263fb 100644 (file)
@@ -1,24 +1,18 @@
 SCM := $(shell if [ -d .svn ]; then echo svn; elif [ -d ../.git ]; then echo git; fi)
 PERL ?= perl
-
-ifdef XONOTIC_USE_FTEQCC
-FTEQCC ?= gmqcc
-FTEQCCFLAGS_WATERMARK ?=
-FTEQCCFLAGS ?= -std=fteqcc -fshort-logic -O1 -flno $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
-FTEQCCFLAGS_PROGS ?=
-FTEQCCFLAGS_MENU ?=
+QCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"' -DCVAR_POPCON=1
+QCC ?= fteqcc
+
+VERSION_MESSAGE = $(shell $(QCC) --version --help)
+ifneq (,$(findstring gmqcc,$(VERSION_MESSAGE)))
+# this is gmqcc
+QCCFLAGS_WATERMARK =
+QCCFLAGS ?= -Werror -Wall -Wno-field-redeclared -Wno-double-declaration -Wno-assign-function-types -Wno-unused-variable -std=fteqcc -fshort-logic -O1 -flno $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
 else
-FTEQCC ?= fteqcc
-FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"' -DCVAR_POPCON
-FTEQCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-return_only -fno-fastarrays $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
-FTEQCCFLAGS_PROGS ?=
-FTEQCCFLAGS_MENU ?=
+# this. is. fteqccccccccccccccccccc!
+QCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-return_only -fno-fastarrays $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
 endif
 
-# NOTE: use -DUSE_FTE instead of -TFTE here!
-# It will automagically add an engine check with -TID and then change back to -TFTE
-FTEQCCFLAGS_CSPROGS ?= 
-
 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
 XON_BUILDSYSTEM =
 
@@ -38,18 +32,18 @@ clean:
 FILES_CSPROGS = $(shell find client common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
 ../csprogs.dat: $(FILES_CSPROGS)
        @echo make[1]: Entering directory \`$(PWD)/client\'
-       cd client && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS)
+       cd client && $(QCC) $(QCCFLAGS)
 
 FILES_PROGS = $(shell find server common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
 ../progs.dat: $(FILES_PROGS)
        @echo make[1]: Entering directory \`$(PWD)/server\'
-       cd server && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_PROGS)
+       cd server && $(QCC) $(QCCFLAGS)
 
 FILES_MENU = $(shell find menu common warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
 ../menu.dat: $(FILES_MENU)
        @echo make[1]: Entering directory \`$(PWD)/menu\'
-       cd menu && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_MENU)
+       cd menu && $(QCC) $(QCCFLAGS)
 
 .PHONY: testcase
 testcase:
-       cd testcase && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS) -DTESTCASE="$$TESTCASE"
+       cd testcase && $(QCC) $(QCCFLAGS) -DTESTCASE="$$TESTCASE"
index afd7f1c5ce25ea2bad16b2d3dda0c58c30d4ddad..869afbb571452d0b623a480e773a28a09d559f5c 100644 (file)
@@ -901,8 +901,8 @@ float cvar_settemp(string tmp_cvar, string tmp_value)
 
 float cvar_settemp_restore()
 {
-       float i;
-       entity e;
+       float i = 0;
+       entity e = world;
        while((e = find(e, classname, "saved_cvar_value")))
        {
                if(cvar_type(e.netname))
index 2835d522da0e528fc19a9c0388d95114556fc94c..f342de066659133089b673d1161c329bbf27a12c 100644 (file)
@@ -53,7 +53,7 @@ void GameCommand(string theCommand)
 
        if(argv(0) == "directmenu" || argv(0) == "directpanelhudmenu")
        {
-               string filter;
+               string filter = string_null;
                if(argv(0) == "directpanelhudmenu")
                        filter = strzone("HUD");
 
index 8f8f45119f8744bd74d900776d4b97015bc25406..64da6bcd6de8a93f0919d080bc425f2f358b3762 100644 (file)
@@ -279,7 +279,7 @@ float Nexposee_keyUp(entity me, float scan, float ascii, float shift)
 
 float Nexposee_keyDown(entity me, float scan, float ascii, float shift)
 {
-       float nexposeeKey;
+       float nexposeeKey = 0;
        if(me.animationState == 2)
                if(SUPER(Nexposee).keyDown(me, scan, ascii, shift))
                        return 1;
index 0537967bd69cf564c33986968426c98e8acb69a7..90b559b01ca4cf2a61cc513c98555ef3ba5e15dd 100644 (file)
@@ -249,7 +249,6 @@ void XonoticCampaignList_clickListBoxItem(entity me, float i, vector where)
 void XonoticCampaignList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
 {
        string s;
-       float p;
        vector theColor;
        float theAlpha;
        float j, n;
@@ -274,7 +273,6 @@ void XonoticCampaignList_drawListBoxItem(entity me, float i, vector absSize, flo
        if(isSelected)
                draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
 
-       s = ftos(p);
        if(draw_PictureSize(strcat("/maps/", campaign_mapname[i])) == '0 0 0')
                draw_Picture(me.columnPreviewOrigin * eX, "nopreview_map", me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);
        else
index 03898a3f8b90ef48b11e74de917d8939a1dfe4dc..52f1a1f26e7890d18da2c2a4257749815605e9d9 100644 (file)
@@ -166,7 +166,10 @@ float XonoticCvarList_keyDown(entity me, float scan, float ascii, float shift)
                return 1;
        }
        else if(scan == K_ENTER)
+       {
                me.cvarValueBox.parent.setFocus(me.cvarValueBox.parent, me.cvarValueBox);
+               return 1;
+       }
        else if(SUPER(XonoticCvarList).keyDown(me, scan, ascii, shift))
                return 1;
        else if(!me.controlledTextbox)
index c37cb7e4055f105508ec1770c56eb12ffdcc5cc0..6e13f65b818ea6cb348a1d47a744e43072d33299 100644 (file)
@@ -14,7 +14,7 @@ ENDCLASS(XonoticSingleplayerDialog)
 
 void InstantAction_LoadMap(entity btn, entity dummy)
 {
-       float pmin, pmax, pstep;
+       float pmin = 2, pmax = 16, pstep = 1;
 
        cvar_set("timelimit_override", "10");
        cvar_set("g_lms_lives_override", "9");
index 54b9554a80456d1ccc25a2f7df2c02790c1f961a..fe91b0650a0888a911f828c3d371395f1e0c6d6c 100644 (file)
@@ -185,7 +185,6 @@ void XonoticMapList_drawListBoxItem(entity me, float i, vector absSize, float is
        else if(included)
                draw_Fill('0 0 0', '1 1 0', SKINCOLOR_MAPLIST_INCLUDEDBG, SKINALPHA_MAPLIST_INCLUDEDBG);
 
-       s = ftos(p);
        if(draw_PictureSize(strcat("/maps/", MapInfo_Map_bspname)) == '0 0 0')
                draw_Picture(me.columnPreviewOrigin * eX, "nopreview_map", me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);
        else
index 44ca1b227943cf7da354dbe5219f72b387f3fa48..c7f733a195fe605cbe823d34ca11a7f6ef2833c0 100644 (file)
@@ -825,7 +825,9 @@ float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift)
                {
                        main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
                        DialogOpenButton_Click_withCoords(me, main.serverInfoDialog, org, sz);
+                       return 1;
                }
+               return 0;
        }
        else if(scan == K_INS || scan == K_MOUSE3 || scan == K_KP_INS)
        {
@@ -834,7 +836,9 @@ float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift)
                {
                        ToggleFavorite(me.selectedServer);
                        me.ipAddressBoxFocused = -1;
+                       return 1;
                }
+               return 0;
        }
        else if(SUPER(XonoticServerList).keyDown(me, scan, ascii, shift))
                return 1;