1.1 --- a/templates/progops.c Tue Mar 21 18:45:42 2017 +0100
1.2 +++ b/templates/progops.c Thu Mar 23 16:40:57 2017 +0100
1.3 @@ -32,13 +32,13 @@
1.4 __ref obj = (__ref) (immutable ? __ALLOCATEIM : __ALLOCATE)(1, size);
1.5 obj->table = table;
1.6 obj->pos = __INSTANCEPOS;
1.7 - __store_via_object(obj, __class__, (__attr) {.value=cls});
1.8 - return (__attr) {.value=obj};
1.9 + __store_via_object(obj, __class__, __ATTRVALUE(cls));
1.10 + return __ATTRVALUE(obj);
1.11 }
1.12
1.13 -__attr __new_wrapper(__ref context, __attr attr)
1.14 +__attr __new_wrapper(__attr context, __attr attr)
1.15 {
1.16 - return __new___builtins___core_wrapper((__attr[]) {__NULL, {.value=context}, attr});
1.17 + return __new___builtins___core_wrapper((__attr[]) {__NULL, context, attr});
1.18 }
1.19
1.20 /* Generic internal data allocation. */
1.21 @@ -163,7 +163,7 @@
1.22
1.23 /* Return instances as provided. */
1.24
1.25 - if (__is_instance(arg.value))
1.26 + if (__is_instance(__VALUE(arg)))
1.27 return arg;
1.28
1.29 /* Invoke non-instances to produce instances. */
1.30 @@ -192,7 +192,7 @@
1.31 /* Obtain the __args__ special member, referencing the parameter table. */
1.32 /* Refer to the table and minimum/maximum. */
1.33
1.34 - const __ptable *ptable = __check_and_load_via_object(target.value, __args__).ptable;
1.35 + const __ptable *ptable = __check_and_load_via_object(__VALUE(target), __args__).ptable;
1.36 const unsigned int min = ptable->min, max = ptable->max;
1.37
1.38 /* Reserve enough space for the arguments. */
1.39 @@ -247,13 +247,13 @@
1.40 for (pos = nargs; pos < max; pos++)
1.41 {
1.42 if (allargs[pos].value == 0)
1.43 - allargs[pos] = __GETDEFAULT(target.value, pos - min);
1.44 + allargs[pos] = __GETDEFAULT(__VALUE(target), pos - min);
1.45 }
1.46 }
1.47
1.48 /* Call with the prepared arguments. */
1.49
1.50 - return (always_callable ? __get_function(allargs[0].value, target) : __check_and_get_function(allargs[0].value, target))(allargs);
1.51 + return (always_callable ? __get_function(allargs[0], target) : __check_and_get_function(allargs[0], target))(allargs);
1.52 }
1.53
1.54 /* Error routines. */
1.55 @@ -281,9 +281,10 @@
1.56 int __BOOL(__attr attr)
1.57 {
1.58 __attr args[2] = {__NULL, attr};
1.59 + __ref truevalue = __VALUE(__builtins___boolean_True);
1.60
1.61 /* Invoke the bool function with the object and test against True. */
1.62
1.63 - return (attr.value == __builtins___boolean_True.value) ||
1.64 - (__fn___builtins___boolean_bool(args).value == __builtins___boolean_True.value);
1.65 + return (__VALUE(attr) == truevalue) ||
1.66 + (__VALUE(__fn___builtins___boolean_bool(args)) == truevalue);
1.67 }