Implemented implicit 'protected' inheritance in virtual functions

This commit is contained in:
ZZYZX 2017-03-05 01:24:22 +02:00 committed by Christoph Oelckers
commit 7cbabfb0d4
5 changed files with 25 additions and 23 deletions

View file

@ -705,10 +705,8 @@ do_double: if (inexact)
class VMFunction
{
public:
bool Native;
bool Final = false; // cannot be overridden
bool Unsafe = false; // Contains references to class fields that are unsafe for psp and item state calls.
bool FuncConst = false; // [ZZ] readonly function
bool Unsafe = false;
int VarFlags = 0; // [ZZ] this replaces 5+ bool fields
int BarrierSide = 0; // [ZZ] FScopeBarrier::Side
BYTE ImplicitArgs = 0; // either 0 for static, 1 for method or 3 for action
unsigned VirtualIndex = ~0u;
@ -718,7 +716,7 @@ public:
class PPrototype *Proto;
VMFunction(FName name = NAME_None) : Native(false), ImplicitArgs(0), Name(name), Proto(NULL)
VMFunction(FName name = NAME_None) : ImplicitArgs(0), Name(name), Proto(NULL)
{
AllFunctions.Push(this);
}
@ -942,9 +940,10 @@ class VMNativeFunction : public VMFunction
public:
typedef int (*NativeCallType)(VMValue *param, TArray<VMValue> &defaultparam, int numparam, VMReturn *ret, int numret);
VMNativeFunction() : NativeCall(NULL) { Native = true; }
VMNativeFunction(NativeCallType call) : NativeCall(call) { Native = true; }
VMNativeFunction(NativeCallType call, FName name) : VMFunction(name), NativeCall(call) { Native = true; }
// 8 is VARF_Native.
VMNativeFunction() : NativeCall(NULL) { VarFlags = 8; }
VMNativeFunction(NativeCallType call) : NativeCall(call) { VarFlags = 8; }
VMNativeFunction(NativeCallType call, FName name) : VMFunction(name), NativeCall(call) { VarFlags = 8; }
// Return value is the number of results.
NativeCallType NativeCall;