harec

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

commit 32b494e17e4253cb6a9d0186a36adb360ebc7140
parent e026ec4eca56361c32685b193a56ddd21e3d48fd
Author: Drew DeVault <sir@cmpwn.com>
Date:   Mon, 11 Jan 2021 13:58:27 -0500

rt::compile: use const where appropriate

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

diff --git a/rt/compile.ha b/rt/compile.ha @@ -1,5 +1,5 @@ // Runs the Hare compiler and returns the exit status. -export fn compile(src: str) int = { +export fn compile(src: const str) int = { let status = 0; let pipefd = [-1, -1]; pipe2(&pipefd, 0); @@ -19,7 +19,7 @@ export fn compile(src: str) int = { } else { close(pipefd[0]); - let buf = src: *const char: *const [*]u8; + const buf = src: *const char: *const [*]u8; for (let n = 0z; n < len(src)) { let m = write(pipefd[1], &buf[n], len(src) - n); assert(m: i64 > 0i64, "write(2) failed");