- Fix errors/warnings from MinGW 4.5.0 (tdm-1).

- Disable the missing field initializers warnings that -Wextra produces from GCC.

SVN r3173 (trunk)
This commit is contained in:
Randy Heit 2011-03-29 05:20:33 +00:00
parent b477ed8490
commit d3b44a4172
19 changed files with 25 additions and 23 deletions

View file

@ -394,7 +394,7 @@ if( CMAKE_COMPILER_IS_GNUCXX )
set( CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${REL_CXX_FLAGS}" ) set( CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${REL_CXX_FLAGS}" )
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${REL_CXX_FLAGS}" ) set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${REL_CXX_FLAGS}" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused -Wextra" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused -Wextra -Wno-missing-field-initializers" )
# Remove extra warnings when using the official DirectX headers. # Remove extra warnings when using the official DirectX headers.
# Also, TDM-GCC 4.4.0 no longer accepts glibc-style printf formats as valid, # Also, TDM-GCC 4.4.0 no longer accepts glibc-style printf formats as valid,

View file

@ -1248,6 +1248,10 @@ void AM_changeWindowScale ()
{ {
mtof_zoommul = int(M_ZOOMOUT); mtof_zoommul = int(M_ZOOMOUT);
} }
else
{
mtof_zoommul = MAPUNIT;
}
am_zoomdir = 0; am_zoomdir = 0;
// Change the scaling multipliers // Change the scaling multipliers

View file

@ -1712,7 +1712,7 @@ static int PatchMisc (int dummy)
{ "IDKFA Armor", myoffsetof(struct DehInfo,KFAArmor) }, { "IDKFA Armor", myoffsetof(struct DehInfo,KFAArmor) },
{ "IDKFA Armor Class", myoffsetof(struct DehInfo,KFAAC) }, { "IDKFA Armor Class", myoffsetof(struct DehInfo,KFAAC) },
{ "No Autofreeze", myoffsetof(struct DehInfo,NoAutofreeze) }, { "No Autofreeze", myoffsetof(struct DehInfo,NoAutofreeze) },
{ NULL, NULL } { NULL, 0 }
}; };
int result; int result;

View file

@ -538,7 +538,7 @@ void DObject::SerializeUserVars(FArchive &arc)
PSymbolTable *symt; PSymbolTable *symt;
FName varname; FName varname;
DWORD count, j; DWORD count, j;
int *varloc; int *varloc = NULL;
symt = &GetClass()->Symbols; symt = &GetClass()->Symbols;

View file

@ -3511,8 +3511,6 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
{ {
TActorIterator<AActor> srciter (args[0]); TActorIterator<AActor> srciter (args[0]);
if (args[1] == 0) dest = (AActor *) activator;
while ( (source = srciter.Next ()) ) while ( (source = srciter.Next ()) )
{ {
if (args[1] != 0) if (args[1] != 0)
@ -3525,7 +3523,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
} }
else else
{ {
if (P_CheckSight(source, dest, flags)) return 1; if (P_CheckSight(source, activator, flags)) return 1;
} }
} }
} }

View file

@ -767,8 +767,8 @@ static void CreateStartSpot (fixed_t *pos, FMapThing *start)
0, (LittleLong(pos[0])<<12), ((-LittleLong(pos[1]))<<12), 0,// tid, x, y, z 0, (LittleLong(pos[0])<<12), ((-LittleLong(pos[1]))<<12), 0,// tid, x, y, z
short(Scale ((2048-angle)&2047, 360, 2048)), 1, // angle, type short(Scale ((2048-angle)&2047, 360, 2048)), 1, // angle, type
0, 0, // Skillfilter, Classfilter 0, 0, // Skillfilter, Classfilter
7|MTF_SINGLE|224, // flags 7|MTF_SINGLE|224, // flags
0, {NULL}, NULL // special is 0, args and Conversation are NULL 0, {0}, 0 // special is 0, args and Conversation are 0
}; };
*start = mt; *start = mt;

View file

@ -5218,7 +5218,7 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z,
{ {
static const int angdiff[3] = { -1<<26, 1<<26, 0 }; static const int angdiff[3] = { -1<<26, 1<<26, 0 };
int i; int i;
angle_t an; angle_t an = angle;
angle_t pitch; angle_t pitch;
AActor *linetarget; AActor *linetarget;
int vrange = nofreeaim? ANGLE_1*35 : 0; int vrange = nofreeaim? ANGLE_1*35 : 0;

View file

@ -64,7 +64,7 @@ CCMD (dumpmap)
} }
wadinfo_t header = { PWAD_ID, 12, 0 }; wadinfo_t header = { PWAD_ID, 12, 0 };
wadlump_t lumps[12] = { {0, 0, {NULL}} }; wadlump_t lumps[12] = { {0, 0, {0}} };
fseek (file, 12, SEEK_SET); fseek (file, 12, SEEK_SET);
@ -95,7 +95,7 @@ CCMD (dumpmap)
static int WriteTHINGS (FILE *file) static int WriteTHINGS (FILE *file)
{ {
mapthinghexen_t mt = { 0, 0, 0, 0, 0, 0, 0, 0, {NULL} }; mapthinghexen_t mt = { 0, 0, 0, 0, 0, 0, 0, 0, {0} };
AActor *mo = players[consoleplayer].mo; AActor *mo = players[consoleplayer].mo;
mt.x = LittleShort(short(mo->x >> FRACBITS)); mt.x = LittleShort(short(mo->x >> FRACBITS));

View file

@ -592,7 +592,7 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2)
{ {
FTexture *const DONT_DRAW = ((FTexture*)(intptr_t)-1); FTexture *const DONT_DRAW = ((FTexture*)(intptr_t)-1);
int i,j; int i,j;
F3DFloor *rover, *fover; F3DFloor *rover, *fover = NULL;
int passed, last; int passed, last;
fixed_t floorheight; fixed_t floorheight;
fixed_t ceilingheight; fixed_t ceilingheight;

View file

@ -1695,7 +1695,7 @@ void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor
fixed_t tx, tx2; fixed_t tx, tx2;
fixed_t tz; fixed_t tz;
fixed_t xscale, yscale; fixed_t xscale = FRACUNIT, yscale = FRACUNIT;
int x1; int x1;
int x2; int x2;

View file

@ -268,7 +268,7 @@ static const hexenseq_t HexenSequences[] = {
{ NAME_DoorCreak, { HexenDoorSeq(3), HexenLastSeq } }, { NAME_DoorCreak, { HexenDoorSeq(3), HexenLastSeq } },
{ NAME_DoorMetal2, { HexenDoorSeq(9), HexenLastSeq } }, { NAME_DoorMetal2, { HexenDoorSeq(9), HexenLastSeq } },
{ NAME_Wind, { HexenEnvSeq(10), HexenLastSeq } }, { NAME_Wind, { HexenEnvSeq(10), HexenLastSeq } },
{ NAME_None, {NULL} } { NAME_None, {0} }
}; };
static int SeqTrans[64*3]; static int SeqTrans[64*3];

View file

@ -725,7 +725,7 @@ void MIDIStreamer::Update()
CloseHandle(PlayerThread); CloseHandle(PlayerThread);
PlayerThread = NULL; PlayerThread = NULL;
Printf ("MIDI playback failure: "); Printf ("MIDI playback failure: ");
if (code >= 0 && code < countof(MMErrorCodes)) if (code < countof(MMErrorCodes))
{ {
Printf("%s\n", MMErrorCodes[code]); Printf("%s\n", MMErrorCodes[code]);
} }

View file

@ -124,7 +124,7 @@ inline unsigned __int64 rdtsc()
return 0; return 0;
} }
#else #else
inline volatile unsigned long long rdtsc() inline unsigned long long rdtsc()
{ {
#ifndef __amd64__ #ifndef __amd64__
if (CPU.bRDTSC) if (CPU.bRDTSC)

View file

@ -498,7 +498,7 @@ void FTexture::FillBuffer(BYTE *buff, int pitch, int height, FTextureFormat fmt)
case TEX_RGB: case TEX_RGB:
{ {
FCopyInfo inf = {OP_OVERWRITE, BLEND_NONE, {NULL}, 0, 0}; FCopyInfo inf = {OP_OVERWRITE, BLEND_NONE, {0}, 0, 0};
FBitmap bmp(buff, pitch, pitch/4, height); FBitmap bmp(buff, pitch, pitch/4, height);
CopyTrueColorPixels(&bmp, 0, 0, 0, &inf); CopyTrueColorPixels(&bmp, 0, 0, 0, &inf);
break; break;

View file

@ -1115,7 +1115,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomBulletAttack)
int i; int i;
int bangle; int bangle;
int bslope; int bslope = 0;
if (self->target || (Flags & CBAF_AIMFACING)) if (self->target || (Flags & CBAF_AIMFACING))
{ {
@ -1288,7 +1288,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireBullets)
int i; int i;
int bangle; int bangle;
int bslope; int bslope = 0;
if ((Flags & FBF_USEAMMO) && weapon) if ((Flags & FBF_USEAMMO) && weapon)
{ {

View file

@ -2037,7 +2037,7 @@ void V_InitFontColors ()
{ {
TArray<FName> names; TArray<FName> names;
int lump, lastlump = 0; int lump, lastlump = 0;
TranslationParm tparm = { 0, 0, {NULL}, {NULL} }; // Silence GCC (for real with -Wextra ) TranslationParm tparm = { 0, 0, {0}, {0} }; // Silence GCC (for real with -Wextra )
TArray<TranslationParm> parms; TArray<TranslationParm> parms;
TArray<TempParmInfo> parminfo; TArray<TempParmInfo> parminfo;
TArray<TempColorInfo> colorinfo; TArray<TempColorInfo> colorinfo;

View file

@ -1287,7 +1287,7 @@ bool FDInputJoystickManager::IsXInputDeviceFast(const GUID *guid)
UINT cbSize; UINT cbSize;
cbSize = rdi.cbSize = sizeof(rdi); cbSize = rdi.cbSize = sizeof(rdi);
if (MyGetRawInputDeviceInfoA(devices[i].hDevice, RIDI_DEVICEINFO, &rdi, &cbSize) >= 0) if ((INT)MyGetRawInputDeviceInfoA(devices[i].hDevice, RIDI_DEVICEINFO, &rdi, &cbSize) >= 0)
{ {
if(MAKELONG(rdi.hid.dwVendorId, rdi.hid.dwProductId) == (LONG)guid->Data1) if(MAKELONG(rdi.hid.dwVendorId, rdi.hid.dwProductId) == (LONG)guid->Data1)
{ {

View file

@ -1017,7 +1017,7 @@ FRawPS2Controller *FRawPS2Manager::EnumDevices()
UINT cbSize; UINT cbSize;
cbSize = rdi.cbSize = sizeof(rdi); cbSize = rdi.cbSize = sizeof(rdi);
if (MyGetRawInputDeviceInfoA(devices[i].hDevice, RIDI_DEVICEINFO, &rdi, &cbSize) >= 0) if ((INT)MyGetRawInputDeviceInfoA(devices[i].hDevice, RIDI_DEVICEINFO, &rdi, &cbSize) >= 0)
{ {
// All the PS2 adapters report themselves as joysticks. // All the PS2 adapters report themselves as joysticks.
// (By comparison, the 360 controller reports itself as a gamepad.) // (By comparison, the 360 controller reports itself as a gamepad.)

View file

@ -1108,7 +1108,7 @@ BOOL CALLBACK IWADBoxCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
filepart = WadList[i].Path; filepart = WadList[i].Path;
else else
filepart++; filepart++;
work.Format("%s (%s)", WadList[i].Name, filepart); work.Format("%s (%s)", WadList[i].Name.GetChars(), filepart);
SendMessage(ctrl, LB_ADDSTRING, 0, (LPARAM)work.GetChars()); SendMessage(ctrl, LB_ADDSTRING, 0, (LPARAM)work.GetChars());
SendMessage(ctrl, LB_SETITEMDATA, i, (LPARAM)i); SendMessage(ctrl, LB_SETITEMDATA, i, (LPARAM)i);
} }