ref: a9feab0830ecdf0b3e52e9339522918e3f12226f
parent: c447a5da8c8087d94867560764b59f03d0e70b1d
author: Simon Howard <fraggle@gmail.com>
date: Sat Jun 16 12:02:58 EDT 2007
Shut up strict aliasing warnings Subversion-branch: /trunk/chocolate-doom Subversion-revision: 909
--- a/src/p_ceilng.c
+++ b/src/p_ceilng.c
@@ -73,8 +73,7 @@
case silentCrushAndRaise:
break;
default:
- S_StartSound((mobj_t *)&ceiling->sector->soundorg,
- sfx_stnmov);
+ S_StartSound(&ceiling->sector->soundorg, sfx_stnmov);
// ?
break;
}
@@ -89,8 +88,7 @@
break;
case silentCrushAndRaise:
- S_StartSound((mobj_t *)&ceiling->sector->soundorg,
- sfx_pstop);
+ S_StartSound(&ceiling->sector->soundorg, sfx_pstop);
case fastCrushAndRaise:
case crushAndRaise:
ceiling->direction = -1;
@@ -116,8 +114,7 @@
{
case silentCrushAndRaise: break;
default:
- S_StartSound((mobj_t *)&ceiling->sector->soundorg,
- sfx_stnmov);
+ S_StartSound(&ceiling->sector->soundorg, sfx_stnmov);
}
}
@@ -126,8 +123,7 @@
switch(ceiling->type)
{
case silentCrushAndRaise:
- S_StartSound((mobj_t *)&ceiling->sector->soundorg,
- sfx_pstop);
+ S_StartSound(&ceiling->sector->soundorg, sfx_pstop);
case crushAndRaise:
ceiling->speed = CEILSPEED;
case fastCrushAndRaise:
--- a/src/p_doors.c
+++ b/src/p_doors.c
@@ -76,20 +76,17 @@
{
case blazeRaise:
door->direction = -1; // time to go back down
- S_StartSound((mobj_t *)&door->sector->soundorg,
- sfx_bdcls);
+ S_StartSound(&door->sector->soundorg, sfx_bdcls);
break;
case normal:
door->direction = -1; // time to go back down
- S_StartSound((mobj_t *)&door->sector->soundorg,
- sfx_dorcls);
+ S_StartSound(&door->sector->soundorg, sfx_dorcls);
break;
case close30ThenOpen:
door->direction = 1;
- S_StartSound((mobj_t *)&door->sector->soundorg,
- sfx_doropn);
+ S_StartSound(&door->sector->soundorg, sfx_doropn);
break;
default:
@@ -107,8 +104,7 @@
case raiseIn5Mins:
door->direction = 1;
door->type = normal;
- S_StartSound((mobj_t *)&door->sector->soundorg,
- sfx_doropn);
+ S_StartSound(&door->sector->soundorg, sfx_doropn);
break;
default:
@@ -131,8 +127,7 @@
case blazeClose:
door->sector->specialdata = NULL;
P_RemoveThinker (&door->thinker); // unlink and free
- S_StartSound((mobj_t *)&door->sector->soundorg,
- sfx_bdcls);
+ S_StartSound(&door->sector->soundorg, sfx_bdcls);
break;
case normal:
@@ -160,8 +155,7 @@
default:
door->direction = 1;
- S_StartSound((mobj_t *)&door->sector->soundorg,
- sfx_doropn);
+ S_StartSound(&door->sector->soundorg, sfx_doropn);
break;
}
}
@@ -300,8 +294,7 @@
door->topheight -= 4*FRACUNIT;
door->direction = -1;
door->speed = VDOORSPEED * 4;
- S_StartSound((mobj_t *)&door->sector->soundorg,
- sfx_bdcls);
+ S_StartSound(&door->sector->soundorg, sfx_bdcls);
break;
case close:
@@ -308,15 +301,13 @@
door->topheight = P_FindLowestCeilingSurrounding(sec);
door->topheight -= 4*FRACUNIT;
door->direction = -1;
- S_StartSound((mobj_t *)&door->sector->soundorg,
- sfx_dorcls);
+ S_StartSound(&door->sector->soundorg, sfx_dorcls);
break;
case close30ThenOpen:
door->topheight = sec->ceilingheight;
door->direction = -1;
- S_StartSound((mobj_t *)&door->sector->soundorg,
- sfx_dorcls);
+ S_StartSound(&door->sector->soundorg, sfx_dorcls);
break;
case blazeRaise:
@@ -326,8 +317,7 @@
door->topheight -= 4*FRACUNIT;
door->speed = VDOORSPEED * 4;
if (door->topheight != sec->ceilingheight)
- S_StartSound((mobj_t *)&door->sector->soundorg,
- sfx_bdopn);
+ S_StartSound(&door->sector->soundorg, sfx_bdopn);
break;
case normal:
@@ -336,8 +326,7 @@
door->topheight = P_FindLowestCeilingSurrounding(sec);
door->topheight -= 4*FRACUNIT;
if (door->topheight != sec->ceilingheight)
- S_StartSound((mobj_t *)&door->sector->soundorg,
- sfx_doropn);
+ S_StartSound(&door->sector->soundorg, sfx_doropn);
break;
default:
@@ -443,16 +432,16 @@
{
case 117: // BLAZING DOOR RAISE
case 118: // BLAZING DOOR OPEN
- S_StartSound((mobj_t *)&sec->soundorg,sfx_bdopn);
+ S_StartSound(&sec->soundorg,sfx_bdopn);
break;
case 1: // NORMAL DOOR SOUND
case 31:
- S_StartSound((mobj_t *)&sec->soundorg,sfx_doropn);
+ S_StartSound(&sec->soundorg,sfx_doropn);
break;
default: // LOCKED DOOR SOUND
- S_StartSound((mobj_t *)&sec->soundorg,sfx_doropn);
+ S_StartSound(&sec->soundorg,sfx_doropn);
break;
}
--- a/src/p_floor.c
+++ b/src/p_floor.c
@@ -217,8 +217,7 @@
floor->crush,0,floor->direction);
if (!(leveltime&7))
- S_StartSound((mobj_t *)&floor->sector->soundorg,
- sfx_stnmov);
+ S_StartSound(&floor->sector->soundorg, sfx_stnmov);
if (res == pastdest)
{
@@ -248,8 +247,7 @@
}
P_RemoveThinker(&floor->thinker);
- S_StartSound((mobj_t *)&floor->sector->soundorg,
- sfx_pstop);
+ S_StartSound(&floor->sector->soundorg, sfx_pstop);
}
}
--- a/src/p_plats.c
+++ b/src/p_plats.c
@@ -66,8 +66,7 @@
|| plat->type == raiseToNearestAndChange)
{
if (!(leveltime&7))
- S_StartSound((mobj_t *)&plat->sector->soundorg,
- sfx_stnmov);
+ S_StartSound(&plat->sector->soundorg, sfx_stnmov);
}
@@ -75,8 +74,7 @@
{
plat->count = plat->wait;
plat->status = down;
- S_StartSound((mobj_t *)&plat->sector->soundorg,
- sfx_pstart);
+ S_StartSound(&plat->sector->soundorg, sfx_pstart);
}
else
{
@@ -84,8 +82,7 @@
{
plat->count = plat->wait;
plat->status = waiting;
- S_StartSound((mobj_t *)&plat->sector->soundorg,
- sfx_pstop);
+ S_StartSound(&plat->sector->soundorg, sfx_pstop);
switch(plat->type)
{
@@ -113,7 +110,7 @@
{
plat->count = plat->wait;
plat->status = waiting;
- S_StartSound((mobj_t *)&plat->sector->soundorg,sfx_pstop);
+ S_StartSound(&plat->sector->soundorg,sfx_pstop);
}
break;
@@ -124,7 +121,7 @@
plat->status = up;
else
plat->status = down;
- S_StartSound((mobj_t *)&plat->sector->soundorg,sfx_pstart);
+ S_StartSound(&plat->sector->soundorg,sfx_pstart);
}
case in_stasis:
break;
@@ -192,7 +189,7 @@
// NO MORE DAMAGE, IF APPLICABLE
sec->special = 0;
- S_StartSound((mobj_t *)&sec->soundorg,sfx_stnmov);
+ S_StartSound(&sec->soundorg,sfx_stnmov);
break;
case raiseAndChange:
@@ -202,7 +199,7 @@
plat->wait = 0;
plat->status = up;
- S_StartSound((mobj_t *)&sec->soundorg,sfx_stnmov);
+ S_StartSound(&sec->soundorg,sfx_stnmov);
break;
case downWaitUpStay:
@@ -215,7 +212,7 @@
plat->high = sec->floorheight;
plat->wait = 35*PLATWAIT;
plat->status = down;
- S_StartSound((mobj_t *)&sec->soundorg,sfx_pstart);
+ S_StartSound(&sec->soundorg,sfx_pstart);
break;
case blazeDWUS:
@@ -228,7 +225,7 @@
plat->high = sec->floorheight;
plat->wait = 35*PLATWAIT;
plat->status = down;
- S_StartSound((mobj_t *)&sec->soundorg,sfx_pstart);
+ S_StartSound(&sec->soundorg,sfx_pstart);
break;
case perpetualRaise:
@@ -246,7 +243,7 @@
plat->wait = 35*PLATWAIT;
plat->status = P_Random()&1;
- S_StartSound((mobj_t *)&sec->soundorg,sfx_pstart);
+ S_StartSound(&sec->soundorg,sfx_pstart);
break;
}
P_AddActivePlat(plat);
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -1165,7 +1165,7 @@
buttonlist[i].btexture;
break;
}
- S_StartSound((mobj_t *)&buttonlist[i].soundorg,sfx_swtchn);
+ S_StartSound(&buttonlist[i].soundorg,sfx_swtchn);
memset(&buttonlist[i],0,sizeof(button_t));
}
}
--- a/src/p_spec.h
+++ b/src/p_spec.h
@@ -235,7 +235,7 @@
bwhere_e where;
int btexture;
int btimer;
- mobj_t* soundorg;
+ degenmobj_t *soundorg;
} button_t;
--- a/src/p_switch.c
+++ b/src/p_switch.c
@@ -183,7 +183,7 @@
buttonlist[i].where = w;
buttonlist[i].btexture = texture;
buttonlist[i].btimer = time;
- buttonlist[i].soundorg = (mobj_t *)&line->frontsector->soundorg;
+ buttonlist[i].soundorg = &line->frontsector->soundorg;
return;
}
}