- 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_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.
# 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);
}
else
{
mtof_zoommul = MAPUNIT;
}
am_zoomdir = 0;
// Change the scaling multipliers

View file

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

View file

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

View file

@ -3511,8 +3511,6 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
{
TActorIterator<AActor> srciter (args[0]);
if (args[1] == 0) dest = (AActor *) activator;
while ( (source = srciter.Next ()) )
{
if (args[1] != 0)
@ -3525,7 +3523,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
}
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
short(Scale ((2048-angle)&2047, 360, 2048)), 1, // angle, type
0, 0, // Skillfilter, Classfilter
7|MTF_SINGLE|224, // flags
0, {NULL}, NULL // special is 0, args and Conversation are NULL
7|MTF_SINGLE|224, // flags
0, {0}, 0 // special is 0, args and Conversation are 0
};
*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 };
int i;
angle_t an;
angle_t an = angle;
angle_t pitch;
AActor *linetarget;
int vrange = nofreeaim? ANGLE_1*35 : 0;

View file

@ -64,7 +64,7 @@ CCMD (dumpmap)
}
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);
@ -95,7 +95,7 @@ CCMD (dumpmap)
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;
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);
int i,j;
F3DFloor *rover, *fover;
F3DFloor *rover, *fover = NULL;
int passed, last;
fixed_t floorheight;
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 tz;
fixed_t xscale, yscale;
fixed_t xscale = FRACUNIT, yscale = FRACUNIT;
int x1;
int x2;

View file

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

View file

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

View file

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

View file

@ -498,7 +498,7 @@ void FTexture::FillBuffer(BYTE *buff, int pitch, int height, FTextureFormat fmt)
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);
CopyTrueColorPixels(&bmp, 0, 0, 0, &inf);
break;

View file

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

View file

@ -2037,7 +2037,7 @@ void V_InitFontColors ()
{
TArray<FName> names;
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<TempParmInfo> parminfo;
TArray<TempColorInfo> colorinfo;

View file

@ -1287,7 +1287,7 @@ bool FDInputJoystickManager::IsXInputDeviceFast(const GUID *guid)
UINT cbSize;
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)
{

View file

@ -1017,7 +1017,7 @@ FRawPS2Controller *FRawPS2Manager::EnumDevices()
UINT cbSize;
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.
// (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;
else
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_SETITEMDATA, i, (LPARAM)i);
}