]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Support compiling without optimizations
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 21 Dec 2015 01:30:24 +0000 (12:30 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 21 Dec 2015 01:30:24 +0000 (12:30 +1100)
We can't function without -Ooverlap-locals though

qcsrc/Makefile
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/view.qc
qcsrc/common/deathtypes/all.qh
qcsrc/common/movetypes/push.qc
qcsrc/lib/net.qh
qcsrc/lib/yenc.qh
qcsrc/server/weapons/selection.qc

index d332a0413789e72e4f4201c0203fef10d0519069..bea2993a02587e3a345326f5ceb77e80f96dafca 100644 (file)
@@ -15,8 +15,11 @@ QCCFLAGS_FEATURES ?= \
        -DVEHICLES_USE_ODE=0 \
        -DBUILD_MOD=$(BUILD_MOD)
 
+# -Ooverlap-locals is required
+
 QCCFLAGS ?= \
        -std=gmqcc \
+       -Ooverlap-locals \
        -O3 \
        -Werror -Wall -Wcpp \
        $(QCCFLAGS_WTFS) \
index 9ea22c92bf55333fe9e508652bb7185d6f6cbbd1..0705ddfe5c3091cf1fe2b48e72b2437da69dc664 100644 (file)
@@ -108,7 +108,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
        float f; // every function should have that
 
        int redflag, blueflag, yellowflag, pinkflag, neutralflag; // current status
-       float redflag_statuschange_elapsedtime, blueflag_statuschange_elapsedtime, yellowflag_statuschange_elapsedtime, pinkflag_statuschange_elapsedtime, neutralflag_statuschange_elapsedtime; // time since the status changed
+       float redflag_statuschange_elapsedtime = 0, blueflag_statuschange_elapsedtime = 0, yellowflag_statuschange_elapsedtime = 0, pinkflag_statuschange_elapsedtime = 0, neutralflag_statuschange_elapsedtime = 0; // time since the status changed
        bool ctf_oneflag; // one-flag CTF mode enabled/disabled
        int stat_items = STAT(CTF_FLAGSTATUS);
        float fs, fs2, fs3, size1, size2;
@@ -160,7 +160,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
        const float BLINK_FREQ = 5; // circle frequency, = 2*pi*frequency in hertz
 
        #define X(team, cond) \
-       string team##_icon, team##_icon_prevstatus; \
+       string team##_icon = string_null, team##_icon_prevstatus = string_null; \
        int team##_alpha, team##_alpha_prevstatus; \
        team##_alpha = team##_alpha_prevstatus = 1; \
        MACRO_BEGIN { \
index 55610620a82b786f18e46f05f7dd53436f3e09e4..6d2811f8b69008aa42829fad9cb48212663b426b 100644 (file)
@@ -77,13 +77,13 @@ float autocvar_cl_leanmodel_up_limit;
 
 #define highpass(value, frac, ref_store, ret) MACRO_BEGIN \
 { \
-       float __f; lowpass(value, frac, ref_store, __f); \
+       float __f = 0; lowpass(value, frac, ref_store, __f); \
        ret = (value) - __f; \
 } MACRO_END
 
 #define highpass_limited(value, frac, limit, ref_store, ret) MACRO_BEGIN \
 { \
-       float __f; lowpass_limited(value, frac, limit, ref_store, __f); \
+       float __f = 0; lowpass_limited(value, frac, limit, ref_store, __f); \
        ret = (value) - __f; \
 } MACRO_END
 
@@ -230,7 +230,7 @@ void viewmodel_animate(entity this)
                // Sajt: I tried to smooth out the transitions between bob and no bob, which works
                // for the most part, but for some reason when you go through a message trigger or
                // pick up an item or anything like that it will momentarily jolt the gun.
-               vector forward, right, up;
+               vector forward, right = '0 0 0', up = '0 0 0';
                float bspeed;
                float t = 1;
                float s = time * autocvar_cl_bobmodel_speed;
index 3c953bcf9d4756ddda33d8cd807fdc005476e03b..14304992a2273200878117c54c2eab2397cd80f6 100644 (file)
@@ -12,14 +12,16 @@ REGISTRY_CHECK(Deathtypes)
 .entity death_msgmurder;
 .string death_msgextra;
 
+int dt_identity(int i) { return i; }
+
 #define REGISTER_DEATHTYPE(id, msg_death, msg_death_by, extra) \
     REGISTER(Deathtypes, DEATH, id, m_id, new(deathtype)) { \
         make_pure(this); \
         this.m_id += DT_FIRST; \
         this.nent_name = #id; \
         this.death_msgextra = extra; \
-        if (msg_death       != NO_MSG) this.death_msgself   = msg_multi_notifs[msg_death    - 1]; \
-        if (msg_death_by    != NO_MSG) this.death_msgmurder = msg_multi_notifs[msg_death_by - 1]; \
+        if (msg_death       != NO_MSG) this.death_msgself   = msg_multi_notifs[dt_identity(msg_death    - 1)]; \
+        if (msg_death_by    != NO_MSG) this.death_msgmurder = msg_multi_notifs[dt_identity(msg_death_by - 1)]; \
     }
 
 const int DEATH_WEAPONMASK = BITS(8);
index c45fe5949dfde3360e86f2926e85be585f4f05b6..b832465464ffd7496c273dd3b70214d84d7c8295 100644 (file)
@@ -99,7 +99,7 @@ void _Movetype_PushMove(entity this, float dt)  // SV_PushMove
 
                        // try moving the contacted entity
                        this.solid = SOLID_NOT;
-                       bool flag;
+                       bool flag = false;
                        WITH(entity, this, check, {
                                flag = _Movetype_PushEntity(this, move, true);
                        });
index f73fcf97aa037fb9ce5dc0b099ad710e57b827e2..0c0f814e87e6a1113387c40e1fc8d847fae59782 100644 (file)
@@ -223,7 +223,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
        void WriteByte(int to, int b)
        {
                assert(to == MSG_C2S);
-               string s;
+               string s = string_null;
                yenc_single(b, s);
                string tmp = strcat(g_buf, s);
                if (g_buf) strunzone(g_buf);
@@ -232,7 +232,9 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
 #elif defined(SVQC)
        int ReadByte()
        {
-               ydec_single(g_buf, return);
+               int ret = -1;
+               ydec_single(g_buf, ret);
+               return ret;
        }
        void WriteByte(int to, int b);
 #endif
index 3e57d7f5d5401e563bc6f1f10caacba993fde558..34cf0635d5876359eea555a4f7d90da31dbdf018 100644 (file)
@@ -53,10 +53,10 @@ TEST(yEncDec)
        {
                int expect = i;
 
-               string fragment;
+               string fragment = string_null;
                yenc_single(expect, fragment);
 
-               int encdec;
+               int encdec = 0;
                STRING_ITERATOR(fragmentiterator, fragment, 0);
                ydec_single(fragmentiterator, encdec);
 
index 0495774227360ee3746ffb7d438891c12b551e21..abd1d9f319a611b592fcc2f609cc97d844cf96a0 100644 (file)
@@ -19,7 +19,7 @@ void Send_WeaponComplain(entity e, float wpn, float type)
 
 bool client_hasweapon(entity cl, Weapon wpn, float andammo, bool complain)
 {
-       float f;
+       float f = 0;
 
        if (time < cl.hasweapon_complain_spam)
                complain = 0;