diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-05-15 00:05:40 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-05-15 00:05:40 +0200 |
commit | 12116eee483a088a53e81babfc55ee8a38d6a2ac (patch) | |
tree | 81fc87c6be2f0d44887cc024f5fdd85886452798 /lib | |
parent | 73b97bcf662f5e952fef49bd7259f7fb910b0820 (diff) |
Prefer *ucs*() to *u8*()
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicode/string/u8norm_nfd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/unicode/string/u8norm_nfd.c b/lib/unicode/string/u8norm_nfd.c index 9dc1066..a89a1b5 100644 --- a/lib/unicode/string/u8norm_nfd.c +++ b/lib/unicode/string/u8norm_nfd.c @@ -34,12 +34,12 @@ u8norm_nfd(size_t *dstn, struct u8view src, alloc_fn alloc, void *ctx) char8_t *dst = alloc(ctx, nullptr, 0, src.len, NFD_SCALE, alignof(char8_t)); *dstn = 0; - for (rune ch; u8next(&ch, &src) != 0; decomp(dst, dstn, bufsz, ch)) + for (rune ch; ucsnext(&ch, &src) != 0; decomp(dst, dstn, bufsz, ch)) ; return alloc(ctx, dst, src.len, *dstn, 1, alignof(char8_t)); } -#define WRITE(ch) *dstn += rtou8(dst + *dstn, bufsz - *dstn, (ch)) +#define WRITE(ch) *dstn += rtoucs(dst + *dstn, bufsz - *dstn, (ch)) void decomp(char8_t *dst, size_t *dstn, size_t bufsz, rune ch) @@ -72,12 +72,12 @@ decomp(char8_t *dst, size_t *dstn, size_t bufsz, rune ch) int w; rune hc; char8_t *p = dst + *dstn; - while (w = u8prev(&hc, (const char8_t **)&p, dst)) { + while (w = ucsprev(&hc, (const char8_t **)&p, dst)) { enum uprop_ccc ccc2 = uprop_get_ccc(hc); if (ccc2 == CCC_NR || ccc2 <= ccc) { out: char8_t tmp[U8_LEN_MAX]; - int w2 = rtou8(tmp, sizeof(tmp), ch); + int w2 = rtoucs(tmp, sizeof(tmp), ch); p += w; memmove(p + w2, p, dst + *dstn - p); memcpy(p, tmp, w2); |