Removed all unused variable/parameter warnings

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@848 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2003-03-03 05:17:33 +00:00
parent 8fd821963a
commit 02856f0cb4
22 changed files with 53 additions and 27 deletions
+2
View File
@@ -272,6 +272,7 @@ CombatIsInevitable (RESPONSE_REF R)
static void static void
Frenzy (RESPONSE_REF R) Frenzy (RESPONSE_REF R)
{ {
(void) R; // ignored
switch (GET_GAME_STATE (KOHR_AH_REASONS)) switch (GET_GAME_STATE (KOHR_AH_REASONS))
{ {
case 0: case 0:
@@ -367,6 +368,7 @@ KohrAhStory (RESPONSE_REF R)
static void static void
DieHuman (RESPONSE_REF R) DieHuman (RESPONSE_REF R)
{ {
(void) R; // ignored
switch (GET_GAME_STATE (KOHR_AH_REASONS)) switch (GET_GAME_STATE (KOHR_AH_REASONS))
{ {
case 0: case 0:
+1
View File
@@ -441,6 +441,7 @@ static void RevealSelf (RESPONSE_REF R);
static void static void
TellProbe (RESPONSE_REF R) TellProbe (RESPONSE_REF R)
{ {
(void) R; // ignored
NPCPhrase (THAT_WAS_PROBE); NPCPhrase (THAT_WAS_PROBE);
DISABLE_PHRASE (what_was_red_thing); DISABLE_PHRASE (what_was_red_thing);
+2
View File
@@ -532,6 +532,7 @@ DoRescue (RESPONSE_REF R)
SIZE dx, dy; SIZE dx, dy;
COUNT fuel_required; COUNT fuel_required;
(void) R; // ignored
dx = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x)) dx = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x))
- SOL_X; - SOL_X;
dy = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y)) dy = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y))
@@ -1771,6 +1772,7 @@ DoMelnormeHate (RESPONSE_REF R)
{ {
BYTE hate_count; BYTE hate_count;
(void) R; // ignored
hate_count = GET_GAME_STATE (MELNORME_HATE_COUNT); hate_count = GET_GAME_STATE (MELNORME_HATE_COUNT);
switch (hate_count++) switch (hate_count++)
{ {
+1
View File
@@ -407,6 +407,7 @@ static void OrzNeutral (RESPONSE_REF R);
static void static void
WhereAndrosyn (RESPONSE_REF R) WhereAndrosyn (RESPONSE_REF R)
{ {
(void) R; // ignored
NPCPhrase (DISEMBLE_ABOUT_ANDROSYN); NPCPhrase (DISEMBLE_ABOUT_ANDROSYN);
DISABLE_PHRASE (where_androsyn); DISABLE_PHRASE (where_androsyn);
+4 -8
View File
@@ -86,14 +86,9 @@ ShipsReady (void)
SIZE i; SIZE i;
return (GET_GAME_STATE (PKUNK_MANNER) == 3 return (GET_GAME_STATE (PKUNK_MANNER) == 3
&& !((i = (GLOBAL (GameClock.year_index) - START_YEAR) && !((i = (GLOBAL (GameClock.year_index) - START_YEAR) - GET_GAME_STATE (PKUNK_SHIP_YEAR)) < 0
- GET_GAME_STATE (PKUNK_SHIP_YEAR)) < 0 || ((i == 0 && (i = GLOBAL (GameClock.month_index) - GET_GAME_STATE (PKUNK_SHIP_MONTH)) < 0)
|| (i == 0 || (i == 0 && GLOBAL (GameClock.day_index) < GET_GAME_STATE (PKUNK_SHIP_DAY)))));
&& (i = GLOBAL (GameClock.month_index) -
GET_GAME_STATE (PKUNK_SHIP_MONTH)) < 0
|| (i == 0
&& GLOBAL (GameClock.day_index) <
GET_GAME_STATE (PKUNK_SHIP_DAY)))));
} }
static void static void
@@ -815,6 +810,7 @@ static void
PkunkMigrate (RESPONSE_REF R) PkunkMigrate (RESPONSE_REF R)
{ {
BYTE ReasonMask; BYTE ReasonMask;
(void) R; // ignored
ReasonMask = GET_GAME_STATE (PKUNK_REASONS); ReasonMask = GET_GAME_STATE (PKUNK_REASONS);
if (!(ReasonMask & GOOD_REASON_1)) if (!(ReasonMask & GOOD_REASON_1))
+3 -8
View File
@@ -301,14 +301,9 @@ Rebels (RESPONSE_REF R)
else if (PLAYER_SAID (R, any_ships)) else if (PLAYER_SAID (R, any_ships))
{ {
if (GET_GAME_STATE (YEHAT_SHIP_MONTH) if (GET_GAME_STATE (YEHAT_SHIP_MONTH)
&& ((NumVisits = (GLOBAL (GameClock.year_index) - START_YEAR) && ((NumVisits = (GLOBAL (GameClock.year_index) - START_YEAR) - GET_GAME_STATE (YEHAT_SHIP_YEAR)) < 0
- GET_GAME_STATE (YEHAT_SHIP_YEAR)) < 0 || ((NumVisits == 0 && (NumVisits = GLOBAL (GameClock.month_index) - GET_GAME_STATE (YEHAT_SHIP_MONTH)) < 0)
|| (NumVisits == 0 || (NumVisits == 0 && GLOBAL (GameClock.day_index) < GET_GAME_STATE (YEHAT_SHIP_DAY)))))
&& (NumVisits = GLOBAL (GameClock.month_index) -
GET_GAME_STATE (YEHAT_SHIP_MONTH)) < 0
|| (NumVisits == 0
&& GLOBAL (GameClock.day_index) <
GET_GAME_STATE (YEHAT_SHIP_DAY)))))
NPCPhrase (NO_SHIPS_YET); NPCPhrase (NO_SHIPS_YET);
else if ((NumVisits = ActivateStarShip (YEHAT_SHIP, FEASIBILITY_STUDY)) == 0) else if ((NumVisits = ActivateStarShip (YEHAT_SHIP, FEASIBILITY_STUDY)) == 0)
NPCPhrase (NO_ROOM); NPCPhrase (NO_ROOM);
+2
View File
@@ -318,6 +318,7 @@ ExplainDefeat (RESPONSE_REF R)
static void static void
RealizeMistake (RESPONSE_REF R) RealizeMistake (RESPONSE_REF R)
{ {
(void) R; // ignored
NPCPhrase (DGRUNTI); NPCPhrase (DGRUNTI);
SET_GAME_STATE (SHOFIXTI_STACK1, 0); SET_GAME_STATE (SHOFIXTI_STACK1, 0);
SET_GAME_STATE (SHOFIXTI_STACK3, 0); SET_GAME_STATE (SHOFIXTI_STACK3, 0);
@@ -347,6 +348,7 @@ RealizeMistake (RESPONSE_REF R)
static void static void
Hostile (RESPONSE_REF R) Hostile (RESPONSE_REF R)
{ {
(void) R; // ignored
switch (GET_GAME_STATE (SHOFIXTI_STACK1)) switch (GET_GAME_STATE (SHOFIXTI_STACK1))
{ {
case 0: case 0:
+1
View File
@@ -154,6 +154,7 @@ static LOCDATA slylandro_desc =
static void static void
ExitConversation (RESPONSE_REF R) ExitConversation (RESPONSE_REF R)
{ {
(void) R; // ignored
SET_GAME_STATE (BATTLE_SEGUE, 0); SET_GAME_STATE (BATTLE_SEGUE, 0);
switch (GET_GAME_STATE (SLYLANDRO_HOME_VISITS)) switch (GET_GAME_STATE (SLYLANDRO_HOME_VISITS))
+2 -1
View File
@@ -140,6 +140,7 @@ ByeBye (RESPONSE_REF R)
{ {
BYTE b0, b1, b2, b3; BYTE b0, b1, b2, b3;
(void) R; // ignored
b0 = GET_GAME_STATE (STARBASE_BULLETS0); b0 = GET_GAME_STATE (STARBASE_BULLETS0);
b1 = GET_GAME_STATE (STARBASE_BULLETS1); b1 = GET_GAME_STATE (STARBASE_BULLETS1);
b2 = GET_GAME_STATE (STARBASE_BULLETS2); b2 = GET_GAME_STATE (STARBASE_BULLETS2);
@@ -1741,7 +1742,7 @@ SellMinerals (RESPONSE_REF R)
TimeIn = GetTimeCounter (); TimeIn = GetTimeCounter ();
} }
if (amount = GLOBAL_SIS (ElementAmounts[i])) if ((amount = GLOBAL_SIS (ElementAmounts[i])) != 0)
{ {
total += amount * GLOBAL (ElementWorth[i]); total += amount * GLOBAL (ElementWorth[i]);
do do
+1
View File
@@ -667,6 +667,7 @@ InitialSyreen (RESPONSE_REF R)
static void static void
PlanAmbush (RESPONSE_REF R) PlanAmbush (RESPONSE_REF R)
{ {
(void) R; // ignored
NPCPhrase (OK_FOUND_VAULT); NPCPhrase (OK_FOUND_VAULT);
SET_GAME_STATE (MYCON_AMBUSH, 1); SET_GAME_STATE (MYCON_AMBUSH, 1);
+1
View File
@@ -475,6 +475,7 @@ ThraddCulture (RESPONSE_REF R)
static void static void
ThraddWorship (RESPONSE_REF R) ThraddWorship (RESPONSE_REF R)
{ {
(void) R; // ignored
SET_GAME_STATE (THRADD_VISITS, 0); SET_GAME_STATE (THRADD_VISITS, 0);
SET_GAME_STATE (THRADD_MANNER, 1); SET_GAME_STATE (THRADD_MANNER, 1);
SET_GAME_STATE (THRADD_STACK_1, 0); SET_GAME_STATE (THRADD_STACK_1, 0);
+1
View File
@@ -227,6 +227,7 @@ ExitConversation (RESPONSE_REF R)
static void static void
FormAlliance (RESPONSE_REF R) FormAlliance (RESPONSE_REF R)
{ {
(void) R; // ignored
NPCPhrase_cb (ALLY_WITH_US0, &SelectAlienZOQ); NPCPhrase_cb (ALLY_WITH_US0, &SelectAlienZOQ);
NPCPhrase_cb (ALLY_WITH_US1, &SelectAlienPIK); NPCPhrase_cb (ALLY_WITH_US1, &SelectAlienPIK);
NPCPhrase_cb (ALLY_WITH_US2, &SelectAlienZOQ); NPCPhrase_cb (ALLY_WITH_US2, &SelectAlienZOQ);
-1
View File
@@ -135,7 +135,6 @@ InitSIS (void)
{ {
HSTARSHIP hMasterShip; HSTARSHIP hMasterShip;
STARSHIPPTR MasterShipPtr; STARSHIPPTR MasterShipPtr;
extern QUEUE master_q;
hMasterShip = FindMasterShip (ship_ref); hMasterShip = FindMasterShip (ship_ref);
MasterShipPtr = LockStarShip (&master_q, hMasterShip); MasterShipPtr = LockStarShip (&master_q, hMasterShip);
+3 -1
View File
@@ -295,6 +295,7 @@ void rZF_nearestneighbor (SDL_Surface *src, SDL_Surface *dst, int use_weight)
for (y = 0; y < dst->h; y++) for (y = 0; y < dst->h; y++)
{ {
if (y) if (y)
{
if (!(y & 0x03)) if (!(y & 0x03))
{ {
yptr += src->w; yptr += src->w;
@@ -305,6 +306,7 @@ void rZF_nearestneighbor (SDL_Surface *src, SDL_Surface *dst, int use_weight)
} }
else if (use_weight) else if (use_weight)
pry += 12; pry += 12;
}
for (x = 0; x < dst->w; x++) for (x = 0; x < dst->w; x++)
{ {
Uint32 p; Uint32 p;
@@ -421,7 +423,7 @@ void rZF_continuous (SDL_Surface *src, SDL_Surface *dst)
int fromx, fromx4; int fromx, fromx4;
int dy1; int dy1;
Uint32 p00; Uint32 p00;
char cpl[3][3] = {0,0,0,0,0,0,0,0,0}; char cpl[3][3] = {{0,0,0},{0,0,0},{0,0,0}};
if (x == src->w) if (x == src->w)
fromx = 0; fromx = 0;
else else
@@ -404,6 +404,7 @@ SWORD VC1_SampleLoad(struct SAMPLOAD* sload,int type)
ULONG VC1_SampleSpace(int type) ULONG VC1_SampleSpace(int type)
{ {
(void) type; // ignored
return vc_memory; return vc_memory;
} }
@@ -411,6 +412,8 @@ ULONG VC1_SampleLength(int type,SAMPLE* s)
{ {
if (!s) return 0; if (!s) return 0;
(void) type; // ignored
return (s->length*((s->flags&SF_16BITS)?2:1))+16; return (s->length*((s->flags&SF_16BITS)?2:1))+16;
} }
+13
View File
@@ -37,12 +37,18 @@ PlayChannel (COUNT channel, PVOID sample, COUNT sample_length, COUNT loop_begin,
TFBSound_Sourcei (soundSource[channel].handle, TFBSOUND_BUFFER, TFBSound_Sourcei (soundSource[channel].handle, TFBSOUND_BUFFER,
tfb_sample->buffer[0]); tfb_sample->buffer[0]);
TFBSound_SourcePlay (soundSource[channel].handle); TFBSound_SourcePlay (soundSource[channel].handle);
/* ignored arguments */
(void)sample_length;
(void)loop_begin;
(void)loop_length;
(void)priority;
} }
void void
StopChannel (COUNT channel, unsigned char Priority) StopChannel (COUNT channel, unsigned char Priority)
{ {
StopSource (channel); StopSource (channel);
(void)Priority; // ignored
} }
static void static void
@@ -84,6 +90,7 @@ SetChannelVolume (COUNT channel, COUNT volume, BYTE priority)
{ {
TFBSound_Sourcef (soundSource[channel].handle, TFBSOUND_GAIN, TFBSound_Sourcef (soundSource[channel].handle, TFBSOUND_GAIN,
(volume / (float)MAX_VOLUME) * sfxVolumeScale); (volume / (float)MAX_VOLUME) * sfxVolumeScale);
(void)priority; // ignored
} }
// Status: Ignored // Status: Ignored
@@ -98,6 +105,7 @@ GetSampleAddress (SOUND sound)
COUNT COUNT
GetSampleLength (SOUND sound) GetSampleLength (SOUND sound)
{ {
(void)sound;
return 0; return 0;
} }
@@ -105,12 +113,16 @@ GetSampleLength (SOUND sound)
void void
SetChannelRate (COUNT channel, DWORD rate_hz, unsigned char priority) SetChannelRate (COUNT channel, DWORD rate_hz, unsigned char priority)
{ {
(void) channel;
(void) rate_hz;
(void) priority;
} }
// Status: Ignored // Status: Ignored
COUNT COUNT
GetSampleRate (SOUND sound) GetSampleRate (SOUND sound)
{ {
(void) sound;
return 0; return 0;
} }
@@ -127,6 +139,7 @@ _GetSoundBankData (FILE *fp, DWORD length)
TFB_SoundSample *sndfx[MAX_FX]; TFB_SoundSample *sndfx[MAX_FX];
STRING_TABLE Snd; STRING_TABLE Snd;
(void) length; // ignored
opos = ftell (fp); opos = ftell (fp);
{ {
+3
View File
@@ -162,6 +162,9 @@ get_previous_chain (TFB_SoundChain *first_chain, TFB_SoundChain *current_chain)
BOOLEAN BOOLEAN
InitSound (int argc, char* argv[]) InitSound (int argc, char* argv[])
{ {
/* Quell compiler warnings */
(void)argc;
(void)argv;
return TRUE; return TRUE;
} }
-3
View File
@@ -271,9 +271,6 @@ _GetStringData (FILE *fp, DWORD length)
lpStringOffs = lpST->StringOffsets; lpStringOffs = lpST->StringOffsets;
lpClipOffs = &lpST->StringOffsets[lpST->StringCount + 1]; lpClipOffs = &lpST->StringOffsets[lpST->StringCount + 1];
{
long foo = (lpST->StringCount + 1) << ((lpST->flags & HAS_SOUND_CLIPS) ? 1 : 0);
}
lpTSOffs = &lpST->StringOffsets[(lpST->StringCount + 1) lpTSOffs = &lpST->StringOffsets[(lpST->StringCount + 1)
<< ((lpST->flags & HAS_SOUND_CLIPS) ? 1 : 0)]; << ((lpST->flags & HAS_SOUND_CLIPS) ? 1 : 0)];
for (n = 0; n < (int)lpST->StringCount; for (n = 0; n < (int)lpST->StringCount;
+2
View File
@@ -553,6 +553,7 @@ ClearSemaphore (Semaphore sem)
sem_name = SemMon[i].Name; sem_name = SemMon[i].Name;
if (SemMon[i].Thread && SemMon[i].Thread != NativeThreadID ()) if (SemMon[i].Thread && SemMon[i].Thread != NativeThreadID ())
#if defined (THREAD_QUEUE) && defined (THREAD_NAMES) #if defined (THREAD_QUEUE) && defined (THREAD_NAMES)
{
if (ThreadNameNative (SemMon[i].Thread) == NULL) if (ThreadNameNative (SemMon[i].Thread) == NULL)
fprintf( stderr, "Freeing %s Semaphore in '%s' set by defunct thread '%s'!\n", fprintf( stderr, "Freeing %s Semaphore in '%s' set by defunct thread '%s'!\n",
sem_name, sem_name,
@@ -563,6 +564,7 @@ ClearSemaphore (Semaphore sem)
sem_name, sem_name,
ThreadNameNative (NativeThreadID ()), ThreadNameNative (NativeThreadID ()),
ThreadNameNative (SemMon[i].Thread)); ThreadNameNative (SemMon[i].Thread));
}
SemMon[i].ThreadName[0] = 0; SemMon[i].ThreadName[0] = 0;
#else #else
fprintf (stderr, "Freeing %s Semaphore that was set by a different thread\n", fprintf (stderr, "Freeing %s Semaphore that was set by a different thread\n",
+3
View File
@@ -40,6 +40,9 @@ InitOscilloscope (DWORD x, DWORD y, DWORD width, DWORD height, FRAME_DESC *f)
TFB_DrawImage_Image (f->image, 0, 0, 0, NULL, scope_bg); TFB_DrawImage_Image (f->image, 0, 0, 0, NULL, scope_bg);
scope_init = 1; scope_init = 1;
} }
/* remove compiler warnings */
(void) x;
(void) y;
} }
void void
+2 -1
View File
@@ -61,8 +61,9 @@ RotatePlanet (int x, int da, int dx, int dy, int zoom)
RECT r, *rp = NULL; RECT r, *rp = NULL;
CONTEXT OldContext; CONTEXT OldContext;
(void)da; // ignored
// If thiis frame hasn' been generted, generate it // If this frame hasn't been generted, generate it
if (! pSolarSysState->isPFADefined[x]) { if (! pSolarSysState->isPFADefined[x]) {
RenderLevelMasks (x); RenderLevelMasks (x);
pSolarSysState->isPFADefined[x] = 1; pSolarSysState->isPFADefined[x] = 1;
-1
View File
@@ -110,7 +110,6 @@ PrintCoarseScanPC (void)
SIZE temp; SIZE temp;
TEXT t; TEXT t;
RECT r; RECT r;
STAMP s;
UNICODE buf[40]; UNICODE buf[40];
SetSemaphore (GraphicsSem); SetSemaphore (GraphicsSem);