]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Enable -fdefault-eraseable TimePath/default-eraseable
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 12 May 2018 04:17:56 +0000 (14:17 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 12 May 2018 04:17:56 +0000 (14:17 +1000)
50 files changed:
cmake/qcc.sh
qcsrc/Makefile
qcsrc/client/commands/cl_cmd.qc
qcsrc/client/hud/panel/centerprint.qc
qcsrc/client/main.qc
qcsrc/client/miscfunctions.qc
qcsrc/common/debug.qh
qcsrc/common/gamemodes/gamemode/nexball/sv_weapon.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/lib/_all.inc
qcsrc/lib/angle.qc
qcsrc/lib/bits.qh
qcsrc/lib/bool.qh
qcsrc/lib/color.qh
qcsrc/lib/compiler.qh
qcsrc/lib/counting.qh
qcsrc/lib/cvar.qh
qcsrc/lib/draw.qh
qcsrc/lib/file.qh
qcsrc/lib/i18n.qh
qcsrc/lib/intrusivelist.qh
qcsrc/lib/json.qc
qcsrc/lib/map.qh
qcsrc/lib/markdown.qh
qcsrc/lib/math.qh
qcsrc/lib/noise.qh
qcsrc/lib/oo.qh
qcsrc/lib/p2mathlib.qc
qcsrc/lib/p2mathlib.qh
qcsrc/lib/random.qc
qcsrc/lib/random.qh
qcsrc/lib/registry.qh
qcsrc/lib/sort.qh
qcsrc/lib/sortlist.qc
qcsrc/lib/spawnfunc.qh
qcsrc/lib/static.qh
qcsrc/lib/string.qh
qcsrc/lib/urllib.qc
qcsrc/lib/urllib.qh
qcsrc/lib/vector.qh
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/command/menu_cmd.qh
qcsrc/menu/menu.qc
qcsrc/menu/xonotic/serverlist.qh
qcsrc/menu/xonotic/util.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/sv_main.qc
qcsrc/server/utils.qh
qcsrc/tools/compilationunits.sh

index a6038dd59131c5df736e0862c8b29086f6833162..8ad162337b44dfad35b91b4f3c1eb8588e750247 100755 (executable)
@@ -23,6 +23,7 @@ case $1 in
         -Wno-field-redeclared \
         -flno -futf8 -fno-bail-on-werror \
         -frelaxed-switch -freturn-assignments \
+        -fdefault-eraseable \
         ${@:2}
     ;;
 esac
index d09b2c5ccffa730255a6545d0f411a11adc05fc5..ae67f13fdafb57690704a783fd9fc30f235a4ff7 100644 (file)
@@ -57,6 +57,7 @@ QCCFLAGS ?= \
        $(QCCFLAGS_WTFS) \
        -flno -futf8 -fno-bail-on-werror \
        -frelaxed-switch -freturn-assignments \
+       -fdefault-eraseable \
        $(QCCFLAGS_EXTRA)
 
 
index 8eea240d40f4da8ebdd79bb9dee4a30b364e19b2..7992ada3ade2ef50215b99fb0edd4cf926bad7c1 100644 (file)
@@ -520,7 +520,7 @@ void LocalCommand_macro_write_aliases(int fh)
 // =========================================
 // If this function exists, client code handles gamecommand instead of the engine code.
 
-void GameCommand(string command)
+EXPORT void GameCommand(string command)
 {
        int argc = tokenize_console(command);
 
index f8f70c8189e671de3cb01fd3d4c4a8aab3e7745a..65bfbe70d839182760530012ab4a57ee7e8b8d1d 100644 (file)
@@ -245,7 +245,7 @@ void HUD_CenterPrint ()
                else // Expiring soon, so fade it out.
                        a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
 
-               if(centerprint_msgID[j] == CPID_TIMEIN)
+               if(centerprint_msgID[j] == ORDINAL(CPID_TIMEIN))
                        a = 1;
 
                // while counting down show it anyway in order to hold the current message position
index 37027d25cd35570419c819179b207311580f157e..2f55de2fa5a923581a2b2f95ee0c007ba03a5926 100644 (file)
@@ -898,20 +898,20 @@ void Gamemode_Init()
        }
 }
 // CSQC_Parse_StuffCmd : Provides the stuffcmd string in the first parameter that the server provided.  To execute standard behavior, simply execute localcmd with the string.
-void CSQC_Parse_StuffCmd(string strMessage)
+EXPORT void CSQC_Parse_StuffCmd(string strMessage)
 {
        if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_StuffCmd(\"%s\")", strMessage);
        localcmd(strMessage);
 }
 // CSQC_Parse_Print : Provides the print string in the first parameter that the server provided.  To execute standard behavior, simply execute print with the string.
-void CSQC_Parse_Print(string strMessage)
+EXPORT void CSQC_Parse_Print(string strMessage)
 {
        if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_Print(\"%s\")", strMessage);
        print(ColorTranslateRGB(strMessage));
 }
 
 // CSQC_Parse_CenterPrint : Provides the centerprint_hud string in the first parameter that the server provided.
-void CSQC_Parse_CenterPrint(string strMessage)
+EXPORT void CSQC_Parse_CenterPrint(string strMessage)
 {
        if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_CenterPrint(\"%s\")", strMessage);
        centerprint_hud(strMessage);
@@ -920,7 +920,7 @@ void CSQC_Parse_CenterPrint(string strMessage)
 // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
 // You must ALWAYS first acquire the temporary ID, which is sent as a byte.
 // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
-bool CSQC_Parse_TempEntity()
+EXPORT bool CSQC_Parse_TempEntity()
 {
        // Acquire TE ID
        int nTEID = ReadByte();
index 01409280a4a4c9f535cf18e6c0f7f21b2eb1d8b0..ec76692e584474829181bb7fe9dcd93008ad082a 100644 (file)
@@ -551,7 +551,7 @@ void DrawCircleClippedPic(vector centre, float radi, string pic, float f, vector
 }
 
 /** engine callback */
-void URI_Get_Callback(int id, int status, string data)
+EXPORT void URI_Get_Callback(int id, int status, string data)
 {
     TC(int, id); TC(int, status);
        if(url_URI_Get_Callback(id, status, data))
index 983b073b406c8cfb93de92a31002d5dd1359fa56..3e8ac046f2adb39fcc65072e1529f00d8666def0 100644 (file)
@@ -458,7 +458,6 @@ NET_HANDLE(debug_text_3d, bool is_new) {
 #define debug_text_3d_4(pos, msg, align, dur) debug_text_3d_5(pos, msg, align, dur, stov(cvar_string("debug_text_3d_default_velocity")))
 #define debug_text_3d_5(pos, msg, align, dur, vel) debug_text_3d_fn(pos, msg, align, dur, vel)
 
-ERASEABLE
 void debug_text_3d_fn(vector pos, string msg, float align, float duration, vector vel) {
        WriteHeader(MSG_BROADCAST, debug_text_3d);
        WriteVector(MSG_BROADCAST, pos);
index 838d0dd7e9cf07e0be6fc7e4ebf894613e452f55..6c636f297b3e3bba226806fb2215e6fd4b10d7de 100644 (file)
@@ -44,7 +44,7 @@ METHOD(BallStealer, wr_setup, void(BallStealer this, entity actor, .entity weapo
 
 METHOD(BallStealer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
-    TC(BallStealer, this);
+    TC(BallStealer, thiswep);
 }
 
 METHOD(BallStealer, wr_checkammo1, bool(BallStealer this, entity actor, .entity weaponentity))
index d9164dc19ab6c999534cf72f868801f2750b466a..919fb0008807deec09383217076275147c892cd9 100644 (file)
@@ -381,7 +381,7 @@ void W_Hagar_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int
 
        int slot = weaponslot(weaponentity);
        ATTACK_FINISHED(actor, slot) = time + WEP_CVAR_PRI(hagar, refire) * W_WeaponRateFactor(actor);
-       int theframe = WFRAME_FIRE1;
+       WFRAME theframe = WFRAME_FIRE1;
        entity this = actor.(weaponentity);
        if(this)
        {
index 0bed40bbf081fcd3c784719cc463c0db1be14dcb..bad65bc358a1dfc48067af34c36c08ea1efaa658 100644 (file)
        #define ACCUMULATE [[accumulate]]
 #endif
 
-#ifndef QCC_SUPPORT_ERASEABLE
-       #define ERASEABLE
+#ifndef QCC_SUPPORT_NOERASE
+       #define EXPORT
 #else
-       #define ERASEABLE [[eraseable]]
+       #define EXPORT [[noerase]]
 #endif
 
 #ifndef QCC_SUPPORT_ALIAS
@@ -173,39 +173,39 @@ void make_safe_for_remove(entity this);
 
 #ifdef MENUQC
        void _m_init();
-       void m_init() { if (_m_init) _m_init(); }
+       EXPORT void m_init() { if (_m_init) _m_init(); }
        #define m_init _m_init
 
        void _m_shutdown();
-       void m_shutdown() { if (_m_shutdown) _m_shutdown(); }
+       EXPORT void m_shutdown() { if (_m_shutdown) _m_shutdown(); }
        #define m_shutdown _m_shutdown
 
        void _m_draw(float width, float height);
-       void m_draw(float width, float height) { if (_m_draw) _m_draw(width, height); }
+       EXPORT void m_draw(float width, float height) { if (_m_draw) _m_draw(width, height); }
        #define m_draw _m_draw
 
        void _m_keydown(int keynr, int ascii);
-       void m_keydown(int keynr, int ascii) { if (_m_keydown) _m_keydown(keynr, ascii); }
+       EXPORT void m_keydown(int keynr, int ascii) { if (_m_keydown) _m_keydown(keynr, ascii); }
        #define m_keydown _m_keydown
 
        void _m_toggle(int mode);
-       void m_toggle(int mode) { if (_m_toggle) _m_toggle(mode); }
+       EXPORT void m_toggle(int mode) { if (_m_toggle) _m_toggle(mode); }
        #define m_toggle _m_toggle
 #endif
 
 #ifdef SVQC
        void _main();
-       void main() { if (_main) _main(); }
+       EXPORT void main() { if (_main) _main(); }
        #define main _main
 
        void _SV_Shutdown();
-       void SV_Shutdown() { if (_SV_Shutdown) _SV_Shutdown(); }
+       EXPORT void SV_Shutdown() { if (_SV_Shutdown) _SV_Shutdown(); }
        #define SV_Shutdown _SV_Shutdown
 
        void _StartFrame();
        bool _StartFrame_init;
        void spawnfunc_worldspawn(entity);
-       void StartFrame() {
+       EXPORT void StartFrame() {
                if (!_StartFrame_init) {
                        _StartFrame_init = true;
                        float oldtime = time; time = 1;
@@ -217,49 +217,49 @@ void make_safe_for_remove(entity this);
        #define StartFrame _StartFrame
 
        void _SetNewParms();
-       void SetNewParms() { if (_SetNewParms) _SetNewParms(); }
+       EXPORT void SetNewParms() { if (_SetNewParms) _SetNewParms(); }
        #define SetNewParms _SetNewParms
 
        void _SetChangeParms(entity this);
-       void SetChangeParms() { ENGINE_EVENT(); if (_SetChangeParms) _SetChangeParms(this); }
+       EXPORT void SetChangeParms() { ENGINE_EVENT(); if (_SetChangeParms) _SetChangeParms(this); }
        #define SetChangeParms _SetChangeParms
 
 #ifdef DP_EXT_PRECONNECT
        void _ClientPreConnect(entity this);
-       void ClientPreConnect() { ENGINE_EVENT(); if (_ClientPreConnect) _ClientPreConnect(this); }
+       EXPORT void ClientPreConnect() { ENGINE_EVENT(); if (_ClientPreConnect) _ClientPreConnect(this); }
        #define ClientPreConnect _ClientPreConnect
 #endif
 
        void _ClientConnect(entity this);
-       void ClientConnect() { ENGINE_EVENT(); if (_ClientConnect) _ClientConnect(this); }
+       EXPORT void ClientConnect() { ENGINE_EVENT(); if (_ClientConnect) _ClientConnect(this); }
        #define ClientConnect _ClientConnect
 
        void _ClientDisconnect(entity this);
-       void ClientDisconnect() { ENGINE_EVENT(); if (_ClientDisconnect) _ClientDisconnect(this); }
+       EXPORT void ClientDisconnect() { ENGINE_EVENT(); if (_ClientDisconnect) _ClientDisconnect(this); }
        #define ClientDisconnect _ClientDisconnect
 
        void _PutClientInServer(entity this);
-       void PutClientInServer() { ENGINE_EVENT(); if (_PutClientInServer) _PutClientInServer(this); }
+       EXPORT void PutClientInServer() { ENGINE_EVENT(); if (_PutClientInServer) _PutClientInServer(this); }
        #define PutClientInServer _PutClientInServer
 
        void _ClientKill(entity this);
-       void ClientKill() { ENGINE_EVENT(); if (_ClientKill) _ClientKill(this); }
+       EXPORT void ClientKill() { ENGINE_EVENT(); if (_ClientKill) _ClientKill(this); }
        #define ClientKill _ClientKill
 
        void _PlayerPreThink(entity this);
-       void PlayerPreThink() { ENGINE_EVENT(); if (_PlayerPreThink) _PlayerPreThink(this); }
+       EXPORT void PlayerPreThink() { ENGINE_EVENT(); if (_PlayerPreThink) _PlayerPreThink(this); }
        #define PlayerPreThink _PlayerPreThink
 
        void _PlayerPostThink(entity this);
-       void PlayerPostThink() { ENGINE_EVENT(); if (_PlayerPostThink) _PlayerPostThink(this); }
+       EXPORT void PlayerPostThink() { ENGINE_EVENT(); if (_PlayerPostThink) _PlayerPostThink(this); }
        #define PlayerPostThink _PlayerPostThink
 
        void _SV_PlayerPhysics(entity this);
-       void SV_PlayerPhysics() { ENGINE_EVENT(); if (_SV_PlayerPhysics) _SV_PlayerPhysics(this); }
+       EXPORT void SV_PlayerPhysics() { ENGINE_EVENT(); if (_SV_PlayerPhysics) _SV_PlayerPhysics(this); }
        #define SV_PlayerPhysics _SV_PlayerPhysics
 
        void _SV_OnEntityPreSpawnFunction(entity this);
-       void SV_OnEntityPreSpawnFunction()
+       EXPORT void SV_OnEntityPreSpawnFunction()
        {
                ENGINE_EVENT();
                __spawnfunc_expecting = true;
@@ -268,11 +268,11 @@ void make_safe_for_remove(entity this);
        #define SV_OnEntityPreSpawnFunction _SV_OnEntityPreSpawnFunction
 
        void _SV_ChangeTeam(entity this, int _color);
-       void SV_ChangeTeam(int _color) { ENGINE_EVENT(); if (_SV_ChangeTeam) _SV_ChangeTeam(this, _color); }
+       EXPORT void SV_ChangeTeam(int _color) { ENGINE_EVENT(); if (_SV_ChangeTeam) _SV_ChangeTeam(this, _color); }
        #define SV_ChangeTeam _SV_ChangeTeam
 
        void _SV_ParseClientCommand(entity this, string command);
-       void SV_ParseClientCommand(string command)
+       EXPORT void SV_ParseClientCommand(string command)
        {
                ENGINE_EVENT();
                if (_SV_ParseClientCommand) _SV_ParseClientCommand(this, command);
@@ -282,34 +282,34 @@ void make_safe_for_remove(entity this);
 
 #ifdef CSQC
        void _CSQC_Init();
-       void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); }
+       EXPORT void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); }
        #define CSQC_Init _CSQC_Init
 
        void _CSQC_Shutdown();
-       void CSQC_Shutdown() { if (_CSQC_Shutdown) _CSQC_Shutdown(); }
+       EXPORT void CSQC_Shutdown() { if (_CSQC_Shutdown) _CSQC_Shutdown(); }
        #define CSQC_Shutdown _CSQC_Shutdown
 
        void _CSQC_UpdateView(entity this, float w, float h);
-       void CSQC_UpdateView(float w, float h) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h); }
+       EXPORT void CSQC_UpdateView(float w, float h) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h); }
        #define CSQC_UpdateView _CSQC_UpdateView
 
        bool _CSQC_InputEvent(int inputType, float nPrimary, float nSecondary);
-       bool CSQC_InputEvent(int inputType, float nPrimary, float nSecondary)
+       EXPORT bool CSQC_InputEvent(int inputType, float nPrimary, float nSecondary)
        {
                return _CSQC_InputEvent ? _CSQC_InputEvent(inputType, nPrimary, nSecondary) : false;
        }
        #define CSQC_InputEvent _CSQC_InputEvent
 
        bool _CSQC_ConsoleCommand(string s);
-       bool CSQC_ConsoleCommand(string s) { return _CSQC_ConsoleCommand ? _CSQC_ConsoleCommand(s) : false; }
+       EXPORT bool CSQC_ConsoleCommand(string s) { return _CSQC_ConsoleCommand ? _CSQC_ConsoleCommand(s) : false; }
        #define CSQC_ConsoleCommand _CSQC_ConsoleCommand
 
        void _CSQC_Ent_Update(entity this, bool isNew);
-       void CSQC_Ent_Update(bool isNew) { ENGINE_EVENT(); if (_CSQC_Ent_Update) _CSQC_Ent_Update(this, isNew); }
+       EXPORT void CSQC_Ent_Update(bool isNew) { ENGINE_EVENT(); if (_CSQC_Ent_Update) _CSQC_Ent_Update(this, isNew); }
        #define CSQC_Ent_Update _CSQC_Ent_Update
 
        void _CSQC_Ent_Remove(entity this);
-       void CSQC_Ent_Remove() { ENGINE_EVENT(); if (_CSQC_Ent_Remove) _CSQC_Ent_Remove(this); }
+       EXPORT void CSQC_Ent_Remove() { ENGINE_EVENT(); if (_CSQC_Ent_Remove) _CSQC_Ent_Remove(this); }
        #define CSQC_Ent_Remove _CSQC_Ent_Remove
 #endif
 #undef ENGINE_EVENT
index 1757c55b812a184c7f00f0e26c82eeb8704c303a..33107751bc68429a6d3613e1fdd00584f5f7f04a 100644 (file)
@@ -9,7 +9,6 @@
 /*
 * Return a angle within +/- 360.
 */
-ERASEABLE
 float anglemods(float v)
 {
        v = v - 360 * floor(v / 360);
@@ -25,7 +24,6 @@ float anglemods(float v)
 /*
 * Return the short angle
 */
-ERASEABLE
 float shortangle_f(float ang1, float ang2)
 {
        if(ang1 > ang2)
@@ -42,7 +40,6 @@ float shortangle_f(float ang1, float ang2)
        return ang1;
 }
 
-ERASEABLE
 vector shortangle_v(vector ang1, vector ang2)
 {
        vector vtmp;
@@ -54,7 +51,6 @@ vector shortangle_v(vector ang1, vector ang2)
        return vtmp;
 }
 
-ERASEABLE
 vector shortangle_vxy(vector ang1, vector ang2)
 {
        vector vtmp = '0 0 0';
@@ -69,7 +65,6 @@ vector shortangle_vxy(vector ang1, vector ang2)
 * Return the angle offset between angle ang and angle of the vector from->to
 */
 
-ERASEABLE
 vector angleofs3(vector from, vector ang, vector to)
 {
        vector v_res;
index c158ea032d497cb29a8709c2e02ad4fa8e2bd610..0e07cb43e69d8a1e849f4301b26a359101565087 100644 (file)
@@ -10,7 +10,6 @@
        #define BITSET(var, mask, flag) ((var) ^ (-(flag) ^ (var)) & (mask))
 #endif
 
-ERASEABLE
 int lowestbit(int f)
 {
        f &= ~(f << 1);
@@ -21,7 +20,6 @@ int lowestbit(int f)
        return f;
 }
 
-ERASEABLE
 int randombit(int bits)
 {
        if (!(bits & (bits - 1)))  // this ONLY holds for powers of two!
@@ -44,7 +42,6 @@ int randombit(int bits)
        return b;
 }
 
-ERASEABLE
 int randombits(int bits, int k, bool error_return)
 {
        int r = 0;
@@ -78,7 +75,6 @@ enum {
        OP_MINUS
 };
 
-ERASEABLE
 bool GiveBit(entity e, .int fld, int bit, int op, int val)
 {
        int v0 = (e.(fld) & bit);
@@ -103,7 +99,6 @@ bool GiveBit(entity e, .int fld, int bit, int op, int val)
        return v0 != v1;
 }
 
-ERASEABLE
 bool GiveValue(entity e, .int fld, int op, int val)
 {
        int v0 = e.(fld);
index c78f717d9e983be74923a5dd8fb5252b73f9b627..dc50c771f164470a2a1e9d81d63c838c549abd2e 100644 (file)
@@ -9,7 +9,6 @@
 #define boolean(value) ((value) != 0)
 
 // get true/false value of a string with multiple different inputs
-ERASEABLE
 float InterpretBoolean(string input)
 {
        switch (strtolower(input))
index 6f7a7326de41f5cce1953dc26a5ac27aa933296d..3bc7889ead0eaa8f6b13bb3fb22d16208eeb06f7 100644 (file)
@@ -3,7 +3,6 @@
 #include "string.qh"
 
 #define colormapPaletteColor(c, isPants) colormapPaletteColor_(c, isPants, time)
-ERASEABLE
 vector colormapPaletteColor_(int c, bool isPants, float t)
 {
        switch (c)
@@ -36,7 +35,6 @@ vector colormapPaletteColor_(int c, bool isPants, float t)
        }
 }
 
-ERASEABLE
 float rgb_mi_ma_to_hue(vector rgb, float mi, float ma)
 {
        if (mi == ma)
@@ -58,7 +56,6 @@ float rgb_mi_ma_to_hue(vector rgb, float mi, float ma)
        }
 }
 
-ERASEABLE
 vector hue_mi_ma_to_rgb(float hue, float mi, float ma)
 {
        vector rgb;
@@ -113,7 +110,6 @@ vector hue_mi_ma_to_rgb(float hue, float mi, float ma)
        return rgb;
 }
 
-ERASEABLE
 vector rgb_to_hsv(vector rgb)
 {
        float mi, ma;
@@ -131,13 +127,11 @@ vector rgb_to_hsv(vector rgb)
        return hsv;
 }
 
-ERASEABLE
 vector hsv_to_rgb(vector hsv)
 {
        return hue_mi_ma_to_rgb(hsv.x, hsv.z * (1 - hsv.y), hsv.z);
 }
 
-ERASEABLE
 vector rgb_to_hsl(vector rgb)
 {
        float mi, ma;
@@ -157,7 +151,6 @@ vector rgb_to_hsl(vector rgb)
        return hsl;
 }
 
-ERASEABLE
 vector hsl_to_rgb(vector hsl)
 {
        float mi, ma, maminusmi;
@@ -173,7 +166,6 @@ vector hsl_to_rgb(vector hsl)
        return hue_mi_ma_to_rgb(hsl.x, mi, ma);
 }
 
-ERASEABLE
 string rgb_to_hexcolor(vector rgb)
 {
        return strcat(
index 5ca0ed56525ee33886c46a0a7c27ecfd7763068b..d82e43534d004d6110441c7e126623c4d023b31d 100644 (file)
@@ -12,9 +12,9 @@
        #endif
 #endif
 
-#ifndef QCC_SUPPORT_ERASEABLE
+#ifndef QCC_SUPPORT_NOERASE
        #ifdef GMQCC
-               #define QCC_SUPPORT_ERASEABLE
+               #define QCC_SUPPORT_NOERASE
        #endif
 #endif
 
index b38ba9d05a9313f670f8fa8bdeede09c565ebf2c..c44951225ba2bc179bfb67f7c25812ed8de135dd 100644 (file)
@@ -61,7 +61,6 @@
        _("CI_THI^%d seconds"), /* third */ \
        _("CI_MUL^%d seconds")) /* multi */
 
-ERASEABLE
 string count_ordinal(int interval)
 {
        // This function is designed primarily for the English language, it's impossible
@@ -87,7 +86,6 @@ string count_ordinal(int interval)
        return "";
 }
 
-ERASEABLE
 string count_fill(float interval, string zeroth, string first, string second, string third, string multi)
 {
        // This function is designed primarily for the English language, it's impossible
@@ -118,7 +116,6 @@ string count_fill(float interval, string zeroth, string first, string second, st
        return "";
 }
 
-ERASEABLE
 string process_time(float outputtype, float seconds)
 {
        float tmp_hours = 0, tmp_minutes = 0, tmp_seconds = 0;
index e8e2c54880a1a29eed6c48d50a6ac0cd44c016ff..454b83ab457c329711d03d3bc84e947d171fc2bb 100644 (file)
@@ -4,10 +4,8 @@
 #include "progname.qh"
 #include "static.qh"
 
-ERASEABLE
 void RegisterCvars(void(string name, string def, string desc, bool archive, string file) f) {}
 
-ERASEABLE
 bool cvar_value_issafe(string s)
 {
        if (strstrofs(s, "\"", 0) >= 0) return false;
@@ -20,7 +18,6 @@ bool cvar_value_issafe(string s)
 }
 
 /** escape the string to make it safe for consoles */
-ERASEABLE
 string MakeConsoleSafe(string input)
 {
        input = strreplace("\n", "", input);
@@ -30,19 +27,16 @@ string MakeConsoleSafe(string input)
        return input;
 }
 
-ERASEABLE
 void cvar_describe(string name, string desc)
 {
        localcmd(sprintf("\nset %1$s \"$%1$s\" \"%2$s\"\n", name, MakeConsoleSafe(desc)));
 }
 
-ERASEABLE
 void cvar_archive(string name)
 {
        localcmd(sprintf("\nseta %1$s \"$%1$s\"\n", name));
 }
 
-ERASEABLE
 void RegisterCvars_Set(string name, string def, string desc, bool archive, string file)
 {
        cvar_describe(name, desc);
@@ -50,7 +44,6 @@ void RegisterCvars_Set(string name, string def, string desc, bool archive, strin
 }
 
 int RegisterCvars_Save_fd;
-ERASEABLE
 void RegisterCvars_Save(string name, string def, string desc, bool archive, string file)
 {
        if (!archive) return;
index 2bf480a8782aed99c16167731c5f38efd1300fcd..fbb4a09b5510705f71d43a0eb461ded50ece0d0d 100644 (file)
                }
        }
 
-       ERASEABLE
        void drawstringright(vector position, string text, vector theScale, vector rgb, float theAlpha, int flag)
        {
                position.x -= 2 / 3 * strlen(text) * theScale.x;
                drawstring_builtin(position, text, theScale, rgb, theAlpha, flag);
        }
 
-       ERASEABLE
        void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, int flag)
        {
                position.x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale.x);
index 5bc24f627185f5fd5c4bf87aaaf32a40f0908ff8..949a748a84e140efa80fa5cbfdd767dbad635190 100644 (file)
@@ -1,6 +1,5 @@
 #pragma once
 
-ERASEABLE
 bool fexists(string f)
 {
        int fh = fopen(f, FILE_READ);
index 3dfac622464a1144ed74096703108d0e9afa8251..8ebedb76f65f66110d3fd26ffaa46277e1b24021 100644 (file)
@@ -10,7 +10,6 @@ string prvm_language;
 /**
  * @deprecated prefer _("translated")
  */
-ERASEABLE
 string language_filename(string s)
 {
        string fn = prvm_language;
@@ -41,7 +40,6 @@ string language_filename(string s)
        }
 #endif
 
-ERASEABLE
 string CTX(string s)
 {
 #if CTX_CACHE
index fc0e080eae32fa103333559653d439a403895cb2..4fa49d3f3bfef7bc41035a9bb56e35cf1db755a4 100644 (file)
@@ -4,11 +4,8 @@
 
 const int IL_MAX = 128;
 
-ERASEABLE
 void IL_INIT(entity this);
-ERASEABLE
 void IL_DTOR(entity this);
-ERASEABLE
 void IL_ENDFRAME();
 
 /**
@@ -40,7 +37,6 @@ ENDCLASS(IntrusiveList)
 #define IL_LAST(this) (this.il_tail)
 #define IL_PEEK(this) (this.il_tail)
 
-ERASEABLE
 bool IL_CONTAINS(IntrusiveList this, entity it)
 {
        assert(this, return false);
@@ -50,7 +46,6 @@ bool IL_CONTAINS(IntrusiveList this, entity it)
 /**
  * Push to tail
  */
-ERASEABLE
 entity IL_PUSH(IntrusiveList this, entity it)
 {
        assert(this, return NULL);
@@ -69,7 +64,6 @@ entity IL_PUSH(IntrusiveList this, entity it)
 /**
  * Push to head
  */
-ERASEABLE
 entity IL_UNSHIFT(IntrusiveList this, entity it)
 {
        assert(this, return NULL);
@@ -88,7 +82,6 @@ entity IL_UNSHIFT(IntrusiveList this, entity it)
 /**
  * Pop from tail
  */
-ERASEABLE
 entity IL_POP(IntrusiveList this)
 {
        assert(this, return NULL);
@@ -106,7 +99,6 @@ entity IL_POP(IntrusiveList this)
 /**
  * Pop from head
  */
-ERASEABLE
 entity IL_SHIFT(IntrusiveList this)
 {
        assert(this, return NULL);
@@ -124,7 +116,6 @@ entity IL_SHIFT(IntrusiveList this)
 /**
  * Remove any element, anywhere in the list
  */
-ERASEABLE
 void IL_REMOVE(IntrusiveList this, entity it)
 {
        assert(this, return);
@@ -189,7 +180,6 @@ int il_links_ptr;
 
 #define IL_LISTS_PER_BIT IL_CEIL(IL_MAX / (3 * 24))
 
-ERASEABLE
 void IL_INIT(IntrusiveList this)
 {
        .entity nextfld, prevfld;
@@ -218,14 +208,12 @@ void IL_INIT(IntrusiveList this)
        LOG_WARNF("IntrusiveList overflow");
 }
 
-ERASEABLE
 void IL_DTOR(IntrusiveList this)
 {
        IL_CLEAR(this);
        il_links[this.il_id] = NULL;
 }
 
-ERASEABLE
 void IL_ENDFRAME()
 {
 #if 0
@@ -245,7 +233,6 @@ void IL_ENDFRAME()
 #endif
 }
 
-ERASEABLE
 void ONREMOVE(entity this)
 {
        if (this.il_lists) {
index b477fe15e59124924662e4c463030ff7016ca94e..acdf198e835bc83206df152766913225a27bb90c 100644 (file)
@@ -32,7 +32,6 @@ string _json_ns;
 // Current keys
 int _json_keys;
 
-ERASEABLE
 bool _json_parse_object() {
     JSON_BEGIN();
     if (STRING_ITERATOR_GET(_json) != '{') JSON_FAIL("expected '{'");
@@ -41,7 +40,6 @@ bool _json_parse_object() {
     JSON_END();
 }
 
-    ERASEABLE
     bool _json_parse_members() {
         JSON_BEGIN();
         for (;;) {
@@ -55,7 +53,6 @@ bool _json_parse_object() {
         JSON_END();
     }
 
-        ERASEABLE
         bool _json_parse_pair() {
             JSON_BEGIN();
             if (!_json_parse_string(false)) JSON_FAIL("expected string");
@@ -69,7 +66,6 @@ bool _json_parse_object() {
             JSON_END();
         }
 
-ERASEABLE
 bool _json_parse_array() {
     JSON_BEGIN();
     if (STRING_ITERATOR_GET(_json) != '[') JSON_FAIL("expected '['");
@@ -97,7 +93,6 @@ bool _json_parse_array() {
     JSON_END();
 }
 
-ERASEABLE
 bool _json_parse_value() {
     JSON_BEGIN();
     if (!(_json_parse_string(true)
@@ -110,7 +105,6 @@ bool _json_parse_value() {
     JSON_END();
 }
 
-    ERASEABLE
     bool _json_parse_true() {
         JSON_BEGIN();
         if (!(STRING_ITERATOR_GET(_json) == 't'
@@ -122,7 +116,6 @@ bool _json_parse_value() {
         JSON_END();
     }
 
-    ERASEABLE
     bool _json_parse_false() {
         JSON_BEGIN();
         if (!(STRING_ITERATOR_GET(_json) == 'f'
@@ -135,7 +128,6 @@ bool _json_parse_value() {
         JSON_END();
     }
 
-    ERASEABLE
     bool _json_parse_null() {
         JSON_BEGIN();
         if (!(STRING_ITERATOR_GET(_json) == 'n'
@@ -147,7 +139,6 @@ bool _json_parse_value() {
         JSON_END();
     }
 
-ERASEABLE
 bool _json_parse_string(bool add) {
     JSON_BEGIN();
     if (STRING_ITERATOR_GET(_json) != '"') JSON_FAIL("expected opening '\"'");
@@ -179,14 +170,12 @@ bool _json_parse_string(bool add) {
     JSON_END();
 }
 
-ERASEABLE
 bool _json_parse_number() {
     JSON_BEGIN();
     if (!(_json_parse_float() || _json_parse_int())) JSON_FAIL("expected number");
     JSON_END();
 }
 
-    ERASEABLE
     bool _json_parse_float() {
         JSON_BEGIN();
         string s = "";
@@ -208,7 +197,6 @@ bool _json_parse_number() {
         JSON_END();
     }
 
-    ERASEABLE
     bool _json_parse_int() {
         JSON_BEGIN();
         string s = "";
@@ -226,7 +214,6 @@ bool _json_parse_number() {
         JSON_END();
     }
 
-ERASEABLE
 int json_parse(string in, bool() func) {
     string trimmed = "";
     LABEL(trim) {
@@ -272,7 +259,6 @@ int json_parse(string in, bool() func) {
     return _json_buffer;
 }
 
-ERASEABLE
 string json_get(int buf, string key)
 {
     for (int i = 1, n = buf_getsize(buf); i < n; i += 2) {
@@ -281,13 +267,11 @@ string json_get(int buf, string key)
     return string_null;
 }
 
-ERASEABLE
 void json_del(int buf)
 {
     buf_del(buf);
 }
 
-ERASEABLE
 void json_dump(int buf)
 {
     for (int i = 0, n = buf_getsize(buf); i < n; ++i) {
index ea7f0e1fe26f62143774a14a217047780abb9e6c..22abbcb61f937886e206d7d22f7e83ad2d78085c 100644 (file)
@@ -4,7 +4,6 @@
 
 // Databases (hash tables)
 const int DB_BUCKETS = 8192;
-ERASEABLE
 void db_save(int db, string filename)
 {
        int fh = fopen(filename, FILE_WRITE);
@@ -21,17 +20,14 @@ void db_save(int db, string filename)
 
 USING(HashMap, int);
 
-ERASEABLE
 int db_create()
 {
        return buf_create();
 }
 #define HM_NEW(this) (this = db_create())
 
-ERASEABLE
 void db_put(int db, string key, string value);
 
-ERASEABLE
 int db_load(string filename)
 {
        int db = buf_create();
@@ -65,7 +61,6 @@ int db_load(string filename)
        return db;
 }
 
-ERASEABLE
 void db_dump(int db, string filename)
 {
        int fh = fopen(filename, FILE_WRITE);
@@ -80,14 +75,12 @@ void db_dump(int db, string filename)
        fclose(fh);
 }
 
-ERASEABLE
 void db_close(int db)
 {
        buf_del(db);
 }
 #define HM_DELETE(this) db_close(this)
 
-ERASEABLE
 string db_get(int db, string key)
 {
        int h = crc16(false, key) % DB_BUCKETS;
@@ -97,7 +90,6 @@ string db_get(int db, string key)
 
 #define db_remove(db, key) db_put(db, key, "")
 
-ERASEABLE
 void db_put(int db, string key, string value)
 {
        int h = crc16(false, key) % DB_BUCKETS;
index a3bffeaaef3b223e96273b4e81959c7306083c85..63a4182b457c1c38849467d5d0fbae0dc9b93446 100644 (file)
@@ -5,7 +5,6 @@
  *   - two spaces escape a linebreak (otherwise text wraps)
  *   - two linebreaks become a paragraph (remain unchanged)
  */
-ERASEABLE
 string markdown(string s)
 {
        string buf = "";
index d8f19906a3eb26b1d9003e74f4493450f4b018d8..32f2cde8af2f7007cf7b2a053ab35b0c8219c39d 100644 (file)
@@ -2,7 +2,6 @@
 
 #include "lib/float.qh"
 
-ERASEABLE
 void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight)
 {
        if (weight == 0) return;
@@ -11,7 +10,6 @@ void mean_accumulate(entity e, .float a, .float c, float mean, float value, floa
        e.(c) += weight;
 }
 
-ERASEABLE
 float mean_evaluate(entity e, .float a, .float c, float mean)
 {
        if (e.(c) == 0) return 0;
@@ -34,7 +32,6 @@ Angc used for animations
 */
 
 
-ERASEABLE
 float angc(float a1, float a2)
 {
        while (a1 > 180)
@@ -53,13 +50,11 @@ float angc(float a1, float a2)
        return a;
 }
 
-ERASEABLE
 float fsnap(float val, float fsize)
 {
        return rint(val / fsize) * fsize;
 }
 
-ERASEABLE
 vector vsnap(vector point, float fsize)
 {
        vector vret;
@@ -71,13 +66,11 @@ vector vsnap(vector point, float fsize)
        return vret;
 }
 
-ERASEABLE
 vector lerpv(float t0, vector v0, float t1, vector v1, float t)
 {
        return v0 + (v1 - v0) * ((t - t0) / (t1 - t0));
 }
 
-ERASEABLE
 vector bezier_quadratic_getpoint(vector a, vector b, vector c, float t)
 {
        return (c - 2 * b + a) * (t * t)
@@ -85,14 +78,12 @@ vector bezier_quadratic_getpoint(vector a, vector b, vector c, float t)
               + a;
 }
 
-ERASEABLE
 vector bezier_quadratic_getderivative(vector a, vector b, vector c, float t)
 {
        return (c - 2 * b + a) * (2 * t)
               + (b - a) * 2;
 }
 
-ERASEABLE
 float cubic_speedfunc(float startspeedfactor, float endspeedfactor, float spd)
 {
        return (((startspeedfactor + endspeedfactor - 2
@@ -101,7 +92,6 @@ float cubic_speedfunc(float startspeedfactor, float endspeedfactor, float spd)
               ) * spd;
 }
 
-ERASEABLE
 bool cubic_speedfunc_is_sane(float startspeedfactor, float endspeedfactor)
 {
        if (startspeedfactor < 0 || endspeedfactor < 0) return false;
@@ -166,40 +156,34 @@ bool cubic_speedfunc_is_sane(float startspeedfactor, float endspeedfactor)
 }
 
 /** continuous function mapping all reals into -1..1 */
-ERASEABLE
 float float2range11(float f)
 {
        return f / (fabs(f) + 1);
 }
 
 /** continuous function mapping all reals into 0..1 */
-ERASEABLE
 float float2range01(float f)
 {
        return 0.5 + 0.5 * float2range11(f);
 }
 
-ERASEABLE
 float median(float a, float b, float c)
 {
        return (a < c) ? bound(a, b, c) : bound(c, b, a);
 }
 
-ERASEABLE
 float almost_equals(float a, float b)
 {
        float eps = (max(a, -a) + max(b, -b)) * 0.001;
        return a - b < eps && b - a < eps;
 }
 
-ERASEABLE
 float almost_equals_eps(float a, float b, float times_eps)
 {
        float eps = max(fabs(a), fabs(b)) * FLOAT_EPSILON * times_eps;
        return a - b < eps && b - a < eps;
 }
 
-ERASEABLE
 float almost_in_bounds(float a, float b, float c)
 {
        float eps = (max(a, -a) + max(c, -c)) * 0.001;
@@ -207,7 +191,6 @@ float almost_in_bounds(float a, float b, float c)
        return b == median(a - eps, b, c + eps);
 }
 
-ERASEABLE
 float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float d)
 {
        if (halflifedist > 0) return (0.5 ** ((bound(mindist, d, maxdist) - mindist) / halflifedist));
@@ -217,7 +200,6 @@ float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float
 
 #define power2of(e) (2 ** e)
 
-ERASEABLE
 float log2of(float e)
 {
        // NOTE: generated code
@@ -270,7 +252,6 @@ float log2of(float e)
 }
 
 /** ax^2 + bx + c = 0 */
-ERASEABLE
 vector solve_quadratic(float a, float b, float c)
 {
        vector v;
@@ -329,7 +310,6 @@ vector solve_quadratic(float a, float b, float c)
 /// src_min and src_max must not be the same or division by zero occurs.
 ///
 /// dest_max can be smaller than dest_min if you want the resulting range to be inverted, all values can be negative.
-ERASEABLE
 float map_ranges(float value, float src_min, float src_max, float dest_min, float dest_max) {
        float src_diff = src_max - src_min;
        float dest_diff = dest_max - dest_min;
@@ -338,7 +318,6 @@ float map_ranges(float value, float src_min, float src_max, float dest_min, floa
 }
 
 /// Same as `map_ranges` except that values outside the source range are clamped to min or max.
-ERASEABLE
 float map_bound_ranges(float value, float src_min, float src_max, float dest_min, float dest_max) {
        if (value <= src_min) return dest_min;
        if (value >= src_max) return dest_max;
index 5ef9cf8b6b17708b6bed1bb664b593d049496e53..92718e93db4d09ca7c708bfcdf75d1f860a84157 100644 (file)
@@ -8,13 +8,11 @@ classfield(Noise).float noise_paccum2;
 classfield(Noise).float noise_paccum3;
 classfield(Noise).float noise_bstate;
 
-ERASEABLE
 float Noise_Brown(entity e, float dt)
 {
        e.noise_baccum += random() * sqrt(dt);  // same stddev for all dt
        return e.noise_baccum;
 }
-ERASEABLE
 float Noise_Pink(entity e, float dt)
 {
        float f;
@@ -25,13 +23,11 @@ float Noise_Pink(entity e, float dt)
        if (random() > (0.9613 ** f)) e.noise_paccum3 = 0.43488 * (2 * random() - 1);
        return e.noise_paccum + e.noise_paccum2 + e.noise_paccum3;
 }
-ERASEABLE
 float Noise_White(entity e, float dt)
 {
        return random() * 2 - 1;
 }
 /** +1 or -1 */
-ERASEABLE
 float Noise_Burst(entity e, float dt, float p)
 {
        if (random() > (p ** dt)) e.noise_bstate = !e.noise_bstate;
index b22ff791501c9a990c93e5d9c7f3dabc2c35f661..70a8c1fa63d9ebc75667a9ab49aa028a3c039632 100644 (file)
@@ -309,8 +309,8 @@ STATIC_INIT(RegisterClasses)
        #define DEBUG_STUFF(cname)
 #else
        #define DEBUG_STUFF(cname) \
-               ERASEABLE bool is_##cname(entity e) { return e.instanceOf##cname; } \
-               ERASEABLE void isnt_##cname(entity e) { eprint(e); }
+               bool is_##cname(entity e) { return e.instanceOf##cname; } \
+               void isnt_##cname(entity e) { eprint(e); }
 #endif
 
 #define METHOD_REFERENCE(cname, name) \
index ce6f7ea899c8513995827f5c6bf373fae8baa539..0cee3112188a7d3196ac2ade8d71be2438e89163 100644 (file)
@@ -17,7 +17,6 @@
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
-ERASEABLE
 vector vec_bias(vector v, float f)
 {
        vector c;
@@ -26,7 +25,6 @@ vector vec_bias(vector v, float f)
        c.z = v.z + f;
        return c;
 }
-ERASEABLE
 vector vec_to_min(vector a, vector b)
 {
        vector c;
@@ -36,7 +34,6 @@ vector vec_to_min(vector a, vector b)
        return c;
 }
 
-ERASEABLE
 vector vec_to_max(vector a, vector b)
 {
        vector c;
@@ -47,7 +44,6 @@ vector vec_to_max(vector a, vector b)
 }
 
 // there may already be a function for bounding a vector in this manner, however my very quick search did not reveal one -- Player_2
-ERASEABLE
 vector vec_bounds_in(vector point, vector a, vector b)
 {
        vector d = vec_to_min(a, b);
@@ -58,7 +54,6 @@ vector vec_bounds_in(vector point, vector a, vector b)
        return c;
 }
 
-ERASEABLE
 vector vec_bounds_out(vector point, vector a, vector b)
 {
        vector d = vec_to_max(a, b);
@@ -69,7 +64,6 @@ vector vec_bounds_out(vector point, vector a, vector b)
        return c;
 }
 
-ERASEABLE
 float angle_snap_f(float f, float increment)
 {
        for (int j = 0; j <= 360; )
@@ -81,7 +75,6 @@ float angle_snap_f(float f, float increment)
        return 0;
 }
 
-ERASEABLE
 vector angle_snap_vec(vector v, float increment)
 {
        vector c;
@@ -91,7 +84,6 @@ vector angle_snap_vec(vector v, float increment)
        return c;
 }
 
-ERASEABLE
 vector aim_vec(vector org, vector targ)
 {
        vector v;
index 898d6ca1ceae2c3a2338a92d88e1397ce5a6e59a..dc2944aa910e3e4eb399a37dbc212cd2e520f69e 100644 (file)
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
-ERASEABLE
 vector vec_bias(vector v, float f);
 
 
-ERASEABLE
 vector vec_to_min(vector a, vector b);
-ERASEABLE
 vector vec_to_max(vector a, vector b);
 
 // there may already be a function for bounding a vector in this manner, however my very quick search did not reveal one -- Player_2
-ERASEABLE
 vector vec_bounds_in(vector point, vector a, vector b);
-ERASEABLE
 vector vec_bounds_out(vector point, vector a, vector b);
 
-ERASEABLE
 float angle_snap_f(float f, float increment);
-ERASEABLE
 vector angle_snap_vec(vector v,  float increment);
 
-ERASEABLE
 vector aim_vec(vector org, vector targ);
index a5ff69356a21f516ba290bac01761eac2a7cce88..627fec11a92e1293bec76db098230b0a5fafc7f0 100644 (file)
@@ -1,6 +1,5 @@
 #include "random.qh"
 
-ERASEABLE
 void RandomSelection_Init()
 {
        RandomSelection_totalweight = 0;
@@ -10,7 +9,6 @@ void RandomSelection_Init()
        RandomSelection_best_priority = -1;
 }
 
-ERASEABLE
 void RandomSelection_Add(entity e, float f, string s, vector v, float weight, float priority)
 {
        if (priority > RandomSelection_best_priority)
@@ -38,7 +36,6 @@ void RandomSelection_Add(entity e, float f, string s, vector v, float weight, fl
 float DistributeEvenly_amount;
 float DistributeEvenly_totalweight;
 
-ERASEABLE
 void DistributeEvenly_Init(float amount, float totalweight)
 {
        if (DistributeEvenly_amount)
@@ -50,7 +47,6 @@ void DistributeEvenly_Init(float amount, float totalweight)
        DistributeEvenly_totalweight = totalweight;
 }
 
-ERASEABLE
 float DistributeEvenly_Get(float weight)
 {
        float f;
@@ -61,7 +57,6 @@ float DistributeEvenly_Get(float weight)
        return f;
 }
 
-ERASEABLE
 float DistributeEvenly_GetRandomized(float weight)
 {
        float f;
@@ -75,7 +70,6 @@ float DistributeEvenly_GetRandomized(float weight)
 // from the GNU Scientific Library
 float gsl_ran_gaussian_lastvalue;
 float gsl_ran_gaussian_lastvalue_set;
-ERASEABLE
 float gsl_ran_gaussian(float sigma)
 {
        if (gsl_ran_gaussian_lastvalue_set)
index e3900697b7d1a54b29f30a75e592abe9fc426b01..b2fc53f0cac4edaaa3ef964c25b7b6093ac2ae2c 100644 (file)
@@ -7,9 +7,7 @@ float RandomSelection_chosen_float;
 string RandomSelection_chosen_string;
 vector RandomSelection_chosen_vec;
 
-ERASEABLE
 void RandomSelection_Init();
-ERASEABLE
 void RandomSelection_Add(entity e, float f, string s, vector v, float weight, float priority);
 #define RandomSelection_AddEnt(e, weight, priority) RandomSelection_Add(e, 0, string_null, '0 0 0', weight, priority)
 #define RandomSelection_AddFloat(f, weight, priority) RandomSelection_Add(NULL, f, string_null, '0 0 0', weight, priority)
index d8f18a02c96e4ab98b749530dd5f1f58550609b5..29766c65ddd2b04259a71292386977e97407f31c 100644 (file)
@@ -146,9 +146,7 @@ REGISTRY(Registries, BITS(8))
 
 #define REGISTRY_HASH(id) Registry_hash_##id
 
-ERASEABLE
 ACCUMULATE void Registry_check(string r, string server) { }
-ERASEABLE
 ACCUMULATE void Registry_send_all() { }
 
 #ifdef SVQC
index 565ebb29c81513276a8f49334cfebd2589cb0986..2790cdf2dc3cc760dbe814bc8c8edb3be2322695 100644 (file)
@@ -5,7 +5,6 @@ USING(swapfunc_t, void (int i1, int i2, entity pass));
 /** <0 for <, ==0 for ==, >0 for > (like strcmp) */
 USING(comparefunc_t, int (int i1, int i2, entity pass));
 
-ERASEABLE
 void heapsort(int n, swapfunc_t swap, comparefunc_t cmp, entity pass)
 {
        #define heapify(_count) \
@@ -40,7 +39,6 @@ void heapsort(int n, swapfunc_t swap, comparefunc_t cmp, entity pass)
        }
 }
 
-ERASEABLE
 void shuffle(float n, swapfunc_t swap, entity pass)
 {
        for (int i = 1; i < n; ++i)
index e800bc4576ae8d81ca1c4a37838e5ae6db2c0bf7..6748b60cd77954e84064e072a6d6cef715be0804 100644 (file)
@@ -1,6 +1,5 @@
 #include "sortlist.qh"
 
-ERASEABLE
 entity Sort_Spawn()
 {
        entity sort = new_pure(sortlist);
index d3198b3ce4c7666bf986564916b9d9678b3dc097..fc540c64afab15c093a4c48f00680a9ceb0ff1e7 100644 (file)
@@ -1,7 +1,7 @@
 #pragma once
 
 /** If this global exists, only functions with spawnfunc_ name prefix qualify as spawn functions */
-noref bool require_spawnfunc_prefix;
+EXPORT noref bool require_spawnfunc_prefix;
 .bool spawnfunc_checked;
 
 // Optional type checking; increases compile time too much to be enabled by default
@@ -86,7 +86,7 @@ noref bool require_spawnfunc_prefix;
        #define spawnfunc_1(id) spawnfunc_2(id, FIELDS_UNION)
        #define spawnfunc_2(id, whitelist) \
                void __spawnfunc_##id(entity this); \
-               ACCUMULATE void spawnfunc_##id(entity this) \
+               EXPORT ACCUMULATE void spawnfunc_##id(entity this) \
                { \
                    if (!__spawnfunc_first) { \
                 __spawnfunc_first = true; \
index e0ec96b8ec0c43872992e12523329c0be74e8f5d..03073b47d000131fcac06fd1c161ffa6183ef62c 100644 (file)
@@ -7,7 +7,6 @@ float(int tmr) _gettime = #67;
 float(int tmr) _gettime = #519;
 #endif
 
-ERASEABLE
 void profile(string s)
 {
        static float g_starttime;
index 96e8a3a276258d568380219e0b1d8218ac9b7cf5..fc5bb4f20e08cf4b87fce4dd55a433e22ae5afd6 100644 (file)
@@ -60,7 +60,6 @@ MACRO_END
        this = string_null; \
 MACRO_END
 
-ERASEABLE
 string seconds_tostring(float sec)
 {
        float minutes = floor(sec / 60);
@@ -68,7 +67,6 @@ string seconds_tostring(float sec)
        return sprintf("%d:%02d", minutes, sec);
 }
 
-ERASEABLE
 string format_time(float seconds)
 {
        seconds = floor(seconds + 0.5);
@@ -82,7 +80,6 @@ string format_time(float seconds)
        else return sprintf(_("%02d:%02d:%02d"), hours, minutes, seconds);
 }
 
-ERASEABLE
 string mmsss(float tenths)
 {
        tenths = floor(tenths + 0.5);
@@ -92,7 +89,6 @@ string mmsss(float tenths)
        return strcat(ftos(minutes), ":", substring(s, 1, 2), ".", substring(s, 3, 1));
 }
 
-ERASEABLE
 string mmssss(float hundredths)
 {
        hundredths = floor(hundredths + 0.5);
@@ -104,7 +100,6 @@ string mmssss(float hundredths)
 
 int ColorTranslateMode;
 
-ERASEABLE
 string ColorTranslateRGB(string s)
 {
        return (ColorTranslateMode & 1) ? strdecolorize(s) : s;
@@ -149,7 +144,6 @@ string CCR(string input)
 
 #define startsWith(haystack, needle) (strstrofs(haystack, needle, 0) == 0)
 
-ERASEABLE
 bool startsWithNocase(string haystack, string needle)
 {
        return strcasecmp(substring(haystack, 0, strlen(needle)), needle) == 0;
@@ -159,7 +153,6 @@ noref string _endsWith_suffix;
 #define endsWith(this, suffix) (_endsWith_suffix = suffix, substring(this, -strlen(_endsWith_suffix), -1) == _endsWith_suffix)
 
 /** unzone the string, and return it as tempstring. Safe to be called on string_null */
-ERASEABLE
 string fstrunzone(string s)
 {
        if (!s) return s;
@@ -169,7 +162,6 @@ string fstrunzone(string s)
 }
 
 /** returns first word */
-ERASEABLE
 string car(string s)
 {
        int o = strstrofs(s, " ", 0);
@@ -178,7 +170,6 @@ string car(string s)
 }
 
 /** returns all but first word */
-ERASEABLE
 string cdr(string s)
 {
        int o = strstrofs(s, " ", 0);
@@ -186,7 +177,6 @@ string cdr(string s)
        return substring(s, o + 1, strlen(s) - (o + 1));
 }
 
-ERASEABLE
 string cons(string a, string b)
 {
        if (a == "") return b;
@@ -194,7 +184,6 @@ string cons(string a, string b)
        return strcat(a, " ", b);
 }
 
-ERASEABLE
 string cons_mid(string a, string mid, string b)
 {
        if (a == "") return b;
@@ -202,13 +191,11 @@ string cons_mid(string a, string mid, string b)
        return strcat(a, mid, b);
 }
 
-ERASEABLE
 string substring_range(string s, float b, float e)
 {
        return substring(s, b, e - b);
 }
 
-ERASEABLE
 string swapwords(string str, float i, float j)
 {
        float n;
@@ -230,13 +217,11 @@ string swapwords(string str, float i, float j)
 }
 
 string _shufflewords_str;
-ERASEABLE
 void _shufflewords_swapfunc(float i, float j, entity pass)
 {
        _shufflewords_str = swapwords(_shufflewords_str, i, j);
 }
 
-ERASEABLE
 string shufflewords(string str)
 {
        _shufflewords_str = str;
@@ -247,7 +232,6 @@ string shufflewords(string str)
        return str;
 }
 
-ERASEABLE
 string unescape(string in)
 {
        in = strzone(in);  // but it doesn't seem to be necessary in my tests at least
@@ -272,7 +256,6 @@ string unescape(string in)
        return str;
 }
 
-ERASEABLE
 string strwords(string s, int w)
 {
        int endpos = 0;
@@ -284,7 +267,6 @@ string strwords(string s, int w)
 
 #define strhasword(s, w) (strstrofs(strcat(" ", s, " "), strcat(" ", w, " "), 0) >= 0)
 
-ERASEABLE
 int u8_strsize(string s)
 {
        int l = 0;
@@ -298,7 +280,6 @@ int u8_strsize(string s)
 }
 
 //List of Unicode spaces: https://www.cs.tut.fi/~jkorpela/chars/spaces.html
-ERASEABLE
 bool isInvisibleString(string s)
 {
        s = strdecolorize(s);
@@ -344,7 +325,6 @@ bool isInvisibleString(string s)
 
 // Multiline text file buffers
 
-ERASEABLE
 int buf_load(string pFilename)
 {
        int buf = buf_create();
@@ -362,7 +342,6 @@ int buf_load(string pFilename)
        return buf;
 }
 
-ERASEABLE
 void buf_save(float buf, string pFilename)
 {
        int fh = fopen(pFilename, FILE_WRITE);
@@ -376,7 +355,6 @@ void buf_save(float buf, string pFilename)
 /**
  * converts a number to a string with the indicated number of decimals
  */
-ERASEABLE
 string ftos_decimals(float number, int decimals)
 {
        // inhibit stupid negative zero
@@ -387,7 +365,6 @@ string ftos_decimals(float number, int decimals)
 /**
  * converts a number to a string with the minimum number of decimals
  */
-ERASEABLE
 string ftos_mindecimals(float number)
 {
        // inhibit stupid negative zero
@@ -395,7 +372,6 @@ string ftos_mindecimals(float number)
        return sprintf("%.7g", number);
 }
 
-ERASEABLE
 int vercmp_recursive(string v1, string v2)
 {
        int dot1 = strstrofs(v1, ".", 0);
@@ -414,7 +390,6 @@ int vercmp_recursive(string v1, string v2)
        else return (dot2 == -1) ? 1 : vercmp_recursive(substring(v1, dot1 + 1, 999), substring(v2, dot2 + 1, 999));
 }
 
-ERASEABLE
 int vercmp(string v1, string v2)
 {
        if (strcasecmp(v1, v2) == 0) return 0;  // early out check
index 2ad7bda2464b6842daa52fb70b2889c1835ab02c..6f0630c95e3fb14d394261f476f3c311f9c2c1bd 100644 (file)
@@ -24,7 +24,6 @@ const float URL_FH_STDOUT = -2;
 entity url_fromid[NUM_URL_ID];
 int autocvar__urllib_nextslot;
 
-ERASEABLE
 float url_URI_Get_Callback(int id, float status, string data)
 {
        if (id < MIN_URL_ID) return 0;
@@ -83,7 +82,6 @@ float url_URI_Get_Callback(int id, float status, string data)
        }
 }
 
-ERASEABLE
 void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
 {
        entity e;
@@ -203,7 +201,6 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
 }
 
 // close a file
-ERASEABLE
 void url_fclose(entity e)
 {
        int i;
@@ -283,7 +280,6 @@ void url_fclose(entity e)
 }
 
 // with \n (blame FRIK_FILE)
-ERASEABLE
 string url_fgets(entity e)
 {
        if (e.url_fh == URL_FH_CURL)
@@ -308,7 +304,6 @@ string url_fgets(entity e)
 }
 
 // without \n (blame FRIK_FILE)
-ERASEABLE
 void url_fputs(entity e, string s)
 {
        if (e.url_fh == URL_FH_CURL)
@@ -331,7 +326,6 @@ void url_fputs(entity e, string s)
 }
 
 // multi URL object, tries URLs separated by space in sequence
-ERASEABLE
 void url_multi_ready(entity fh, entity me, float status)
 {
        float n;
@@ -360,7 +354,6 @@ void url_multi_ready(entity fh, entity me, float status)
        me.url_ready(fh, me.url_ready_pass, status);
 }
 
-ERASEABLE
 void url_multi_fopen(string url, int mode, url_ready_func rdy, entity pass)
 {
        float n;
index 8918ca0a2a695df6ade44e96df9837b271adc3a4..00523a84f137adb1e9d1a393d7da07008070bfa7 100644 (file)
@@ -17,20 +17,14 @@ const float URL_READY_CANREAD  =  2;
 // errors: -1, or negative HTTP status code
 USING(url_ready_func, void (entity handle, entity pass, float status));
 
-ERASEABLE
 void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass);
-ERASEABLE
 void url_fclose(entity e);
-ERASEABLE
 string url_fgets(entity e);
-ERASEABLE
 void url_fputs(entity e, string s);
 
 // returns true if handled
-ERASEABLE
 float url_URI_Get_Callback(int id, float status, string data);
 #define MIN_URL_ID URI_GET_URLLIB
 #define NUM_URL_ID (URI_GET_URLLIB_END - URI_GET_URLLIB + 1)
 
-ERASEABLE
 void url_multi_fopen(string url, float mode, url_ready_func rdy, entity pass);
index 8340381bab3aff467e543a1fdf1d1c19eacf1463..6c32e4312d594799e830c68b7b05f2f49fffcd87 100644 (file)
@@ -25,7 +25,6 @@ noref vector _dotproduct_a, _dotproduct_b;
 #if 1
 #define cross(a, b) ((a) >< (b))
 #else
-ERASEABLE
 vector cross(vector a, vector b)
 {
        return
@@ -46,7 +45,6 @@ const vector eX = '1 0 0';
 const vector eY = '0 1 0';
 const vector eZ = '0 0 1';
 
-ERASEABLE
 vector randompos(vector m1, vector m2)
 {
        vector v;
@@ -57,19 +55,16 @@ vector randompos(vector m1, vector m2)
        return v;
 }
 
-ERASEABLE
 float vlen_maxnorm2d(vector v)
 {
        return max(v.x, v.y, -v.x, -v.y);
 }
 
-ERASEABLE
 float vlen_minnorm2d(vector v)
 {
        return min(max(v.x, -v.x), max(v.y, -v.y));
 }
 
-ERASEABLE
 float dist_point_line(vector p, vector l0, vector ldir)
 {
        ldir = normalize(ldir);
@@ -82,11 +77,9 @@ float dist_point_line(vector p, vector l0, vector ldir)
 }
 
 /** requires that m2>m1 in all coordinates, and that m4>m3 */
-ERASEABLE
 float boxesoverlap(vector m1, vector m2, vector m3, vector m4) { return m2_x >= m3_x && m1_x <= m4_x && m2_y >= m3_y && m1_y <= m4_y && m2_z >= m3_z && m1_z <= m4_z; }
 
 /** requires the same as boxesoverlap, but is a stronger condition */
-ERASEABLE
 float boxinsidebox(vector smins, vector smaxs, vector bmins, vector bmaxs) { return smins.x >= bmins.x && smaxs.x <= bmaxs.x && smins.y >= bmins.y && smaxs.y <= bmaxs.y && smins.z >= bmins.z && smaxs.z <= bmaxs.z; }
 
 #define PITCH(v) ((v).x)
@@ -112,7 +105,6 @@ noref vector _vec2;
 noref vector _vec3;
 #define vec3(_x, _y, _z) (_vec3.x = (_x), _vec3.y = (_y), _vec3.z = (_z), _vec3)
 
-ERASEABLE
 vector Rotate(vector v, float a)
 {
        float a_sin = sin(a), a_cos = cos(a);
@@ -127,7 +119,6 @@ noref vector _yinvert;
  * @param norm the normalized normal
  * @returns dir reflected by norm
  */
-ERASEABLE
 vector reflect(vector dir, vector norm)
 {
        return dir - 2 * (dir * norm) * norm;
@@ -136,13 +127,11 @@ vector reflect(vector dir, vector norm)
 /**
  * clip vel along the plane defined by norm (assuming 0 distance away), bounciness determined by bounce 0..1
  */
-ERASEABLE
 vector vec_reflect(vector vel, vector norm, float bounce)
 {
        return vel - (1 + bounce) * (vel * norm) * norm;
 }
 
-ERASEABLE
 vector vec_epsilon(vector this, float eps)
 {
        if (this.x > -eps && this.x < eps) this.x = 0;
@@ -155,7 +144,6 @@ vector vec_epsilon(vector this, float eps)
        (out = vec_epsilon(vec_reflect(in, normal, (overbounce) - 1), 0.1))
 
 #ifdef GAMEQC
-       ERASEABLE
        vector get_corner_position(entity box, int corner)
        {
                switch (corner)
@@ -172,7 +160,6 @@ vector vec_epsilon(vector this, float eps)
                }
        }
 
-       ERASEABLE
        vector NearestPointOnBox(entity box, vector org)
        {
                vector m1 = box.mins + box.origin;
index e727b39e6446acbb10e8745c5b0a5bb93d3fcdea..26e11e2deb01871c07917662ef0a41700155d41e 100644 (file)
@@ -38,7 +38,7 @@ void _dumptree_close(entity pass, entity me)
 
 float updateConwidths(float width, float height, float pixelheight);
 
-void GameCommand(string theCommand)
+EXPORT void GameCommand(string theCommand)
 {
        int argc = tokenize_console(theCommand);
        string ss = strtolower(argv(0));
index 31537bd40f96da7d2ae4b5902a59040c617fe406..bb40ddbd66edd8f33b65a633c7fff8ac9c496b70 100644 (file)
@@ -1,3 +1,3 @@
 #pragma once
 
-void GameCommand(string command);
+EXPORT void GameCommand(string command);
index fb6c4aeeda60a612cbe47ffe4c6804022b315c23..6d75466dc0b852b3c65632d078b32216dd6739a2 100644 (file)
@@ -223,7 +223,7 @@ void m_init_delayed()
        if (Menu_Active) m_display();  // delayed menu display
 }
 
-void m_keyup(float key, float ascii)
+EXPORT void m_keyup(float key, float ascii)
 {
        if (!menuInitialized) return;
        if (!Menu_Active) return;
index 74f3bd570d5fee88efdcdbab3fbdaa341c2545a6..abddbd8cb667c3d30e9d75d53d5521d97dcd5d66 100644 (file)
@@ -128,7 +128,7 @@ float IsServerInList(string list, string srv);
 entity RetrieveCategoryEnt(float catnum);
 
 float CheckCategoryOverride(float cat);
-float m_gethostcachecategory(float entry) { return CheckCategoryOverride(CheckCategoryForEntry(entry)); }
+EXPORT float m_gethostcachecategory(float entry) { return CheckCategoryOverride(CheckCategoryForEntry(entry)); }
 
 
 // fields for category entities
index c9cd001ba9f9fcd4ec2fdc79727b31e8c6684e7b..35eb7b85474ff05914580f76cbef6bc78eb3be1d 100644 (file)
@@ -285,7 +285,7 @@ string _Nex_ExtResponseSystem_Packs;
 float _Nex_ExtResponseSystem_PacksStep;
 
 /** engine callback */
-void URI_Get_Callback(float id, float status, string data)
+EXPORT void URI_Get_Callback(float id, float status, string data)
 {
        if(url_URI_Get_Callback(id, status, data))
        {
index a613edc14c7861581e16833dc0278413caf96f68..2c2789ecafdbae04213ea9331a1b5774ca0de021 100644 (file)
@@ -2053,7 +2053,7 @@ void Physics_Frame()
 }
 
 void systems_update();
-void EndFrame()
+EXPORT void EndFrame()
 {
        anticheat_endframe();
 
@@ -2143,7 +2143,7 @@ float RedirectionThink()
 }
 
 void TargetMusic_RestoreGame();
-void RestoreGame()
+EXPORT void RestoreGame()
 {
        // Loaded from a save game
        // some things then break, so let's work around them...
index bbbefd5a88f11cbb32e959a313366da154c3de74..9189c573417c2b5109d496716adfac2e23d81c60 100644 (file)
@@ -1112,7 +1112,7 @@ bool WarpZone_Projectile_Touch_ImpactFilter_Callback(entity this, entity toucher
 }
 
 /** engine callback */
-void URI_Get_Callback(float id, float status, string data)
+EXPORT void URI_Get_Callback(float id, float status, string data)
 {
        if(url_URI_Get_Callback(id, status, data))
        {
index 487ab1fc533821590ab49c18fdeffb7cf24dd686..eb8ee0ba08a163d9b68c59474418625242c382ff 100644 (file)
@@ -149,7 +149,7 @@ void Pause_TryPause(bool ispaused)
        setpause(ispaused);
 }
 
-void SV_PausedTic(float elapsedtime)
+EXPORT void SV_PausedTic(float elapsedtime)
 {
        if (!server_is_dedicated) Pause_TryPause(false);
 }
index 097685abf1766820a9e3f964928da71172c31d5b..dd764ce8329b8598d8ff72e40f514c728d08e880 100644 (file)
@@ -10,7 +10,7 @@ const string STR_OBSERVER = "observer";
 #define IS_SPEC(v) ((v).classname == STR_SPECTATOR)
 #define IS_OBSERVER(v) ((v).classname == STR_OBSERVER)
 
-#define IS_CLIENT(v) (v.flags & FL_CLIENT)
+#define IS_CLIENT(v) ((v).flags & FL_CLIENT)
 /** want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v)) */
 #define IS_BOT_CLIENT(v) (clienttype(v) == CLIENTTYPE_BOT)
 #define IS_FAKE_CLIENT(v) (clienttype(v) == CLIENTTYPE_NOTACLIENT)
index e3d1eb01368df1c714c55d7264eda99e89ff8bbd..f39055bd28e2e349604cc1fe8db6f537efe4596a 100755 (executable)
@@ -38,11 +38,13 @@ QCCDEFS="${QCCDEFS[@]}"
 
 declare -a QCCFLAGS=(
     -std=gmqcc
-    -Wall -Werror
+    -Ooverlap-locals
+    -Werror
+    -Wall
     -futf8
-    -freturn-assignments
     -frelaxed-switch
-    -Ooverlap-locals
+    -freturn-assignments
+    -fdefault-eraseable
 )
 declare -a NOWARN=(
     -Wno-field-redeclared