From f716939956e0da16d20b18ea63b5a49b4038da15 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 13 Sep 2014 05:15:05 -0400 Subject: Add vld_ prefix for vldoor_e enum values. It was pointed out to me recently that vldoor_e has enum values named 'open' and 'close'. These can potentially conflict with POSIX standard functions that have the same names, if the right header files are included. This doesn't currently cause any problems. However, to avoid any possibility of a conflict occurring if a different compiler is used, add a vld_ prefix to all the enum values, to namespace them. --- src/heretic/p_doors.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/heretic/p_doors.c') diff --git a/src/heretic/p_doors.c b/src/heretic/p_doors.c index 9e244912..fcae83a1 100644 --- a/src/heretic/p_doors.c +++ b/src/heretic/p_doors.c @@ -45,11 +45,11 @@ void T_VerticalDoor(vldoor_t * door) if (!--door->topcountdown) switch (door->type) { - case normal: + case vld_normal: door->direction = -1; // time to go back down S_StartSound(&door->sector->soundorg, sfx_doropn); break; - case close30ThenOpen: + case vld_close30ThenOpen: door->direction = 1; S_StartSound(&door->sector->soundorg, sfx_doropn); break; @@ -62,9 +62,9 @@ void T_VerticalDoor(vldoor_t * door) { switch (door->type) { - case raiseIn5Mins: + case vld_raiseIn5Mins: door->direction = 1; - door->type = normal; + door->type = vld_normal; S_StartSound(&door->sector->soundorg, sfx_doropn); break; default: @@ -80,13 +80,13 @@ void T_VerticalDoor(vldoor_t * door) { switch (door->type) { - case normal: - case close: + case vld_normal: + case vld_close: door->sector->specialdata = NULL; P_RemoveThinker(&door->thinker); // unlink and free S_StartSound(&door->sector->soundorg, sfx_dorcls); break; - case close30ThenOpen: + case vld_close30ThenOpen: door->direction = 0; door->topcountdown = 35 * 30; break; @@ -98,7 +98,7 @@ void T_VerticalDoor(vldoor_t * door) { switch (door->type) { - case close: // DON'T GO BACK UP! + case vld_close: // DON'T GO BACK UP! break; default: door->direction = 1; @@ -114,12 +114,12 @@ void T_VerticalDoor(vldoor_t * door) { switch (door->type) { - case normal: + case vld_normal: door->direction = 0; // wait at top door->topcountdown = door->topwait; break; - case close30ThenOpen: - case open: + case vld_close30ThenOpen: + case vld_open: door->sector->specialdata = NULL; P_RemoveThinker(&door->thinker); // unlink and free S_StopSound(&door->sector->soundorg); @@ -165,19 +165,19 @@ int EV_DoDoor(line_t * line, vldoor_e type, fixed_t speed) door->sector = sec; switch (type) { - case close: + case vld_close: door->topheight = P_FindLowestCeilingSurrounding(sec); door->topheight -= 4 * FRACUNIT; door->direction = -1; S_StartSound(&door->sector->soundorg, sfx_doropn); break; - case close30ThenOpen: + case vld_close30ThenOpen: door->topheight = sec->ceilingheight; door->direction = -1; S_StartSound(&door->sector->soundorg, sfx_doropn); break; - case normal: - case open: + case vld_normal: + case vld_open: door->direction = 1; door->topheight = P_FindLowestCeilingSurrounding(sec); door->topheight -= 4 * FRACUNIT; @@ -313,13 +313,13 @@ void EV_VerticalDoor(line_t * line, mobj_t * thing) case 26: case 27: case 28: - door->type = normal; + door->type = vld_normal; break; case 31: case 32: case 33: case 34: - door->type = open; + door->type = vld_open; line->special = 0; break; } @@ -349,7 +349,7 @@ void P_SpawnDoorCloseIn30(sector_t * sec) door->thinker.function = T_VerticalDoor; door->sector = sec; door->direction = 0; - door->type = normal; + door->type = vld_normal; door->speed = VDOORSPEED; door->topcountdown = 30 * 35; } @@ -370,7 +370,7 @@ void P_SpawnDoorRaiseIn5Mins(sector_t * sec, int secnum) door->thinker.function = T_VerticalDoor; door->sector = sec; door->direction = 2; - door->type = raiseIn5Mins; + door->type = vld_raiseIn5Mins; door->speed = VDOORSPEED; door->topheight = P_FindLowestCeilingSurrounding(sec); door->topheight -= 4 * FRACUNIT; -- cgit v1.2.3