- Fix some GCC 4.7.1 warnings.

SVN r3747 (trunk)
This commit is contained in:
Randy Heit 2012-07-07 03:43:11 +00:00
parent f0d60ddcee
commit fd784b05c2
18 changed files with 38 additions and 37 deletions

View file

@ -41,7 +41,7 @@ public:
public:
// deprecated
Music_Emu::load;
using Music_Emu::load;
blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader
{ return load_remaining_( &h, sizeof h, in ); }

View file

@ -34,7 +34,7 @@ public:
public:
// deprecated
Music_Emu::load;
using Music_Emu::load;
blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader
{ return load_remaining_( &h, sizeof h, in ); }
enum { gym_rate = 60 };

View file

@ -58,7 +58,7 @@ public:
void ignore_silence( bool disable = true );
// Info for current track
Gme_File::track_info;
using Gme_File::track_info;
blargg_err_t track_info( track_info_t* out ) const;
// Sound customization

View file

@ -44,7 +44,7 @@ public:
public:
// deprecated
Music_Emu::load;
using Music_Emu::load;
blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader
{ return load_remaining_( &h, sizeof h, in ); }

View file

@ -46,7 +46,7 @@ public:
public:
// deprecated
struct header_t { char tag [4]; };
Music_Emu::load;
using Music_Emu::load;
blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader
{ return load_remaining_( &h, sizeof h, in ); }
void disable_playlist( bool = true ); // use clear_playlist()

View file

@ -47,7 +47,7 @@ public:
public:
// deprecated
Music_Emu::load;
using Music_Emu::load;
blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader
{ return load_remaining_( &h, sizeof h, in ); }
byte const* trailer() const; // use track_info()

View file

@ -51,7 +51,7 @@ public:
public:
// deprecated
Music_Emu::load;
using Music_Emu::load;
blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader
{ return load_remaining_( &h, sizeof h, in ); }
byte const* gd3_data( int* size_out = 0 ) const; // use track_info()

View file

@ -217,10 +217,10 @@ int PackUserCmd (const usercmd_t *ucmd, const usercmd_t *basis, BYTE **stream)
buttons_changed = ucmd->buttons ^ basis->buttons;
if (buttons_changed != 0)
{
BYTE bytes[4] = { ucmd->buttons & 0x7F,
(ucmd->buttons >> 7) & 0x7F,
(ucmd->buttons >> 14) & 0x7F,
(ucmd->buttons >> 21) & 0xFF };
BYTE bytes[4] = { BYTE(ucmd->buttons & 0x7F),
BYTE((ucmd->buttons >> 7) & 0x7F),
BYTE((ucmd->buttons >> 14) & 0x7F),
BYTE((ucmd->buttons >> 21) & 0xFF) };
flags |= UCMDF_BUTTONS;

View file

@ -2104,7 +2104,7 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio
if (level.time != 0 || level.maptime != 0)
{
DWORD time[2] = { BigLong(TICRATE), BigLong(level.time) };
DWORD time[2] = { DWORD(BigLong(TICRATE)), DWORD(BigLong(level.time)) };
M_AppendPNGChunk (stdfile, MAKE_ID('p','t','I','c'), (BYTE *)&time, 8);
}

View file

@ -384,19 +384,19 @@ PNGHandle *M_VerifyPNG (FILE *file)
if (fread (&data, 1, 8, file) != 8)
{
return false;
return NULL;
}
if (data[0] != MAKE_ID(137,'P','N','G') || data[1] != MAKE_ID(13,10,26,10))
{ // Does not have PNG signature
return false;
return NULL;
}
if (fread (&data, 1, 8, file) != 8)
{
return false;
return NULL;
}
if (data[1] != MAKE_ID('I','H','D','R'))
{ // IHDR must be the first chunk
return false;
return NULL;
}
// It looks like a PNG so far, so start creating a PNGHandle for it
@ -451,7 +451,7 @@ PNGHandle *M_VerifyPNG (FILE *file)
}
delete png;
return false;
return NULL;
}
//==========================================================================

View file

@ -235,13 +235,13 @@ void DiskWriterIO::OPLwriteReg(int which, uint reg, uchar data)
{
if (reg != 0 && reg != 2 && (reg != 255 || data != 255))
{
BYTE cmd[2] = { data, reg };
BYTE cmd[2] = { data, BYTE(reg) };
fwrite(cmd, 1, 2, File);
}
}
else
{
BYTE cmd[3] = { 4, reg, data };
BYTE cmd[3] = { 4, BYTE(reg), data };
fwrite (cmd + (reg > 4), 1, 3 - (reg > 4), File);
}
}
@ -261,7 +261,7 @@ void DiskWriterIO :: SetChip(int chipnum)
CurChip = chipnum;
if (Format == FMT_RDOS)
{
BYTE switcher[2] = { chipnum + 1, 2 };
BYTE switcher[2] = { BYTE(chipnum + 1), 2 };
fwrite(switcher, 1, 2, File);
}
else
@ -309,7 +309,7 @@ void DiskWriterIO::SetClockRate(double samples_per_tick)
}
else
{ // Change the clock rate in the middle of the song.
BYTE clock_change[4] = { 0, 2, clock_word & 255, clock_word >> 8 };
BYTE clock_change[4] = { 0, 2, BYTE(clock_word & 255), BYTE(clock_word >> 8) };
fwrite(clock_change, 1, 4, File);
}
}

View file

@ -154,7 +154,7 @@ inline bool FWadFile::IsMarker(int lump, const char *marker)
struct Marker
{
int markertype;
int index;
unsigned int index;
};
void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, namespace_t space, bool flathack)
@ -191,8 +191,8 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name
{
// We have found no F_START but one or more F_END markers.
// mark all lumps before the last F_END marker as potential flats.
int end = markers[markers.Size()-1].index;
for(int i = 0; i < end; i++)
unsigned int end = markers[markers.Size()-1].index;
for(unsigned int i = 0; i < end; i++)
{
if (Lumps[i].LumpSize == 4096)
{

View file

@ -14,7 +14,7 @@
#ifndef PR_SET_PTRACER
#define PR_SET_PTRACER 0x59616d61
#endif
#else if defined (__APPLE__)
#elif defined (__APPLE__)
#include <signal.h>
#endif

View file

@ -532,7 +532,7 @@ DUMBFILE *dumb_read_allfile(dumbfile_mem_status *filestate, BYTE *start, FILE *f
if (fread(mem + lenhave, 1, lenfull - lenhave, file) != (size_t)(lenfull - lenhave))
{
delete[] mem;
return false;
return NULL;
}
filestate->ptr = mem;
}

View file

@ -465,7 +465,7 @@ void FTextureManager::ParseRangeAnim (FScanner &sc, FTextureID picnum, int usety
void FTextureManager::ParsePicAnim (FScanner &sc, FTextureID picnum, int usetype, bool missing, TArray<FAnimDef::FAnimFrame> &frames)
{
FTextureID framenum;
DWORD min, max;
DWORD min = 1, max = 1;
framenum = ParseFramenum (sc, picnum, usetype, missing);
ParseTime (sc, min, max);
@ -536,6 +536,7 @@ void FTextureManager::ParseTime (FScanner &sc, DWORD &min, DWORD &max)
}
else
{
min = max = 1;
sc.ScriptError ("Must specify a duration for animation frame");
}
}

View file

@ -71,10 +71,10 @@ protected:
FTexture *EmptyTexture_TryCreate(FileReader & file, int lumpnum)
{
char check[8];
if (file.GetLength() != 8) return false;
if (file.GetLength() != 8) return NULL;
file.Seek(0, SEEK_SET);
if (file.Read(check, 8) != 8) return false;
if (memcmp(check, "\0\0\0\0\0\0\0\0", 8)) return false;
if (file.Read(check, 8) != 8) return NULL;
if (memcmp(check, "\0\0\0\0\0\0\0\0", 8)) return NULL;
return new FEmptyTexture(lumpnum);
}

View file

@ -1032,7 +1032,7 @@ FxCompareRel::FxCompareRel(int o, FxExpression *l, FxExpression *r)
FxExpression *FxCompareRel::Resolve(FCompileContext& ctx)
{
CHECKRESOLVED();
if (!ResolveLR(ctx, true)) return false;
if (!ResolveLR(ctx, true)) return NULL;
if (!ValueType.isNumeric())
{
@ -1126,7 +1126,7 @@ FxExpression *FxCompareEq::Resolve(FCompileContext& ctx)
{
CHECKRESOLVED();
if (!ResolveLR(ctx, true)) return false;
if (!ResolveLR(ctx, true)) return NULL;
if (!left || !right)
{
@ -1229,7 +1229,7 @@ FxBinaryInt::FxBinaryInt(int o, FxExpression *l, FxExpression *r)
FxExpression *FxBinaryInt::Resolve(FCompileContext& ctx)
{
CHECKRESOLVED();
if (!ResolveLR(ctx, false)) return false;
if (!ResolveLR(ctx, false)) return NULL;
if (ctx.lax && ValueType == VAL_Float)
{