From: Rudolf Polzer Date: Mon, 31 Dec 2012 11:43:15 +0000 (+0100) Subject: fix uninitialized globals X-Git-Tag: xonotic-v0.7.0~152 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7b3283bf69a829c3d7ce1403cdbb3a9b8a55008a;p=xonotic%2Fxonotic-data.pk3dir.git fix uninitialized globals --- diff --git a/qcsrc/Makefile b/qcsrc/Makefile index d90ce997b..9fa80f8f8 100644 --- a/qcsrc/Makefile +++ b/qcsrc/Makefile @@ -7,22 +7,32 @@ VERSION_MESSAGE = $(shell cd server && $(QCC) --version --help) ifneq (,$(findstring GMQCC,$(VERSION_MESSAGE))) # this is gmqcc QCCFLAGS ?= \ - -std=gmqcc \ + -std=fteqcc \ -Werror -Wall \ -Wno-field-redeclared \ -Wno-double-declaration \ -Wno-uninitialized-global \ -O3 \ + -fadjust-vector-fields \ -fftepp \ + -fftepp-predefs \ + -frelaxed-switch \ + -fshort-logic \ + -fno-perl-logic \ -ftranslatable-strings \ - -fadjust-vector-fields \ + -fno-initialized-nonconstants \ -fno-assign-function-types \ + -flno \ -fcorrect-ternary \ + -fno-single-vector-defs \ -fcorrect-logic \ -ftrue-empty-strings \ + -fno-false-empty-strings \ + -futf8 \ + -fno-bail-on-werror \ + -floop-labels \ -funtyped-nil \ - -fshort-logic \ - -flno \ + -fno-permissive \ $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK) else # this. is. fteqccccccccccccccccccc! diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index eb70262ea..940f81057 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -782,7 +782,6 @@ void CSQC_UpdateView(float w, float h) // improved polyblend - vector rgb; if(autocvar_hud_contents) { float contentalpha_temp, incontent, liquidalpha, contentfadetime; diff --git a/qcsrc/client/vehicles/vehicles.qc b/qcsrc/client/vehicles/vehicles.qc index 5efa11cf5..1c8c3c483 100644 --- a/qcsrc/client/vehicles/vehicles.qc +++ b/qcsrc/client/vehicles/vehicles.qc @@ -212,13 +212,13 @@ void Net_VehicleSetup() } } #define HUD_GETSTATS \ - float vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \ - float shield = getstati(STAT_VEHICLESTAT_SHIELD); \ - float energy = getstati(STAT_VEHICLESTAT_ENERGY); \ - float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \ - float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \ - float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \ - float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2); + noref float vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \ + noref float shield = getstati(STAT_VEHICLESTAT_SHIELD); \ + noref float energy = getstati(STAT_VEHICLESTAT_ENERGY); \ + noref float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \ + noref float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \ + noref float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \ + noref float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2); void CSQC_BUMBLE_HUD() { diff --git a/qcsrc/csqcmodellib/cl_model.qc b/qcsrc/csqcmodellib/cl_model.qc index 163a5126d..a1a414126 100644 --- a/qcsrc/csqcmodellib/cl_model.qc +++ b/qcsrc/csqcmodellib/cl_model.qc @@ -145,9 +145,9 @@ void CSQCModel_InterpolateAnimation_Do() void CSQCModel_Draw() { // some nice flags for CSQCMODEL_IF and the hooks - float isplayer = (self.entnum >= 1 && self.entnum <= maxclients); - float islocalplayer = (self.entnum == player_localnum + 1); - float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1)); + noref float isplayer = (self.entnum >= 1 && self.entnum <= maxclients); + noref float islocalplayer = (self.entnum == player_localnum + 1); + noref float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1)); // we don't do this for the local player as that one is already handled // by CSQCPlayer_SetCamera() @@ -179,9 +179,9 @@ void CSQCModel_Read(float isnew) sf = ReadShort(); // some nice flags for CSQCMODEL_IF and the hooks - float isplayer = (self.entnum >= 1 && self.entnum <= maxclients); - float islocalplayer = (self.entnum == player_localnum + 1); - float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1)); + noref float isplayer = (self.entnum >= 1 && self.entnum <= maxclients); + noref float islocalplayer = (self.entnum == player_localnum + 1); + noref float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1)); self.classname = "csqcmodel"; self.iflags |= IFLAG_ANGLES; // interpolate angles too diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 2dd523175..0710ddfa8 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -830,8 +830,6 @@ void GameCommand_animbench(float request, float argc) case CMD_REQUEST_COMMAND: { entity tmp_entity; - float i; - vector v; if(argc >= 4) { diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 2e5d9f4d6..a3eeefb73 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -339,7 +339,7 @@ void Send_CSQC_KillCenterprint(entity e, string s1, string s2, float msg, float void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) { string s, a, msg; - float w, type; + float type; if (targ.classname == "player") { diff --git a/qcsrc/server/vehicles/spiderbot.qc b/qcsrc/server/vehicles/spiderbot.qc index ebd74754f..9bbdd096a 100644 --- a/qcsrc/server/vehicles/spiderbot.qc +++ b/qcsrc/server/vehicles/spiderbot.qc @@ -286,7 +286,6 @@ void spiderbot_rocket_do() DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE, self.owner); crosshair_trace(self.owner); - vector _ct_end = trace_endpos + trace_plane_normal; rocket.pos1 = trace_endpos + randomvec() * (0.75 * autocvar_g_vehicle_spiderbot_rocket_radius); rocket.pos1_z = trace_endpos_z; diff --git a/qcsrc/server/vehicles/vehicles_def.qh b/qcsrc/server/vehicles/vehicles_def.qh index 30633ed36..f1d389044 100644 --- a/qcsrc/server/vehicles/vehicles_def.qh +++ b/qcsrc/server/vehicles/vehicles_def.qh @@ -62,7 +62,6 @@ var .void() vehicle_die; /// Vehicles custom function to be executed when veh #define VHSF_NORMAL 0 #define VHSF_FACTORY 2 var .void(float _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns -var .float(float _imp) vehicles_impusle_null; var .float(float _imp) vehicles_impusle; .float vehicle_weapon2mode = volly_counter;