aboutsummaryrefslogtreecommitdiff
path: root/lib/unicode/string
diff options
context:
space:
mode:
Diffstat (limited to 'lib/unicode/string')
-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, 16 insertions, 0 deletions
diff --git a/lib/unicode/string/u8casefold.c b/lib/unicode/string/u8casefold.c
index aba08f3..eff1e48 100644
--- a/lib/unicode/string/u8casefold.c
+++ b/lib/unicode/string/u8casefold.c
@@ -1,6 +1,7 @@
#include <errno.h>
#include <stdckdint.h>
+#include "macros.h"
#include "mbstring.h"
#include "unicode/prop.h"
#include "unicode/string.h"
@@ -9,6 +10,9 @@ char8_t *
u8casefold(size_t *dstn, struct u8view sv, enum caseflags flags, alloc_fn alloc,
void *alloc_ctx)
{
+ ASSUME(dstn != nullptr);
+ ASSUME(alloc != nullptr);
+
size_t bufsz;
if (ckd_mul(&bufsz, sv.len, (size_t)U8CASEFOLD_SCALE)) {
errno = EOVERFLOW;
diff --git a/lib/unicode/string/u8lower.c b/lib/unicode/string/u8lower.c
index 47c32f5..d5eb58c 100644
--- a/lib/unicode/string/u8lower.c
+++ b/lib/unicode/string/u8lower.c
@@ -2,6 +2,7 @@
#include <stdckdint.h>
#include "_attrs.h"
+#include "macros.h"
#include "mbstring.h"
#include "unicode/prop.h"
#include "unicode/string.h"
@@ -19,6 +20,9 @@ char8_t *
u8lower(size_t *dstn, struct u8view sv, enum caseflags flags, alloc_fn alloc,
void *alloc_ctx)
{
+ ASSUME(dstn != nullptr);
+ ASSUME(alloc != nullptr);
+
struct lcctx ctx = {
.az_or_tr = flags & CF_LANG_AZ,
.lt = flags & CF_LANG_LT,
diff --git a/lib/unicode/string/u8title.c b/lib/unicode/string/u8title.c
index 1adf110..0c3620e 100644
--- a/lib/unicode/string/u8title.c
+++ b/lib/unicode/string/u8title.c
@@ -2,6 +2,7 @@
#include <stdckdint.h>
#include "_attrs.h"
+#include "macros.h"
#include "mbstring.h"
#include "unicode/prop.h"
#include "unicode/string.h"
@@ -20,6 +21,9 @@ char8_t *
u8title(size_t *dstn, struct u8view sv, enum caseflags flags, alloc_fn alloc,
void *alloc_ctx)
{
+ ASSUME(dstn != nullptr);
+ ASSUME(alloc != nullptr);
+
struct tcctx ctx_t;
struct lcctx ctx_l;
diff --git a/lib/unicode/string/u8upper.c b/lib/unicode/string/u8upper.c
index 5da49ba..df25ee7 100644
--- a/lib/unicode/string/u8upper.c
+++ b/lib/unicode/string/u8upper.c
@@ -1,6 +1,7 @@
#include <errno.h>
#include <stdckdint.h>
+#include "macros.h"
#include "mbstring.h"
#include "unicode/prop.h"
#include "unicode/string.h"
@@ -9,6 +10,9 @@ char8_t *
u8upper(size_t *dstn, struct u8view sv, enum caseflags flags, alloc_fn alloc,
void *alloc_ctx)
{
+ ASSUME(dstn != nullptr);
+ ASSUME(alloc != nullptr);
+
struct ucctx ctx = {
.az_or_tr = flags & CF_LANG_AZ,
.lt = flags & CF_LANG_LT,