From abd6729d39ccff59fed9b151196183517f0346ef Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 11 Dec 2018 00:35:22 +0100 Subject: [PATCH] - fixed deprecation warnings for member functions not checking the version. --- src/scripting/backend/codegen.cpp | 6 +++--- src/scripting/thingdef.cpp | 4 ++-- src/scripting/thingdef.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index 0eecab9a9..db87134dd 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -7600,7 +7600,7 @@ FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx) if (ctx.Class != nullptr) { - PFunction *afd = FindClassMemberFunction(ctx.Class, ctx.Class, MethodName, ScriptPosition, &error); + PFunction *afd = FindClassMemberFunction(ctx.Class, ctx.Class, MethodName, ScriptPosition, &error, ctx.Version); if (afd != nullptr) { @@ -8002,7 +8002,7 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx) if (novirtual) { bool error; - PFunction *afd = FindClassMemberFunction(ccls, ctx.Class, MethodName, ScriptPosition, &error); + PFunction *afd = FindClassMemberFunction(ccls, ctx.Class, MethodName, ScriptPosition, &error, ctx.Version); if ((nullptr != afd) && (afd->Variants[0].Flags & VARF_Method) && (afd->Variants[0].Flags & VARF_Virtual)) { staticonly = false; @@ -8309,7 +8309,7 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx) isresolved: bool error = false; - PFunction *afd = FindClassMemberFunction(cls, ctx.Class, MethodName, ScriptPosition, &error); + PFunction *afd = FindClassMemberFunction(cls, ctx.Class, MethodName, ScriptPosition, &error, ctx.Version); if (error) { delete this; diff --git a/src/scripting/thingdef.cpp b/src/scripting/thingdef.cpp index 928f645a8..439bf8ce8 100644 --- a/src/scripting/thingdef.cpp +++ b/src/scripting/thingdef.cpp @@ -236,7 +236,7 @@ PFunction *CreateAnonymousFunction(PContainerType *containingclass, PType *retur // //========================================================================== -PFunction *FindClassMemberFunction(PContainerType *selfcls, PContainerType *funccls, FName name, FScriptPosition &sc, bool *error) +PFunction *FindClassMemberFunction(PContainerType *selfcls, PContainerType *funccls, FName name, FScriptPosition &sc, bool *error, const VersionInfo &version) { // Skip ACS_NamedExecuteWithResult. Anything calling this should use the builtin instead. if (name == NAME_ACS_NamedExecuteWithResult) return nullptr; @@ -263,7 +263,7 @@ PFunction *FindClassMemberFunction(PContainerType *selfcls, PContainerType *func { sc.Message(MSG_ERROR, "%s is declared protected and not accessible", symbol->SymbolName.GetChars()); } - else if (funcsym->Variants[0].Flags & VARF_Deprecated) + else if ((funcsym->Variants[0].Flags & VARF_Deprecated) && funcsym->mVersion <= version) { sc.Message(MSG_WARNING, "Call to deprecated function %s", symbol->SymbolName.GetChars()); } diff --git a/src/scripting/thingdef.h b/src/scripting/thingdef.h index 844e38957..6e6737282 100644 --- a/src/scripting/thingdef.h +++ b/src/scripting/thingdef.h @@ -204,7 +204,7 @@ class FxVMFunctionCall *ParseAction(FScanner &sc, FState state, FString statestr FName CheckCastKludges(FName in); void SetImplicitArgs(TArray *args, TArray *argflags, TArray *argnames, PContainerType *cls, uint32_t funcflags, int useflags); PFunction *CreateAnonymousFunction(PContainerType *containingclass, PType *returntype, int flags); -PFunction *FindClassMemberFunction(PContainerType *cls, PContainerType *funccls, FName name, FScriptPosition &sc, bool *error); +PFunction *FindClassMemberFunction(PContainerType *cls, PContainerType *funccls, FName name, FScriptPosition &sc, bool *error, const VersionInfo &version); void CreateDamageFunction(PNamespace *ns, const VersionInfo &ver, PClassActor *info, AActor *defaults, FxExpression *id, bool fromDecorate, int lumpnum); //==========================================================================