shithub: choc

Download patch

ref: 828b09914106de7dc00199fa810278e12988324b
parent: ae18d8c4b6f7f918aa5ec496ca32899793cbe41e
author: Simon Howard <[email protected]>
date: Sun Nov 23 12:39:11 EST 2008

Shut up compiler warnings in Heretic code.

Subversion-branch: /branches/raven-branch
Subversion-revision: 1385

--- a/src/heretic/p_ceilng.c
+++ b/src/heretic/p_ceilng.c
@@ -55,7 +55,7 @@
                               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 @@
                               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)
--- a/src/heretic/p_doors.c
+++ b/src/heretic/p_doors.c
@@ -54,13 +54,11 @@
                 {
                     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 @@
                     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 @@
                     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 @@
                         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 @@
                     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 @@
                 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 @@
                 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 @@
     {
         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;
     }
 
--- a/src/heretic/p_floor.c
+++ b/src/heretic/p_floor.c
@@ -196,7 +196,7 @@
                       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 @@
         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)
--- a/src/heretic/p_plats.c
+++ b/src/heretic/p_plats.c
@@ -49,7 +49,7 @@
                               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)
@@ -56,7 +56,7 @@
             {
                 if (!(leveltime & 7))
                 {
-                    S_StartSound((mobj_t *) & plat->sector->soundorg,
+                    S_StartSound(&plat->sector->soundorg,
                                  sfx_stnmov);
                 }
             }
@@ -64,13 +64,13 @@
             {
                 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 @@
             {
                 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 @@
                     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 @@
                 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 @@
                 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 @@
                 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 @@
                     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);
--- a/src/heretic/p_spec.c
+++ b/src/heretic/p_spec.c
@@ -1029,7 +1029,7 @@
                             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));
             }
         }
--- a/src/heretic/p_spec.h
+++ b/src/heretic/p_spec.h
@@ -188,7 +188,7 @@
     bwhere_e where;
     int btexture;
     int btimer;
-    mobj_t *soundorg;
+    void *soundorg;
 } button_t;
 
 #define	MAXSWITCHES	50      // max # of wall switches in a level
--- a/src/heretic/p_switch.c
+++ b/src/heretic/p_switch.c
@@ -152,7 +152,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;
         }
 
--- a/src/heretic/s_sound.c
+++ b/src/heretic/s_sound.c
@@ -129,8 +129,9 @@
     }
 }
 
-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_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 @@
     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++)
--- a/src/heretic/s_sound.h
+++ b/src/heretic/s_sound.h
@@ -31,9 +31,9 @@
 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);
--- 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"