1.1 --- a/templates/native/str.c Thu Nov 04 23:44:29 2021 +0100
1.2 +++ b/templates/native/str.c Tue Aug 29 01:46:23 2023 +0200
1.3 @@ -1,6 +1,6 @@
1.4 /* Native functions for string operations.
1.5
1.6 -Copyright (C) 2016, 2017, 2021 Paul Boddie <paul@boddie.org.uk>
1.7 +Copyright (C) 2016, 2017, 2021, 2023 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 @@ -28,7 +28,7 @@
1.12
1.13 /* String operations. */
1.14
1.15 -__attr __fn_native_str_str_add(__attr __self, __attr _data, __attr other, __attr _size, __attr othersize)
1.16 +__attr __fn_native_str_str_add(__attr __result, __attr __self, __attr _data, __attr other, __attr _size, __attr othersize)
1.17 {
1.18 /* _data, other interpreted as string.__data__ */
1.19 char *s = _data.strvalue;
1.20 @@ -45,7 +45,7 @@
1.21 return __new_str(r, n);
1.22 }
1.23
1.24 -__attr __fn_native_str_str_chr(__attr __self, __attr _data)
1.25 +__attr __fn_native_str_str_chr(__attr __result, __attr __self, __attr _data)
1.26 {
1.27 /* data interpreted as int */
1.28 int n = __TOINT(_data);
1.29 @@ -55,7 +55,7 @@
1.30 return __new_str(s, 1);
1.31 }
1.32
1.33 -__attr __fn_native_str_str_lt(__attr __self, __attr _data, __attr other)
1.34 +__attr __fn_native_str_str_lt(__attr __result, __attr __self, __attr _data, __attr other)
1.35 {
1.36 /* _data, other interpreted as string.__data__ */
1.37 char *s = _data.strvalue;
1.38 @@ -65,7 +65,7 @@
1.39 return strcmp(s, o) < 0 ? __builtins___boolean_True : __builtins___boolean_False;
1.40 }
1.41
1.42 -__attr __fn_native_str_str_gt(__attr __self, __attr _data, __attr other)
1.43 +__attr __fn_native_str_str_gt(__attr __result, __attr __self, __attr _data, __attr other)
1.44 {
1.45 /* _data, other interpreted as string.__data__ */
1.46 char *s = _data.strvalue;
1.47 @@ -75,7 +75,7 @@
1.48 return strcmp(s, o) > 0 ? __builtins___boolean_True : __builtins___boolean_False;
1.49 }
1.50
1.51 -__attr __fn_native_str_str_eq(__attr __self, __attr _data, __attr other)
1.52 +__attr __fn_native_str_str_eq(__attr __result, __attr __self, __attr _data, __attr other)
1.53 {
1.54 /* _data, other interpreted as string.__data__ */
1.55 char *s = _data.strvalue;
1.56 @@ -85,7 +85,7 @@
1.57 return strcmp(s, o) == 0 ? __builtins___boolean_True : __builtins___boolean_False;
1.58 }
1.59
1.60 -__attr __fn_native_str_str_ord(__attr __self, __attr _data)
1.61 +__attr __fn_native_str_str_ord(__attr __result, __attr __self, __attr _data)
1.62 {
1.63 /* _data interpreted as string.__data__ */
1.64 char *s = _data.strvalue;
1.65 @@ -93,12 +93,12 @@
1.66 return __new_int((__int) s[0]);
1.67 }
1.68
1.69 -__attr __fn_native_str_str_size(__attr __self, __attr _size)
1.70 +__attr __fn_native_str_str_size(__attr __result, __attr __self, __attr _size)
1.71 {
1.72 return __new_int(_size.sizevalue);
1.73 }
1.74
1.75 -__attr __fn_native_str_str_substr(__attr __self, __attr _data, __attr start, __attr end, __attr step)
1.76 +__attr __fn_native_str_str_substr(__attr __result, __attr __self, __attr _data, __attr start, __attr end, __attr step)
1.77 {
1.78 /* _data interpreted as string.__data__ */
1.79 char *s = _data.strvalue, *sub;