]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
make it compile with gmqcc; strict function types YEAH
authorRudolf Polzer <divverent@xonotic.org>
Mon, 31 Dec 2012 11:02:30 +0000 (12:02 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 31 Dec 2012 11:02:30 +0000 (12:02 +0100)
14 files changed:
qcsrc/Makefile
qcsrc/client/Main.qc
qcsrc/common/util.qh
qcsrc/server/command/common.qc
qcsrc/server/command/vote.qc
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/pathlib.qc
qcsrc/server/pathlib/movenode.qc
qcsrc/server/pathlib/pathlib.qh
qcsrc/server/t_plats.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/w_hagar.qc
qcsrc/server/w_seeker.qc

index c6cc796ee8650679eb40977ee3c96f507709e075..1ffb727a80d1eac54146d837ef7014c45cfecc7a 100644 (file)
@@ -11,14 +11,13 @@ QCCFLAGS ?= \
        -Werror -Wall \
        -Wno-field-redeclared \
        -Wno-double-declaration \
-       -Wno-assign-function-types \
        -Wno-unused-variable \
        -Wno-uninitialized-global \
        -O3 \
        -fftepp \
        -ftranslatable-strings \
        -fadjust-vector-fields \
-       -fassign-function-types \
+       -fno-assign-function-types \
        -fcorrect-ternary \
        -fcorrect-logic \
        -ftrue-empty-strings \
index 77a9792169edf17e403a89eb5972c5629baf8b7e..c389540fd920ce2699307862c23c8452467ee397 100644 (file)
@@ -120,7 +120,7 @@ void CSQC_Init(void)
        draw_endBoldFont();
        menu_visible = FALSE;
        menu_show = menu_show_error;
-       menu_action = menu_sub_null;
+       menu_action = func_null;
 
        for(i = 0; i < 255; ++i)
                if(getplayerkeyvalue(i, "viewentity") == "")
@@ -398,7 +398,7 @@ float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
        if (MapVote_InputEvent(bInputType, nPrimary, nSecondary))
                return true;
 
-       if(menu_visible)
+       if(menu_visible && menu_action)
                if(menu_action(bInputType, nPrimary, nSecondary))
                        return TRUE;
 
index 2bdaf1f1d034b3fabb161e7bbb074bb2f41edc0d..10e680e562615a818f62f7297294681158ed03aa 100644 (file)
@@ -224,8 +224,13 @@ void WriteInt24_t(float dest, float val);
 #endif
 
 // the NULL function
+#ifdef GMQCC
+#define func_null nil
+#define string_null nil
+#else
 var void func_null(void);
 var string string_null;
+#endif
 float float2range11(float f);
 float float2range01(float f);
 
index eae71b045c82845688d653b999d705f07854ac68..53ad41d3551d0d7de500622a31f224ec87b52ef1 100644 (file)
@@ -572,7 +572,7 @@ void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMAN
                                {                                       
                                        if(caller) { caller.allowed_timeouts -= 1; }
                                        
-                                       bprint(GetCallerName(caller), " ^7called a timeout", (caller ? strcat(" (", ftos(caller.allowed_timeouts), " timeout(s) left)") : string_null), "!\n"); // write a bprint who started the timeout (and how many they have left)
+                                       bprint(GetCallerName(caller), " ^7called a timeout", (caller ? strcat(" (", ftos(caller.allowed_timeouts), " timeout(s) left)") : ""), "!\n"); // write a bprint who started the timeout (and how many they have left)
                                        
                                        timeout_status = TIMEOUT_LEADTIME;
                                        timeout_caller = caller;
@@ -614,7 +614,7 @@ void CommonCommand_who(float request, entity caller, float argc)
                        string separator = strreplace("%", " ", strcat((argv(1) ? argv(1) : " "), "^7"));
                        string tmp_netaddress, tmp_crypto_idfp;
                        
-                       print_to(caller, strcat("List of client information", (privacy ? " (some data is hidden for privacy)" : string_null), ":"));
+                       print_to(caller, strcat("List of client information", (privacy ? " (some data is hidden for privacy)" : ""), ":"));
                        print_to(caller, sprintf(strreplace(" ", separator, " %-4s %-20s %-5s %-3s %-9s %-16s %s "), 
                                "ent", "nickname", "ping", "pl", "time", "ip", "crypto_id"));
                        
index 56484a2a97b5bea826f094f20fdd1a803687c312..34446fdfcfddf0e3a6b78fa5d68967239b2737a9 100644 (file)
@@ -172,7 +172,7 @@ void VoteSpam(float notvoters, float mincount, string result)
                strcat("^2:^1", ftos(vote_reject_count)),
                ((mincount >= 0) ? strcat("^2 (^1", ftos(mincount), "^2 needed)") : "^2"),
                strcat(", ^1", ftos(vote_abstain_count), "^2 didn't care"),
-               strcat(", ^1", ftos(notvoters), strcat("^2 didn't ", ((mincount >= 0) ? string_null : "have to "), "vote\n"))));
+               strcat(", ^1", ftos(notvoters), strcat("^2 didn't ", ((mincount >= 0) ? "" : "have to "), "vote\n"))));
        
        if(autocvar_sv_eventlog)
        {
index e0a29d87a7b86d3198edfa4087ca273908736c31..f777254138e0c0dc4facdb4259567ac397d11cba 100644 (file)
@@ -624,7 +624,7 @@ string deathmessage;
 #define ACTIVE_BUSY    2
 #define ACTIVE_TOGGLE  3
 .float active;
-.float (float act_state) setactive;
+.void (float act_state) setactive;
 .entity realowner;
 
 .float nex_charge;
index 07bdf87937a410bb3f711dd1aab52d901a22768a..9317e234067ea69734a4e5bbeb36fb5d6564328a 100644 (file)
@@ -1824,7 +1824,7 @@ void InitializeEntitiesRun()
             self = e_old;
         }
         //dprint("Delayed initialization: ", self.classname, "\n");
-        if(func != func_null)
+        if(func)
             func();
         else
         {
@@ -1850,7 +1850,7 @@ void SetCustomizer(entity e, float(void) customizer, void(void) uncustomizer)
 {
     e.customizeentityforclient = customizer;
     e.uncustomizeentityforclient = uncustomizer;
-    e.uncustomizeentityforclient_set = (uncustomizer != func_null);
+    e.uncustomizeentityforclient_set = !!uncustomizer;
 }
 
 .float nottargeted;
index ce4c2b4b8d74a40c13455b05d9020f05473e7cfc..3cb4ca750ee15f971eb5a9a59b772b0c9445d83a 100644 (file)
@@ -214,7 +214,7 @@ float edge_show(vector point,float fsize)
 #endif
 
 var vector pathlib_movenode(vector start,vector end,float doedge);
-vector pathlib_wateroutnode(vector start,vector end)
+vector pathlib_wateroutnode(vector start,vector end,float doedge)
 {
     vector surface;
 
@@ -248,7 +248,7 @@ vector pathlib_wateroutnode(vector start,vector end)
     return end;
 }
 
-vector pathlib_swimnode(vector start,vector end)
+vector pathlib_swimnode(vector start,vector end,float doedge)
 {
     pathlib_movenode_goodnode = 0;
 
index 9369fb4d69f2a179ff47ac74c8677e49349a1449..c45ac0dee4bb266fc1f36552037dffc94b625198 100644 (file)
@@ -1,4 +1,4 @@
-vector pathlib_wateroutnode(vector start,vector end)
+vector pathlib_wateroutnode(vector start,vector end, float doedge)
 {
     vector surface;
 
@@ -32,7 +32,7 @@ vector pathlib_wateroutnode(vector start,vector end)
     return end;
 }
 
-vector pathlib_swimnode(vector start,vector end)
+vector pathlib_swimnode(vector start,vector end, float doedge)
 {
     pathlib_movenode_goodnode = 0;
 
@@ -43,7 +43,7 @@ vector pathlib_swimnode(vector start,vector end)
     end_y = fsnap(end_y, pathlib_gridsize);
 
     if(pointcontents(end) == CONTENT_EMPTY)
-        return pathlib_wateroutnode( start, end);
+        return pathlib_wateroutnode( start, end, doedge);
 
     tracebox(start, movenode_boxmin,movenode_boxmax, end, MOVE_WORLDONLY, self);
     if(trace_fraction == 1)
@@ -52,7 +52,7 @@ vector pathlib_swimnode(vector start,vector end)
     return end;
 }
 
-vector pathlib_flynode(vector start,vector end)
+vector pathlib_flynode(vector start,vector end, float doedge)
 {
     pathlib_movenode_goodnode = 0;
 
index 71d13caa4e084660b568389f7f96031e54bfafc1..d1b6667d715f4a6075f992f999ceb846a608e339 100644 (file)
@@ -75,9 +75,9 @@ vector movenode_boxmax;
 vector movenode_boxmin;
 float  pathlib_movenode_goodnode;
 
-vector     pathlib_wateroutnode(vector start, vector end);
-vector     pathlib_swimnode(vector start, vector end);
-vector     pathlib_flynode(vector start, vector end);
+vector     pathlib_wateroutnode(vector start, vector end, float doedge);
+vector     pathlib_swimnode(vector start, vector end, float doedge);
+vector     pathlib_flynode(vector start, vector end, float doedge);
 vector     pathlib_walknode(vector start, vector end, float doedge);
 var vector pathlib_movenode(vector start, vector end, float doedge);
 
index 7c21c4e2e396158ffa18f8e46a639fe82ce8e7e3..df511c63795d611068e2b74d2fc85ba896f91383 100644 (file)
@@ -1615,7 +1615,6 @@ float SECRET_1ST_DOWN = 4;                // 1st move is down from arrow
 float SECRET_NO_SHOOT = 8;             // only opened by trigger
 float SECRET_YES_SHOOT = 16;   // shootable even if targeted
 
-
 void fd_secret_use()
 {
        float temp;
@@ -1666,6 +1665,11 @@ void fd_secret_use()
                sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
 }
 
+void fd_secret_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+       fd_secret_use();
+}
+
 // Wait after first movement...
 void fd_secret_move1()
 {
@@ -1822,7 +1826,7 @@ void spawnfunc_func_door_secret()
        {
                self.health = 10000;
                self.takedamage = DAMAGE_YES;
-               self.event_damage = fd_secret_use;
+               self.event_damage = fd_secret_damage;
        }
        self.oldorigin = self.origin;
        if (!self.wait)
index ad7bd2dcf0919f93519329b3124aaaa59156052f..93b27df9756a0deb3ef6452ebfc77e6df2878252 100644 (file)
@@ -74,7 +74,7 @@ float autocvar_g_vehicle_racer_bouncestop;
 vector autocvar_g_vehicle_racer_bouncepain;
 
 var vector racer_force_from_tag(string tag_name, float spring_length, float max_power);
-void racer_spawn(float _spawnflag);
+void racer_spawn_default();
 
 void racer_align4point(float _delta)
 {
@@ -545,7 +545,7 @@ void racer_blowup()
                                        DEATH_WAKIBLOWUP, world);
 
     self.nextthink  = time + autocvar_g_vehicle_racer_respawntime;
-    self.think      = racer_spawn;
+    self.think      = racer_spawn_default;
     self.movetype   = MOVETYPE_NONE;
     self.effects    = EF_NODRAW;
 
@@ -554,8 +554,6 @@ void racer_blowup()
     self.velocity  = '0 0 0';
 
     setorigin(self, self.pos1);
-       self.think     = racer_spawn;
-       self.nextthink = time + autocvar_g_vehicle_racer_respawntime;
 }
 
 void racer_deadtouch()
@@ -626,6 +624,10 @@ void racer_spawn(float _spawnflag)
     self.damageforcescale = 0.5;
     //self.destvec = autocvar_g_vehicle_racer_bouncepain;
 }
+void racer_spawn_default()
+{
+       racer_spawn(0);
+}
 
 
 
index de444cb31e8ae7b4b62cfd1639c0294a6d22b558..55e361ebbcdb9ca395f145407edc9b0d957f07ef 100644 (file)
@@ -351,7 +351,7 @@ float w_hagar(float req)
        else if (req == WR_THINK)
        {
                float loadable_secondary;
-               loadable_secondary = autocvar_g_balance_hagar_secondary_load && autocvar_g_balance_hagar_secondary;
+               loadable_secondary = (autocvar_g_balance_hagar_secondary_load && autocvar_g_balance_hagar_secondary);
 
                if (loadable_secondary)
                        W_Hagar_Attack2_Load(); // must always run each frame
index 9bdd89013ad35df1fc3afcc126d203e1cf436668..975449f5d10c723c5fb765204c66641ae277e0c8 100644 (file)
@@ -495,8 +495,8 @@ void Seeker_Fire_Tag()
        missile.solid           = SOLID_BBOX;
 
        missile.takedamage       = DAMAGE_YES;
-       missile.event_damage    = Seeker_Tag_Explode;
-       missile.health          = autocvar_g_balance_seeker_tag_health;
+       missile.event_damage     = Seeker_Tag_Damage;
+       missile.health           = autocvar_g_balance_seeker_tag_health;
        missile.damageforcescale = autocvar_g_balance_seeker_tag_damageforcescale;
 
        setorigin (missile, w_shotorg);