foxygit / doom Log in
commit 828b09914106de7dc00199fa810278e12988324b
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sun Nov 23 17:39:11 2008 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sun Nov 23 17:39:11 2008 +0000

    Shut up compiler warnings in Heretic code.

    Subversion-branch: /branches/raven-branch
    Subversion-revision: 1385
---
 src/heretic/p_ceilng.c |  4 ++--
 src/heretic/p_doors.c  | 31 +++++++++++++------------------
 src/heretic/p_floor.c  |  4 ++--
 src/heretic/p_plats.c  | 22 +++++++++++-----------
 src/heretic/p_spec.c   |  2 +-
 src/heretic/p_spec.h   |  2 +-
 src/heretic/p_switch.c |  2 +-
 src/heretic/s_sound.c  |  9 ++++++---
 src/heretic/s_sound.h  |  6 +++---
 src/heretic/sb_bar.c   |  1 +
 10 files changed, 41 insertions(+), 42 deletions(-)

diff --git a/src/heretic/p_ceilng.c b/src/heretic/p_ceilng.c
index 71b7b4b5..bf7ef676 100644
--- a/src/heretic/p_ceilng.c
+++ b/src/heretic/p_ceilng.c
@@ -55,7 +55,7 @@ void T_MoveCeiling(ceiling_t * ceiling)
                               ceiling->topheight, false, 1,
                               ceiling->direction);
             if (!(leveltime & 7))
-                S_StartSound((mobj_t *) & ceiling->sector->soundorg,
+                S_StartSound(&ceiling->sector->soundorg,
                              sfx_dormov);
             if (res == pastdest)
                 switch (ceiling->type)
@@ -76,7 +76,7 @@ void T_MoveCeiling(ceiling_t * ceiling)
                               ceiling->bottomheight, ceiling->crush, 1,
                               ceiling->direction);
             if (!(leveltime & 7))
-                S_StartSound((mobj_t *) & ceiling->sector->soundorg,
+                S_StartSound(&ceiling->sector->soundorg,
                              sfx_dormov);
             if (res == pastdest)
                 switch (ceiling->type)
diff --git a/src/heretic/p_doors.c b/src/heretic/p_doors.c
index 303922c8..e0e82fbe 100644
--- a/src/heretic/p_doors.c
+++ b/src/heretic/p_doors.c
@@ -54,13 +54,11 @@ void T_VerticalDoor(vldoor_t * door)
                 {
                     case normal:
                         door->direction = -1;   // time to go back down
-                        S_StartSound((mobj_t *)
-                                     & door->sector->soundorg, sfx_doropn);
+                        S_StartSound(&door->sector->soundorg, sfx_doropn);
                         break;
                     case close30ThenOpen:
                         door->direction = 1;
-                        S_StartSound((mobj_t *)
-                                     & door->sector->soundorg, sfx_doropn);
+                        S_StartSound(&door->sector->soundorg, sfx_doropn);
                         break;
                     default:
                         break;
@@ -74,8 +72,7 @@ void T_VerticalDoor(vldoor_t * door)
                     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:
                         break;
@@ -94,8 +91,7 @@ void T_VerticalDoor(vldoor_t * door)
                     case close:
                         door->sector->specialdata = NULL;
                         P_RemoveThinker(&door->thinker);        // unlink and free
-                        S_StartSound((mobj_t *)
-                                     & door->sector->soundorg, sfx_dorcls);
+                        S_StartSound(&door->sector->soundorg, sfx_dorcls);
                         break;
                     case close30ThenOpen:
                         door->direction = 0;
@@ -113,8 +109,7 @@ void T_VerticalDoor(vldoor_t * door)
                         break;
                     default:
                         door->direction = 1;
-                        S_StartSound((mobj_t *)
-                                     & door->sector->soundorg, sfx_doropn);
+                        S_StartSound(&door->sector->soundorg, sfx_doropn);
                         break;
                 }
             }
@@ -134,7 +129,7 @@ void T_VerticalDoor(vldoor_t * door)
                     case open:
                         door->sector->specialdata = NULL;
                         P_RemoveThinker(&door->thinker);        // unlink and free
-                        S_StopSound((mobj_t *) & door->sector->soundorg);
+                        S_StopSound(&door->sector->soundorg);
                         break;
                     default:
                         break;
@@ -181,12 +176,12 @@ int EV_DoDoor(line_t * line, vldoor_e type, fixed_t speed)
                 door->topheight = P_FindLowestCeilingSurrounding(sec);
                 door->topheight -= 4 * FRACUNIT;
                 door->direction = -1;
-                S_StartSound((mobj_t *) & door->sector->soundorg, sfx_doropn);
+                S_StartSound(&door->sector->soundorg, sfx_doropn);
                 break;
             case close30ThenOpen:
                 door->topheight = sec->ceilingheight;
                 door->direction = -1;
-                S_StartSound((mobj_t *) & door->sector->soundorg, sfx_doropn);
+                S_StartSound(&door->sector->soundorg, sfx_doropn);
                 break;
             case normal:
             case open:
@@ -195,7 +190,7 @@ int EV_DoDoor(line_t * line, vldoor_e type, fixed_t speed)
                 door->topheight -= 4 * FRACUNIT;
                 if (door->topheight != sec->ceilingheight)
                 {
-                    S_StartSound((mobj_t *) & door->sector->soundorg,
+                    S_StartSound(&door->sector->soundorg,
                                  sfx_doropn);
                 }
                 break;
@@ -303,12 +298,12 @@ void EV_VerticalDoor(line_t * line, mobj_t * thing)
     {
         case 1:                // NORMAL DOOR SOUND
         case 31:
-            S_StartSound((mobj_t *) & sec->soundorg, sfx_doropn);
-            //S_StartSound((mobj_t *)&sec->soundorg, sfx_dormov);
+            S_StartSound(&sec->soundorg, sfx_doropn);
+            //S_StartSound(&sec->soundorg, sfx_dormov);
             break;
         default:               // LOCKED DOOR SOUND
-            S_StartSound((mobj_t *) & sec->soundorg, sfx_doropn);
-            //S_StartSound((mobj_t *)&sec->soundorg, sfx_dormov);
+            S_StartSound(&sec->soundorg, sfx_doropn);
+            //S_StartSound(&sec->soundorg, sfx_dormov);
             break;
     }

diff --git a/src/heretic/p_floor.c b/src/heretic/p_floor.c
index b91cc06b..24c7ffa2 100644
--- a/src/heretic/p_floor.c
+++ b/src/heretic/p_floor.c
@@ -196,7 +196,7 @@ void T_MoveFloor(floormove_t * floor)
                       floor->direction);
     if (!(leveltime & 7))
     {
-        S_StartSound((mobj_t *) & floor->sector->soundorg, sfx_dormov);
+        S_StartSound(&floor->sector->soundorg, sfx_dormov);
     }

     if (res == pastdest)
@@ -204,7 +204,7 @@ void T_MoveFloor(floormove_t * floor)
         floor->sector->specialdata = NULL;
         if (floor->type == raiseBuildStep)
         {
-            S_StartSound((mobj_t *) & floor->sector->soundorg, sfx_pstop);
+            S_StartSound(&floor->sector->soundorg, sfx_pstop);
         }
         if (floor->direction == 1)
             switch (floor->type)
diff --git a/src/heretic/p_plats.c b/src/heretic/p_plats.c
index fe7b2061..23aa99d9 100644
--- a/src/heretic/p_plats.c
+++ b/src/heretic/p_plats.c
@@ -49,14 +49,14 @@ void T_PlatRaise(plat_t * plat)
                               plat->high, plat->crush, 0, 1);
             if (!(leveltime & 31))
             {
-                S_StartSound((mobj_t *) & plat->sector->soundorg, sfx_stnmov);
+                S_StartSound(&plat->sector->soundorg, sfx_stnmov);
             }
             if (plat->type == raiseAndChange
                 || plat->type == raiseToNearestAndChange)
             {
                 if (!(leveltime & 7))
                 {
-                    S_StartSound((mobj_t *) & plat->sector->soundorg,
+                    S_StartSound(&plat->sector->soundorg,
                                  sfx_stnmov);
                 }
             }
@@ -64,13 +64,13 @@ void T_PlatRaise(plat_t * plat)
             {
                 plat->count = plat->wait;
                 plat->status = down;
-                S_StartSound((mobj_t *) & plat->sector->soundorg, sfx_pstart);
+                S_StartSound(&plat->sector->soundorg, sfx_pstart);
             }
             else if (res == pastdest)
             {
                 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)
                 {
                     case downWaitUpStay:
@@ -92,13 +92,13 @@ void T_PlatRaise(plat_t * plat)
             {
                 plat->count = plat->wait;
                 plat->status = waiting;
-                S_StartSound((mobj_t *) & plat->sector->soundorg, sfx_pstop);
+                S_StartSound(&plat->sector->soundorg, sfx_pstop);
             }
             else
             {
                 if (!(leveltime & 31))
                 {
-                    S_StartSound((mobj_t *) & plat->sector->soundorg,
+                    S_StartSound(&plat->sector->soundorg,
                                  sfx_stnmov);
                 }
             }
@@ -110,7 +110,7 @@ void T_PlatRaise(plat_t * plat)
                     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;
@@ -173,7 +173,7 @@ int EV_DoPlat(line_t * line, plattype_e type, int amount)
                 plat->wait = 0;
                 plat->status = up;
                 sec->special = 0;       // NO MORE DAMAGE, IF APPLICABLE
-                S_StartSound((mobj_t *) & sec->soundorg, sfx_stnmov);
+                S_StartSound(&sec->soundorg, sfx_stnmov);
                 break;
             case raiseAndChange:
                 plat->speed = PLATSPEED / 2;
@@ -181,7 +181,7 @@ int EV_DoPlat(line_t * line, plattype_e type, int amount)
                 plat->high = sec->floorheight + amount * FRACUNIT;
                 plat->wait = 0;
                 plat->status = up;
-                S_StartSound((mobj_t *) & sec->soundorg, sfx_stnmov);
+                S_StartSound(&sec->soundorg, sfx_stnmov);
                 break;
             case downWaitUpStay:
                 plat->speed = PLATSPEED * 4;
@@ -191,7 +191,7 @@ int EV_DoPlat(line_t * line, plattype_e type, int amount)
                 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:
                 plat->speed = PLATSPEED;
@@ -203,7 +203,7 @@ int EV_DoPlat(line_t * line, plattype_e type, int amount)
                     plat->high = sec->floorheight;
                 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);
diff --git a/src/heretic/p_spec.c b/src/heretic/p_spec.c
index e357e680..6227237b 100644
--- a/src/heretic/p_spec.c
+++ b/src/heretic/p_spec.c
@@ -1029,7 +1029,7 @@ void P_UpdateSpecials(void)
                             buttonlist[i].btexture;
                         break;
                 }
-                S_StartSound((mobj_t *) & buttonlist[i].soundorg, sfx_switch);
+                S_StartSound(buttonlist[i].soundorg, sfx_switch);
                 memset(&buttonlist[i], 0, sizeof(button_t));
             }
         }
diff --git a/src/heretic/p_spec.h b/src/heretic/p_spec.h
index 298046fd..7f5e2c43 100644
--- a/src/heretic/p_spec.h
+++ b/src/heretic/p_spec.h
@@ -188,7 +188,7 @@ typedef struct
     bwhere_e where;
     int btexture;
     int btimer;
-    mobj_t *soundorg;
+    void *soundorg;
 } button_t;

 #define	MAXSWITCHES	50      // max # of wall switches in a level
diff --git a/src/heretic/p_switch.c b/src/heretic/p_switch.c
index d1d7e0bf..cef6a74b 100644
--- a/src/heretic/p_switch.c
+++ b/src/heretic/p_switch.c
@@ -152,7 +152,7 @@ void P_StartButton(line_t * line, bwhere_e w, int texture, int time)
             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;
         }

diff --git a/src/heretic/s_sound.c b/src/heretic/s_sound.c
index 2e3e200f..bdd24594 100644
--- a/src/heretic/s_sound.c
+++ b/src/heretic/s_sound.c
@@ -129,8 +129,9 @@ static mobj_t *GetSoundListener(void)
     }
 }

-void S_StartSound(mobj_t * origin, int sound_id)
+void S_StartSound(void *_origin, int sound_id)
 {
+    mobj_t *origin = _origin;
     mobj_t *listener;
     int dist, vol;
     int i;
@@ -297,8 +298,9 @@ void S_StartSound(mobj_t * origin, int sound_id)
     }
 }

-void S_StartSoundAtVolume(mobj_t * origin, int sound_id, int volume)
+void S_StartSoundAtVolume(void *_origin, int sound_id, int volume)
 {
+    mobj_t *origin = _origin;
     mobj_t *listener;
     int i;

@@ -397,8 +399,9 @@ boolean S_StopSoundID(int sound_id, int priority)
     return (true);
 }

-void S_StopSound(mobj_t * origin)
+void S_StopSound(void *_origin)
 {
+    mobj_t *origin = _origin;
     int i;

     for (i = 0; i < snd_Channels; i++)
diff --git a/src/heretic/s_sound.h b/src/heretic/s_sound.h
index c000d2a9..e678fc99 100644
--- a/src/heretic/s_sound.h
+++ b/src/heretic/s_sound.h
@@ -31,9 +31,9 @@ extern int snd_MaxVolume;
 extern int snd_MusicVolume;

 void S_Start(void);
-void S_StartSound(mobj_t * origin, int sound_id);
-void S_StartSoundAtVolume(mobj_t * origin, int sound_id, int volume);
-void S_StopSound(mobj_t * origin);
+void S_StartSound(void *origin, int sound_id);
+void S_StartSoundAtVolume(void *origin, int sound_id, int volume);
+void S_StopSound(void *origin);
 void S_PauseSound(void);
 void S_ResumeSound(void);
 void S_UpdateSounds(mobj_t * listener);
diff --git a/src/heretic/sb_bar.c b/src/heretic/sb_bar.c
index 407290ff..77bd40c2 100644
--- a/src/heretic/sb_bar.c
+++ b/src/heretic/sb_bar.c
@@ -27,6 +27,7 @@
 #include "doomdef.h"
 #include "i_video.h"
 #include "m_cheat.h"
+#include "m_misc.h"
 #include "m_random.h"
 #include "p_local.h"
 #include "s_sound.h"