- removed the implicit conversion operators from FName.
These were creating dangerous interdependencies. It is better to do explicit conversions when needed. As an added plus, this means that zstring.h no longer depends on name.h which was very annoying.
This commit is contained in:
parent
6996d54a23
commit
ace3e29473
57 changed files with 184 additions and 200 deletions
|
|
@ -57,7 +57,7 @@ class USDFParser : public UDMFParserBase
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
PClassActor *CheckActorType(const char *key)
|
||||
PClassActor *CheckActorType(FName key)
|
||||
{
|
||||
PClassActor *type = nullptr;
|
||||
if (namespace_bits == St)
|
||||
|
|
@ -77,7 +77,7 @@ class USDFParser : public UDMFParserBase
|
|||
return type;
|
||||
}
|
||||
|
||||
PClassActor *CheckInventoryActorType(const char *key)
|
||||
PClassActor *CheckInventoryActorType(FName key)
|
||||
{
|
||||
PClassActor* const type = CheckActorType(key);
|
||||
return nullptr != type && type->IsDescendantOf(NAME_Inventory) ? type : nullptr;
|
||||
|
|
@ -98,7 +98,7 @@ class USDFParser : public UDMFParserBase
|
|||
while (!sc.CheckToken('}'))
|
||||
{
|
||||
FName key = ParseKey();
|
||||
switch(key)
|
||||
switch(key.GetIndex())
|
||||
{
|
||||
case NAME_Item:
|
||||
check.Item = CheckInventoryActorType(key);
|
||||
|
|
@ -110,7 +110,7 @@ class USDFParser : public UDMFParserBase
|
|||
}
|
||||
}
|
||||
|
||||
switch (type)
|
||||
switch (type.GetIndex())
|
||||
{
|
||||
case NAME_Cost: response->ItemCheck.Push(check); break;
|
||||
case NAME_Require: response->ItemCheckRequire.Push(check); break;
|
||||
|
|
@ -147,7 +147,7 @@ class USDFParser : public UDMFParserBase
|
|||
FName key = ParseKey(true, &block);
|
||||
if (!block)
|
||||
{
|
||||
switch(key)
|
||||
switch(key.GetIndex())
|
||||
{
|
||||
case NAME_Text:
|
||||
ReplyString = CheckString(key);
|
||||
|
|
@ -216,7 +216,7 @@ class USDFParser : public UDMFParserBase
|
|||
case NAME_Arg2:
|
||||
case NAME_Arg3:
|
||||
case NAME_Arg4:
|
||||
reply->Args[int(key)-int(NAME_Arg0)] = CheckInt(key);
|
||||
reply->Args[key.GetIndex()-int(NAME_Arg0)] = CheckInt(key);
|
||||
break;
|
||||
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ class USDFParser : public UDMFParserBase
|
|||
}
|
||||
else
|
||||
{
|
||||
switch(key)
|
||||
switch(key.GetIndex())
|
||||
{
|
||||
case NAME_Cost:
|
||||
case NAME_Require:
|
||||
|
|
@ -288,7 +288,7 @@ class USDFParser : public UDMFParserBase
|
|||
while (!sc.CheckToken('}'))
|
||||
{
|
||||
FName key = ParseKey();
|
||||
switch(key)
|
||||
switch(key.GetIndex())
|
||||
{
|
||||
case NAME_Item:
|
||||
check.Item = CheckInventoryActorType(key);
|
||||
|
|
@ -329,7 +329,7 @@ class USDFParser : public UDMFParserBase
|
|||
FName key = ParseKey(true, &block);
|
||||
if (!block)
|
||||
{
|
||||
switch(key)
|
||||
switch(key.GetIndex())
|
||||
{
|
||||
case NAME_Pagename:
|
||||
if (namespace_bits != Gz)
|
||||
|
|
@ -395,7 +395,7 @@ class USDFParser : public UDMFParserBase
|
|||
}
|
||||
else
|
||||
{
|
||||
switch(key)
|
||||
switch(key.GetIndex())
|
||||
{
|
||||
case NAME_Ifitem:
|
||||
if (!ParseIfItem(node)) return false;
|
||||
|
|
@ -437,7 +437,7 @@ class USDFParser : public UDMFParserBase
|
|||
FName key = ParseKey(true, &block);
|
||||
if (!block)
|
||||
{
|
||||
switch(key)
|
||||
switch(key.GetIndex())
|
||||
{
|
||||
case NAME_Actor:
|
||||
type = CheckActorType(key);
|
||||
|
|
@ -464,7 +464,7 @@ class USDFParser : public UDMFParserBase
|
|||
}
|
||||
else
|
||||
{
|
||||
switch(key)
|
||||
switch(key.GetIndex())
|
||||
{
|
||||
case NAME_Page:
|
||||
if (!ParsePage()) return false;
|
||||
|
|
@ -571,7 +571,7 @@ public:
|
|||
sc.MustGetToken('=');
|
||||
sc.MustGetToken(TK_StringConst);
|
||||
namespc = sc.String;
|
||||
switch(namespc)
|
||||
switch(namespc.GetIndex())
|
||||
{
|
||||
case NAME_GZDoom:
|
||||
namespace_bits = Gz;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue