1.1 --- a/templates/native/unicode.c Sat Oct 30 23:09:57 2021 +0200
1.2 +++ b/templates/native/unicode.c Sun Oct 31 01:01:10 2021 +0200
1.3 @@ -1,6 +1,6 @@
1.4 /* Native functions for Unicode 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 @@ -39,9 +39,9 @@
1.12 else return 0;
1.13 }
1.14
1.15 -static unsigned int nextpos(char *s, unsigned int size, unsigned int bytestart)
1.16 +static __int nextpos(char *s, __int size, __int bytestart)
1.17 {
1.18 - unsigned int i = bytestart;
1.19 + __int i = bytestart;
1.20
1.21 while (i < size)
1.22 {
1.23 @@ -53,9 +53,9 @@
1.24 return i;
1.25 }
1.26
1.27 -static unsigned int prevpos(char *s, unsigned int bytestart)
1.28 +static __int prevpos(char *s, __int bytestart)
1.29 {
1.30 - unsigned int i = bytestart;
1.31 + __int i = bytestart;
1.32
1.33 while (i > 0)
1.34 {
1.35 @@ -74,8 +74,8 @@
1.36 /* _data interpreted as string.__data__ */
1.37 char *s = _data.strvalue;
1.38 /* _size interpreted as int */
1.39 - int size = __TOINT(_size);
1.40 - unsigned int i, c = 0;
1.41 + __int size = __TOINT(_size);
1.42 + __int i, c = 0;
1.43
1.44 for (i = 0; i < size; i++)
1.45 if (boundary(s[i]))
1.46 @@ -90,8 +90,8 @@
1.47 /* _data interpreted as string.__data__ */
1.48 char *s = _data.strvalue;
1.49 /* _size interpreted as int */
1.50 - int size = __TOINT(_size);
1.51 - unsigned int i, c = 0, v;
1.52 + __int size = __TOINT(_size);
1.53 + __int i, c = 0, v;
1.54
1.55 for (i = 0; i < size; i++)
1.56 {
1.57 @@ -124,20 +124,20 @@
1.58 /* _data interpreted as string.__data__ */
1.59 char *s = _data.strvalue, *sub;
1.60 /* _size interpreted as int */
1.61 - int ss = __TOINT(_size);
1.62 + __int ss = __TOINT(_size);
1.63 /* start interpreted as int */
1.64 - int istart = __TOINT(start);
1.65 + __int istart = __TOINT(start);
1.66 /* end interpreted as int */
1.67 - int iend = __TOINT(end);
1.68 + __int iend = __TOINT(end);
1.69 /* step interpreted as int */
1.70 - int istep = __TOINT(step);
1.71 + __int istep = __TOINT(step);
1.72
1.73 /* Calculate the number of characters. */
1.74 - size_t nchar = ((iend - istart - (istep > 0 ? 1 : -1)) / istep) + 1;
1.75 - unsigned int indexes[nchar];
1.76 + __int nchar = ((iend - istart - (istep > 0 ? 1 : -1)) / istep) + 1;
1.77 + __int indexes[nchar];
1.78
1.79 - unsigned int c, d, i, to, from, lastbyte = 0;
1.80 - int resultsize = 0;
1.81 + __int c, d, i, to, from, lastbyte = 0;
1.82 + __int resultsize = 0;
1.83
1.84 /* Find the indexes of the characters. */
1.85 if (istep > 0)
1.86 @@ -197,7 +197,7 @@
1.87 {
1.88 /* value interpreted as int */
1.89 int i = __TOINT(value);
1.90 - unsigned int resultsize;
1.91 + __int resultsize;
1.92 char *s;
1.93
1.94 if (i < 128) resultsize = 1;