From: Rudolf Polzer Date: Mon, 17 Dec 2012 15:29:58 +0000 (+0100) Subject: fix some uninitialized variable use etc. X-Git-Tag: xonotic-v0.7.0~184 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=f59376561f8824ef2cabc7be4fd61c4ae5b59f01;p=xonotic%2Fxonotic-data.pk3dir.git fix some uninitialized variable use etc. --- diff --git a/qcsrc/Makefile b/qcsrc/Makefile index badc3ac1c..8d2279a47 100644 --- a/qcsrc/Makefile +++ b/qcsrc/Makefile @@ -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" diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index afd7f1c5c..869afbb57 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -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)) diff --git a/qcsrc/menu/command/menu_cmd.qc b/qcsrc/menu/command/menu_cmd.qc index 2835d522d..f342de066 100644 --- a/qcsrc/menu/command/menu_cmd.qc +++ b/qcsrc/menu/command/menu_cmd.qc @@ -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"); diff --git a/qcsrc/menu/item/nexposee.c b/qcsrc/menu/item/nexposee.c index 8f8f45119..64da6bcd6 100644 --- a/qcsrc/menu/item/nexposee.c +++ b/qcsrc/menu/item/nexposee.c @@ -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; diff --git a/qcsrc/menu/xonotic/campaign.c b/qcsrc/menu/xonotic/campaign.c index 0537967bd..90b559b01 100644 --- a/qcsrc/menu/xonotic/campaign.c +++ b/qcsrc/menu/xonotic/campaign.c @@ -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 diff --git a/qcsrc/menu/xonotic/cvarlist.c b/qcsrc/menu/xonotic/cvarlist.c index 03898a3f8..52f1a1f26 100644 --- a/qcsrc/menu/xonotic/cvarlist.c +++ b/qcsrc/menu/xonotic/cvarlist.c @@ -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) diff --git a/qcsrc/menu/xonotic/dialog_singleplayer.c b/qcsrc/menu/xonotic/dialog_singleplayer.c index c37cb7e40..6e13f65b8 100644 --- a/qcsrc/menu/xonotic/dialog_singleplayer.c +++ b/qcsrc/menu/xonotic/dialog_singleplayer.c @@ -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"); diff --git a/qcsrc/menu/xonotic/maplist.c b/qcsrc/menu/xonotic/maplist.c index 54b9554a8..fe91b0650 100644 --- a/qcsrc/menu/xonotic/maplist.c +++ b/qcsrc/menu/xonotic/maplist.c @@ -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 diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index 44ca1b227..c7f733a19 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -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;