- renamed the file system related classes to actually use the term "FileSystem".

This commit is contained in:
Christoph Oelckers 2020-04-11 13:24:34 +02:00
commit 6bccde3b51
103 changed files with 647 additions and 647 deletions

View file

@ -687,7 +687,7 @@ void ZCCCompiler::CreateStructTypes()
syms = &OutNamespace->Symbols;
}
if (s->NodeName() == NAME__ && Wads.GetLumpFile(Lump) == 0)
if (s->NodeName() == NAME__ && fileSystem.GetLumpFile(Lump) == 0)
{
// This is just a container for syntactic purposes.
s->strct->Type = nullptr;
@ -1406,7 +1406,7 @@ bool ZCCCompiler::CompileFields(PContainerType *type, TArray<ZCC_VarDeclarator *
ZCC_Latent | ZCC_Final | ZCC_Action | ZCC_Static | ZCC_FuncConst | ZCC_Abstract | ZCC_Virtual | ZCC_Override | ZCC_Extension | ZCC_VirtualScope | ZCC_ClearScope;
// Some internal fields need to be set to clearscope.
if (Wads.GetLumpFile(Lump) == 0) notallowed &= ~ZCC_ClearScope;
if (fileSystem.GetLumpFile(Lump) == 0) notallowed &= ~ZCC_ClearScope;
if (field->Flags & notallowed)
{
@ -1617,7 +1617,7 @@ bool ZCCCompiler::CompileProperties(PClass *type, TArray<ZCC_Property *> &Proper
TArray<PField *> fields;
ZCC_Identifier *id = (ZCC_Identifier *)p->Body;
if (FName(p->NodeName) == FName("prefix") && Wads.GetLumpFile(Lump) == 0)
if (FName(p->NodeName) == FName("prefix") && fileSystem.GetLumpFile(Lump) == 0)
{
// only for internal definitions: Allow setting a prefix. This is only for compatiblity with the old DECORATE property parser, but not for general use.
prefix = id->Id;
@ -1672,7 +1672,7 @@ bool ZCCCompiler::CompileFlagDefs(PClass *type, TArray<ZCC_FlagDef *> &Propertie
PField *field;
FName referenced = FName(p->RefName);
if (FName(p->NodeName) == FName("prefix") && Wads.GetLumpFile(Lump) == 0)
if (FName(p->NodeName) == FName("prefix") && fileSystem.GetLumpFile(Lump) == 0)
{
// only for internal definitions: Allow setting a prefix. This is only for compatiblity with the old DECORATE property parser, but not for general use.
prefix = referenced;
@ -1840,7 +1840,7 @@ PType *ZCCCompiler::DetermineType(PType *outertype, ZCC_TreeNode *field, FName n
case ZCC_NativeType:
// Creating an instance of a native struct is only allowed for internal definitions of native variables.
if (Wads.GetLumpFile(Lump) != 0 || !formember)
if (fileSystem.GetLumpFile(Lump) != 0 || !formember)
{
Error(field, "%s: @ not allowed for user scripts", name.GetChars());
}
@ -1896,7 +1896,7 @@ PType *ZCCCompiler::DetermineType(PType *outertype, ZCC_TreeNode *field, FName n
auto ftype = DetermineType(outertype, field, name, atype->ElementType, false, true);
if (ftype->GetRegType() == REGT_NIL || ftype->GetRegCount() > 1)
{
if (field->NodeType == AST_VarDeclarator && (static_cast<ZCC_VarDeclarator*>(field)->Flags & ZCC_Native) && Wads.GetLumpFile(Lump) == 0)
if (field->NodeType == AST_VarDeclarator && (static_cast<ZCC_VarDeclarator*>(field)->Flags & ZCC_Native) && fileSystem.GetLumpFile(Lump) == 0)
{
// the internal definitions may declare native arrays to complex types.
// As long as they can be mapped to a static array type the VM can handle them, in a limited but sufficient fashion.

View file

@ -245,7 +245,7 @@ static void ParseSingleFile(FScanner *pSC, const char *filename, int lump, void
{
if (filename != nullptr)
{
lump = Wads.CheckNumForFullName(filename, true);
lump = fileSystem.CheckNumForFullName(filename, true);
if (lump >= 0)
{
lsc.OpenLumpNum(lump);
@ -355,7 +355,7 @@ static void DoParse(int lumpnum)
void *parser;
ZCCToken value;
auto baselump = lumpnum;
auto fileno = Wads.GetLumpFile(lumpnum);
auto fileno = fileSystem.GetLumpFile(lumpnum);
parser = ZCCParseAlloc(malloc);
ZCCParseState state;
@ -415,18 +415,18 @@ static void DoParse(int lumpnum)
ParseSingleFile(&sc, nullptr, lumpnum, parser, state);
for (unsigned i = 0; i < Includes.Size(); i++)
{
lumpnum = Wads.CheckNumForFullName(Includes[i], true);
lumpnum = fileSystem.CheckNumForFullName(Includes[i], true);
if (lumpnum == -1)
{
IncludeLocs[i].Message(MSG_ERROR, "Include script lump %s not found", Includes[i].GetChars());
}
else
{
auto fileno2 = Wads.GetLumpFile(lumpnum);
auto fileno2 = fileSystem.GetLumpFile(lumpnum);
if (fileno == 0 && fileno2 != 0)
{
I_FatalError("File %s is overriding core lump %s.",
Wads.GetWadFullName(Wads.GetLumpFile(lumpnum)), Includes[i].GetChars());
fileSystem.GetWadFullName(fileSystem.GetLumpFile(lumpnum)), Includes[i].GetChars());
}
ParseSingleFile(nullptr, nullptr, lumpnum, parser, state);
@ -445,7 +445,7 @@ static void DoParse(int lumpnum)
// If the parser fails, there is no point starting the compiler, because it'd only flood the output with endless errors.
if (FScriptPosition::ErrorCounter > 0)
{
I_Error("%d errors while parsing %s", FScriptPosition::ErrorCounter, Wads.GetLumpFullPath(baselump).GetChars());
I_Error("%d errors while parsing %s", FScriptPosition::ErrorCounter, fileSystem.GetLumpFullPath(baselump).GetChars());
}
#ifndef NDEBUG
@ -459,7 +459,7 @@ static void DoParse(int lumpnum)
if (Args->CheckParm("-dumpast"))
{
FString ast = ZCC_PrintAST(state.TopNode);
FString filename = Wads.GetLumpFullPath(baselump);
FString filename = fileSystem.GetLumpFullPath(baselump);
filename.ReplaceChars(":\\/?|", '.');
filename << ".ast";
FileWriter *ff = FileWriter::Open(filename);
@ -471,19 +471,19 @@ static void DoParse(int lumpnum)
}
PSymbolTable symtable;
auto newns = Wads.GetLumpFile(baselump) == 0 ? Namespaces.GlobalNamespace : Namespaces.NewNamespace(Wads.GetLumpFile(baselump));
auto newns = fileSystem.GetLumpFile(baselump) == 0 ? Namespaces.GlobalNamespace : Namespaces.NewNamespace(fileSystem.GetLumpFile(baselump));
ZCCCompiler cc(state, NULL, symtable, newns, baselump, state.ParseVersion);
cc.Compile();
if (FScriptPosition::ErrorCounter > 0)
{
// Abort if the compiler produced any errors. Also do not compile further lumps, because they very likely miss some stuff.
I_Error("%d errors, %d warnings while compiling %s", FScriptPosition::ErrorCounter, FScriptPosition::WarnCounter, Wads.GetLumpFullPath(baselump).GetChars());
I_Error("%d errors, %d warnings while compiling %s", FScriptPosition::ErrorCounter, FScriptPosition::WarnCounter, fileSystem.GetLumpFullPath(baselump).GetChars());
}
else if (FScriptPosition::WarnCounter > 0)
{
// If we got warnings, but no errors, print the information but continue.
Printf(TEXTCOLOR_ORANGE "%d warnings while compiling %s\n", FScriptPosition::WarnCounter, Wads.GetLumpFullPath(baselump).GetChars());
Printf(TEXTCOLOR_ORANGE "%d warnings while compiling %s\n", FScriptPosition::WarnCounter, fileSystem.GetLumpFullPath(baselump).GetChars());
}
}
@ -497,7 +497,7 @@ void ParseScripts()
int lump, lastlump = 0;
FScriptPosition::ResetErrorCounter();
while ((lump = Wads.FindLump("ZSCRIPT", &lastlump)) != -1)
while ((lump = fileSystem.FindLump("ZSCRIPT", &lastlump)) != -1)
{
DoParse(lump);
}