aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/bytes.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-27 17:26:51 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-27 17:26:51 -0400
commit3c52a756339a2d96824d21a7d3ad5de7fc1085a0 (patch)
treee5299a25ebb76186d6372b700710d7c8c7fe0728 /src/stdlib/bytes.c
parent2186e84de0c0fd47ba48eaa35f74ea2754c3b81f (diff)
Deprecate custom printf specifiers in favor of print() function that
uses _Generic() to generically convert any value to a string or print as a string.
Diffstat (limited to 'src/stdlib/bytes.c')
-rw-r--r--src/stdlib/bytes.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/stdlib/bytes.c b/src/stdlib/bytes.c
index b24a721b..09e19c40 100644
--- a/src/stdlib/bytes.c
+++ b/src/stdlib/bytes.c
@@ -32,24 +32,24 @@ public Text_t Byte$hex(Byte_t byte, bool uppercase, bool prefix) {
public PUREFUNC Byte_t Byte$from_int(Int_t i, bool truncate) {
if unlikely (truncate && Int$compare_value(i, I_small(0xFF)) > 0)
- fail("This value is too large to convert to a byte without truncation: %k", (Text_t[1]){Int$value_as_text(i)});
+ fail("This value is too large to convert to a byte without truncation: ", i);
else if unlikely (truncate && Int$compare_value(i, I_small(0)) < 0)
- fail("Negative values can't be converted to bytes: %k", (Text_t[1]){Int$value_as_text(i)});
+ fail("Negative values can't be converted to bytes: ", i);
return (i.small != 0);
}
public PUREFUNC Byte_t Byte$from_int64(Int64_t i, bool truncate) {
if unlikely (truncate && i != (Int64_t)(Byte_t)i)
- fail("This value can't be converted to a byte without truncation: %ld", i);
+ fail("This value can't be converted to a byte without truncation: ", i);
return (Byte_t)i;
}
public PUREFUNC Byte_t Byte$from_int32(Int32_t i, bool truncate) {
if unlikely (truncate && i != (Int32_t)(Byte_t)i)
- fail("This value can't be converted to a byte without truncation: %d", i);
+ fail("This value can't be converted to a byte without truncation: ", i);
return (Byte_t)i;
}
public PUREFUNC Byte_t Byte$from_int16(Int16_t i, bool truncate) {
if unlikely (truncate && i != (Int16_t)(Byte_t)i)
- fail("This value can't be converted to a byte without truncation: %d", i);
+ fail("This value can't be converted to a byte without truncation: ", i);
return (Byte_t)i;
}