shithub: duke3d

Download patch

ref: bfadba232782de130ee4be4503a3911dde673723
parent: fa17f876521561f90a01ff5e99d410c9f29100ab
parent: b5c9aeaa7779f4c7c5c3f972a005be06d80b0166
author: Fabien <fabien.sanglard@gmail.com>
date: Tue Sep 1 19:18:04 EDT 2015

Merge pull request #33 from darealshinji/cleanup-1

Cleanup: -Wunused-function -Wunused-but-set-variable

--- a/Engine/src/engine.c
+++ b/Engine/src/engine.c
@@ -7241,7 +7241,8 @@
     sectortype *sec, *sec2;
     walltype *wal;
     int32_t i, j, k, t, dx, dy, dax, day, daz, daz2, bad, dir;
-    int32_t dasprclipmask, dawalclipmask;
+//    int32_t dasprclipmask;
+    int32_t dawalclipmask;
     short startwall, endwall, clipsectcnt;
     uint8_t  bad2;
 
@@ -7248,7 +7249,7 @@
     if ((*sectnum) < 0) return(-1);
 
     dawalclipmask = (cliptype&65535);
-    dasprclipmask = (cliptype>>16);
+//    dasprclipmask = (cliptype>>16);
 
     k = 32;
     dir = 1;
@@ -7428,7 +7429,7 @@
 
 void draw2dgrid(int32_t posxe, int32_t posye, short ange, int32_t zoome, short gride)
 {
-    int32_t i, xp1, yp1, xp2=0, yp2, tempy, tempint;
+    int32_t i, xp1, yp1, xp2=0, yp2, tempy; // tempint;
     uint8_t  mask;
 
     if (gride > 0)
@@ -7442,7 +7443,7 @@
         {
             setcolor16(8);
 
-            tempint = ((yp1*640+pageoffset)>>3)+(int32_t)_getVideoBase();
+//            tempint = ((yp1*640+pageoffset)>>3)+(int32_t)_getVideoBase();
             tempy = yp2-yp1+1;
             mask = 0;
             xp1 = 320-mulscale14(posxe+131072,zoome);
--- a/Game/src/audiolib/_multivc.h
+++ b/Game/src/audiolib/_multivc.h
@@ -206,31 +206,31 @@
 
 // typedef char HARSH_CLIP_TABLE_8[ MV_NumVoices * 256 ];
 
-static void MV_Mix( VoiceNode *voice);
-static void MV_PlayVoice( VoiceNode *voice );
-static void MV_StopVoice( VoiceNode *voice );
-static void MV_ServiceVoc( void );
+//static void MV_Mix( VoiceNode *voice);
+//static void MV_PlayVoice( VoiceNode *voice );
+//static void MV_StopVoice( VoiceNode *voice );
+//static void MV_ServiceVoc( void );
 
-static playbackstatus MV_GetNextVOCBlock( VoiceNode *voice );
-static playbackstatus MV_GetNextDemandFeedBlock( VoiceNode *voice );
-static playbackstatus MV_GetNextRawBlock( VoiceNode *voice );
-static playbackstatus MV_GetNextWAVBlock( VoiceNode *voice );
+//static playbackstatus MV_GetNextVOCBlock( VoiceNode *voice );
+//static playbackstatus MV_GetNextDemandFeedBlock( VoiceNode *voice );
+//static playbackstatus MV_GetNextRawBlock( VoiceNode *voice );
+//static playbackstatus MV_GetNextWAVBlock( VoiceNode *voice );
 
-static void       MV_ServiceRecord( void );
-static VoiceNode *MV_GetVoice( int handle );
-static VoiceNode *MV_AllocVoice( int priority );
+//static void       MV_ServiceRecord( void );
+//static VoiceNode *MV_GetVoice( int handle );
+//static VoiceNode *MV_AllocVoice( int priority );
 
-#if 0
-static short     *MV_GetVolumeTable( int vol );
-#else
-static int        MV_GetVolumeTable( int vol );
-#endif
+//#if 0
+//static short     *MV_GetVolumeTable( int vol );
+//#else
+//static int        MV_GetVolumeTable( int vol );
+//#endif
 
-static void       MV_SetVoiceMixMode( VoiceNode *voice );
+void       MV_SetVoiceMixMode( VoiceNode *voice );
 
-static void       MV_SetVoicePitch( VoiceNode *voice, unsigned long rate, int pitchoffset );
-static void       MV_CalcVolume( int MaxLevel );
-static void       MV_CalcPanTable( void );
+//static void       MV_SetVoicePitch( VoiceNode *voice, unsigned long rate, int pitchoffset );
+//static void       MV_CalcVolume( int MaxLevel );
+//static void       MV_CalcPanTable( void );
 
 #ifdef PLAT_DOS
 #define ATR_INDEX               0x3c0
--- a/Game/src/audiolib/multivoc.c
+++ b/Game/src/audiolib/multivoc.c
@@ -929,6 +929,7 @@
    Starts recording of the waiting buffer.
 ---------------------------------------------------------------------*/
 
+#ifdef PLAT_DOS
 static void MV_ServiceRecord
    (
    void
@@ -948,6 +949,7 @@
       MV_MixPage = 0;
       }
    }
+#endif
 
 
 /*---------------------------------------------------------------------
@@ -1384,7 +1386,7 @@
    Selects which method should be used to mix the voice.
 ---------------------------------------------------------------------*/
 
-static void MV_SetVoiceMixMode
+void MV_SetVoiceMixMode
    (
    VoiceNode *voice
    )
--- a/Game/src/audiolib/mv_mix.c
+++ b/Game/src/audiolib/mv_mix.c
@@ -41,6 +41,7 @@
 	return fa;
 }
 
+/*
 static int MV_cubic8(const unsigned char *src, int position, int rate)
 {
 	int temp, hpos = position >> 16;
@@ -58,6 +59,7 @@
 
 	return do_cubic ? (MV_cubic(position) >> 8) + 0x80 : (gval(3) >> 8) + 0x80;
 }
+*/
 
 static int MV_cubic16(const short *src, int position, int rate)
 {
@@ -95,6 +97,7 @@
 	return do_cubic ? MV_cubic(position) : gval(3);
 }
 
+/*
 static int MV_cubic16to8(const short *src, int position, int rate)
 {
 	int temp, hpos = position >> 16;
@@ -112,6 +115,7 @@
 
 	return do_cubic ? (MV_cubic(position) >> 8) + 0x80 : (gval(3) >> 8) + 0x80;
 }
+*/
 
 void MV_Mix8BitMono( uint32_t position, uint32_t rate,
    const char *start, uint32_t length )
--- a/Game/src/game.c
+++ b/Game/src/game.c
@@ -1431,7 +1431,7 @@
 
 void myospal(int32_t x, int32_t y, short tilenum, int8_t shade, uint8_t  orientation, uint8_t  p)
 {
-    uint8_t  fp;
+//    uint8_t  fp;
     short a;
 
     if(orientation&4)
@@ -1438,7 +1438,7 @@
         a = 1024;
     else a = 0;
 
-    fp = sector[ps[screenpeek].cursectnum].floorpal;
+//    fp = sector[ps[screenpeek].cursectnum].floorpal;
 
     rotatesprite(x<<16,y<<16,65536L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2);
 
@@ -9731,7 +9731,8 @@
 
 void dobonus(uint8_t  bonusonly)
 {
-    short t, tinc,gfx_offset;
+    short t, gfx_offset;
+//    short tinc;
     int32_t i, y,xfragtotal,yfragtotal;
     short bonuscnt;
     char text[512];
@@ -9781,7 +9782,7 @@
                 for(t=63;t>=0;t--) palto(0,0,0,t);
 
                 KB_FlushKeyboardQueue();
-                totalclock = 0; tinc = 0;
+                totalclock = 0; //tinc = 0;
                 while( 1 )
                 {
                     clearview(0L);
@@ -9979,7 +9980,7 @@
 
     ps[myconnectindex].palette = palette;
     KB_FlushKeyboardQueue();
-    totalclock = 0; tinc = 0;
+    totalclock = 0; //tinc = 0;
     bonuscnt = 0;
 
     MUSIC_StopSong();
@@ -10103,7 +10104,7 @@
     KB_FlushKeyboardQueue();
     for(t=0;t<64;t++) palto(0,0,0,63-t);
     bonuscnt = 0;
-    totalclock = 0; tinc = 0;
+    totalclock = 0; //tinc = 0;
 
     while( 1 )
     {
--- a/Game/src/menues.c
+++ b/Game/src/menues.c
@@ -2337,13 +2337,13 @@
 				{
 					int y, x1;
 					int32_t xPos, xPos2;
-					int32_t yPos, yPos2;
+					int32_t yPos; //yPos2;
 
 					xPos =  ( xdim *32) / 320;
 					yPos =  ( ydim *30) / 200;
 
 					xPos2 =  ( xdim *282) / 320;
-					yPos2 =  ( ydim *130) / 200;
+					//yPos2 =  ( ydim *130) / 200;
 
 					for(y=yPos; y < (ydim - (yPos*2)); y+=128)
 					{
--- a/Game/src/premap.c
+++ b/Game/src/premap.c
@@ -1070,8 +1070,8 @@
 
 void resetpspritevars(uint8_t  g)
 {
-    short i, j, nexti,circ;
-    int32_t firstx,firsty;
+    short i, j, nexti; //circ;
+//    int32_t firstx,firsty;
     spritetype *s;
     uint8_t  aimmode[MAXPLAYERS];
     STATUSBARTYPE tsbar[MAXPLAYERS];
@@ -1190,7 +1190,7 @@
     }
 
     numplayersprites = 0;
-    circ = 2048/ud.multimode;
+//    circ = 2048/ud.multimode;
 
     which_palookup = 9;
     j = connecthead;
@@ -1203,11 +1203,11 @@
         if( numplayersprites == MAXPLAYERS)
             gameexit("\nToo many player sprites (max 16.)");
 
-        if(numplayersprites == 0)
-        {
-            firstx = ps[0].posx;
-            firsty = ps[0].posy;
-        }
+//        if(numplayersprites == 0)
+//        {
+//            firstx = ps[0].posx;
+//            firsty = ps[0].posy;
+//        }
 
         po[numplayersprites].ox = s->x;
         po[numplayersprites].oy = s->y;
--- a/Game/src/sector.c
+++ b/Game/src/sector.c
@@ -550,10 +550,10 @@
 {
     int32_t j=0, l, q, startwall, endwall;
     short i;
-    uint8_t  sect_error;
+//    uint8_t  sect_error;
     sectortype *sptr;
 
-    sect_error = 0;
+//    sect_error = 0;
     sptr = &sector[sn];
 
     switch(sptr->lotag&(0xffff-49152))