From d74f349e27a1ba20bd549362f95915ee6d2dd9d1 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sat, 8 Jan 2022 10:15:43 -0500 Subject: allow terms to be more complicated --- 04a/in04 | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to '04a/in04') diff --git a/04a/in04 b/04a/in04 index 7abe8ae..8c0d2cc 100644 --- a/04a/in04 +++ b/04a/in04 @@ -331,11 +331,9 @@ function memchr argument mem argument c local p - local a p = mem :memchr_loop - a = *1p - if a == c goto memchr_loop_end + if *1p == c goto memchr_loop_end p += 1 goto memchr_loop :memchr_loop_end @@ -343,12 +341,10 @@ function memchr function strlen argument s - local c local p p = s :strlen_loop - c = *1p - if c == 0 goto strlen_loop_end + if *1p == 0 goto strlen_loop_end p += 1 goto strlen_loop :strlen_loop_end @@ -414,9 +410,7 @@ function fputn function fputc argument fd argument c - local p - p = &c - syscall(1, fd, p, 1) + syscall(1, fd, &c, 1) return function putc @@ -428,10 +422,8 @@ function putc function fgetc argument fd local c - local p c = 0 - p = &c - syscall(0, fd, p, 1) + syscall(0, fd, &c, 1) return c ; read a line from fd as a null-terminated string -- cgit v1.2.3