aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/lib
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/librune/lib')
-rw-r--r--vendor/librune/lib/builder/u8strfit.c4
-rw-r--r--vendor/librune/lib/builder/u8strfree.c2
-rw-r--r--vendor/librune/lib/builder/u8strgrow.c4
-rw-r--r--vendor/librune/lib/builder/u8strinit.c11
-rw-r--r--vendor/librune/lib/builder/u8strpushr.c4
-rw-r--r--vendor/librune/lib/builder/u8strpushstr.c4
-rw-r--r--vendor/librune/lib/builder/u8strpushu8.c4
-rw-r--r--vendor/librune/lib/gbrk/u8gnext.c15
-rw-r--r--vendor/librune/lib/rtype/riscntrl.c7
-rw-r--r--vendor/librune/lib/rtype/risdigit.c7
-rw-r--r--vendor/librune/lib/rtype/risgraph.c7
-rw-r--r--vendor/librune/lib/rtype/risletter.c7
-rw-r--r--vendor/librune/lib/rtype/rislower.c7
-rw-r--r--vendor/librune/lib/rtype/rismark.c7
-rw-r--r--vendor/librune/lib/rtype/risnumber.c7
-rw-r--r--vendor/librune/lib/rtype/rispunct.c7
-rw-r--r--vendor/librune/lib/rtype/risspace.c17
-rw-r--r--vendor/librune/lib/rtype/rissymbol.c7
-rw-r--r--vendor/librune/lib/rtype/ristitle.c7
-rw-r--r--vendor/librune/lib/rtype/risupper.c7
-rw-r--r--vendor/librune/lib/rtype/runeis.c31
-rw-r--r--vendor/librune/lib/utf8/rtou8.c2
-rw-r--r--vendor/librune/lib/utf8/u8chk.c5
-rw-r--r--vendor/librune/lib/utf8/u8chr.c24
-rw-r--r--vendor/librune/lib/utf8/u8next.c18
-rw-r--r--vendor/librune/lib/utf8/u8prev.c15
-rw-r--r--vendor/librune/lib/utf8/u8rchr.c36
-rw-r--r--vendor/librune/lib/utf8/u8set.c6
-rw-r--r--vendor/librune/lib/utf8/u8tor_uc.c2
29 files changed, 208 insertions, 73 deletions
diff --git a/vendor/librune/lib/builder/u8strfit.c b/vendor/librune/lib/builder/u8strfit.c
index c59b4b0..d0f0ecb 100644
--- a/vendor/librune/lib/builder/u8strfit.c
+++ b/vendor/librune/lib/builder/u8strfit.c
@@ -4,8 +4,8 @@
#include "internal/common.h"
-struct u8buf *
-u8strfit(struct u8buf *b)
+struct u8str *
+u8strfit(struct u8str *b)
{
return (b->p = realloc(b->p, b->len)) ? b : nullptr;
}
diff --git a/vendor/librune/lib/builder/u8strfree.c b/vendor/librune/lib/builder/u8strfree.c
index f425691..506c71b 100644
--- a/vendor/librune/lib/builder/u8strfree.c
+++ b/vendor/librune/lib/builder/u8strfree.c
@@ -3,7 +3,7 @@
#include "builder.h"
void
-u8strfree(struct u8buf b)
+u8strfree(struct u8str b)
{
free(b.p);
}
diff --git a/vendor/librune/lib/builder/u8strgrow.c b/vendor/librune/lib/builder/u8strgrow.c
index 253fcfc..022b216 100644
--- a/vendor/librune/lib/builder/u8strgrow.c
+++ b/vendor/librune/lib/builder/u8strgrow.c
@@ -6,8 +6,8 @@
static size_t nextpow2(size_t);
-struct u8buf *
-u8strgrow(struct u8buf *b, size_t n)
+struct u8str *
+u8strgrow(struct u8str *b, size_t n)
{
if (n > b->cap) {
b->cap = nextpow2(n);
diff --git a/vendor/librune/lib/builder/u8strinit.c b/vendor/librune/lib/builder/u8strinit.c
index caf061e..29947e8 100644
--- a/vendor/librune/lib/builder/u8strinit.c
+++ b/vendor/librune/lib/builder/u8strinit.c
@@ -4,12 +4,13 @@
#include "internal/common.h"
-struct u8buf *
-u8strinit(struct u8buf *b, size_t n)
+struct u8str *
+u8strinit(struct u8str *b, size_t n)
{
- if (n && !(b->p = malloc(n)))
- return nullptr;
- else
+ if (n) {
+ if (!(b->p = malloc(n)))
+ return nullptr;
+ } else
b->p = nullptr;
b->len = 0;
b->cap = n;
diff --git a/vendor/librune/lib/builder/u8strpushr.c b/vendor/librune/lib/builder/u8strpushr.c
index 89bb64f..60c1d50 100644
--- a/vendor/librune/lib/builder/u8strpushr.c
+++ b/vendor/librune/lib/builder/u8strpushr.c
@@ -3,8 +3,8 @@
#include "internal/common.h"
-struct u8buf *
-u8strpushr(struct u8buf *b, rune ch)
+struct u8str *
+u8strpushr(struct u8str *b, rune ch)
{
if (!u8strgrow(b, b->len + u8wdth(ch)))
return nullptr;
diff --git a/vendor/librune/lib/builder/u8strpushstr.c b/vendor/librune/lib/builder/u8strpushstr.c
index b80ad35..a036840 100644
--- a/vendor/librune/lib/builder/u8strpushstr.c
+++ b/vendor/librune/lib/builder/u8strpushstr.c
@@ -5,8 +5,8 @@
#include "internal/common.h"
-struct u8buf *
-u8strpushstr(struct u8buf *b, const char *s)
+struct u8str *
+u8strpushstr(struct u8str *b, const char *s)
{
size_t n = strlen(s);
if (!u8strgrow(b, b->len + n))
diff --git a/vendor/librune/lib/builder/u8strpushu8.c b/vendor/librune/lib/builder/u8strpushu8.c
index 0bcf9fc..dc6db11 100644
--- a/vendor/librune/lib/builder/u8strpushu8.c
+++ b/vendor/librune/lib/builder/u8strpushu8.c
@@ -5,8 +5,8 @@
#include "internal/common.h"
-struct u8buf *
-u8strpushu8(struct u8buf *b, struct u8view v)
+struct u8str *
+u8strpushu8(struct u8str *b, struct u8view v)
{
if (!u8strgrow(b, b->len + v.len))
return nullptr;
diff --git a/vendor/librune/lib/gbrk/u8gnext.c b/vendor/librune/lib/gbrk/u8gnext.c
index 875d5cb..5dae265 100644
--- a/vendor/librune/lib/gbrk/u8gnext.c
+++ b/vendor/librune/lib/gbrk/u8gnext.c
@@ -1,4 +1,4 @@
-#include <sys/types.h>
+#include <stddef.h>
#include "gbrk.h"
#include "utf8.h"
@@ -6,8 +6,6 @@
#include "internal/common.h"
#include "internal/gbrk_lookup.h"
-#define lengthof(a) (sizeof(a) / sizeof(*(a)))
-
struct gbrk_state {
enum {
GB9C_NONE,
@@ -21,7 +19,7 @@ struct gbrk_state {
static bool u8isgbrk(rune, rune, struct gbrk_state *);
static gbrk_prop getprop(rune);
-const char8_t *
+size_t
u8gnext(struct u8view *g, const char8_t **s, size_t *n)
{
int m;
@@ -30,7 +28,7 @@ u8gnext(struct u8view *g, const char8_t **s, size_t *n)
struct gbrk_state gs = {0};
if (*n == 0)
- return nullptr;
+ return 0;
g->p = p = *s;
p += u8tor_uc(&ch1, p);
@@ -44,7 +42,8 @@ u8gnext(struct u8view *g, const char8_t **s, size_t *n)
m = u8tor_uc(&ch2, p);
if (u8isgbrk(ch1, ch2, &gs)) {
*n -= g->len = p - *s;
- return *s = p;
+ *s = p;
+ return g->len;
}
ch1 = ch2;
@@ -145,13 +144,13 @@ do_break:
gbrk_prop
getprop(rune ch)
{
- ssize_t lo, hi;
+ ptrdiff_t lo, hi;
lo = 0;
hi = lengthof(gbrk_prop_tbl) - 1;
while (lo <= hi) {
- ssize_t i = (lo + hi) / 2;
+ ptrdiff_t i = (lo + hi) / 2;
if (ch < gbrk_prop_tbl[i].lo)
hi = i - 1;
diff --git a/vendor/librune/lib/rtype/riscntrl.c b/vendor/librune/lib/rtype/riscntrl.c
new file mode 100644
index 0000000..562a2a8
--- /dev/null
+++ b/vendor/librune/lib/rtype/riscntrl.c
@@ -0,0 +1,7 @@
+#include "rtype.h"
+
+bool
+riscntrl(rune ch)
+{
+ return runeis(ch, UC_CC);
+}
diff --git a/vendor/librune/lib/rtype/risdigit.c b/vendor/librune/lib/rtype/risdigit.c
new file mode 100644
index 0000000..391543a
--- /dev/null
+++ b/vendor/librune/lib/rtype/risdigit.c
@@ -0,0 +1,7 @@
+#include "rtype.h"
+
+bool
+risdigit(rune ch)
+{
+ return runeis(ch, UC_ND);
+}
diff --git a/vendor/librune/lib/rtype/risgraph.c b/vendor/librune/lib/rtype/risgraph.c
new file mode 100644
index 0000000..8eb6a09
--- /dev/null
+++ b/vendor/librune/lib/rtype/risgraph.c
@@ -0,0 +1,7 @@
+#include "rtype.h"
+
+bool
+risgraph(rune ch)
+{
+ return runeis(ch, UC_L | UC_M | UC_N | UC_P | UC_ZS);
+}
diff --git a/vendor/librune/lib/rtype/risletter.c b/vendor/librune/lib/rtype/risletter.c
new file mode 100644
index 0000000..2dfab73
--- /dev/null
+++ b/vendor/librune/lib/rtype/risletter.c
@@ -0,0 +1,7 @@
+#include "rtype.h"
+
+bool
+risletter(rune ch)
+{
+ return runeis(ch, UC_L);
+}
diff --git a/vendor/librune/lib/rtype/rislower.c b/vendor/librune/lib/rtype/rislower.c
new file mode 100644
index 0000000..ee90ce8
--- /dev/null
+++ b/vendor/librune/lib/rtype/rislower.c
@@ -0,0 +1,7 @@
+#include "rtype.h"
+
+bool
+rislower(rune ch)
+{
+ return runeis(ch, UC_LL);
+}
diff --git a/vendor/librune/lib/rtype/rismark.c b/vendor/librune/lib/rtype/rismark.c
new file mode 100644
index 0000000..5d784ec
--- /dev/null
+++ b/vendor/librune/lib/rtype/rismark.c
@@ -0,0 +1,7 @@
+#include "rtype.h"
+
+bool
+rismark(rune ch)
+{
+ return runeis(ch, UC_M);
+}
diff --git a/vendor/librune/lib/rtype/risnumber.c b/vendor/librune/lib/rtype/risnumber.c
new file mode 100644
index 0000000..26aa428
--- /dev/null
+++ b/vendor/librune/lib/rtype/risnumber.c
@@ -0,0 +1,7 @@
+#include "rtype.h"
+
+bool
+risnumber(rune ch)
+{
+ return runeis(ch, UC_N);
+}
diff --git a/vendor/librune/lib/rtype/rispunct.c b/vendor/librune/lib/rtype/rispunct.c
new file mode 100644
index 0000000..2abcba6
--- /dev/null
+++ b/vendor/librune/lib/rtype/rispunct.c
@@ -0,0 +1,7 @@
+#include "rtype.h"
+
+bool
+rispunct(rune ch)
+{
+ return runeis(ch, UC_P);
+}
diff --git a/vendor/librune/lib/rtype/risspace.c b/vendor/librune/lib/rtype/risspace.c
new file mode 100644
index 0000000..992c13b
--- /dev/null
+++ b/vendor/librune/lib/rtype/risspace.c
@@ -0,0 +1,17 @@
+#include "rtype.h"
+
+#include "internal/common.h"
+
+/* TODO: Make constexpr */
+static const bool latin1_space_tbl[LATIN1_MAX + 1] = {
+ ['\t'] = true, ['\n'] = true, ['\v'] = true, ['\f'] = true,
+ ['\r'] = true, [' '] = true, [0x85] = true, [0xA0] = true,
+};
+
+bool
+risspace(rune ch)
+{
+ if (ch <= LATIN1_MAX)
+ return latin1_space_tbl[ch];
+ return runeis(ch, UC_Z);
+}
diff --git a/vendor/librune/lib/rtype/rissymbol.c b/vendor/librune/lib/rtype/rissymbol.c
new file mode 100644
index 0000000..9e9a4f5
--- /dev/null
+++ b/vendor/librune/lib/rtype/rissymbol.c
@@ -0,0 +1,7 @@
+#include "rtype.h"
+
+bool
+rissymbol(rune ch)
+{
+ return runeis(ch, UC_S);
+}
diff --git a/vendor/librune/lib/rtype/ristitle.c b/vendor/librune/lib/rtype/ristitle.c
new file mode 100644
index 0000000..8ddd904
--- /dev/null
+++ b/vendor/librune/lib/rtype/ristitle.c
@@ -0,0 +1,7 @@
+#include "rtype.h"
+
+bool
+ristitle(rune ch)
+{
+ return runeis(ch, UC_LT);
+}
diff --git a/vendor/librune/lib/rtype/risupper.c b/vendor/librune/lib/rtype/risupper.c
new file mode 100644
index 0000000..2b77479
--- /dev/null
+++ b/vendor/librune/lib/rtype/risupper.c
@@ -0,0 +1,7 @@
+#include "rtype.h"
+
+bool
+risupper(rune ch)
+{
+ return runeis(ch, UC_LU);
+}
diff --git a/vendor/librune/lib/rtype/runeis.c b/vendor/librune/lib/rtype/runeis.c
new file mode 100644
index 0000000..180432e
--- /dev/null
+++ b/vendor/librune/lib/rtype/runeis.c
@@ -0,0 +1,31 @@
+#include <stddef.h>
+
+#include "rtype.h"
+
+#include "internal/common.h"
+#include "internal/rtype_lookup.h"
+
+bool
+runeis(rune ch, unicat c)
+{
+ ptrdiff_t lo, hi;
+
+ if (ch <= LATIN1_MAX)
+ return rtype_lat1_tbl[ch] & c;
+
+ lo = 0;
+ hi = lengthof(rtype_cat_tbl) - 1;
+
+ while (lo <= hi) {
+ ptrdiff_t i = (lo + hi) / 2;
+
+ if (ch < rtype_cat_tbl[i].lo)
+ hi = i - 1;
+ else if (ch > rtype_cat_tbl[i].hi)
+ lo = i + 1;
+ else
+ return c & rtype_cat_tbl[i].cat;
+ }
+
+ return false;
+}
diff --git a/vendor/librune/lib/utf8/rtou8.c b/vendor/librune/lib/utf8/rtou8.c
index 1823f08..94cce34 100644
--- a/vendor/librune/lib/utf8/rtou8.c
+++ b/vendor/librune/lib/utf8/rtou8.c
@@ -1,3 +1,5 @@
+#include <stddef.h>
+
#include "utf8.h"
#include "internal/common.h"
diff --git a/vendor/librune/lib/utf8/u8chk.c b/vendor/librune/lib/utf8/u8chk.c
index 422bbd8..4fd1afc 100644
--- a/vendor/librune/lib/utf8/u8chk.c
+++ b/vendor/librune/lib/utf8/u8chk.c
@@ -1,9 +1,10 @@
#include "rune.h"
+#define _RUNE_NO_MACRO_WRAPPER 1
#include "utf8.h"
#include "internal/common.h"
-const char8_t *
+char8_t *
u8chk(const char8_t *s, size_t n)
{
while (n) {
@@ -11,7 +12,7 @@ u8chk(const char8_t *s, size_t n)
int m = u8tor(&ch, s);
if (ch == RUNE_ERROR)
- return s;
+ return (char8_t *)s;
n -= m;
}
diff --git a/vendor/librune/lib/utf8/u8chr.c b/vendor/librune/lib/utf8/u8chr.c
index 4ecbd10..c387300 100644
--- a/vendor/librune/lib/utf8/u8chr.c
+++ b/vendor/librune/lib/utf8/u8chr.c
@@ -1,10 +1,10 @@
+#include <stddef.h>
#include <stdint.h>
#include <string.h>
+#define _RUNE_NO_MACRO_WRAPPER 1
#include "utf8.h"
-#include "internal/common.h"
-
/* NOTE: The memmem*() functions were taken directly from the memmem()
implementation on OpenBSD. As a result, these functions are licensed under
OpenBSDs 2-Clause BSD License instead of this libraries 0-Clause BSD License.
@@ -32,7 +32,7 @@
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-static const char8_t *
+static char8_t *
memmem2(const char8_t *h, size_t k, const char8_t *n)
{
uint16_t hw, nw;
@@ -41,12 +41,12 @@ memmem2(const char8_t *h, size_t k, const char8_t *n)
for (h += 2, k -= 2; k; k--, hw = hw << 8 | *h++) {
if (hw == nw)
- return h - 2;
+ return (char8_t *)h - 2;
}
- return hw == nw ? h - 2 : nullptr;
+ return hw == nw ? (char8_t *)h - 2 : nullptr;
}
-static const char8_t *
+static char8_t *
memmem3(const char8_t *h, size_t k, const char8_t *n)
{
uint32_t hw, nw;
@@ -55,12 +55,12 @@ memmem3(const char8_t *h, size_t k, const char8_t *n)
for (h += 3, k -= 3; k; k--, hw = (hw | *h++) << 8) {
if (hw == nw)
- return h - 3;
+ return (char8_t *)h - 3;
}
- return hw == nw ? h - 3 : nullptr;
+ return hw == nw ? (char8_t *)h - 3 : nullptr;
}
-static const char8_t *
+static char8_t *
memmem4(const char8_t *h, size_t k, const char8_t *n)
{
uint32_t hw, nw;
@@ -69,12 +69,12 @@ memmem4(const char8_t *h, size_t k, const char8_t *n)
for (h += 4, k -= 4; k; k--, hw = hw << 8 | *h++) {
if (hw == nw)
- return h - 4;
+ return (char8_t *)h - 4;
}
- return hw == nw ? h - 4 : nullptr;
+ return hw == nw ? (char8_t *)h - 4 : nullptr;
}
-const char8_t *
+char8_t *
u8chr(const char8_t *s, rune ch, size_t n)
{
char8_t buf[U8_LEN_MAX];
diff --git a/vendor/librune/lib/utf8/u8next.c b/vendor/librune/lib/utf8/u8next.c
index 8edc084..12c521d 100644
--- a/vendor/librune/lib/utf8/u8next.c
+++ b/vendor/librune/lib/utf8/u8next.c
@@ -1,14 +1,16 @@
+#define _RUNE_NO_MACRO_WRAPPER 1
#include "utf8.h"
-#include "internal/common.h"
-
-const char8_t *
+int
u8next(rune *ch, const char8_t **s, size_t *n)
{
- int m;
+ int m = 0;
+
+ if (*n) {
+ m = u8tor_uc(ch, *s);
+ *n -= m;
+ *s += m;
+ }
- if (*n == 0)
- return nullptr;
- *n -= m = u8tor_uc(ch, *s);
- return *s += m;
+ return m;
}
diff --git a/vendor/librune/lib/utf8/u8prev.c b/vendor/librune/lib/utf8/u8prev.c
index fac0fc7..a219ae9 100644
--- a/vendor/librune/lib/utf8/u8prev.c
+++ b/vendor/librune/lib/utf8/u8prev.c
@@ -1,9 +1,10 @@
+#define _RUNE_NO_MACRO_WRAPPER 1
#include "rune.h"
#include "utf8.h"
#include "internal/common.h"
-const char8_t *
+int
u8prev(rune *ch, const char8_t **p, const char8_t *start)
{
int off;
@@ -12,7 +13,7 @@ u8prev(rune *ch, const char8_t **p, const char8_t *start)
ptrdiff_t d = s - start;
if (d <= 0) {
- return nullptr;
+ return 0;
} else if (U1(s[-1])) {
*ch = s[-1];
off = 1;
@@ -29,9 +30,11 @@ u8prev(rune *ch, const char8_t **p, const char8_t *start)
} else
match = false;
- if (match && u8chkr(*ch))
- return *p -= off;
+ if (!(match && u8chkr(*ch))) {
+ *ch = RUNE_ERROR;
+ off = 1;
+ }
- *ch = RUNE_ERROR;
- return *p--;
+ *p -= off;
+ return off;
}
diff --git a/vendor/librune/lib/utf8/u8rchr.c b/vendor/librune/lib/utf8/u8rchr.c
index 15fff51..b2668e4 100644
--- a/vendor/librune/lib/utf8/u8rchr.c
+++ b/vendor/librune/lib/utf8/u8rchr.c
@@ -1,20 +1,20 @@
+#include <stddef.h>
#include <stdint.h>
+#define _RUNE_NO_MACRO_WRAPPER 1
#include "utf8.h"
-#include "internal/common.h"
-
-static const char8_t *
+static char8_t *
memrchr1(const char8_t *s, size_t k, const char8_t *n)
{
for (const char8_t *p = s + k - 1; k-- > 0; p--) {
if (*p == *n)
- return p;
+ return (char8_t *)p;
}
return nullptr;
}
-static const char8_t *
+static char8_t *
memrchr2(const char8_t *h, size_t k, const char8_t *n)
{
uint16_t hw, nw;
@@ -24,13 +24,13 @@ memrchr2(const char8_t *h, size_t k, const char8_t *n)
for (H -= 2, k -= 2; k; k--, hw = hw >> 8 | (*H-- << 8)) {
if (hw == nw)
- return H + 1;
+ return (char8_t *)H + 1;
}
- return hw == nw ? H + 1 : nullptr;
+ return hw == nw ? (char8_t *)H + 1 : nullptr;
}
-static const char8_t *
+static char8_t *
memrchr3(const char8_t *h, size_t k, const char8_t *n)
{
uint32_t hw, nw;
@@ -42,13 +42,13 @@ memrchr3(const char8_t *h, size_t k, const char8_t *n)
k--, hw = (hw >> 8 | (*H-- << 24)) & UINT32_C(0xFFFFFF00))
{
if (hw == nw)
- return H + 1;
+ return (char8_t *)H + 1;
}
- return hw == nw ? H + 1 : nullptr;
+ return hw == nw ? (char8_t *)H + 1 : nullptr;
}
-static const char8_t *
+static char8_t *
memrchr4(const char8_t *h, size_t k, const char8_t *n)
{
uint32_t hw, nw;
@@ -58,13 +58,13 @@ memrchr4(const char8_t *h, size_t k, const char8_t *n)
for (H -= 4, k -= 4; k; k--, hw = hw >> 8 | (*H-- << 24)) {
if (hw == nw)
- return H + 1;
+ return (char8_t *)H + 1;
}
- return hw == nw ? H + 1 : nullptr;
+ return hw == nw ? (char8_t *)H + 1 : nullptr;
}
-const char8_t *
+char8_t *
u8rchr(const char8_t *s, rune ch, size_t n)
{
char8_t buf[U8_LEN_MAX];
@@ -74,13 +74,13 @@ u8rchr(const char8_t *s, rune ch, size_t n)
return nullptr;
switch (m) {
case 1:
- return memrchr1(s, n, buf);
+ return (char8_t *)memrchr1(s, n, buf);
case 2:
- return memrchr2(s, n, buf);
+ return (char8_t *)memrchr2(s, n, buf);
case 3:
- return memrchr3(s, n, buf);
+ return (char8_t *)memrchr3(s, n, buf);
case 4:
- return memrchr4(s, n, buf);
+ return (char8_t *)memrchr4(s, n, buf);
}
unreachable();
diff --git a/vendor/librune/lib/utf8/u8set.c b/vendor/librune/lib/utf8/u8set.c
index 0dfba2c..6c57991 100644
--- a/vendor/librune/lib/utf8/u8set.c
+++ b/vendor/librune/lib/utf8/u8set.c
@@ -5,7 +5,7 @@
#include "internal/common.h"
size_t
-u8set(const char8_t *s, rune ch, size_t n)
+u8set(char8_t *s, rune ch, size_t n)
{
int m;
char8_t buf[U8_LEN_MAX];
@@ -13,12 +13,12 @@ u8set(const char8_t *s, rune ch, size_t n)
if (n == 0)
return 0;
if (ch <= _1B_MAX) {
- memset((char *)s, ch, n);
+ memset(s, ch, n);
return n;
}
m = rtou8(buf, ch, sizeof(buf));
for (size_t i = 0; i < n; i += m)
- memcpy((char *)s + i, buf, m);
+ memcpy(s + i, buf, m);
return n - n % m;
}
diff --git a/vendor/librune/lib/utf8/u8tor_uc.c b/vendor/librune/lib/utf8/u8tor_uc.c
index ea57332..3448b59 100644
--- a/vendor/librune/lib/utf8/u8tor_uc.c
+++ b/vendor/librune/lib/utf8/u8tor_uc.c
@@ -1,3 +1,5 @@
+#include <stddef.h>
+
#include "utf8.h"
#include "internal/common.h"