1.1 --- a/templates/types.h Wed Jul 11 23:53:09 2018 +0200
1.2 +++ b/templates/types.h Thu Jul 12 00:15:16 2018 +0200
1.3 @@ -1,6 +1,6 @@
1.4 /* Runtime types.
1.5
1.6 -Copyright (C) 2015, 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.7 +Copyright (C) 2015, 2016, 2017, 2018 Paul Boddie <paul@boddie.org.uk>
1.8
1.9 This program is free software; you can redistribute it and/or modify it under
1.10 the terms of the GNU General Public License as published by the Free Software
1.11 @@ -85,7 +85,6 @@
1.12 __ppos pos; /* parameter table position for key */
1.13 };
1.14 __attr (*fn)(); /* callable details */
1.15 - float floatvalue; /* floating point value */
1.16 char * strvalue; /* string value */
1.17 __fragment * seqvalue; /* sequence data */
1.18 void * datavalue; /* object-specific data */
1.19 @@ -96,6 +95,11 @@
1.20 const __table * table; /* attribute table */
1.21 __ppos pos; /* position of attribute indicating class */
1.22 __attr attrs[]; /* attributes */
1.23 +
1.24 + /* Specialisations of this type may add other members.
1.25 + See generator.py for type generation, progops.h for definitions, and
1.26 + the generated progtypes.h for the final details. */
1.27 +
1.28 } __obj;
1.29
1.30 #define __INSTANCE_SIZE(NUMBER) ((NUMBER) * sizeof(__attr) + sizeof(__table *) + sizeof(__ppos))
1.31 @@ -117,7 +121,7 @@
1.32
1.33 /* Attribute value setting. */
1.34
1.35 -#define __ATTRVALUE(VALUE) ((__attr) {.value=VALUE})
1.36 +#define __ATTRVALUE(VALUE) ((__attr) {.value=(__ref) VALUE})
1.37 #define __NULL __ATTRVALUE(0)
1.38 #define __SETNULL(ATTR) ((ATTR).value = 0)
1.39