1.1 --- a/templates/native/list.c Sun Feb 26 21:47:56 2017 +0100
1.2 +++ b/templates/native/list.c Mon Feb 27 00:55:52 2017 +0100
1.3 @@ -1,6 +1,6 @@
1.4 /* Native functions for list operations.
1.5
1.6 -Copyright (C) 2016 Paul Boddie <paul@boddie.org.uk>
1.7 +Copyright (C) 2016, 2017 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 @@ -31,7 +31,7 @@
1.12 {
1.13 __attr * const size = &__args[1];
1.14 /* size.__data__ interpreted as int */
1.15 - unsigned int n = __load_via_object(size->value, __pos___data__).intvalue;
1.16 + unsigned int n = __load_via_object(size->value, __ATTRPOS(__data__)).intvalue;
1.17 __attr attr = {.seqvalue=__new_fragment(n)};
1.18
1.19 /* Return the __data__ attribute. */
1.20 @@ -45,7 +45,7 @@
1.21 /* _data interpreted as list */
1.22 __fragment *data = _data->seqvalue;
1.23 /* size.__data__ interpreted as int */
1.24 - unsigned int n = __load_via_object(size->value, __pos___data__).intvalue;
1.25 + unsigned int n = __load_via_object(size->value, __ATTRPOS(__data__)).intvalue;
1.26
1.27 data->size = n;
1.28 return __builtins___none_None;
1.29 @@ -56,12 +56,12 @@
1.30 __attr * const self = &__args[1];
1.31 __attr * const value = &__args[2];
1.32 /* self.__data__ interpreted as list */
1.33 - __fragment *data = __load_via_object(self->value, __pos___data__).seqvalue;
1.34 + __fragment *data = __load_via_object(self->value, __ATTRPOS(__data__)).seqvalue;
1.35 __fragment *newdata = __fragment_append(data, value);
1.36
1.37 /* Replace the __data__ attribute if appropriate. */
1.38 if (newdata != data)
1.39 - __store_via_object(self->value, __pos___data__, ((__attr) {.seqvalue=newdata}));
1.40 + __store_via_object(self->value, __ATTRPOS(__data__), ((__attr) {.seqvalue=newdata}));
1.41 return __builtins___none_None;
1.42 }
1.43
1.44 @@ -70,7 +70,7 @@
1.45 __attr * const self = &__args[1];
1.46 __attr * const other = &__args[2];
1.47 /* self.__data__, other interpreted as list */
1.48 - __fragment *data = __load_via_object(self->value, __pos___data__).seqvalue;
1.49 + __fragment *data = __load_via_object(self->value, __ATTRPOS(__data__)).seqvalue;
1.50 __fragment *other_data = other->seqvalue;
1.51 __fragment *newdata = data;
1.52 unsigned int size = data->size, capacity = data->capacity;
1.53 @@ -92,7 +92,7 @@
1.54
1.55 /* Replace the __data__ attribute if appropriate. */
1.56 if (newdata != data)
1.57 - __store_via_object(self->value, __pos___data__, ((__attr) {.seqvalue=newdata}));
1.58 + __store_via_object(self->value, __ATTRPOS(__data__), ((__attr) {.seqvalue=newdata}));
1.59 return __builtins___none_None;
1.60 }
1.61
1.62 @@ -120,7 +120,7 @@
1.63 /* _data interpreted as fragment */
1.64 __attr *elements = _data->seqvalue->attrs;
1.65 /* index.__data__ interpreted as int */
1.66 - int i = __load_via_object(index->value, __pos___data__).intvalue;
1.67 + int i = __load_via_object(index->value, __ATTRPOS(__data__)).intvalue;
1.68
1.69 return elements[i];
1.70 }
1.71 @@ -133,7 +133,7 @@
1.72 /* _data interpreted as fragment */
1.73 __attr *elements = _data->seqvalue->attrs;
1.74 /* index.__data__ interpreted as int */
1.75 - int i = __load_via_object(index->value, __pos___data__).intvalue;
1.76 + int i = __load_via_object(index->value, __ATTRPOS(__data__)).intvalue;
1.77
1.78 /* Set the element. */
1.79 elements[i] = *value;