- declared most native getters in Actor as const.

- made the self pointer of const functions readonly.

This seems to work fine. Both calling a non-const function and trying to assign a value to a member fail with an error message.
This commit is contained in:
Christoph Oelckers 2017-03-04 12:43:07 +01:00
commit 7dbc6939c4
3 changed files with 31 additions and 21 deletions

View file

@ -110,12 +110,13 @@ void SetImplicitArgs(TArray<PType *> *args, TArray<DWORD> *argflags, TArray<FNam
if (funcflags & VARF_Method)
{
// implied self pointer
if (args != nullptr) args->Push(NewPointer(cls));
if (args != nullptr) args->Push(NewPointer(cls, !!(funcflags & VARF_ReadOnly)));
if (argflags != nullptr) argflags->Push(VARF_Implicit | VARF_ReadOnly);
if (argnames != nullptr) argnames->Push(NAME_self);
}
if (funcflags & VARF_Action)
{
assert(!(funcflags & VARF_ReadOnly));
// implied caller and callingstate pointers
if (args != nullptr)
{