Cleaned up almost every warning left according to GCC.

The only remaining warnings are signed/unsigned compares, warnings inside
the doomed w_memlib.c, and a couple of mysterious (and probably meaningful)
bugs regarding a pair of LockElement macros.


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@989 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2003-06-22 01:47:06 +00:00
parent 9142a7119b
commit dc85bbc081
11 changed files with 38 additions and 31 deletions
+4 -4
View File
@@ -230,10 +230,10 @@ ShipWorth (void)
} }
static COUNT rescue_fuel = 0; static COUNT rescue_fuel = 0;
static SIS_STATE SIS_copy =
{ /* We're relying on this large, #define-dependent-size structure to be
.log_x = 0, automatically initialized to 0 across the board here. */
}; static SIS_STATE SIS_copy;
static BOOLEAN static BOOLEAN
StripShip (COUNT fuel_required) StripShip (COUNT fuel_required)
-9
View File
@@ -30,15 +30,6 @@ void LoadMasterShipList (void);
//End Added by Chris //End Added by Chris
static void
DoFMV (char *name, char *loopname, BOOLEAN uninit)
{
VidPlay ((MEM_HANDLE)name, loopname, uninit);
while (VidPlaying ())
;
VidStop ();
}
void void
DoShipSpin (COUNT index, MUSIC_REF hMusic) DoShipSpin (COUNT index, MUSIC_REF hMusic)
{ {
+7 -4
View File
@@ -28,13 +28,16 @@ void LoadMasterShipList (void);
//End Added by Chris //End Added by Chris
void void
DoFMV (char *name, char *loopname) DoFMV (char *name, char *loopname, BOOLEAN uninit)
{ {
VidPlay((MEM_HANDLE)name, loopname,FALSE); MEM_HANDLE vidref = 0;
VidPlay (vidref, loopname, uninit);
while(VidPlaying ()) while(VidPlaying ())
; ;
VidStop(); VidStop();
(void) name;
} }
/* //Already defined in fmv.c /* //Already defined in fmv.c
void void
Introduction (void) Introduction (void)
@@ -71,7 +74,7 @@ Introduction (void)
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2)); SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2));
if (InputState == 0) if (InputState == 0)
DoFMV ("intro", NULL); DoFMV ("intro", NULL, FALSE);
InitGameKernel (); InitGameKernel ();
} }
@@ -86,7 +89,7 @@ Victory (void)
xform_buf[0] = FadeAllToBlack; xform_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2)); SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2));
DoFMV ("victory", NULL); DoFMV ("victory", NULL, TRUE);
InitGameKernel (); InitGameKernel ();
} }
-1
View File
@@ -142,7 +142,6 @@ DrawBatch (PPRIMITIVE lpBasePrim, PRIM_LINKS PrimLinks, register
register GRAPHICS_PRIM PrimType; register GRAPHICS_PRIM PrimType;
PPRIMITIVE lpWorkPrim; PPRIMITIVE lpWorkPrim;
RECT ClipRect; RECT ClipRect;
FRAMEPTR SrcFramePtr;
TFB_Palette color; TFB_Palette color;
DWORD c32k; DWORD c32k;
@@ -306,7 +306,8 @@ FRAMEPTR Build_Font_Effect (FRAMEPTR FramePtr, Uint32 from, Uint32 to, BYTE type
width = GetFrameWidth (FramePtr); width = GetFrameWidth (FramePtr);
height = GetFrameHeight (FramePtr); height = GetFrameHeight (FramePtr);
NewFrame = CaptureDrawable (CreateDrawable (RAM_DRAWABLE, (SIZE)width, (SIZE)height, 1)); NewFrame = CaptureDrawable (CreateDrawable ((CREATE_FLAGS)RAM_DRAWABLE,
(SIZE)width, (SIZE)height, 1));
tfbOrigImg = FramePtr->image; tfbOrigImg = FramePtr->image;
OrigImg = (SDL_Surface *)tfbOrigImg->NormalImg; OrigImg = (SDL_Surface *)tfbOrigImg->NormalImg;
SDL_LockSurface (OrigImg); SDL_LockSurface (OrigImg);
@@ -427,7 +427,7 @@ uint32 SoundDecoder_Decode (TFB_SoundDecoder *decoder)
if (rc < 0) if (rc < 0)
{ {
decoder->error = SOUNDDECODER_ERROR; decoder->error = SOUNDDECODER_ERROR;
fprintf (stderr, "SoundDecoder_Decode(): error decoding %s, code %d\n", decoder->filename, rc); fprintf (stderr, "SoundDecoder_Decode(): error decoding %s, code %ld\n", decoder->filename, rc);
return decoded_bytes; return decoded_bytes;
} }
if (rc == 0 || (close_on_done && buffer_size == (decoded_bytes + rc))) if (rc == 0 || (close_on_done && buffer_size == (decoded_bytes + rc)))
@@ -568,7 +568,7 @@ uint32 SoundDecoder_DecodeAll (TFB_SoundDecoder *decoder)
{ {
decoder->error = SOUNDDECODER_ERROR; decoder->error = SOUNDDECODER_ERROR;
fprintf (stderr, "SoundDecoder_DecodeAll(): " fprintf (stderr, "SoundDecoder_DecodeAll(): "
"error decoding %s, code %d\n", "error decoding %s, code %ld\n",
decoder->filename, rc); decoder->filename, rc);
return decoded_bytes; return decoded_bytes;
} }
+1 -1
View File
@@ -375,7 +375,7 @@ StreamDecoderTaskFunc (void *data)
if ((error = TFBSound_GetError()) != TFBSOUND_NO_ERROR) if ((error = TFBSound_GetError()) != TFBSOUND_NO_ERROR)
{ {
fprintf (stderr, "StreamDecoderTaskFunc(): TFBSound error after TFBSound_SourceQueueBuffers: %x, file %s, source %d, decoded_bytes %d\n", fprintf (stderr, "StreamDecoderTaskFunc(): TFBSound error after TFBSound_SourceQueueBuffers: %x, file %s, source %d, decoded_bytes %d\n",
error, i, soundSource[i].sample->decoder->filename, decoded_bytes); error, soundSource[i].sample->decoder->filename, i, decoded_bytes);
} }
} }
} }
+5 -3
View File
@@ -696,7 +696,7 @@ GetSoundData (void *data)
if (delta < 0) if (delta < 0)
{ {
fprintf (stderr, "GetSoundData(): something's messed with timing, delta %d\n", delta); fprintf (stderr, "GetSoundData(): something's messed with timing, delta %ld\n", delta);
delta = 0; delta = 0;
} }
else if (delta > (int)(soundSource[SPEECH_SOURCE].sbuf_size * 2)) else if (delta > (int)(soundSource[SPEECH_SOURCE].sbuf_size * 2))
@@ -711,7 +711,8 @@ GetSoundData (void *data)
if (pos % 2 == 1) if (pos % 2 == 1)
pos++; pos++;
assert (pos >= 0); // pos is an unsigned data type; this assertion cannot fail!
// assert (pos >= 0);
for (i = 0; i < RADAR_WIDTH - 2; ++i) for (i = 0; i < RADAR_WIDTH - 2; ++i)
{ {
@@ -783,7 +784,8 @@ GetSoundData (void *data)
if (pos % 2 == 1) if (pos % 2 == 1)
pos++; pos++;
assert (pos >= 0); // pos is an unsigned type; this assertion cannot fail!
// assert (pos >= 0);
for (i = 0; i < RADAR_WIDTH - 2; ++i) for (i = 0; i < RADAR_WIDTH - 2; ++i)
{ {
+3
View File
@@ -43,6 +43,9 @@ extern BOOLEAN DestroyVideo (VIDEO_REF VideoRef);
extern VIDEO_TYPE VidPlay (VIDEO_REF VidRef, char *loopname, BOOLEAN extern VIDEO_TYPE VidPlay (VIDEO_REF VidRef, char *loopname, BOOLEAN
uninit); uninit);
extern void VidStop (void); extern void VidStop (void);
void DoFMV (char *name, char *loopname, BOOLEAN uninit);
/* /*
extern BOOLEAN VidPlaying (void);*/ extern BOOLEAN VidPlaying (void);*/
+7 -4
View File
@@ -79,12 +79,15 @@ LoadPlanet (BOOLEAN IsDefined)
pPlanetDesc = pSolarSysState->pOrbitalDesc; pPlanetDesc = pSolarSysState->pOrbitalDesc;
/*
if (pPlanetDesc->data_index & PLANET_SHIELDED) if (pPlanetDesc->data_index & PLANET_SHIELDED)
; /* pSolarSysState->PlanetSideFrame[2] = CaptureDrawable ( pSolarSysState->PlanetSideFrame[2] = CaptureDrawable (
LoadGraphic (PLANET_SHIELDED_MASK_PMAP_ANIM) LoadGraphic (PLANET_SHIELDED_MASK_PMAP_ANIM)
); */ );
// else if (pSolarSysState->SysInfo.PlanetInfo.AtmoDensity != GAS_GIANT_ATMOSPHERE) else if (pSolarSysState->SysInfo.PlanetInfo.AtmoDensity != GAS_GIANT_ATMOSPHERE)
// LoadLanderData (); LoadLanderData ();
*/
{ {
extern void GeneratePlanetMask (PPLANET_DESC extern void GeneratePlanetMask (PPLANET_DESC
+5
View File
@@ -1904,8 +1904,13 @@ ExploreSolarSys (void)
universe.x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x)); universe.x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x));
universe.y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y)); universe.y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y));
CurStarDescPtr = FindStar (0, &universe, 1, 1);
/*
// The following code used to be there, but the test is
// pointless. Maybe we should panic here?
if ((CurStarDescPtr = FindStar (0, &universe, 1, 1)) == 0) if ((CurStarDescPtr = FindStar (0, &universe, 1, 1)) == 0)
; ;
*/
} }
GLOBAL_SIS (log_x) = UNIVERSE_TO_LOGX (CurStarDescPtr->star_pt.x); GLOBAL_SIS (log_x) = UNIVERSE_TO_LOGX (CurStarDescPtr->star_pt.x);
GLOBAL_SIS (log_y) = UNIVERSE_TO_LOGY (CurStarDescPtr->star_pt.y); GLOBAL_SIS (log_y) = UNIVERSE_TO_LOGY (CurStarDescPtr->star_pt.y);