1.1 --- a/templates/types.h Thu Nov 04 23:44:29 2021 +0100
1.2 +++ b/templates/types.h Tue Aug 29 19:29:31 2023 +0200
1.3 @@ -82,7 +82,8 @@
1.4 /* General attribute members. */
1.5
1.6 __ref value; /* attribute value */
1.7 - __int intvalue; /* integer value data (shifted value, tagged) */
1.8 + __int intvalue; /* integer value data or object-specific size
1.9 + (shifted value, tagged) */
1.10
1.11 /* Special case attribute members. */
1.12
1.13 @@ -95,7 +96,6 @@
1.14 char * strvalue; /* string value */
1.15 __fragment * seqvalue; /* sequence data */
1.16 void * datavalue; /* object-specific data */
1.17 - __int sizevalue; /* object-specific size */
1.18 } __attr;
1.19
1.20 typedef struct __obj
1.21 @@ -136,9 +136,10 @@
1.22 #define __NULL __ATTRVALUE(0)
1.23 #define __SETNULL(ATTR) ((ATTR).value = 0)
1.24
1.25 -/* Attribute as instance setting. */
1.26 +/* Attribute as instance value. */
1.27
1.28 -#define __INTVALUE(VALUE) ((__attr) {.intvalue=(((__int) VALUE) << __NUM_TAG_BITS) | __TAG_INT})
1.29 +#define __FROMINT(VALUE) ((((__int) VALUE) << __NUM_TAG_BITS) | __TAG_INT)
1.30 +#define __INTVALUE(VALUE) ((__attr) {.intvalue=__FROMINT(VALUE)})
1.31 #define __TOINT(ATTR) ((ATTR).intvalue >> __NUM_TAG_BITS)
1.32 #define __MAXINT ((((__int) 1) << ((sizeof(__int) * 8) - 1 - __NUM_TAG_BITS)) - 1)
1.33 #define __MININT (-(((__int) 1) << ((sizeof(__int) * 8) - 1 - __NUM_TAG_BITS)))