From 0f4a666b8907fa1d294f8041d9dc1a7fcf5ea3cb Mon Sep 17 00:00:00 2001 From: belliash Date: Tue, 21 May 2019 10:58:34 +0200 Subject: [PATCH] Variable type should be separated from control flags. --- include/ph7int.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/ph7int.h b/include/ph7int.h index b54f7eb..6d619f6 100644 --- a/include/ph7int.h +++ b/include/ph7int.h @@ -625,11 +625,15 @@ struct ph7_value { void *pOther; /* Other values (Object, Array, Resource, Namespace, etc.) */ } x; sxi32 iFlags; /* Control flags (see below) */ + sxi32 iType; /* Variable data type */ ph7_vm *pVm; /* Virtual machine that own this instance */ SyBlob sBlob; /* String values */ sxu32 nIdx; /* Index number of this entry in the global object allocator */ }; -/* Allowed value types. +/* Variable control flags */ +#define MEMOBJ_FIXEDVAL 0x1000 /* Memory value is fixed and cannot be modified */ +#define MEMOBJ_PARENTOBJ 0x2000 /* Memory value is a parent object */ +/* Allowed variable data types. */ #define MEMOBJ_BOOL 0x0001 /* Memory value is a boolean */ #define MEMOBJ_CALL 0x0002 /* Memory value is a callback */ @@ -643,9 +647,6 @@ struct ph7_value { #define MEMOBJ_MIXED 0x0200 /* Memory value is mixed */ #define MEMOBJ_HASHMAP 0x0400 /* Memory value is a hashmap aka 'array' in the PHP jargon */ #define MEMOBJ_NULL 0x0800 /* Memory value is NULL */ -/* Special purpose */ -#define MEMOBJ_FIXEDVAL 0x1000 /* Memory value is fixed and cannot be modified */ -#define MEMOBJ_PARENTOBJ 0x2000 /* Memory value is a parent object */ /* Mask of all known types */ #define MEMOBJ_ALL (MEMOBJ_STRING|MEMOBJ_INT|MEMOBJ_REAL|MEMOBJ_BOOL|MEMOBJ_NULL|MEMOBJ_HASHMAP|MEMOBJ_OBJ|MEMOBJ_RES|MEMOBJ_CALL|MEMOBJ_CHAR|MEMOBJ_VOID) /* Scalar variables