From 95a61a226be02dac53b1b8938fba486e64979327 Mon Sep 17 00:00:00 2001 From: Nev3r Date: Tue, 10 Nov 2020 12:22:55 +0100 Subject: [PATCH] rename TAG_ITER_C to TAG_ITER_DECLARECOUNTER and remove the semicolon from the macro. --- src/p_ceilng.c | 4 ++-- src/p_floor.c | 22 +++++++++++----------- src/p_lights.c | 2 +- src/p_mobj.c | 4 ++-- src/p_setup.c | 4 ++-- src/p_slopes.c | 2 +- src/p_spec.c | 20 ++++++++++---------- src/taglist.h | 2 +- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/p_ceilng.c b/src/p_ceilng.c index f355ee011..0cea8c52f 100644 --- a/src/p_ceilng.c +++ b/src/p_ceilng.c @@ -395,7 +395,7 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type) sector_t *sec; ceiling_t *ceiling; mtag_t tag = Tag_FGet(&line->tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; TAG_ITER_SECTORS(tag, secnum) { @@ -617,7 +617,7 @@ INT32 EV_DoCrush(line_t *line, ceiling_e type) sector_t *sec; ceiling_t *ceiling; mtag_t tag = Tag_FGet(&line->tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; TAG_ITER_SECTORS(tag, secnum) { diff --git a/src/p_floor.c b/src/p_floor.c index 198148549..98a26039a 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -635,7 +635,7 @@ void T_BounceCheese(bouncecheese_t *bouncer) boolean remove; INT32 i; mtag_t tag = Tag_FGet(&bouncer->sourceline->tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; if (bouncer->sector->crumblestate == CRUMBLE_RESTORE || bouncer->sector->crumblestate == CRUMBLE_WAIT || bouncer->sector->crumblestate == CRUMBLE_ACTIVATED) // Oops! Crumbler says to remove yourself! @@ -775,7 +775,7 @@ void T_StartCrumble(crumble_t *crumble) sector_t *sector; INT32 i; mtag_t tag = Tag_FGet(&crumble->sourceline->tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; // Once done, the no-return thinker just sits there, // constantly 'returning'... kind of an oxymoron, isn't it? @@ -948,7 +948,7 @@ void T_StartCrumble(crumble_t *crumble) void T_MarioBlock(mariothink_t *block) { INT32 i; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; T_MovePlane ( @@ -1295,7 +1295,7 @@ void T_NoEnemiesSector(noenemies_t *nobaddies) INT32 secnum = -1; boolean FOFsector = false; mtag_t tag = Tag_FGet(&nobaddies->sourceline->tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; TAG_ITER_SECTORS(tag, secnum) { @@ -1308,7 +1308,7 @@ void T_NoEnemiesSector(noenemies_t *nobaddies) { INT32 targetsecnum = -1; mtag_t tag2 = Tag_FGet(&sec->lines[i]->tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; if (sec->lines[i]->special < 100 || sec->lines[i]->special >= 300) continue; @@ -1402,7 +1402,7 @@ void T_EachTimeThinker(eachtime_t *eachtime) fixed_t bottomheight, topheight; ffloor_t *rover; mtag_t tag = Tag_FGet(&eachtime->sourceline->tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; for (i = 0; i < MAXPLAYERS; i++) { @@ -1430,7 +1430,7 @@ void T_EachTimeThinker(eachtime_t *eachtime) { INT32 targetsecnum = -1; mtag_t tag2 = Tag_FGet(&sec->lines[i]->tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; if (sec->lines[i]->special < 100 || sec->lines[i]->special >= 300) continue; @@ -1572,7 +1572,7 @@ void T_RaiseSector(raise_t *raise) INT32 direction; result_e res = 0; mtag_t tag = raise->tag; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; if (raise->sector->crumblestate >= CRUMBLE_FALL || raise->sector->ceilingdata) return; @@ -1822,7 +1822,7 @@ void EV_DoFloor(line_t *line, floor_e floortype) sector_t *sec; floormove_t *dofloor; mtag_t tag = Tag_FGet(&line->tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; TAG_ITER_SECTORS(tag, secnum) { @@ -2039,7 +2039,7 @@ void EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed) sector_t *sec; elevator_t *elevator; mtag_t tag = Tag_FGet(&line->tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; // act on all sectors with the same tag as the triggering linedef TAG_ITER_SECTORS(tag, secnum) @@ -2339,7 +2339,7 @@ INT32 EV_StartCrumble(sector_t *sec, ffloor_t *rover, boolean floating, sector_t *foundsec; INT32 i; mtag_t tag = Tag_FGet(&rover->master->tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; // If floor is already activated, skip it if (sec->floordata) diff --git a/src/p_lights.c b/src/p_lights.c index bb8ef6989..326549477 100644 --- a/src/p_lights.c +++ b/src/p_lights.c @@ -374,7 +374,7 @@ void P_FadeLightBySector(sector_t *sector, INT32 destvalue, INT32 speed, boolean void P_FadeLight(INT16 tag, INT32 destvalue, INT32 speed, boolean ticbased, boolean force) { INT32 i; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; // search all sectors for ones with tag TAG_ITER_SECTORS(tag, i) diff --git a/src/p_mobj.c b/src/p_mobj.c index 61a376729..2ae24b402 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4631,7 +4631,7 @@ static boolean P_Boss4MoveCage(mobj_t *mobj, fixed_t delta) INT32 snum; sector_t *sector; boolean gotcage = false; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; TAG_ITER_SECTORS(tag, snum) { @@ -4717,7 +4717,7 @@ static void P_Boss4DestroyCage(mobj_t *mobj) size_t a; sector_t *sector, *rsec; ffloor_t *rover; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; TAG_ITER_SECTORS(tag, snum) { diff --git a/src/p_setup.c b/src/p_setup.c index 87fb2ac0d..dd49ae0be 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2971,7 +2971,7 @@ static void P_ConvertBinaryMap(void) INT32 check = -1; INT32 paramline = -1; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; TAG_ITER_LINES(tag, check) { @@ -3188,7 +3188,7 @@ static void P_ConvertBinaryMap(void) INT32 firstline = -1; mtag_t tag = mapthings[i].angle; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; Tag_FSet(&mapthings[i].tags, tag); diff --git a/src/p_slopes.c b/src/p_slopes.c index 412d13dd2..80278451a 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -546,7 +546,7 @@ static boolean P_SetSlopeFromTag(sector_t *sec, INT32 tag, boolean ceiling) { INT32 i; pslope_t **secslope = ceiling ? &sec->c_slope : &sec->f_slope; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; if (!tag || *secslope) return false; diff --git a/src/p_spec.c b/src/p_spec.c index 39d7e9223..0746c65b0 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2223,7 +2223,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) INT32 secnum = -1; mobj_t *bot = NULL; mtag_t tag = Tag_FGet(&line->tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; I_Assert(!mo || !P_MobjWasRemoved(mo)); // If mo is there, mo must be valid! @@ -3887,7 +3887,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) case 465: // Set linedef executor delay { INT32 linenum; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; if (!udmf) break; @@ -5922,7 +5922,7 @@ void T_LaserFlash(laserthink_t *flash) sector_t *sector; sector_t *sourcesec = flash->sourceline->frontsector; fixed_t top, bottom; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; TAG_ITER_SECTORS(flash->tag, s) { @@ -6204,7 +6204,7 @@ void P_SpawnSpecials(boolean fromnetsave) INT32 s; size_t sec; ffloortype_e ffloorflags; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; case 1: // Definable gravity per sector sec = sides[*lines[i].sidenum].sector - sectors; @@ -7098,7 +7098,7 @@ void P_SpawnSpecials(boolean fromnetsave) */ static void P_AddFakeFloorsByLine(size_t line, ffloortype_e ffloorflags, thinkerlist_t *secthinkers) { - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; INT32 s; mtag_t tag = Tag_FGet(&lines[line].tags); size_t sec = sides[*lines[line].sidenum].sector-sectors; @@ -7214,7 +7214,7 @@ void T_Scroll(scroll_t *s) size_t i; INT32 sect; ffloor_t *rover; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; case sc_side: // scroll wall texture side = sides + s->affectee; @@ -7466,7 +7466,7 @@ static void P_SpawnScrollers(void) switch (special) { register INT32 s; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; case 513: // scroll effect ceiling case 533: // scroll and carry objects on ceiling @@ -7604,7 +7604,7 @@ void T_Disappear(disappear_t *d) ffloor_t *rover; register INT32 s; mtag_t afftag = Tag_FGet(&lines[d->affectee].tags); - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; TAG_ITER_SECTORS(afftag, s) { @@ -8337,7 +8337,7 @@ static void P_SpawnFriction(void) fixed_t strength; // frontside texture offset controls magnitude fixed_t friction; // friction value to be applied during movement INT32 movefactor; // applied to each player move to simulate inertia - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; for (i = 0; i < numlines; i++, l++) if (l->special == 540) @@ -8882,7 +8882,7 @@ static void P_SpawnPushers(void) mtag_t tag; register INT32 s; mobj_t *thing; - TAG_ITER_C + TAG_ITER_DECLARECOUNTER; for (i = 0; i < numlines; i++, l++) { diff --git a/src/taglist.h b/src/taglist.h index ab69787dd..caf99b807 100644 --- a/src/taglist.h +++ b/src/taglist.h @@ -61,7 +61,7 @@ INT32 Tag_FindLineSpecial(const INT16 special, const mtag_t tag); INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start); // Use this macro to declare the iterator position variable. -#define TAG_ITER_C size_t tag_iterator_pos; +#define TAG_ITER_DECLARECOUNTER size_t tag_iterator_pos #define TAG_ITER(fn, tag, id) for(tag_iterator_pos = 0; (id = fn(tag, tag_iterator_pos)) >= 0; tag_iterator_pos++)