hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 48f7a7299b144016d06257942f876f5488bd7bd2
parent fd3ab9ff69e5208d40fa0b7dcded10b809dcd32a
Author: Ember Sawady <ecs@d2evs.net>
Date:   Sun, 18 Feb 2024 18:46:25 +0000

rt::u64tos: return *[*]const u8 rather than *const u8

*const u8 is a pointer to a single u8, we're returning multiple u8s so
*[*]const u8 is more semantically correct

Signed-off-by: Ember Sawady <ecs@d2evs.net>

Diffstat:
Mrt/u64tos.ha | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rt/u64tos.ha b/rt/u64tos.ha @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MPL-2.0 // (c) Hare authors <https://harelang.org> -fn u64tos(u: u64) (*const u8, size) = { +fn u64tos(u: u64) (*[*]const u8, size) = { static let buf: [20]u8 = [0...]; // len("18446744073709551615") let sl = buf[..0]; if (u == 0) { @@ -18,5 +18,5 @@ fn u64tos(u: u64) (*const u8, size) = { s += 1; e -= 1; }; - return (sl: *[*]u8: *const u8, len(sl)); + return (sl: *[*]const u8, len(sl)); };