From 9cb8f5c0cdd70570f3694d8f0ccb079753c78e7c Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 25 Jan 2015 15:26:33 +1100 Subject: [PATCH] Work around a gmqcc bug --- qcsrc/client/View.qc | 2 +- qcsrc/client/bgmscript.qc | 2 +- qcsrc/client/hud.qc | 2 +- qcsrc/client/sortlist.qc | 2 +- qcsrc/common/mapinfo.qc | 8 ++++---- qcsrc/common/notifications.qc | 2 +- qcsrc/common/util.qc | 2 +- qcsrc/menu/item/listbox.qc | 6 +++--- qcsrc/menu/xonotic/colorpicker.qc | 2 +- qcsrc/server/bot/havocbot/role_onslaught.qc | 4 ++-- qcsrc/server/bot/navigation.qc | 6 +++--- qcsrc/server/bot/scripting.qc | 2 +- qcsrc/server/bot/waypoints.qc | 2 +- qcsrc/server/command/sv_cmd.qc | 12 ++++++------ qcsrc/server/command/vote.qc | 2 +- qcsrc/server/g_subs.qc | 2 +- qcsrc/server/g_tetris.qc | 2 +- qcsrc/server/g_world.qc | 2 +- qcsrc/server/miscfunctions.qc | 4 ++-- qcsrc/server/mutators/gamemode_assault.qc | 2 +- qcsrc/server/mutators/sandbox.qc | 2 +- qcsrc/server/scores.qc | 2 +- qcsrc/server/weapons/tracing.qc | 2 +- qcsrc/warpzonelib/common.qc | 4 ++-- qcsrc/warpzonelib/server.qc | 2 +- 25 files changed, 40 insertions(+), 40 deletions(-) diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 013fd2ee1..59382a80e 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -31,7 +31,7 @@ void Porto_Draw() portal_number = 0; nextdir = dir; - for(;;) + for(0;;) { dir = nextdir; traceline(p, p + 65536 * dir, TRUE, porto); diff --git a/qcsrc/client/bgmscript.qc b/qcsrc/client/bgmscript.qc index 9d024941e..800e89972 100644 --- a/qcsrc/client/bgmscript.qc +++ b/qcsrc/client/bgmscript.qc @@ -195,7 +195,7 @@ float BGMScript(entity e) } // find the CURRENT line - for(;;) + for(0;;) { tokenize_console(bufstr_get(bgmscriptbuf, e.bgmscriptline)); if(stof(argv(1)) >= bgmtime || argv(0) != e.bgmscript) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 33d7f9f5c..067770c51 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -3769,7 +3769,7 @@ void HUD_InfoMessages(void) tm = teams.sort_next; if (tm) { - for(; tm.sort_next; tm = tm.sort_next) + for(0; tm.sort_next; tm = tm.sort_next) { if(!tm.team_size || tm.team == NUM_SPECTATOR) continue; diff --git a/qcsrc/client/sortlist.qc b/qcsrc/client/sortlist.qc index 225df0ce0..8537dd336 100644 --- a/qcsrc/client/sortlist.qc +++ b/qcsrc/client/sortlist.qc @@ -92,7 +92,7 @@ void Sort_Finish(entity sort) entity Sort_Get(entity sort, float i) { - for(; sort.sort_next && i > 0; --i) + for(0; sort.sort_next && i > 0; --i) sort = sort.sort_next; return sort; } diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 0e8402979..2654d8706 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -255,7 +255,7 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp mapMins = '0 0 0'; mapMaxs = '0 0 0'; - for(;;) + for(0;;) { if (!((s = fgets(fh)))) break; @@ -789,7 +789,7 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s, print("Map ", pFilename, " references not existing config file ", s, "\n"); else { - for(;;) + for(0;;) { if (!((s = fgets(fh)))) break; @@ -932,7 +932,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p { n = tokenize_console(cvar_string("g_cdtracks_remaplist")); s = strcat(" ", cvar_string("g_cdtracks_dontusebydefault"), " "); - for(;;) + for(0;;) { i = floor(random() * n); if(strstrofs(s, strcat(" ", argv(i), " "), 0) < 0) @@ -980,7 +980,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p } _MapInfo_Map_Reset(); - for(;;) + for(0;;) { if (!((s = fgets(fh)))) break; diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 3e2de3eab..5bb9fcdd5 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -306,7 +306,7 @@ string Process_Notif_Args( string selected, remaining = args; float sel_num = 0; - for(;(remaining != "");) + for(0;(remaining != "");) { selected = car(remaining); remaining = cdr(remaining); diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index e5eadc452..9e022a8ad 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -2538,7 +2538,7 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t queue_end.FindConnectedComponent_processing = 1; // for each queued item: - for(; queue_start; queue_start = queue_start.fld) + for(0; queue_start; queue_start = queue_start.fld) { // find all neighbors of queue_start entity t; diff --git a/qcsrc/menu/item/listbox.qc b/qcsrc/menu/item/listbox.qc index 275b99735..b92beb3d1 100644 --- a/qcsrc/menu/item/listbox.qc +++ b/qcsrc/menu/item/listbox.qc @@ -131,7 +131,7 @@ float ListBox_keyDown(entity me, float key, float ascii, float shift) { float i = me.selectedItem; float a = me.getItemHeight(me, i); - for(;;) + for(0;;) { --i; if (i < 0) @@ -146,7 +146,7 @@ float ListBox_keyDown(entity me, float key, float ascii, float shift) { float i = me.selectedItem; float a = me.getItemHeight(me, i); - for(;;) + for(0;;) { ++i; if (i >= me.nItems) @@ -369,7 +369,7 @@ void ListBox_draw(entity me) float y; i = me.getItemAtPos(me, me.scrollPos); y = me.getItemStart(me, i) - me.scrollPos; - for(; i < me.nItems && y < 1; ++i) + for(0; i < me.nItems && y < 1; ++i) { draw_shift = boxToGlobal(eY * y, oldshift, oldscale); vector relSize = eX * (1 - me.controlWidth) + eY * me.getItemHeight(me, i); diff --git a/qcsrc/menu/xonotic/colorpicker.qc b/qcsrc/menu/xonotic/colorpicker.qc index e0727373c..6e55a585e 100644 --- a/qcsrc/menu/xonotic/colorpicker.qc +++ b/qcsrc/menu/xonotic/colorpicker.qc @@ -73,7 +73,7 @@ vector color_hslimage(vector v, vector margin) float XonoticColorpicker_mouseDrag(entity me, vector coords) { float i, carets; - for(;;) + for(0;;) { i = me.controlledTextbox.cursorPos; if(i >= 2) diff --git a/qcsrc/server/bot/havocbot/role_onslaught.qc b/qcsrc/server/bot/havocbot/role_onslaught.qc index bf5a64389..c9bf60982 100644 --- a/qcsrc/server/bot/havocbot/role_onslaught.qc +++ b/qcsrc/server/bot/havocbot/role_onslaught.qc @@ -118,7 +118,7 @@ void havocbot_goalrating_ons_controlpoints_attack(float ratingscale) cp1 = cp2 = findchain(classname, "onslaught_controlpoint"); // Filter control points - for (; cp2; cp2 = cp2.chain) + for(0; cp2; cp2 = cp2.chain) { cp2.wpcost = c = 0; cp2.wpconsidered = FALSE; @@ -154,7 +154,7 @@ void havocbot_goalrating_ons_controlpoints_attack(float ratingscale) // We'll consider only the best case bestvalue = 99999999999; cp = world; - for (; cp1; cp1 = cp1.chain) + for(0; cp1; cp1 = cp1.chain) { if (!cp1.wpconsidered) continue; diff --git a/qcsrc/server/bot/navigation.qc b/qcsrc/server/bot/navigation.qc index 0f4c330ed..d676c8eb3 100644 --- a/qcsrc/server/bot/navigation.qc +++ b/qcsrc/server/bot/navigation.qc @@ -64,7 +64,7 @@ float tracewalk(entity e, vector start, vector m1, vector m2, vector end, float // Movement loop yaw = vectoyaw(move); move = end - org; - for (;;) + for(0;;) { if (boxesoverlap(end, end, org + m1 + '-1 -1 -1', org + m2 + '1 1 1')) { @@ -108,7 +108,7 @@ float tracewalk(entity e, vector start, vector m1, vector m2, vector end, float { swimming = TRUE; org = trace_endpos - normalize(org - trace_endpos) * stepdist; - for(; org_z < end_z + self.maxs_z; org_z += stepdist) + for(0; org_z < end_z + self.maxs_z; org_z += stepdist) { if(autocvar_bot_debug_tracewalk) debugnode(org); @@ -880,7 +880,7 @@ float navigation_routetogoal(entity e, vector startposition) if(e == world) return FALSE; - for (;;) + for(0;;) { // add the spawnfunc_waypoint to the path navigation_pushroute(e); diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index 1770b4c63..99c2ba830 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -39,7 +39,7 @@ void bot_queuecommand(entity bot, string cmdstring) if(cmdstr == "sound") { // find the LAST word - for(;;) + for(0;;) { sp = strstrofs(parm, " ", 0); if(sp < 0) diff --git a/qcsrc/server/bot/waypoints.qc b/qcsrc/server/bot/waypoints.qc index 870a558c5..d7159c159 100644 --- a/qcsrc/server/bot/waypoints.qc +++ b/qcsrc/server/bot/waypoints.qc @@ -985,7 +985,7 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en tmin = 0; tmax = 1; - for(;;) + for(0;;) { if(tmax - tmin < 0.001) { diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 27ed6b869..ad4f4da52 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -85,7 +85,7 @@ void GameCommand_adminmsg(float request, float argc) if((targets) && (admin_message)) { - for(;targets;) + for(0;targets;) { t = car(targets); targets = cdr(targets); @@ -1024,7 +1024,7 @@ void GameCommand_moveplayer(float request, float argc) // lets see if the target(s) even actually exist. if((targets) && (destination)) { - for(;targets;) + for(0;targets;) { t = car(targets); targets = cdr(targets); @@ -1376,7 +1376,7 @@ void GameCommand_shuffleteams(float request) // build a list of the players in a random order FOR_EACH_PLAYER(tmp_player) { - for(;;) + for(0;;) { i = bound(1, floor(random() * maxclients) + 1, maxclients); @@ -1518,7 +1518,7 @@ void GameCommand_trace(float request, float argc) float hitcount = 0; print("TEST CASE. If this returns the runaway loop counter error, possibly everything is oaky.\n"); float worst_endpos_bug = 0; - for(;;) + for(0;;) { org = world.mins; delta = world.maxs - world.mins; @@ -1547,7 +1547,7 @@ void GameCommand_trace(float request, float argc) // how much do we need to back off? safe = 1; unsafe = 0; - for(;;) + for(0;;) { pos = p * (1 - (safe + unsafe) * 0.5) + start * ((safe + unsafe) * 0.5); tracebox(pos, PL_MIN, PL_MAX, pos, MOVE_NOMONSTERS, world); @@ -1581,7 +1581,7 @@ void GameCommand_trace(float request, float argc) q0 = p; dq = 0; dqf = 1; - for(;;) + for(0;;) { q = p + normalize(end - p) * (dq + dqf); if(q == q0) diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 214083eae..fb09b7e9a 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -615,7 +615,7 @@ float VoteCommand_checkargs(float startpos, float argc) p = strstrofs(cmdrestriction, ";", 0); // find first semicolon - for(;;) + for(0;;) { // we know that at any time, startpos <= argc - minargs // so this means: argc-minargs >= startpos >= argc, thus diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index fd0dc7861..7f8fc68d3 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -554,7 +554,7 @@ float tracebox_inverted (vector v1, vector mi, vector ma, vector v2, float nomon float c; c = 0; - for(;;) + for(0;;) { if(pos * dir >= v2 * dir) { diff --git a/qcsrc/server/g_tetris.qc b/qcsrc/server/g_tetris.qc index f0ea33b61..72e2fbda0 100644 --- a/qcsrc/server/g_tetris.qc +++ b/qcsrc/server/g_tetris.qc @@ -894,7 +894,7 @@ void CompletedLines() cleared = 0; y = TET_LINES; - for(;;) + for(0;;) { ln = GetLine(y); if(strstrofs(ln, "0", 0) < 0) diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 2a706754b..1962d63c5 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -439,7 +439,7 @@ void detect_maptype() vector o, v; float i; - for(;;) + for(0;;) { o = world.mins; o_x += random() * (world.maxs_x - world.mins_x); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 803561245..43ebb25d1 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1045,7 +1045,7 @@ const float SND_LARGESOUND = 16; float sound_allowed(float dest, entity e) { // sounds from world may always pass - for (;;) + for(0;;) { if (e.classname == "body") e = e.enemy; @@ -1484,7 +1484,7 @@ void InitializeEntity(entity e, void(void) func, float order) cur = initialize_entity_first; prev = world; - for (;;) + for(0;;) { if (!cur || cur.initialize_entity_order > order) { diff --git a/qcsrc/server/mutators/gamemode_assault.qc b/qcsrc/server/mutators/gamemode_assault.qc index 8a8c50b38..a62460e22 100644 --- a/qcsrc/server/mutators/gamemode_assault.qc +++ b/qcsrc/server/mutators/gamemode_assault.qc @@ -338,7 +338,7 @@ void havocbot_goalrating_ast_targets(float ratingscale) ad = findchain(classname, "func_assault_destructible"); - for (; ad; ad = ad.chain) + for(0; ad; ad = ad.chain) { if (ad.target == "") continue; diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index e84c6d696..dec1bf3dd 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -393,7 +393,7 @@ void sandbox_Database_Load() } else { - for(;;) + for(0;;) { file_read = fgets(file_get); if(file_read == "") diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index bd83f0b69..d1a832ed7 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -833,7 +833,7 @@ void Score_NicePrint_Player(entity to, entity p, float w) sk = p.scorekeeper; s = strcat(s, p.netname); - for(;;) + for(0;;) { i = strlennocol(s) - NAMEWIDTH; if(i > 0) diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index 55e6d5415..dfe318cf0 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -363,7 +363,7 @@ void fireBullet(vector start, vector dir, float spread, float max_solid_penetrat WarpZone_trace_forent = self; - for (;;) + for(0;;) { // TODO also show effect while tracing WarpZone_TraceBox_ThroughZone(start, '0 0 0', '0 0 0', end, FALSE, WarpZone_trace_forent, world, fireBullet_trace_callback); diff --git a/qcsrc/warpzonelib/common.qc b/qcsrc/warpzonelib/common.qc index c1b3614c1..222d667ee 100644 --- a/qcsrc/warpzonelib/common.qc +++ b/qcsrc/warpzonelib/common.qc @@ -263,7 +263,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, sol = -1; frac = 0; i = 16; - for(;;) + for(0;;) { if(--i < 1) { @@ -386,7 +386,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo } WarpZone_MakeAllSolid(); i = 16; - for(;;) + for(0;;) { if(--i < 1) { diff --git a/qcsrc/warpzonelib/server.qc b/qcsrc/warpzonelib/server.qc index 4b18d381b..7e83c3549 100644 --- a/qcsrc/warpzonelib/server.qc +++ b/qcsrc/warpzonelib/server.qc @@ -834,7 +834,7 @@ void WarpZone_StartFrame() if(IS_NOT_A_CLIENT(e)) { if(warpzone_warpzones_exist) - for(; (e = nextent(e)); ) + for(0; (e = nextent(e)); ) WarpZone_StoreProjectileData(e); break; } -- 2.39.2