F_MODE_*: changed values
The F_MODE_AS and F_MODE_AD flags do not index the <prop> array,
in contrast to the other F_* entries, but blocked the next
possible index in this array. Therefore changed the numbering to
negative numbers that will never index an array.
Also use a symbolic constant for the length of the array <props>
and use it to allocate it.
Change-Id: I71e487515ef9851c5f12bf899c285b7fb1da3a59
diff --git a/sys/thing/properties.h b/sys/thing/properties.h
index be7a6cd..77ec0d0 100644
--- a/sys/thing/properties.h
+++ b/sys/thing/properties.h
@@ -7,11 +7,12 @@
#ifndef __THING_PROPERTIES_H__
#define __THING_PROPERTIES_H__
-// Flags indexing <prop> and they are used as well for Set() calls
+// Type Flags indexing <prop> and they are used as well for Set() calls
#define F_VALUE 0
#define F_MODE 1
#define F_SET_METHOD 2
#define F_QUERY_METHOD 3
+#define F_PROP_ENTRIES 4 // how many entries in <prop> mapping?
// The following are used as type flags for Set(), but they do not index
// <prop>, therfore they have a negative sign.
@@ -20,11 +21,11 @@
// automatically
#define F_SET_MAPPER -F_SET_METHOD
// Flags for Set() to modify/manipulate F_MODE of a property in bit-wise
-// manner
-#define F_MODE_AS 4
-#define F_MODE_AD 5
+// manner (but are themselves not bitwise of course!).
+#define F_MODE_AS -400
+#define F_MODE_AD -500
-// mode flags for Properties
+// and from here the mode flags for Properties
#define SAVE 64
#define PROTECTED 128 // only this_object() can change the values
#define SECURED 256 // like PROTECTED, but never resetable