Sort #includes
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 2 May 2015 03:14:27 +0000 (13:14 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 2 May 2015 03:14:27 +0000 (13:14 +1000)
28 files changed:
qcsrc/client/announcer.qc
qcsrc/client/bgmscript.qc
qcsrc/client/casings.qc
qcsrc/client/command/cl_cmd.qc
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/damage.qc
qcsrc/client/effects.qc
qcsrc/client/hook.qc
qcsrc/client/hud_config.qc
qcsrc/client/laser.qc
qcsrc/client/main.qc
qcsrc/client/mapvoting.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/movetypes.qc
qcsrc/client/noise.qc
qcsrc/client/particles.qc
qcsrc/client/prandom.qc
qcsrc/client/progs.src
qcsrc/client/rubble.qc
qcsrc/client/scoreboard.qc
qcsrc/client/shownames.qc
qcsrc/client/target_music.qc
qcsrc/client/teamradar.qc
qcsrc/client/tturrets.qc
qcsrc/client/vehicles/vehicles.qc
qcsrc/client/view.qc
qcsrc/client/weapons/projectile.qc
qcsrc/test/compilationunit.sh

index 116dba7..5de0395 100644 (file)
@@ -1,13 +1,11 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-    #include "../common/stats.qh"
-    #include "../common/util.qh"
-    #include "autocvars.qh"
-    #include "../common/notifications.qh"
-    #include "main.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "announcer.qh"
+
+#include "autocvars.qh"
+#include "main.qh"
+#include "../common/notifications.qh"
+#include "../common/stats.qh"
+#include "../common/util.qh"
+#include "../dpdefs/csprogsdefs.qh"
 
 bool announcer_1min;
 bool announcer_5min;
index 7bc3b9b..70c4bab 100644 (file)
@@ -1,13 +1,10 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "../common/util.qh"
-       #include "autocvars.qh"
-       #include "bgmscript.qh"
-       #include "main.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "bgmscript.qh"
+
+#include "autocvars.qh"
+#include "defs.qh"
+#include "main.qh"
+#include "../common/util.qh"
+#include "../dpdefs/csprogsdefs.qh"
 
 #define CONSTANT_SPEED_DECAY
 
index 97f6271..c80c9bc 100644 (file)
@@ -1,18 +1,16 @@
-#if defined(CSQC)
-       #include "autocvars.qh"
-       #include "../common/util.qh"
-       #include "defs.qh"
-       #include "main.qh"
-       #include "movetypes.qh"
-       #include "prandom.qh"
-       #include "rubble.qh"
-
-       .float cnt;
-       .float alpha;
-       .int state;
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "casings.qh"
+
+#include "autocvars.qh"
+#include "defs.qh"
+#include "main.qh"
+#include "movetypes.qh"
+#include "prandom.qh"
+#include "rubble.qh"
+#include "../common/util.qh"
+
+.float cnt;
+.float alpha;
+.int state;
 
 entityclass(Casing)
 class(Casing) .bool silent;
index 8b5fc51..5a69fbb 100644 (file)
@@ -5,9 +5,6 @@
 
 #include "cl_cmd.qh"
 
-#include "../../common/mapinfo.qh"
-#include "../../common/command/generic.qh"
-#include "../../common/command/shared_defs.qh"
 #include "../autocvars.qh"
 #include "../defs.qh"
 #include "../hud.qh"
@@ -16,6 +13,9 @@
 #include "../mapvoting.qh"
 #include "../miscfunctions.qh"
 #include "../scoreboard.qh"
+#include "../../common/command/generic.qh"
+#include "../../common/command/shared_defs.qh"
+#include "../../common/mapinfo.qh"
 
 void DrawDebugModel()
 {
index 987d166..2337266 100644 (file)
@@ -1,30 +1,23 @@
-#if defined(CSQC)
-       #include "defs.qh"
-       #include "gibs.qh"
-       #include "miscfunctions.qh"
-       #include "player_skeleton.qh"
-       #include "sortlist.qh"
-       #include "main.qh"
-
-       #include "../client/autocvars.qh"
-       #include "../client/weapons/projectile.qh"
-
-       #include "../common/animdecide.qh"
-       #include "../common/csqcmodel_settings.qh"
-       #include "../common/teams.qh"
-
-       #include "../csqcmodellib/cl_model.qh"
-       #include "../csqcmodellib/cl_player.qh"
-       #include "../csqcmodellib/interpolate.qh"
-
-       #include "../warpzonelib/mathlib.qh"
-
-       .float death_time;
-       .int modelflags;
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
-
+#include "csqcmodel_hooks.qh"
+
+#include "defs.qh"
+#include "gibs.qh"
+#include "main.qh"
+#include "miscfunctions.qh"
+#include "player_skeleton.qh"
+#include "sortlist.qh"
+#include "../client/autocvars.qh"
+#include "../client/weapons/projectile.qh"
+#include "../common/animdecide.qh"
+#include "../common/csqcmodel_settings.qh"
+#include "../common/teams.qh"
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/cl_player.qh"
+#include "../csqcmodellib/interpolate.qh"
+#include "../warpzonelib/mathlib.qh"
+
+.float death_time;
+.int modelflags;
 
 void CSQCModel_Hook_PreDraw(bool isplayer);
 
index 112b1ad..c962777 100644 (file)
@@ -1,19 +1,16 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "../common/constants.qh"
-       #include "../common/util.qh"
-       #include "../common/deathtypes.qh"
-       #include "../common/weapons/weapons.qh"
-       #include "vehicles/vehicles.qh"
-       #include "autocvars.qh"
-       #include "defs.qh"
-       #include "damage.qh"
-       #include "gibs.qh"
-       #include "movetypes.qh"
-       #include "prandom.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "damage.qh"
+
+#include "autocvars.qh"
+#include "defs.qh"
+#include "gibs.qh"
+#include "movetypes.qh"
+#include "prandom.qh"
+#include "vehicles/vehicles.qh"
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
+#include "../dpdefs/csprogsdefs.qh"
 
 .entity tag_entity;
 
index 9562350..aa34ae2 100644 (file)
@@ -1,9 +1,7 @@
-#if defined(CSQC)
-    #include "../dpdefs/csprogsdefs.qh"
-    #include "autocvars.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "effects.qh"
+
+#include "autocvars.qh"
+#include "../dpdefs/csprogsdefs.qh"
 
 /*
 .vector fx_start;
index 226934e..0631de6 100644 (file)
@@ -7,9 +7,9 @@
 #include "miscfunctions.qh"
 #include "noise.qh"
 #include "../common/teams.qh"
+#include "../csqcmodellib/interpolate.qh"
 #include "../warpzonelib/common.qh"
 #include "../warpzonelib/mathlib.qh"
-#include "../csqcmodellib/interpolate.qh"
 
 entityclass(Hook)
 class(Hook) .float HookType; // ENT_CLIENT_*
index 6a2101f..6a66edf 100644 (file)
@@ -1,14 +1,12 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "miscfunctions.qh"
-       #include "../dpdefs/keycodes.qh"
-       #include "../common/constants.qh"
-       #include "autocvars.qh"
-       #include "hud.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "hud_config.qh"
+
+#include "autocvars.qh"
+#include "defs.qh"
+#include "hud.qh"
+#include "miscfunctions.qh"
+#include "../common/constants.qh"
+#include "../dpdefs/csprogsdefs.qh"
+#include "../dpdefs/keycodes.qh"
 
 
 #define HUD_Write(s) fputs(fh, s)
index ae4f6c2..f3d60d5 100644 (file)
@@ -1,13 +1,11 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "../common/buffs.qh"
-       #include "../csqcmodellib/interpolate.qh"
-       #include "hook.qh"
-       #include "main.qh"
-       #include "../csqcmodellib/cl_model.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "laser.qh"
+
+#include "hook.qh"
+#include "main.qh"
+#include "../common/buffs.qh"
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/interpolate.qh"
+#include "../dpdefs/csprogsdefs.qh"
 
 
 // a laser goes from origin in direction angles
index fc78f3a..f16e85e 100644 (file)
@@ -6,46 +6,39 @@
 #include "defs.qh"
 #include "effects.qh"
 #include "gibs.qh"
+#include "hook.qh"
 #include "hud.qh"
 #include "hud_config.qh"
-#include "hook.qh"
 #include "laser.qh"
 #include "mapvoting.qh"
+#include "miscfunctions.qh"
 #include "modeleffects.qh"
 #include "particles.qh"
+#include "prandom.qh"
 #include "scoreboard.qh"
 #include "shownames.qh"
 #include "sortlist.qh"
 #include "target_music.qh"
 #include "tturrets.qh"
 #include "tuba.qh"
+#include "vehicles/vehicles.qh"
 #include "wall.qh"
 #include "waypointsprites.qh"
-#include "miscfunctions.qh"
-#include "prandom.qh"
-
-#include "vehicles/vehicles.qh"
-
 #include "weapons/projectile.qh"
-
-#include "../server/vehicles/bumblebee.qh"
-#include "../server/t_items.qh"
-
 #include "../common/buffs.qh"
 #include "../common/deathtypes.qh"
 #include "../common/mapinfo.qh"
-#include "../common/notifications.qh"
+#include "../common/monsters/monsters.qh"
+#include "../common/nades.qh"
 #include "../common/net_notice.qh"
+#include "../common/notifications.qh"
 #include "../common/stats.qh"
 #include "../common/teams.qh"
-
 #include "../common/weapons/weapons.qh"
-#include "../common/monsters/monsters.qh"
-#include "../common/nades.qh"
-
 #include "../csqcmodellib/cl_model.qh"
 #include "../csqcmodellib/interpolate.qh"
-
+#include "../server/t_items.qh"
+#include "../server/vehicles/bumblebee.qh"
 #include "../warpzonelib/client.qh"
 
 // --------------------------------------------------------------------------
index a4a4b68..9b2191b 100644 (file)
@@ -1,14 +1,14 @@
 #include "mapvoting.qh"
-#include "hud.qh"
-#include "../dpdefs/keycodes.qh"
+
 #include "autocvars.qh"
 #include "defs.qh"
+#include "hud.qh"
 #include "main.qh"
-#include "../common/mapinfo.qh"
 #include "miscfunctions.qh"
 #include "scoreboard.qh"
-
+#include "../common/mapinfo.qh"
 #include "../common/util.qh"
+#include "../dpdefs/keycodes.qh"
 
 string MapVote_FormatMapItem(int id, string map, float _count, float maxwidth, vector fontsize)
 {
index 70ec94d..d6aa38e 100644 (file)
@@ -1,16 +1,16 @@
 #include "miscfunctions.qh"
 
-#include "../common/teams.qh"
-#include "../common/urllib.qh"
-#include "../common/util.qh"
-#include "../common/command/generic.qh"
-#include "../csqcmodellib/cl_model.qh"
-#include "../warpzonelib/mathlib.qh"
 #include "autocvars.qh"
 #include "defs.qh"
 #include "hud.qh"
 #include "main.qh"
 #include "sortlist.qh"
+#include "../common/command/generic.qh"
+#include "../common/teams.qh"
+#include "../common/urllib.qh"
+#include "../common/util.qh"
+#include "../csqcmodellib/cl_model.qh"
+#include "../warpzonelib/mathlib.qh"
 
 void AuditLists()
 {
index 2f62ae6..6ffba0f 100644 (file)
@@ -1,14 +1,11 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "../common/stats.qh"
-       #include "../common/util.qh"
-       #include "movetypes.qh"
-       #include "../csqcmodellib/common.qh"
-       #include "../server/t_items.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "movetypes.qh"
+
+#include "defs.qh"
+#include "../common/stats.qh"
+#include "../common/util.qh"
+#include "../csqcmodellib/common.qh"
+#include "../dpdefs/csprogsdefs.qh"
+#include "../server/t_items.qh"
 
 
 const int MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4;
index 5b64d68..1896801 100644 (file)
@@ -1,6 +1,7 @@
+#include "noise.qh"
+
 #if defined(CSQC)
        #include "../dpdefs/csprogsdefs.qh"
-       #include "noise.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
 #endif
index 25fc5da..334487c 100644 (file)
@@ -1,10 +1,10 @@
 #include "particles.qh"
 
-#include "../common/util.qh"
 #include "autocvars.qh"
 #include "bgmscript.qh"
 #include "main.qh"
 #include "../common/stats.qh"
+#include "../common/util.qh"
 #include "../warpzonelib/common.qh"
 
 void Draw_PointParticles()
index 935f142..1813009 100644 (file)
@@ -1,10 +1,7 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "../warpzonelib/mathlib.qh"
-       #include "prandom.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "prandom.qh"
+
+#include "../dpdefs/csprogsdefs.qh"
+#include "../warpzonelib/mathlib.qh"
 
 // prandom - PREDICTABLE random number generator (not seeded yet)
 
index f80da18..7ca2e54 100644 (file)
@@ -11,8 +11,8 @@ damage.qc
 effects.qc
 gibs.qc
 hook.qc
-hud_config.qc
 hud.qc
+hud_config.qc
 laser.qc
 main.qc
 mapvoting.qc
index c09dd18..4e32c0c 100644 (file)
@@ -1,8 +1,4 @@
-#if defined(CSQC)
-       #include "rubble.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "rubble.qh"
 
 // LordHavoc: rewrote this file, it was really bad code
 
index 9f0db01..e31656a 100644 (file)
@@ -1,17 +1,17 @@
 #include "scoreboard.qh"
 
 #include "autocvars.qh"
+#include "defs.qh"
+#include "hud.qh"
+#include "main.qh"
 #include "miscfunctions.qh"
+#include "sortlist.qh"
 #include "../common/constants.qh"
 #include "../common/counting.qh"
 #include "../common/mapinfo.qh"
 #include "../common/stats.qh"
 #include "../common/teams.qh"
 #include "../common/util.qh"
-#include "defs.qh"
-#include "hud.qh"
-#include "main.qh"
-#include "sortlist.qh"
 
 float scoreboard_alpha_bg;
 float scoreboard_alpha_fg;
index 7fe0e49..28b04b1 100644 (file)
@@ -1,19 +1,16 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "../common/constants.qh"
-       #include "../common/teams.qh"
-       #include "../common/util.qh"
-       #include "../common/mapinfo.qh"
-       #include "autocvars.qh"
-       #include "main.qh"
-       #include "../csqcmodellib/cl_model.qh"
-       #include "shownames.qh"
-       #include "hud.qh"
-       #include "miscfunctions.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "shownames.qh"
+
+#include "autocvars.qh"
+#include "defs.qh"
+#include "hud.qh"
+#include "main.qh"
+#include "miscfunctions.qh"
+#include "../common/constants.qh"
+#include "../common/mapinfo.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+#include "../csqcmodellib/cl_model.qh"
+#include "../dpdefs/csprogsdefs.qh"
 
 
 // self.isactive = player is in range and coordinates/status (health and armor) are up to date
index 989bca3..25ce2de 100644 (file)
@@ -3,8 +3,8 @@
 #include "autocvars.qh"
 #include "defs.qh"
 #include "main.qh"
-#include "../common/util.qh"
 #include "../common/constants.qh"
+#include "../common/util.qh"
 #include "../warpzonelib/common.qh"
 
 .string noise;
index 88b4339..3ea3a75 100644 (file)
@@ -1,15 +1,12 @@
-#if defined(CSQC)
-       #include "autocvars.qh"
-       #include "defs.qh"
-       #include "hud.qh"
-       #include "main.qh"
-       #include "miscfunctions.qh"
-       #include "teamradar.qh"
-       #include "../common/util.qh"
-       #include "../csqcmodellib/interpolate.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "teamradar.qh"
+
+#include "autocvars.qh"
+#include "defs.qh"
+#include "hud.qh"
+#include "main.qh"
+#include "miscfunctions.qh"
+#include "../common/util.qh"
+#include "../csqcmodellib/interpolate.qh"
 
 float vlen2d(vector v)
 {
index 9fb1b38..22bacdc 100644 (file)
@@ -2,14 +2,13 @@
 
 #include "autocvars.qh"
 #include "defs.qh"
-#include "main.qh"
 #include "hud.qh"
+#include "main.qh"
 #include "miscfunctions.qh"
-#include "waypointsprites.qh"
 #include "movetypes.qh"
 #include "prandom.qh"
 #include "teamradar.qh"
-
+#include "waypointsprites.qh"
 #include "../common/teams.qh"
 #include "../server/movelib.qh"
 #include "../warpzonelib/anglestransform.qh"
index 012f05e..1cc9072 100644 (file)
@@ -1,19 +1,20 @@
-#include "../../dpdefs/csprogsdefs.qh"
-#include "../../common/constants.qh"
-#include "../../common/stats.qh"
-#include "../../common/util.qh"
-#include "../../common/buffs.qh"
-#include "../../csqcmodellib/cl_model.qh"
-#include "../../server/t_items.qh"
+#include "vehicles.qh"
+
+#include "../autocvars.qh"
 #include "../defs.qh"
+#include "../main.qh"
 #include "../miscfunctions.qh"
 #include "../movetypes.qh"
-#include "../scoreboard.qh"
-#include "../autocvars.qh"
 #include "../movetypes.qh"
 #include "../prandom.qh"
-#include "../main.qh"
-#include "vehicles.qh"
+#include "../scoreboard.qh"
+#include "../../common/buffs.qh"
+#include "../../common/constants.qh"
+#include "../../common/stats.qh"
+#include "../../common/util.qh"
+#include "../../csqcmodellib/cl_model.qh"
+#include "../../dpdefs/csprogsdefs.qh"
+#include "../../server/t_items.qh"
 
 .float cnt;
 
index 0188dd7..8167cb1 100644 (file)
@@ -1,34 +1,30 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "../common/constants.qh"
-       #include "../common/stats.qh"
-       #include "../warpzonelib/mathlib.qh"
-       #include "../warpzonelib/common.qh"
-       #include "../warpzonelib/client.qh"
-       #include "../common/teams.qh"
-       #include "../common/util.qh"
-       #include "../common/nades.qh"
-       #include "../common/weapons/weapons.qh"
-       #include "../common/mapinfo.qh"
-       #include "autocvars.qh"
-       #include "announcer.qh"
-       #include "hud.qh"
-       #include "hud_config.qh"
-       #include "hook.qh"
-       #include "mapvoting.qh"
-       #include "miscfunctions.qh"
-       #include "scoreboard.qh"
-       #include "shownames.qh"
-       #include "target_music.qh"
-       #include "noise.qh"
-       #include "main.qh"
-       #include "waypointsprites.qh"
-       #include "vehicles/vehicles.qh"
-       #include "../csqcmodellib/cl_player.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "announcer.qh"
+#include "autocvars.qh"
+#include "defs.qh"
+#include "hook.qh"
+#include "hud.qh"
+#include "hud_config.qh"
+#include "main.qh"
+#include "mapvoting.qh"
+#include "miscfunctions.qh"
+#include "noise.qh"
+#include "scoreboard.qh"
+#include "shownames.qh"
+#include "target_music.qh"
+#include "vehicles/vehicles.qh"
+#include "waypointsprites.qh"
+#include "../common/constants.qh"
+#include "../common/mapinfo.qh"
+#include "../common/nades.qh"
+#include "../common/stats.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
+#include "../csqcmodellib/cl_player.qh"
+#include "../dpdefs/csprogsdefs.qh"
+#include "../warpzonelib/client.qh"
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/mathlib.qh"
 
 entity porto;
 vector polyline[16];
index e8a2311..0da47f9 100644 (file)
@@ -1,13 +1,14 @@
+#include "projectile.qh"
+
+#include "../autocvars.qh"
+#include "../defs.qh"
+#include "../main.qh"
+#include "../movetypes.qh"
 #include "../../common/constants.qh"
 #include "../../common/nades.qh"
 #include "../../common/util.qh"
 #include "../../csqcmodellib/interpolate.qh"
 #include "../../warpzonelib/anglestransform.qh"
-#include "../autocvars.qh"
-#include "../defs.qh"
-#include "../main.qh"
-#include "../movetypes.qh"
-#include "projectile.qh"
 
 .float alpha;
 .float scale;
index b976a4d..fb89384 100755 (executable)
@@ -3,18 +3,16 @@ set -eu
 cd "$(dirname "$0")"
 cd ..
 
-export QCC=../../../gmqcc/gmqcc
+declare QCC=../../../gmqcc/gmqcc
 
 function check() {
   declare -l base="$1"
   declare -la predefs=("${!2}")
-  find "$base" -type f -name '*.qc' -print0 | while IFS= read -r -d '' file; do
+  find "$base" -type f -name '*.qc' -print0 | sort -z | while IFS= read -r -d '' file; do
     echo "$file"
-    ${QCC} -std=gmqcc -fftepp ${predefs[@]} "$file" >/dev/null
+    ${QCC} -std=gmqcc -fftepp -fftepp-predefs -futf8 -O3 "${predefs[@]}" "$file" >/dev/null
   done
 }
 
-# TODO: `sort -V` all the includes
-
 clientdefs=("-DCSQC" "common/util-pre.qh" "dpdefs/csprogsdefs.qh")
 check client clientdefs[@]