From 7c174401f4926683d26e5b638b95d8956cfdb211 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Sun, 12 Sep 2021 00:43:22 -0400 Subject: defset: add set-mask and clear-mask. * stdlib/defset.tl (set-mask, clear-mask): New update macros. * stdlib/optimize.tl (calc-liveness): Use the new macros. * stdlib/socket.tl (sys:str-inaddr-net-impl, str-in6addr-net): Same. * stdlib/termios.tl (set-iflags, set-oflags, set-cflags, set-lflags, clear-iflags, clear-oflags, clear-cflags, clear-lflags): Same. * lisplib.c (defset_set_entries): Add set-mask and clear-mask to autoload symbols for defset. * txr.1: Documented. * stdlib/doc-syms.tl: Updated. --- stdlib/socket.tl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'stdlib/socket.tl') diff --git a/stdlib/socket.tl b/stdlib/socket.tl index eac123be..aeb33dbe 100644 --- a/stdlib/socket.tl +++ b/stdlib/socket.tl @@ -102,11 +102,11 @@ (defun sys:str-inaddr-net-impl (addr wextra : weff) (let ((mask addr)) - (set mask (logior mask (ash mask 1))) - (set mask (logior mask (ash mask 2))) - (set mask (logior mask (ash mask 4))) - (set mask (logior mask (ash mask 8))) - (set mask (logior mask (ash mask 16))) + (set-mask mask (ash mask 1)) + (set-mask mask (ash mask 2)) + (set-mask mask (ash mask 4)) + (set-mask mask (ash mask 8)) + (set-mask mask (ash mask 16)) (let* ((w (- 32 (width (lognot mask 32)))) (d (logand addr #xFF)) (c (logand (ash addr -8) #xFF)) @@ -130,13 +130,13 @@ (= (ash addr -32) #xFFFF)) `::ffff:@(sys:str-inaddr-net-impl (logtrunc addr 32) 96 width)` (let ((mask addr)) - (set mask (logior mask (ash mask 1))) - (set mask (logior mask (ash mask 2))) - (set mask (logior mask (ash mask 4))) - (set mask (logior mask (ash mask 8))) - (set mask (logior mask (ash mask 16))) - (set mask (logior mask (ash mask 32))) - (set mask (logior mask (ash mask 64))) + (set-mask mask (ash mask 1)) + (set-mask mask (ash mask 2)) + (set-mask mask (ash mask 4)) + (set-mask mask (ash mask 8)) + (set-mask mask (ash mask 16)) + (set-mask mask (ash mask 32)) + (set-mask mask (ash mask 64)) (let* ((w (- 128 (width (lognot mask 128)))) (pieces (let ((count 8)) (nexpand-left (lambda (val) -- cgit v1.2.3