aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib')
-rw-r--r--src/stdlib/integers.c2
-rw-r--r--src/stdlib/text.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/stdlib/integers.c b/src/stdlib/integers.c
index 037aba0f..64d1d847 100644
--- a/src/stdlib/integers.c
+++ b/src/stdlib/integers.c
@@ -665,7 +665,7 @@ public void Int32$deserialize(FILE *in, void *outval, List_t *pointers, const Ty
if (Int$compare_value(bit_index, I(1)) < 0) \
fail("Invalid bit index (expected 1 or higher): ", bit_index); \
if (Int$compare_value(bit_index, Int$from_int64(sizeof(c_type)*8)) > 0) \
- fail("Bit index is too large! There are only ", sizeof(c_type)*8, " bits, but index is: ", bit_index); \
+ fail("Bit index is too large! There are only ", (uint64_t)sizeof(c_type)*8, " bits, but index is: ", bit_index); \
return ((x & (c_type)(1L << (Int64$from_int(bit_index, true)-1L))) != 0); \
} \
typedef struct { \
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)