- Fixed GCC 4 warnings in FNodeBuilder::CreateSubsectorsForReal().

- Changed f_finale.cpp/atkstates[] into a static variable, since its
  anonymous type prevents it from being accessed from other files anyway.
- Fixed: The behavior of the eventtail advancement in d_net.cpp/CheckAbort()
  was compiler-dependant.
- Fixed warnings GCC 4 threw up while compiling re2c and lemon.
- Removed __cdecl from makewad.c again. This is already defined as a builtin
  for MinGW, and redefining it produces a warning. (Why is main explicitly
  declared __cdecl anyway?)
- Fixed building ccdv-win32 with GCC 4. GCC 4 creates a memcpy call, which
  won't work because it doesn't get linked with the standard C library.


SVN r135 (trunk)
This commit is contained in:
Randy Heit 2006-05-22 01:34:07 +00:00
parent 62b7dd3efc
commit df799ade24
23 changed files with 2914 additions and 2169 deletions

View file

@ -35,7 +35,7 @@ RELEASEOBJDIR = releaseobj
CCDV = @ccdv CCDV = @ccdv
FMODDIR = c:/fmods/fmodapi374win FMODDIR = "c:/program files/fmodapi375win"
CPPFLAGS = -DWIN32 -D_WIN32 -D_WINDOWS -DHAVE_STRUPR -DHAVE_FILELENGTH -DI_DO_NOT_LIKE_BIG_DOWNLOADS -D__forceinline=inline -MMD -Izlib -IFLAC -Isrc -Isrc/win32 -Isrc/g_doom -Isrc/g_heretic -I src/g_hexen -Isrc/g_raven -Isrc/g_strife -Isrc/g_shared -Isrc/oplsynth -Isrc/sound CPPFLAGS = -DWIN32 -D_WIN32 -D_WINDOWS -DHAVE_STRUPR -DHAVE_FILELENGTH -DI_DO_NOT_LIKE_BIG_DOWNLOADS -D__forceinline=inline -MMD -Izlib -IFLAC -Isrc -Isrc/win32 -Isrc/g_doom -Isrc/g_heretic -I src/g_hexen -Isrc/g_raven -Isrc/g_strife -Isrc/g_shared -Isrc/oplsynth -Isrc/sound
LDFLAGS += flac/libflac.a zlib/libz.a -lfmod -lwsock32 -lwinmm -lddraw -ldsound -ldxguid -ldinput8 -lole32 -luser32 -lgdi32 -lcomctl32 -lcomdlg32 -lsetupapi -lws2_32 -Wl,--subsystem,windows LDFLAGS += flac/libflac.a zlib/libz.a -lfmod -lwsock32 -lwinmm -lddraw -ldsound -ldxguid -ldinput8 -lole32 -luser32 -lgdi32 -lcomctl32 -lcomdlg32 -lsetupapi -lws2_32 -Wl,--subsystem,windows

View file

@ -77,7 +77,7 @@ static void DumpFormattedOutput()
DWORD out; DWORD out;
WORD color; WORD color;
char *cp; char *cp;
char spaces[8 + 1] = " "; char spaces[8 + 1];
char *saved; char *saved;
int curcol; int curcol;
int i; int i;
@ -89,6 +89,16 @@ static void DumpFormattedOutput()
return; return;
} }
spaces[0] = ' ';
spaces[1] = ' ';
spaces[2] = ' ';
spaces[3] = ' ';
spaces[4] = ' ';
spaces[5] = ' ';
spaces[6] = ' ';
spaces[7] = ' ';
spaces[8] = '\0';
color = info.wAttributes & ~(FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_INTENSITY); color = info.wAttributes & ~(FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_INTENSITY);
curcol = 0; curcol = 0;
saved = NULL; saved = NULL;

View file

@ -1,3 +1,16 @@
May 21, 2006
- Fixed GCC 4 warnings in FNodeBuilder::CreateSubsectorsForReal().
- Changed f_finale.cpp/atkstates[] into a static variable, since its
anonymous type prevents it from being accessed from other files anyway.
- Fixed: The behavior of the eventtail advancement in d_net.cpp/CheckAbort()
was compiler-dependant.
- Fixed warnings GCC 4 threw up while compiling re2c and lemon.
- Removed __cdecl from makewad.c again. This is already defined as a builtin
for MinGW, and redefining it produces a warning. (Why is main explicitly
declared __cdecl anyway?)
- Fixed building ccdv-win32 with GCC 4. GCC 4 creates a memcpy call, which
won't work because it doesn't get linked with the standard C library.
May 20, 2006 May 20, 2006
- Fixed default.cbd and Makefile.mingw for current code state. - Fixed default.cbd and Makefile.mingw for current code state.
- New: Pausing the game (through any means, not just the pause key) now pauses - New: Pausing the game (through any means, not just the pause key) now pauses

View file

@ -336,11 +336,11 @@ private:
Span DummySpan[2]; Span DummySpan[2];
int LumpNum; int LumpNum;
}; };
static FAutomapTexture *mapback; // the automap background static FAutomapTexture *mapback; // the automap background
static fixed_t mapystart=0; // y-value for the start of the map bitmap...used in the parallax stuff. static fixed_t mapystart=0; // y-value for the start of the map bitmap...used in the parallax stuff.
static fixed_t mapxstart=0; //x-value for the bitmap. static fixed_t mapxstart=0; //x-value for the bitmap.
static BOOL stopped = true; static BOOL stopped = true;
@ -543,22 +543,22 @@ static void AM_ClipRotatedExtents ()
static void AM_ScrollParchment (fixed_t dmapx, fixed_t dmapy) static void AM_ScrollParchment (fixed_t dmapx, fixed_t dmapy)
{ {
mapxstart -= MulScale12 (dmapx, scale_mtof); mapxstart -= MulScale12 (dmapx, scale_mtof);
mapystart -= MulScale12 (dmapy, scale_mtof); mapystart -= MulScale12 (dmapy, scale_mtof);
if (mapback != NULL) if (mapback != NULL)
{ {
int pwidth = mapback->GetWidth() << MAPBITS; int pwidth = mapback->GetWidth() << MAPBITS;
int pheight = mapback->GetHeight() << MAPBITS; int pheight = mapback->GetHeight() << MAPBITS;
while(mapxstart > 0) while(mapxstart > 0)
mapxstart -= pwidth; mapxstart -= pwidth;
while(mapxstart <= -pwidth) while(mapxstart <= -pwidth)
mapxstart += pwidth; mapxstart += pwidth;
while(mapystart > 0) while(mapystart > 0)
mapystart -= pheight; mapystart -= pheight;
while(mapystart <= -pheight) while(mapystart <= -pheight)
mapystart += pheight; mapystart += pheight;
} }
} }
@ -1066,15 +1066,15 @@ void AM_doFollowPlayer ()
m_x2 = m_x + m_w; m_x2 = m_x + m_w;
m_y2 = m_y + m_h; m_y2 = m_y + m_h;
// do the parallax parchment scrolling. // do the parallax parchment scrolling.
sx = (players[consoleplayer].camera->x - f_oldloc.x) >> FRACTOMAPBITS; sx = (players[consoleplayer].camera->x - f_oldloc.x) >> FRACTOMAPBITS;
sy = (f_oldloc.y - players[consoleplayer].camera->y) >> FRACTOMAPBITS; sy = (f_oldloc.y - players[consoleplayer].camera->y) >> FRACTOMAPBITS;
if (am_rotate == 1 || (am_rotate == 2 && viewactive)) if (am_rotate == 1 || (am_rotate == 2 && viewactive))
{ {
AM_rotate (&sx, &sy, players[consoleplayer].camera->angle - ANG90); AM_rotate (&sx, &sy, players[consoleplayer].camera->angle - ANG90);
} }
AM_ScrollParchment (sx, sy); AM_ScrollParchment (sx, sy);
f_oldloc.x = players[consoleplayer].camera->x; f_oldloc.x = players[consoleplayer].camera->x;
f_oldloc.y = players[consoleplayer].camera->y; f_oldloc.y = players[consoleplayer].camera->y;
} }
@ -1114,18 +1114,18 @@ void AM_clearFB (int color)
} }
else else
{ {
int pwidth = mapback->GetWidth(); int pwidth = mapback->GetWidth();
int pheight = mapback->GetHeight(); int pheight = mapback->GetHeight();
int x, y; int x, y;
//blit the automap background to the screen. //blit the automap background to the screen.
for (y = mapystart >> MAPBITS; y < f_h; y += pheight) for (y = mapystart >> MAPBITS; y < f_h; y += pheight)
{ {
for (x = mapxstart >> MAPBITS; x < f_w; x += pwidth) for (x = mapxstart >> MAPBITS; x < f_w; x += pwidth)
{ {
screen->DrawTexture (mapback, x, y, DTA_ClipBottom, f_h, TAG_DONE); screen->DrawTexture (mapback, x, y, DTA_ClipBottom, f_h, TAG_DONE);
} }
} }
} }
} }

View file

@ -733,7 +733,7 @@ CCMD(monster)
if (CheckCheatmode ()) return; if (CheckCheatmode ()) return;
TThinkerIterator<AActor> it; TThinkerIterator<AActor> it;
while (mo=it.Next()) while ( (mo = it.Next()) )
{ {
if (mo->flags3&MF3_ISMONSTER && !(mo->flags&MF_CORPSE) && !(mo->flags&MF_FRIENDLY)) if (mo->flags3&MF3_ISMONSTER && !(mo->flags&MF_CORPSE) && !(mo->flags&MF_FRIENDLY))
{ {
@ -756,7 +756,7 @@ CCMD(items)
if (CheckCheatmode ()) return; if (CheckCheatmode ()) return;
TThinkerIterator<AActor> it; TThinkerIterator<AActor> it;
while (mo=it.Next()) while ( (mo = it.Next()) )
{ {
if (mo->IsKindOf(RUNTIME_CLASS(AInventory)) && mo->flags&MF_SPECIAL) if (mo->IsKindOf(RUNTIME_CLASS(AInventory)) && mo->flags&MF_SPECIAL)
{ {

View file

@ -1272,7 +1272,7 @@ BOOL CheckAbort (void)
I_WaitForTic (I_GetTime (false) + TICRATE/4); I_WaitForTic (I_GetTime (false) + TICRATE/4);
I_StartTic (); I_StartTic ();
for ( ; eventtail != eventhead for ( ; eventtail != eventhead
; eventtail = (++eventtail)&(MAXEVENTS-1) ) ; eventtail = (eventtail+1)&(MAXEVENTS-1) )
{ {
ev = &events[eventtail]; ev = &events[eventtail];
if (ev->type == EV_KeyDown && ev->data1 == KEY_ESCAPE) if (ev->type == EV_KeyDown && ev->data1 == KEY_ESCAPE)

View file

@ -478,7 +478,7 @@ castinfo_t castorder[] =
{0, NULL} {0, NULL}
}; };
struct static struct
{ {
const char *type; const char *type;
byte melee; byte melee;

View file

@ -172,6 +172,10 @@ void FNodeBuilder::CreateSubsectorsForReal ()
unsigned int i; unsigned int i;
sub.poly = NULL; sub.poly = NULL;
sub.validcount = 0;
sub.CenterX = 0; // Code in p_setup.cpp will set these for us later.
sub.CenterY = 0;
sub.sector = NULL;
for (i = 0; i < SubsectorSets.Size(); ++i) for (i = 0; i < SubsectorSets.Size(); ++i)
{ {

View file

@ -333,7 +333,7 @@ void FNodeBuilder::FindPolyContainers (TArray<FPolyStart> &spots, TArray<FPolySt
if (GetPolyExtents (spot->polynum, bbox)) if (GetPolyExtents (spot->polynum, bbox))
{ {
FPolyStart *anchor; FPolyStart *anchor = NULL;
unsigned int j; unsigned int j;

View file

@ -96,6 +96,8 @@ struct OPLdata {
}; };
struct OPLio { struct OPLio {
virtual ~OPLio() {}
void OPLwriteChannel(uint regbase, uint channel, uchar data1, uchar data2); void OPLwriteChannel(uint regbase, uint channel, uchar data1, uchar data2);
void OPLwriteValue(uint regbase, uint channel, uchar value); void OPLwriteValue(uint regbase, uint channel, uchar value);
void OPLwriteFreq(uint channel, uint freq, uint octave, uint keyon); void OPLwriteFreq(uint channel, uint freq, uint octave, uint keyon);

View file

@ -273,7 +273,7 @@ void MessagePump (const SDL_Event &sev)
else else
{ // set focus { // set focus
if (!paused) if (!paused)
S_ResumeSound (false); S_ResumeSound ();
} }
} }
break; break;

View file

@ -3014,7 +3014,7 @@ static void ActorFlagSetOrReset (AActor *defaults, Baggage &bag)
SC_MustGetString (); SC_MustGetString ();
part2 = sc_String; part2 = sc_String;
} }
if (fd = FindFlag (bag.Info->Class, part1.GetChars(), part2)) if ( (fd = FindFlag (bag.Info->Class, part1.GetChars(), part2)) )
{ {
DWORD * flagvar = (DWORD*) ((char*)defaults + fd->structoffset); DWORD * flagvar = (DWORD*) ((char*)defaults + fd->structoffset);
if (mod == '+') if (mod == '+')

View file

@ -1530,7 +1530,7 @@ void A_KillChildren(AActor * self)
TThinkerIterator<AActor> it; TThinkerIterator<AActor> it;
AActor * mo; AActor * mo;
while (mo=it.Next()) while ( (mo = it.Next()) )
{ {
if (mo->master == self) if (mo->master == self)
{ {

View file

@ -623,7 +623,7 @@ void FWadCollection::AddFile (const char *filename, const char * data, int lengt
{ {
char * c; char * c;
while (c=(char*)memchr(lump_p->name, '^', 8)) while ((c=(char*)memchr(lump_p->name, '^', 8)))
{ {
*c='\\'; *c='\\';
} }

View file

@ -31,7 +31,7 @@
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** **
*/ */
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#define _WIN32_WINNT 0x0501 #define _WIN32_WINNT 0x0501
#include <windows.h> #include <windows.h>
@ -1005,16 +1005,16 @@ static void WriteBlock (HANDLE file, LPCVOID buffer, DWORD bytes, z_stream *stre
stream->avail_in = bytes; stream->avail_in = bytes;
*crc = crc32 (*crc, (const Bytef *)buffer, bytes); *crc = crc32 (*crc, (const Bytef *)buffer, bytes);
while (stream->avail_in != 0) while (stream->avail_in != 0)
{ {
if (stream->avail_out == 0) if (stream->avail_out == 0)
{ {
stream->next_out = outbuf; stream->next_out = outbuf;
stream->avail_out = sizeof(tar::record); stream->avail_out = sizeof(tar::record);
WriteFile (file, outbuf, sizeof(tar::record), &bytes, NULL); WriteFile (file, outbuf, sizeof(tar::record), &bytes, NULL);
} }
deflate (stream, Z_NO_FLUSH); deflate (stream, Z_NO_FLUSH);
} }
} }
} }
@ -2780,7 +2780,7 @@ void DisplayCrashLog ()
{ {
HINSTANCE riched; HINSTANCE riched;
HANDLE file; HANDLE file;
bool gzipped; bool gzipped = false;
if (NumFiles == 0 || (riched = LoadLibrary ("riched20.dll")) == NULL) if (NumFiles == 0 || (riched = LoadLibrary ("riched20.dll")) == NULL)
{ {

File diff suppressed because it is too large Load diff

View file

@ -23,7 +23,7 @@ int ErrorCount;
void WriteWord (int word); void WriteWord (int word);
void WriteLabel (char *label); void WriteLabel (char *label);
void WriteWords (int count, short *array); void WriteWords (int count, short *array);
void WriteBytes (int count, char *array); void WriteBytes (int count, unsigned char *array);
void WriteNameTable (); void WriteNameTable ();
@ -855,7 +855,7 @@ void WriteWords (int count, short *array)
} }
} }
void WriteBytes (int count, char *array) void WriteBytes (int count, unsigned char *array)
{ {
WriteWord (count); WriteWord (count);
fwrite (array, 1, count, Dest); fwrite (array, 1, count, Dest);
@ -952,7 +952,7 @@ void WriteHeights ()
void WriteCodePConv () void WriteCodePConv ()
{ {
WriteLabel ("CODP"); WriteLabel ("CODP");
WriteWords (CodePMapSize, CodePMap); WriteWords (CodePMapSize, (short *)CodePMap);
} }
void WriteSprites () void WriteSprites ()

View file

@ -2359,7 +2359,7 @@ static void preprocess_input(char *z){
void Parse(gp) void Parse(gp)
struct lemon *gp; struct lemon *gp;
{ {
struct pstate ps; struct pstate ps = { 0, };
FILE *fp; FILE *fp;
char *filebuf; char *filebuf;
int filesize; int filesize;

View file

@ -450,11 +450,7 @@ int buildwad (FILE *listfile, char *listfilename, char *makecmd, char *makefile)
return ret; return ret;
} }
#if !defined(_MSC_VER) int main (int argc, char **argv)
#define __cdecl
#endif
int __cdecl main (int argc, char **argv)
{ {
FILE *listfile = NULL; FILE *listfile = NULL;
char *listfilename = NULL; char *listfilename = NULL;

View file

@ -16,6 +16,7 @@ public:
State *state; State *state;
public: public:
Action(State*); Action(State*);
virtual ~Action() {}
virtual void emit(std::ostream&, bool&) = 0; virtual void emit(std::ostream&, bool&) = 0;
virtual bool isRule() const; virtual bool isRule() const;
virtual bool isMatch() const; virtual bool isMatch() const;

View file

@ -45,6 +45,7 @@ inline std::ostream& operator<<(std::ostream &o, const Range *r){
class RegExp { class RegExp {
public: public:
uint size; uint size;
virtual ~RegExp() {}
public: public:
virtual char *typeOf() = 0; virtual char *typeOf() = 0;
RegExp *isA(char *t) RegExp *isA(char *t)

File diff suppressed because it is too large Load diff

View file

@ -638,7 +638,6 @@ int yylex (void)
{ {
char token[80]; char token[80];
int toksize; int toksize;
int buildup;
int c; int c;
loop: loop:
@ -661,7 +660,7 @@ loop:
} }
if (isdigit (c)) if (isdigit (c))
{ {
buildup = c - '0'; int buildup = c - '0';
if (c == '0') if (c == '0')
{ {
c = fgetc (Source); c = fgetc (Source);
@ -705,6 +704,8 @@ loop:
} }
if (isalpha (c)) if (isalpha (c))
{ {
int buildup = 0;
token[0] = c; token[0] = c;
toksize = 1; toksize = 1;
while (toksize < 79 && (isalnum (c = fgetc (Source)) || c == '_')) while (toksize < 79 && (isalnum (c = fgetc (Source)) || c == '_'))