Merge branch 'master' of ZDoom

# Conflicts:
#	.gitignore
#	src/win32/i_system.cpp
This commit is contained in:
Christoph Oelckers 2016-02-09 14:41:31 +01:00
commit 15d5a5256f
37 changed files with 1104 additions and 126 deletions

View file

@ -647,6 +647,8 @@ public:
// Returns true if this actor is within melee range of its target
bool CheckMeleeRange();
bool CheckNoDelay();
virtual void BeginPlay(); // Called immediately after the actor is created
virtual void PostBeginPlay(); // Called immediately before the actor's first tick
virtual void LevelSpawned(); // Called after BeginPlay if this actor was spawned by the world

View file

@ -456,9 +456,9 @@ CCMD (exec)
}
}
void execLogfile(const char *fn)
void execLogfile(const char *fn, bool append)
{
if ((Logfile = fopen(fn, "w")))
if ((Logfile = fopen(fn, append? "a" : "w")))
{
const char *timestr = myasctime();
Printf("Log started: %s\n", timestr);
@ -482,7 +482,7 @@ CCMD (logfile)
if (argv.argc() >= 2)
{
execLogfile(argv[1]);
execLogfile(argv[1], argv.argc() >=3? !!argv[2]:false);
}
}

View file

@ -182,6 +182,6 @@ extern unsigned int MakeKey (const char *s);
extern unsigned int MakeKey (const char *s, size_t len);
extern unsigned int SuperFastHash (const char *data, size_t len);
void execLogfile(const char *fn);
void execLogfile(const char *fn, bool append = false);
#endif //__C_DISPATCH_H__

View file

@ -2495,7 +2495,7 @@ bool D_LoadDehFile(const char *patchfile)
static bool DoDehPatch()
{
Printf("Adding dehacked patch %s\n", PatchName);
if (!batchrun) Printf("Adding dehacked patch %s\n", PatchName);
int cont;
@ -2586,7 +2586,7 @@ static bool DoDehPatch()
UnloadDehSupp ();
delete[] PatchName;
delete[] PatchFile;
Printf ("Patch installed\n");
if (!batchrun) Printf ("Patch installed\n");
return true;
}

View file

@ -228,6 +228,7 @@ bool nospriterename;
FStartupInfo DoomStartupInfo;
FString lastIWAD;
int restart = 0;
bool batchrun; // just run the startup and collect all error messages in a logfile, then quit without any interaction
cycle_t FrameCycles;
@ -1868,7 +1869,6 @@ static FString ParseGameInfo(TArray<FString> &pwads, const char *fn, const char
static FString CheckGameInfo(TArray<FString> & pwads)
{
DWORD t = I_FPSTime();
// scan the list of WADs backwards to find the last one that contains a GAMEINFO lump
for(int i=pwads.Size()-1; i>=0; i--)
{
@ -1920,8 +1920,6 @@ static FString CheckGameInfo(TArray<FString> & pwads)
delete resfile;
}
}
t = I_FPSTime() - t;
Printf("Gameinfo scan took %d ms\n", t);
return "";
}
@ -2002,7 +2000,7 @@ static void D_DoomInit()
{
rngseed = staticrngseed = atoi(v);
use_staticrng = true;
Printf("D_DoomInit: Static RNGseed %d set.\n", rngseed);
if (!batchrun) Printf("D_DoomInit: Static RNGseed %d set.\n", rngseed);
}
else
{
@ -2012,7 +2010,7 @@ static void D_DoomInit()
FRandom::StaticClearRandom ();
Printf ("M_LoadDefaults: Load system defaults.\n");
if (!batchrun) Printf ("M_LoadDefaults: Load system defaults.\n");
M_LoadDefaults (); // load before initing other systems
}
@ -2080,7 +2078,7 @@ static void CheckCmdLine()
int p;
const char *v;
Printf ("Checking cmd-line parameters...\n");
if (!batchrun) Printf ("Checking cmd-line parameters...\n");
if (Args->CheckParm ("-nomonsters")) flags |= DF_NO_MONSTERS;
if (Args->CheckParm ("-respawn")) flags |= DF_MONSTERS_RESPAWN;
if (Args->CheckParm ("-fast")) flags |= DF_FAST_MONSTERS;
@ -2222,6 +2220,7 @@ void D_DoomMain (void)
FString *args;
int argcount;
FIWadManager *iwad_man;
const char *batchout = Args->CheckValue("-errorlog");
// +logfile gets checked too late to catch the full startup log in the logfile so do some extra check for it here.
FString logfile = Args->TakeValue("+logfile");
@ -2229,6 +2228,17 @@ void D_DoomMain (void)
{
execLogfile(logfile);
}
else if (batchout != NULL && *batchout != 0)
{
batchrun = true;
execLogfile(batchout, true);
Printf("Command line: ");
for (int i = 0; i < Args->NumArgs(); i++)
{
Printf("%s ", Args->GetArg(i));
}
Printf("\n");
}
if (Args->CheckParm("-hashfiles"))
{
@ -2339,7 +2349,7 @@ void D_DoomMain (void)
Printf("Notice: File hashing is incredibly verbose. Expect loading files to take much longer than usual.\n");
}
Printf ("W_Init: Init WADfiles.\n");
if (!batchrun) Printf ("W_Init: Init WADfiles.\n");
Wads.InitMultipleFiles (allwads);
allwads.Clear();
allwads.ShrinkToFit();
@ -2370,21 +2380,21 @@ void D_DoomMain (void)
if (!restart)
{
Printf ("I_Init: Setting up machine state.\n");
if (!batchrun) Printf ("I_Init: Setting up machine state.\n");
I_Init ();
I_CreateRenderer();
}
Printf ("V_Init: allocate screen.\n");
if (!batchrun) Printf ("V_Init: allocate screen.\n");
V_Init (!!restart);
// Base systems have been inited; enable cvar callbacks
FBaseCVar::EnableCallbacks ();
Printf ("S_Init: Setting up sound.\n");
if (!batchrun) Printf ("S_Init: Setting up sound.\n");
S_Init ();
Printf ("ST_Init: Init startup screen.\n");
if (!batchrun) Printf ("ST_Init: Init startup screen.\n");
if (!restart)
{
StartScreen = FStartupScreen::CreateInstance (TexMan.GuesstimateNumTextures() + 5);
@ -2402,23 +2412,23 @@ void D_DoomMain (void)
S_ParseReverbDef ();
// [RH] Parse any SNDINFO lumps
Printf ("S_InitData: Load sound definitions.\n");
if (!batchrun) Printf ("S_InitData: Load sound definitions.\n");
S_InitData ();
// [RH] Parse through all loaded mapinfo lumps
Printf ("G_ParseMapInfo: Load map definitions.\n");
if (!batchrun) Printf ("G_ParseMapInfo: Load map definitions.\n");
G_ParseMapInfo (iwad_info->MapInfo);
ReadStatistics();
// MUSINFO must be parsed after MAPINFO
S_ParseMusInfo();
Printf ("Texman.Init: Init texture manager.\n");
if (!batchrun) Printf ("Texman.Init: Init texture manager.\n");
TexMan.Init();
C_InitConback();
// [CW] Parse any TEAMINFO lumps.
Printf ("ParseTeamInfo: Load team definitions.\n");
if (!batchrun) Printf ("ParseTeamInfo: Load team definitions.\n");
TeamLibrary.ParseTeamInfo ();
PClassActor::StaticInit ();
@ -2437,11 +2447,11 @@ void D_DoomMain (void)
StartScreen->Progress ();
Printf ("R_Init: Init %s refresh subsystem.\n", gameinfo.ConfigName.GetChars());
if (!batchrun) Printf ("R_Init: Init %s refresh subsystem.\n", gameinfo.ConfigName.GetChars());
StartScreen->LoadingStatus ("Loading graphics", 0x3f);
R_Init ();
Printf ("DecalLibrary: Load decals.\n");
if (!batchrun) Printf ("DecalLibrary: Load decals.\n");
DecalLibrary.ReadAllDecals ();
// [RH] Add any .deh and .bex files on the command line.
@ -2458,7 +2468,7 @@ void D_DoomMain (void)
{
if (stricmp (key, "Path") == 0 && FileExists (value))
{
Printf ("Applying patch %s\n", value);
if (!batchrun) Printf ("Applying patch %s\n", value);
D_LoadDehFile(value);
}
}
@ -2483,10 +2493,10 @@ void D_DoomMain (void)
bglobal.spawn_tries = 0;
bglobal.wanted_botnum = bglobal.getspawned.Size();
Printf ("M_Init: Init menus.\n");
if (!batchrun) Printf ("M_Init: Init menus.\n");
M_Init ();
Printf ("P_Init: Init Playloop state.\n");
if (!batchrun) Printf ("P_Init: Init Playloop state.\n");
StartScreen->LoadingStatus ("Init game engine", 0x3f);
AM_StaticInit();
P_Init ();
@ -2497,6 +2507,8 @@ void D_DoomMain (void)
SBarInfo::Load();
HUD_InitHud();
if (!batchrun)
{
// [RH] User-configurable startup strings. Because BOOM does.
static const char *startupString[5] = {
"STARTUP1", "STARTUP2", "STARTUP3", "STARTUP4", "STARTUP5"
@ -2509,10 +2521,11 @@ void D_DoomMain (void)
Printf("%s\n", str);
}
}
}
if (!restart)
{
Printf ("D_CheckNetGame: Checking network game status.\n");
if (!batchrun) Printf ("D_CheckNetGame: Checking network game status.\n");
StartScreen->LoadingStatus ("Checking network game status.", 0x3f);
D_CheckNetGame ();
}
@ -2545,7 +2558,7 @@ void D_DoomMain (void)
StartScreen = NULL;
S_Sound (CHAN_BODY, "misc/startupdone", 1, ATTN_NONE);
if (Args->CheckParm("-norun"))
if (Args->CheckParm("-norun") || batchrun)
{
throw CNoRunExit();
}

View file

@ -1739,7 +1739,7 @@ void D_CheckNetGame (void)
Printf("Arbitrator selected " TEXTCOLOR_BLUE "%s" TEXTCOLOR_NORMAL " networking mode.\n", NetMode == NET_PeerToPeer ? "peer to peer" : "packet server");
}
Printf ("player %i of %i (%i nodes)\n",
if (!batchrun) Printf ("player %i of %i (%i nodes)\n",
consoleplayer+1, doomcom.numplayers, doomcom.numnodes);
}

View file

@ -2322,13 +2322,20 @@ PClass *PClass::CreateDerivedClass(FName name, unsigned int size)
const PClass *existclass = FindClass(name);
// This is a placeholder so fill it in
if (existclass != NULL && existclass->Size == (unsigned)-1)
if (existclass != NULL && (existclass->Size == TClass_Fatal || existclass->Size == TClass_Nonfatal))
{
type = const_cast<PClass*>(existclass);
if (!IsDescendantOf(type->ParentClass))
{
if (existclass->Size == TClass_Fatal)
{
I_Error("%s must inherit from %s but doesn't.", name.GetChars(), type->ParentClass->TypeName.GetChars());
}
else
{
Printf(TEXTCOLOR_RED "%s must inherit from %s but doesn't.", name.GetChars(), type->ParentClass->TypeName.GetChars());
}
}
DPrintf("Defining placeholder class %s\n", name.GetChars());
notnew = true;
}
@ -2380,7 +2387,7 @@ unsigned int PClass::Extend(unsigned int extension)
//
//==========================================================================
PClass *PClass::FindClassTentative(FName name)
PClass *PClass::FindClassTentative(FName name, bool fatal)
{
if (name == NAME_None)
{
@ -2400,7 +2407,7 @@ PClass *PClass::FindClassTentative(FName name)
type->TypeName = name;
type->ParentClass = this;
type->Size = -1;
type->Size = fatal? TClass_Fatal : TClass_Nonfatal;
type->bRuntimeClass = true;
TypeTable.AddType(type, RUNTIME_CLASS(PClass), (intptr_t)type->Outer, name, bucket);
return type;

View file

@ -599,6 +599,12 @@ public:
// Meta-info for every class derived from DObject ---------------------------
enum
{
TClass_Fatal = UINT_MAX,
TClass_Nonfatal = UINT_MAX - 1
};
class PClassClass;
class PClass : public PStruct
{
@ -661,7 +667,7 @@ public:
static PClassActor *FindActor(const FString &name) { return FindActor(FName(name, true)); }
static PClassActor *FindActor(ENamedName name) { return FindActor(FName(name)); }
static PClassActor *FindActor(FName name);
PClass *FindClassTentative(FName name); // not static!
PClass *FindClassTentative(FName name, bool fatal = true); // not static!
static TArray<PClass *> AllClasses;

View file

@ -125,6 +125,8 @@ typedef TMap<int, PClassActor *> FClassMap;
#include "basictypes.h"
extern bool batchrun;
// Bounding box coordinate storage.
enum
{

View file

@ -138,17 +138,8 @@ void AFastProjectile::Tick ()
}
}
}
if ((flags7 & MF7_HANDLENODELAY) && !(flags2 & MF2_DORMANT))
{
flags7 &= ~MF7_HANDLENODELAY;
if (state->GetNoDelay())
{
// For immediately spawned objects with the NoDelay flag set for their
// Spawn state, explicitly call the current state's function.
if (state->CallAction(this, this) && (ObjectFlags & OF_EuthanizeMe))
if (!CheckNoDelay())
return; // freed itself
}
}
// Advance the state
if (tics != -1)
{

View file

@ -434,7 +434,7 @@ void SBarInfo::Load()
int lump = Wads.CheckNumForFullName(gameinfo.statusbar, true);
if(lump != -1)
{
Printf ("ParseSBarInfo: Loading default status bar definition.\n");
if (!batchrun) Printf ("ParseSBarInfo: Loading default status bar definition.\n");
if(SBarInfoScript[SCRIPT_DEFAULT] == NULL)
SBarInfoScript[SCRIPT_DEFAULT] = new SBarInfo(lump);
else
@ -444,7 +444,7 @@ void SBarInfo::Load()
if(Wads.CheckNumForName("SBARINFO") != -1)
{
Printf ("ParseSBarInfo: Loading custom status bar definition.\n");
if (!batchrun) Printf ("ParseSBarInfo: Loading custom status bar definition.\n");
int lastlump, lump;
lastlump = 0;
while((lump = Wads.FindLump("SBARINFO", &lastlump)) != -1)

View file

@ -152,7 +152,7 @@ void PClassActor::StaticInit()
sprites.Push (temp);
}
Printf ("LoadActors: Load actor definitions.\n");
if (!batchrun) Printf ("LoadActors: Load actor definitions.\n");
ClearStrifeTypes();
LoadActors ();
InitBotStuff();

View file

@ -55,11 +55,11 @@ bool UseKnownFolders()
if (file != INVALID_HANDLE_VALUE)
{
CloseHandle(file);
Printf("Using program directory for storage\n");
if (!batchrun) Printf("Using program directory for storage\n");
iswritable = true;
return false;
}
Printf("Using known folders for storage\n");
if (!batchrun) Printf("Using known folders for storage\n");
iswritable = false;
return true;
}

View file

@ -484,7 +484,7 @@ void FSliderItem::Drawer(bool selected)
screen->DrawText(mFont, selected? OptionSettings.mFontColorSelection : mFontColor, mXpos, mYpos, text, DTA_Clean, true, TAG_DONE);
int x = SmallFont->StringWidth ("Green") + 8 + mXpos;
int x2 = SmallFont->StringWidth (mText) + 8 + mXpos;
int x2 = SmallFont->StringWidth (text) + 8 + mXpos;
DrawSlider (MAX(x2, x), mYpos);
}

View file

@ -3841,17 +3841,8 @@ void AActor::Tick ()
Destroy();
return;
}
if ((flags7 & MF7_HANDLENODELAY) && !(flags2 & MF2_DORMANT))
{
flags7 &= ~MF7_HANDLENODELAY;
if (state->GetNoDelay())
{
// For immediately spawned objects with the NoDelay flag set for their
// Spawn state, explicitly call the current state's function.
if (state->CallAction(this, this) && (ObjectFlags & OF_EuthanizeMe))
if (!CheckNoDelay())
return; // freed itself
}
}
// cycle through states, calling action functions at transitions
if (tics != -1)
{
@ -3892,6 +3883,38 @@ void AActor::Tick ()
}
}
//==========================================================================
//
// AActor :: CheckNoDelay
//
//==========================================================================
bool AActor::CheckNoDelay()
{
if ((flags7 & MF7_HANDLENODELAY) && !(flags2 & MF2_DORMANT))
{
flags7 &= ~MF7_HANDLENODELAY;
if (state->GetNoDelay())
{
// For immediately spawned objects with the NoDelay flag set for their
// Spawn state, explicitly call the current state's function.
if (state->CallAction(this, this))
{
if (ObjectFlags & OF_EuthanizeMe)
{
return false; // freed itself
}
if (ObjectFlags & OF_StateChanged)
{
ObjectFlags &= ~OF_StateChanged;
return SetState(state);
}
}
}
}
return true;
}
//==========================================================================
//
// AActor :: CheckSectorTransition

View file

@ -627,13 +627,19 @@ static void ParseFloor (FScanner &sc)
FTextureID picnum;
int terrain;
bool opt = sc.CheckString("optional");
sc.MustGetString ();
picnum = TexMan.CheckForTexture (sc.String, FTexture::TEX_Flat,
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny);
if (!picnum.Exists())
{
Printf ("Unknown flat %s\n", sc.String);
sc.MustGetString();
if (!opt)
{
Printf("Unknown flat %s\n", sc.String);
}
return;
}
sc.MustGetString ();

View file

@ -316,7 +316,7 @@ bool F7ZFile::Open(bool quiet)
}
}
if (!quiet) Printf(", %d lumps\n", NumLumps);
if (!quiet && !batchrun) Printf(", %d lumps\n", NumLumps);
PostProcessArchive(&Lumps[0], sizeof(F7ZLump));
return true;

View file

@ -121,7 +121,7 @@ bool FGrpFile::Open(bool quiet)
fileinfo[i].NameWithZero[12] = '\0'; // Be sure filename is null-terminated
Lumps[i].LumpNameSetup(fileinfo[i].NameWithZero);
}
if (!quiet) Printf(", %d lumps\n", NumLumps);
if (!quiet && !batchrun) Printf(", %d lumps\n", NumLumps);
delete[] fileinfo;
return true;

View file

@ -104,7 +104,7 @@ bool FPakFile::Open(bool quiet)
Lumps = new FUncompressedLump[NumLumps];
if (!quiet) Printf(", %d lumps\n", NumLumps);
if (!quiet && !batchrun) Printf(", %d lumps\n", NumLumps);
for(DWORD i = 0; i < NumLumps; i++)
{

View file

@ -152,7 +152,7 @@ bool FRFFFile::Open(bool quiet)
Lumps = new FRFFLump[NumLumps];
if (!quiet) Printf(", %d lumps\n", NumLumps);
if (!quiet && !batchrun) Printf(", %d lumps\n", NumLumps);
for (DWORD i = 0; i < NumLumps; ++i)
{
Lumps[i].Position = LittleLong(lumps[i].FilePos);

View file

@ -370,7 +370,7 @@ bool FWadFile::Open(bool quiet)
if (!quiet)
{
Printf(", %d lumps\n", NumLumps);
if (!batchrun) Printf(", %d lumps\n", NumLumps);
// don't bother with namespaces here. We won't need them.
SetNamespace("S_START", "S_END", ns_sprites);

View file

@ -268,7 +268,7 @@ bool FZipFile::Open(bool quiet)
NumLumps -= skipped;
free(directory);
if (!quiet) Printf(TEXTCOLOR_NORMAL ", %d lumps\n", NumLumps);
if (!quiet && !batchrun) Printf(TEXTCOLOR_NORMAL ", %d lumps\n", NumLumps);
PostProcessArchive(&Lumps[0], sizeof(FZipLump));
return true;

View file

@ -259,7 +259,7 @@ void I_InitSound ()
nosfx = !!Args->CheckParm ("-nosfx");
GSnd = NULL;
if (nosound)
if (nosound || batchrun)
{
GSnd = new NullSoundRenderer;
I_InitMusic ();

View file

@ -340,10 +340,15 @@ static void FinishThingdef()
{
PClassActor *ti = PClassActor::AllActorClasses[i];
if (ti->Size == (unsigned)-1)
if (ti->Size == TClass_Fatal || ti->Size == TClass_Nonfatal)
{
Printf("Class %s referenced but not defined\n", ti->TypeName.GetChars());
errorcount++;
Printf(TEXTCOLOR_RED "Class %s referenced but not defined\n", ti->TypeName.GetChars());
if (ti->Size == TClass_Fatal) errorcount++;
else
{
// In order to prevent a crash, this class needs to be completed, even though it defines nothing.
ti->ParentClass->CreateDerivedClass(ti->TypeName, ti->ParentClass->Size);
}
continue;
}
@ -439,7 +444,7 @@ void LoadActors ()
}
FinishThingdef();
timer.Unclock();
Printf("DECORATE parsing took %.2f ms\n", timer.TimeMS());
if (!batchrun) Printf("DECORATE parsing took %.2f ms\n", timer.TimeMS());
// Base time: ~52 ms
}

View file

@ -238,14 +238,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, CountInv)
self = COPY_AAPTR(self, pick_pointer);
if (self == NULL || itemtype == NULL)
{
ret->SetInt(false);
ret->SetInt(0);
}
else
{
AInventory *item = self->FindInventory(itemtype);
ret->SetInt(item ? item->Amount : 0);
return 1;
}
return 1;
}
return 0;
}

View file

@ -913,12 +913,12 @@ public:
class FxClassTypeCast : public FxExpression
{
const PClass *desttype;
PClass *desttype;
FxExpression *basex;
public:
FxClassTypeCast(const PClass *dtype, FxExpression *x);
FxClassTypeCast(PClass *dtype, FxExpression *x);
~FxClassTypeCast();
FxExpression *Resolve(FCompileContext&);
ExpEmit Emit(VMFunctionBuilder *build);

View file

@ -3503,7 +3503,7 @@ ExpEmit FxReturnStatement::Emit(VMFunctionBuilder *build, bool tailcall)
//
//==========================================================================
FxClassTypeCast::FxClassTypeCast(const PClass *dtype, FxExpression *x)
FxClassTypeCast::FxClassTypeCast(PClass *dtype, FxExpression *x)
: FxExpression(x->ScriptPosition)
{
desttype = dtype;
@ -3542,28 +3542,18 @@ FxExpression *FxClassTypeCast::Resolve(FCompileContext &ctx)
if (basex->isConstant())
{
FName clsname = static_cast<FxConstant *>(basex)->GetValue().GetName();
const PClass *cls = NULL;
PClass *cls = NULL;
if (clsname != NAME_None)
{
cls = PClass::FindClass(clsname);
if (cls == NULL)
{
/* lax */
// Since this happens in released WADs it must pass without a terminal error... :(
ScriptPosition.Message(MSG_WARNING,
"Unknown class name '%s'",
clsname.GetChars(), desttype->TypeName.GetChars());
}
else
{
// for backwards compatibility with old times it cannot be made a fatal error, if the class is not defined. :(
cls = desttype->FindClassTentative(clsname, false);
if (!cls->IsDescendantOf(desttype))
{
ScriptPosition.Message(MSG_ERROR,"class '%s' is not compatible with '%s'", clsname.GetChars(), desttype->TypeName.GetChars());
delete this;
return NULL;
}
}
ScriptPosition.Message(MSG_DEBUG,"resolving '%s' as class name", clsname.GetChars());
}
FxExpression *x = new FxConstant(cls, ScriptPosition);

View file

@ -256,7 +256,7 @@ void FWadCollection::AddFile (const char *filename, FileReader *wadinfo)
}
}
Printf (" adding %s", filename);
if (!batchrun) Printf (" adding %s", filename);
startlump = NumLumps;
FResourceFile *resfile;

View file

@ -1005,6 +1005,8 @@ void DoMain (HINSTANCE hInstance)
catch (class CNoRunExit &)
{
I_ShutdownGraphics();
if (!batchrun)
{
if (FancyStdOut && !AttachedStdOut)
{ // Outputting to a new console window: Wait for a keypress before quitting.
DWORD bytes;
@ -1020,6 +1022,7 @@ void DoMain (HINSTANCE hInstance)
{
ShowErrorPane(NULL);
}
}
exit(0);
}
catch (class CDoomError &error)
@ -1027,9 +1030,16 @@ void DoMain (HINSTANCE hInstance)
I_ShutdownGraphics ();
RestoreConView ();
if (error.GetMessage ())
{
if (!batchrun)
{
ShowErrorPane(error.GetMessage());
}
else
{
Printf("%s\n", error.GetMessage());
}
}
exit (-1);
}
}

View file

@ -595,14 +595,14 @@ void I_DetectOS(void)
if (OSPlatform == os_Win95)
{
Printf ("OS: Windows %s %lu.%lu.%lu %s\n",
if (!batchrun) Printf ("OS: Windows %s %lu.%lu.%lu %s\n",
osname,
info.dwMajorVersion, info.dwMinorVersion,
info.dwBuildNumber & 0xffff, info.szCSDVersion);
}
else
{
Printf ("OS: Windows %s (NT %lu.%lu) Build %lu\n %s\n",
if (!batchrun) Printf ("OS: Windows %s (NT %lu.%lu) Build %lu\n %s\n",
osname,
info.dwMajorVersion, info.dwMinorVersion,
info.dwBuildNumber, info.szCSDVersion);
@ -610,7 +610,7 @@ void I_DetectOS(void)
if (OSPlatform == os_unknown)
{
Printf ("(Assuming Windows 2000)\n");
if (!batchrun) Printf ("(Assuming Windows 2000)\n");
OSPlatform = os_Win2k;
}
}
@ -727,7 +727,7 @@ void CalculateCPUSpeed()
PerfToMillisec = PerfToSec * 1000.0;
}
Printf ("CPU Speed: %.0f MHz\n", 0.001 / PerfToMillisec);
if (!batchrun) Printf ("CPU Speed: %.0f MHz\n", 0.001 / PerfToMillisec);
}
//==========================================================================

View file

@ -195,7 +195,7 @@ void DumpCPUInfo(const CPUInfo *cpu)
}
*t = '\0';
if (cpu->VendorID[0])
if (cpu->VendorID[0] && !batchrun)
{
Printf("CPU Vendor ID: %s\n", cpu->VendorID);
if (cpustring[0])

62
tools/re2c/config.msc.h Normal file
View file

@ -0,0 +1,62 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <stdint.h> header file. */
/* #undef HAVE_STDINT_H */
/* Name of package */
/* #undef PACKAGE */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "re2c-general@lists.sourceforge.net"
/* Define to the full name of this package. */
#define PACKAGE_NAME "re2c"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "re2c 0.16"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "re2c"
/* Define to the home page for this package. */
/* #undef PACKAGE_URL */
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.16"
/* The size of `0i8', as computed by sizeof. */
#define SIZEOF_0I8 1
/* The size of `0l', as computed by sizeof. */
#define SIZEOF_0L 4
/* The size of `0ll', as computed by sizeof. */
#define SIZEOF_0LL 8
/* The size of `char', as computed by sizeof. */
#define SIZEOF_CHAR 1
/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 4
/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8
/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
/* The size of `void *', as computed by sizeof. */
#ifdef _M_X64
#define SIZEOF_VOID_P 8
#else
#define SIZEOF_VOID_P 4
#endif
/* The size of `__int64', as computed by sizeof. */
#define SIZEOF___INT64 8
/* Version number of package */
/* #undef VERSION */

845
tools/re2c/re2c.vcproj Normal file
View file

@ -0,0 +1,845 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="re2c"
ProjectGUID="{667D2EE7-C357-49E2-9BAB-0A4A45F0F76E}"
RootNamespace="re2c"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="."
IntermediateDirectory="Build"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
CallingConvention="0"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/re2c.exe"
LinkIncremental="1"
GenerateDebugInformation="false"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
CallingConvention="0"
DisableSpecificWarnings="4996;4244"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/re2c.exe"
LinkIncremental="1"
GenerateDebugInformation="false"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="."
IntermediateDirectory="Build"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/re2c.exe"
LinkIncremental="1"
GenerateDebugInformation="false"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
CallingConvention="0"
DisableSpecificWarnings="4996;4244"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/re2c.exe"
LinkIncremental="1"
GenerateDebugInformation="false"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\src\ir\adfa\adfa.cc"
>
</File>
<File
RelativePath=".\src\codegen\bitmap.cc"
>
</File>
<File
RelativePath=".\src\ir\nfa\calc_size.cc"
>
</File>
<File
RelativePath=".\src\parse\code.cc"
>
</File>
<File
RelativePath=".\src\ir\compile.cc"
>
</File>
<File
RelativePath=".\src\ir\skeleton\control_flow.cc"
>
</File>
<File
RelativePath=".\src\ir\dfa\determinization.cc"
>
</File>
<File
RelativePath=".\src\ir\regexp\display.cc"
>
</File>
<File
RelativePath=".\src\codegen\emit_action.cc"
>
</File>
<File
RelativePath=".\src\codegen\emit_dfa.cc"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\enc.cc"
>
</File>
<File
RelativePath=".\src\ir\dfa\fillpoints.cc"
>
</File>
<File
RelativePath=".\src\ir\regexp\fixed_length.cc"
>
</File>
<File
RelativePath=".\src\ir\skeleton\generate_code.cc"
>
</File>
<File
RelativePath=".\src\ir\skeleton\generate_data.cc"
>
</File>
<File
RelativePath=".\src\codegen\go_construct.cc"
>
</File>
<File
RelativePath=".\src\codegen\go_destruct.cc"
>
</File>
<File
RelativePath=".\src\codegen\go_emit.cc"
>
</File>
<File
RelativePath=".\src\codegen\go_used_labels.cc"
>
</File>
<File
RelativePath=".\src\parse\input.cc"
>
</File>
<File
RelativePath=".\src\codegen\input_api.cc"
>
</File>
<File
RelativePath=".\src\codegen\label.cc"
>
</File>
<File
RelativePath=".\src\parse\lex.cc"
>
</File>
<File
RelativePath=".\src\parse\lex_conf.cc"
>
</File>
<File
RelativePath=".\src\main.cc"
>
</File>
<File
RelativePath=".\src\ir\skeleton\match_empty.cc"
>
</File>
<File
RelativePath=".\src\ir\skeleton\maxlen.cc"
>
</File>
<File
RelativePath=".\src\ir\dfa\minimization.cc"
>
</File>
<File
RelativePath=".\src\conf\msg.cc"
>
</File>
<File
RelativePath=".\src\ir\nfa\nfa.cc"
>
</File>
<File
RelativePath=".\src\conf\opt.cc"
>
</File>
<File
RelativePath=".\src\codegen\output.cc"
>
</File>
<File
RelativePath=".\src\conf\parse_opts.cc"
>
</File>
<File
RelativePath=".\src\parse\parser.cc"
>
</File>
<File
RelativePath=".\src\ir\adfa\prepare.cc"
>
</File>
<File
RelativePath=".\src\codegen\print.cc"
>
</File>
<File
RelativePath=".\src\util\range.cc"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\range_suffix.cc"
>
</File>
<File
RelativePath=".\src\ir\regexp\regexp.cc"
>
</File>
<File
RelativePath=".\src\ir\rule_rank.cc"
>
</File>
<File
RelativePath=".\src\util\s_to_n32_unsafe.cc"
>
</File>
<File
RelativePath=".\src\parse\scanner.cc"
>
</File>
<File
RelativePath=".\src\ir\skeleton\skeleton.cc"
>
</File>
<File
RelativePath=".\src\ir\nfa\split.cc"
>
</File>
<File
RelativePath=".\src\parse\unescape.cc"
>
</File>
<File
RelativePath=".\src\ir\skeleton\unreachable.cc"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\utf16\utf16.cc"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\utf16\utf16_range.cc"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\utf16\utf16_regexp.cc"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\utf8\utf8.cc"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\utf8\utf8_range.cc"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\utf8\utf8_regexp.cc"
>
</File>
<File
RelativePath=".\src\conf\warn.cc"
>
</File>
<File
RelativePath=".\src\ir\skeleton\way.cc"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\src\ir\adfa\action.h"
>
</File>
<File
RelativePath=".\src\ir\adfa\adfa.h"
>
</File>
<File
RelativePath=".\src\util\allocate.h"
>
</File>
<File
RelativePath=".\src\util\attribute.h"
>
</File>
<File
RelativePath=".\src\codegen\bitmap.h"
>
</File>
<File
RelativePath=".\src\util\c99_stdint.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\case.h"
>
</File>
<File
RelativePath=".\src\parse\code.h"
>
</File>
<File
RelativePath=".\src\ir\compile.h"
>
</File>
<File
RelativePath=".\config.msc.h"
>
</File>
<File
RelativePath=".\src\util\counter.h"
>
</File>
<File
RelativePath=".\src\ir\dfa\dfa.h"
>
</File>
<File
RelativePath=".\src\codegen\emit.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\empty_class_policy.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\enc.h"
>
</File>
<File
RelativePath=".\src\parse\extop.h"
>
</File>
<File
RelativePath=".\src\util\forbid_copy.h"
>
</File>
<File
RelativePath=".\src\util\free_list.h"
>
</File>
<File
RelativePath=".\src\globals.h"
>
</File>
<File
RelativePath=".\src\codegen\go.h"
>
</File>
<File
RelativePath=".\src\codegen\indent.h"
>
</File>
<File
RelativePath=".\src\parse\input.h"
>
</File>
<File
RelativePath=".\src\codegen\input_api.h"
>
</File>
<File
RelativePath=".\src\codegen\label.h"
>
</File>
<File
RelativePath=".\src\parse\loc.h"
>
</File>
<File
RelativePath=".\src\util\local_increment.h"
>
</File>
<File
RelativePath=".\src\conf\msg.h"
>
</File>
<File
RelativePath=".\src\ir\nfa\nfa.h"
>
</File>
<File
RelativePath=".\src\conf\opt.h"
>
</File>
<File
RelativePath=".\src\util\ord_hash_set.h"
>
</File>
<File
RelativePath=".\src\codegen\output.h"
>
</File>
<File
RelativePath=".\src\parse\parser.h"
>
</File>
<File
RelativePath=".\src\ir\skeleton\path.h"
>
</File>
<File
RelativePath=".\src\codegen\print.h"
>
</File>
<File
RelativePath=".\src\util\range.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\range_suffix.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\regexp.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\regexp_alt.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\regexp_cat.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\regexp_close.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\regexp_match.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\regexp_null.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\regexp_rule.h"
>
</File>
<File
RelativePath=".\src\ir\rule_rank.h"
>
</File>
<File
RelativePath=".\src\parse\rules.h"
>
</File>
<File
RelativePath=".\src\util\s_to_n32_unsafe.h"
>
</File>
<File
RelativePath=".\src\parse\scanner.h"
>
</File>
<File
RelativePath=".\src\ir\skeleton\skeleton.h"
>
</File>
<File
RelativePath=".\src\util\smart_ptr.h"
>
</File>
<File
RelativePath=".\src\parse\spec.h"
>
</File>
<File
RelativePath=".\src\util\static_assert.h"
>
</File>
<File
RelativePath=".\src\util\u32lim.h"
>
</File>
<File
RelativePath=".\src\parse\unescape.h"
>
</File>
<File
RelativePath=".\src\util\uniq_vector.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\utf16\utf16.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\utf16\utf16_range.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\utf16\utf16_regexp.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\utf8\utf8.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\utf8\utf8_range.h"
>
</File>
<File
RelativePath=".\src\ir\regexp\encoding\utf8\utf8_regexp.h"
>
</File>
<File
RelativePath=".\src\conf\warn.h"
>
</File>
<File
RelativePath=".\src\ir\skeleton\way.h"
>
</File>
<File
RelativePath=".\src\parse\y.tab.h"
>
</File>
</Filter>
<File
RelativePath=".\CMakeLists.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -2,7 +2,11 @@
#include <stdio.h>
#include <string>
#if defined(_MSC_VER) && _MSC_VER < 1500
#include "config.msc.h"
#else
#include "config.h"
#endif
#include "src/conf/msg.h"
namespace re2c {

View file

@ -1,7 +1,11 @@
#ifndef _RE2C_UTIL_C99_STDINT_
#define _RE2C_UTIL_C99_STDINT_
#if defined(_MSC_VER) && _MSC_VER < 1500
#include "config.msc.h"
#else
#include "config.h"
#endif
#if HAVE_STDINT_H
# include <stdint.h>

View file

@ -55,7 +55,7 @@ private:
static void append (Range ** & ptail, uint32_t l, uint32_t u);
// test addition and subtraction
template <uint8_t> friend Range * re2c_test::range (uint32_t n);
//template <uint8_t> friend Range * re2c_test::range (uint32_t n);
FORBID_COPY (Range);
};

View file

@ -622,6 +622,10 @@
RelativePath=".\src\dthinker.cpp"
>
</File>
<File
RelativePath=".\src\edata.cpp"
>
</File>
<File
RelativePath=".\src\f_wipe.cpp"
>
@ -1271,6 +1275,10 @@
RelativePath=".\src\dthinker.h"
>
</File>
<File
RelativePath=".\src\edata.h"
>
</File>
<File
RelativePath=".\src\f_finale.h"
>