harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit c5e2fbb8695cde54150ebe59645651553d88e45d
parent 86e0a84d07bbdb4fbe47607d5233f51c1a3877e1
Author: Drew DeVault <sir@cmpwn.com>
Date:   Thu, 31 Dec 2020 10:56:13 -0500

rt: don't rely on implicit casts

We can undo this once we lower these in check.

Diffstat:
Mrt/abort.ha | 6+++---
Mrt/memcmp.ha | 2+-
Mrt/memcpy.ha | 2+-
Mrt/memset.ha | 2+-
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/rt/abort.ha b/rt/abort.ha @@ -1,7 +1,7 @@ export @noreturn @symbol("rt.abort") fn _abort(msg: str) void = { const prefix = "Abort: "; - write(2, prefix: *char, len(prefix)); - write(2, msg: *char, len(msg)); - write(2, "\n": *char, 1); + write(2, prefix: *const char, len(prefix)); + write(2, msg: *const char, len(msg)); + write(2, "\n": *const char, 1z); kill(getpid(), SIGABRT); }; diff --git a/rt/memcmp.ha b/rt/memcmp.ha @@ -1,6 +1,6 @@ export fn memcmp(a: *void, b: *void, amt: size) bool = { let _a = a: *[*]u8, _b = b: *[*]u8; - for (let i = 0z; i < amt; i += 1) { + for (let i = 0z; i < amt; i += 1z) { if (a[i] != b[i]) { return false; }; diff --git a/rt/memcpy.ha b/rt/memcpy.ha @@ -1,6 +1,6 @@ export fn memcpy(dest: *void, src: *void, amt: size) void = { let a = dest: *[*]u8, b = src: *[*]u8; - for (let i = 0z; i < amt; i += 1) { + for (let i = 0z; i < amt; i += 1z) { a[i] = b[i]; }; }; diff --git a/rt/memset.ha b/rt/memset.ha @@ -1,6 +1,6 @@ export fn memzero(ptr: *void, amt: size) void = { let a = ptr: *[*]u8; - for (let i = 0z; i < amt; i += 1) { + for (let i = 0z; i < amt; i += 1z) { a[i] = 0u8; }; };