1.1 --- a/templates/native/list.c Sat Oct 30 23:09:57 2021 +0200
1.2 +++ b/templates/native/list.c Sun Oct 31 01:01:10 2021 +0200
1.3 @@ -1,6 +1,6 @@
1.4 /* Native functions for list operations.
1.5
1.6 -Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.7 +Copyright (C) 2016, 2017, 2021 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 @@ -30,7 +30,7 @@
1.12 __attr __fn_native_list_list_init(__attr __self, __attr size)
1.13 {
1.14 /* size interpreted as int */
1.15 - unsigned int n = __TOINT(size);
1.16 + __int n = __TOINT(size);
1.17 __attr attr = {.seqvalue=__new_fragment(n)};
1.18
1.19 /* Return the __data__ attribute. */
1.20 @@ -42,7 +42,7 @@
1.21 /* _data interpreted as list.__data__ */
1.22 __fragment *data = _data.seqvalue;
1.23 /* size interpreted as int */
1.24 - unsigned int n = __TOINT(size);
1.25 + __int n = __TOINT(size);
1.26
1.27 data->size = n;
1.28 return __builtins___none_None;
1.29 @@ -66,9 +66,9 @@
1.30 __fragment *data = __load_via_object(__VALUE(self), __data__).seqvalue;
1.31 __fragment *other_data = other.seqvalue;
1.32 __fragment *newdata = data;
1.33 - unsigned int size = data->size, capacity = data->capacity;
1.34 - unsigned int other_size = other_data->size;
1.35 - unsigned int i, j, n = size + other_size;
1.36 + __int size = data->size, capacity = data->capacity;
1.37 + __int other_size = other_data->size;
1.38 + __int i, j, n = size + other_size;
1.39
1.40 /* Re-allocate the fragment if the capacity has been reached. */
1.41 if (n >= capacity)
1.42 @@ -91,7 +91,7 @@
1.43 __attr __fn_native_list_list_len(__attr self, __attr _data)
1.44 {
1.45 /* _data interpreted as list.__data__ */
1.46 - unsigned int size = _data.seqvalue->size;
1.47 + __int size = _data.seqvalue->size;
1.48
1.49 /* Return the new integer. */
1.50 return __new_int(size);
1.51 @@ -107,7 +107,7 @@
1.52 /* _data interpreted as list.__data__ */
1.53 __attr *elements = _data.seqvalue->attrs;
1.54 /* index interpreted as int */
1.55 - int i = __TOINT(index);
1.56 + __int i = __TOINT(index);
1.57
1.58 return elements[i];
1.59 }
1.60 @@ -117,7 +117,7 @@
1.61 /* _data interpreted as list.__data__ */
1.62 __attr *elements = _data.seqvalue->attrs;
1.63 /* index interpreted as int */
1.64 - int i = __TOINT(index);
1.65 + __int i = __TOINT(index);
1.66
1.67 /* Set the element. */
1.68 elements[i] = value;