aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/text.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-08-19 23:26:02 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-08-19 23:26:02 -0400
commitc19ec4c443af0648c827e771df634394a7ca7f07 (patch)
tree5936cfe8c64e081621d258f562d02a8e8b32cd4f /src/stdlib/text.c
parente552fc2afcf525d0fd7a3ffe137cc28a43f224a2 (diff)
Some pedantic fixes vetted against compiling on mac.
Diffstat (limited to 'src/stdlib/text.c')
-rw-r--r--src/stdlib/text.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/stdlib/text.c b/src/stdlib/text.c
index 22ebd9c7..6e2e9072 100644
--- a/src/stdlib/text.c
+++ b/src/stdlib/text.c
@@ -828,7 +828,9 @@ public OptionalText_t Text$from_strn(const char *str, size_t len)
if (u32s_normalized != buf2) free(u32s_normalized);
if (unique_clusters.entries.length >= 256) {
- return concat2_assuming_safe(Text$from_components(graphemes, unique_clusters), Text$from_strn(next, (size_t)(end-next)));
+ return concat2_assuming_safe(
+ Text$from_components(graphemes, unique_clusters),
+ Text$from_strn((const char*)next, (size_t)(end-next)));
}
}
@@ -1133,12 +1135,12 @@ PUREFUNC public bool Text$ends_with(Text_t text, Text_t suffix, Text_t *remainde
public Text_t Text$without_prefix(Text_t text, Text_t prefix)
{
- return Text$starts_with(text, prefix, false) ? Text$slice(text, I(prefix.length + 1), I(text.length)) : text;
+ return Text$starts_with(text, prefix, NULL) ? Text$slice(text, I(prefix.length + 1), I(text.length)) : text;
}
public Text_t Text$without_suffix(Text_t text, Text_t suffix)
{
- return Text$ends_with(text, suffix, false) ? Text$slice(text, I(1), I(text.length - suffix.length)) : text;
+ return Text$ends_with(text, suffix, NULL) ? Text$slice(text, I(1), I(text.length - suffix.length)) : text;
}
static bool _has_grapheme(TextIter_t *text, int32_t g)