~dieggsy/srfi-143

fcbf4affe1ad0c9ea9ae4aa02006d992ad6eee4b — dieggsy 3 years ago 20f1422
Fix incorrect one-argument calls to chicken:fx-
1 files changed, 3 insertions(+), 3 deletions(-)

M srfi-143-impl.scm
M srfi-143-impl.scm => srfi-143-impl.scm +3 -3
@@ 48,7 48,7 @@

(define (fxarithmetic-shift i count)
  (if (negative? count)
      (fxarithmetic-shift-right i (chicken:fx- count))
      (fxarithmetic-shift-right i (fxneg count))
      (fxarithmetic-shift-left i count)))

;;; Bitwise functions cloned from SRFI 151, fixnum version


@@ 71,13 71,13 @@
(define (fxfirst-set-bit i) (chicken:fx- (fxbit-count (fxxor i (chicken:fx- i 1))) 1))

(define (fxbit-field n start end)
  (fxand (mask start end) (fxarithmetic-shift n (chicken:fx- start))))
  (fxand (mask start end) (fxarithmetic-shift n (fxneg start))))

(define (fxbit-field-rotate n count start end)
  (define width (chicken:fx- end start))
  (set! count (modulo count width))
  (let ((mask (fxnot (fxarithmetic-shift -1 width))))
    (define zn (fxand mask (fxarithmetic-shift n (chicken:fx- start))))
    (define zn (fxand mask (fxarithmetic-shift n (fxneg start))))
    (fxior (fxarithmetic-shift
            (fxior (fxand mask (fxarithmetic-shift zn count))
                   (fxarithmetic-shift zn (chicken:fx- count width)))