aboutsummaryrefslogtreecommitdiff
path: root/lib/unicode
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-05-10 23:26:01 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-05-10 23:26:01 +0200
commit67122f04e8b3f4bd6ced95a34d94509479d62e9e (patch)
tree615e163dbae82278deaee3f5ba90432e646ae76f /lib/unicode
parent2d4a11bf98a6b36162cff7fec7b0e7a8b3dc5701 (diff)
Accept an element size argument to allocators
Diffstat (limited to 'lib/unicode')
-rw-r--r--lib/unicode/string/u8casefold.c4
-rw-r--r--lib/unicode/string/u8lower.c4
-rw-r--r--lib/unicode/string/u8title.c4
-rw-r--r--lib/unicode/string/u8upper.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/unicode/string/u8casefold.c b/lib/unicode/string/u8casefold.c
index b4afe50..c7694a9 100644
--- a/lib/unicode/string/u8casefold.c
+++ b/lib/unicode/string/u8casefold.c
@@ -19,7 +19,7 @@ u8casefold(size_t *dstn, struct u8view sv, enum caseflags flags, alloc_fn alloc,
return nullptr;
}
- char8_t *dst = alloc(alloc_ctx, nullptr, 0, bufsz, alignof(char8_t));
+ char8_t *dst = alloc(alloc_ctx, nullptr, 0, bufsz, 1, alignof(char8_t));
rune ch;
size_t n = 0;
@@ -30,5 +30,5 @@ u8casefold(size_t *dstn, struct u8view sv, enum caseflags flags, alloc_fn alloc,
}
*dstn = n;
- return alloc(alloc_ctx, dst, bufsz, n, alignof(char8_t));
+ return alloc(alloc_ctx, dst, bufsz, n, 1, alignof(char8_t));
}
diff --git a/lib/unicode/string/u8lower.c b/lib/unicode/string/u8lower.c
index 45309b6..cd6a79f 100644
--- a/lib/unicode/string/u8lower.c
+++ b/lib/unicode/string/u8lower.c
@@ -46,7 +46,7 @@ u8lower(size_t *dstn, struct u8view sv, enum caseflags flags, alloc_fn alloc,
return nullptr;
}
- char8_t *dst = alloc(alloc_ctx, nullptr, 0, bufsz, alignof(char8_t));
+ char8_t *dst = alloc(alloc_ctx, nullptr, 0, bufsz, 1, alignof(char8_t));
while (u8next(&ch, &sv)) {
rune next = 0;
@@ -103,5 +103,5 @@ u8lower(size_t *dstn, struct u8view sv, enum caseflags flags, alloc_fn alloc,
}
*dstn = n;
- return alloc(alloc_ctx, dst, bufsz, n, alignof(char8_t));
+ return alloc(alloc_ctx, dst, bufsz, n, 1, alignof(char8_t));
}
diff --git a/lib/unicode/string/u8title.c b/lib/unicode/string/u8title.c
index 5710920..53855b6 100644
--- a/lib/unicode/string/u8title.c
+++ b/lib/unicode/string/u8title.c
@@ -52,7 +52,7 @@ u8title(size_t *dstn, struct u8view sv, enum caseflags flags, alloc_fn alloc,
return nullptr;
}
- char8_t *dst = alloc(alloc_ctx, nullptr, 0, bufsz, alignof(char8_t));
+ char8_t *dst = alloc(alloc_ctx, nullptr, 0, bufsz, 1, alignof(char8_t));
while (u8next(&ch, &sv)) {
if (sv.p > word.p + word.len) {
@@ -134,5 +134,5 @@ u8title(size_t *dstn, struct u8view sv, enum caseflags flags, alloc_fn alloc,
}
*dstn = n;
- return alloc(alloc_ctx, dst, bufsz, n, alignof(char8_t));
+ return alloc(alloc_ctx, dst, bufsz, n, 1, alignof(char8_t));
}
diff --git a/lib/unicode/string/u8upper.c b/lib/unicode/string/u8upper.c
index 91ae679..4c47613 100644
--- a/lib/unicode/string/u8upper.c
+++ b/lib/unicode/string/u8upper.c
@@ -25,7 +25,7 @@ u8upper(size_t *dstn, struct u8view sv, enum caseflags flags, alloc_fn alloc,
return nullptr;
}
- char8_t *dst = alloc(alloc_ctx, nullptr, 0, bufsz, alignof(char8_t));
+ char8_t *dst = alloc(alloc_ctx, nullptr, 0, bufsz, 1, alignof(char8_t));
rune ch;
size_t n = 0;
@@ -43,5 +43,5 @@ u8upper(size_t *dstn, struct u8view sv, enum caseflags flags, alloc_fn alloc,
}
*dstn = n;
- return alloc(alloc_ctx, dst, bufsz, n, alignof(char8_t));
+ return alloc(alloc_ctx, dst, bufsz, n, 1, alignof(char8_t));
}