Changeset 4267


Ignore:
Timestamp:
10/09/03 16:51:08 (18 years ago)
Author:
piso
Message:

Cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/bit-array-ops.lisp

    r4265 r4267  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: bit-array-ops.lisp,v 1.1 2003-10-09 16:41:53 piso Exp $
     4;;; $Id: bit-array-ops.lisp,v 1.2 2003-10-09 16:51:08 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    5656       (error 'program-error "~S and ~S do not have the same dimensions"
    5757              bit-array-1 bit-array-2))
    58      (let* ((result-bit-array (pick-result-array result-bit-array bit-array-1))
    59             (end3 (array-total-size result-bit-array)))
    60        (do ((index-1 0 (1+ index-1))
    61             (index-2 0 (1+ index-2))
    62             (index-3 0 (1+ index-3)))
    63            ((>= index-3 end3) result-bit-array)
    64          (setf (row-major-aref result-bit-array index-3)
    65                (logand (,function (row-major-aref bit-array-1 index-1)
    66                                   (row-major-aref bit-array-2 index-2))
     58     (let ((result-bit-array (pick-result-array result-bit-array bit-array-1)))
     59       (dotimes (i (array-total-size result-bit-array) result-bit-array)
     60         (setf (row-major-aref result-bit-array i)
     61               (logand (,function (row-major-aref bit-array-1 i)
     62                                  (row-major-aref bit-array-2 i))
    6763                       1))))))
    6864
    69 (def-bit-array-op bit-and logand)
    70 (def-bit-array-op bit-ior logior)
    71 (def-bit-array-op bit-xor logxor)
    72 (def-bit-array-op bit-eqv logeqv)
    73 (def-bit-array-op bit-nand lognand)
    74 (def-bit-array-op bit-nor lognor)
     65(def-bit-array-op bit-and   logand)
     66(def-bit-array-op bit-ior   logior)
     67(def-bit-array-op bit-xor   logxor)
     68(def-bit-array-op bit-eqv   logeqv)
     69(def-bit-array-op bit-nand  lognand)
     70(def-bit-array-op bit-nor   lognor)
    7571(def-bit-array-op bit-andc1 logandc1)
    7672(def-bit-array-op bit-andc2 logandc2)
    77 (def-bit-array-op bit-orc1 logorc1)
    78 (def-bit-array-op bit-orc2 logorc2)
     73(def-bit-array-op bit-orc1  logorc1)
     74(def-bit-array-op bit-orc2  logorc2)
    7975
    8076(defun bit-not (bit-array &optional result-bit-array)
     
    8379   BIT-ARRAY is used.  If RESULT-BIT-ARRAY is NIL or omitted, a new array is
    8480   created.  Both arrays must have the same rank and dimensions."
    85   (let* ((result-bit-array (pick-result-array result-bit-array bit-array))
    86          (dst-end (array-total-size result-bit-array)))
    87     (do ((src-index 0 (1+ src-index))
    88          (dst-index 0 (1+ dst-index)))
    89         ((>= dst-index dst-end) result-bit-array)
    90       (setf (row-major-aref result-bit-array dst-index)
    91             (logxor (row-major-aref bit-array src-index) 1)))))
     81  (let ((result-bit-array (pick-result-array result-bit-array bit-array)))
     82    (dotimes (i (array-total-size result-bit-array) result-bit-array)
     83      (setf (row-major-aref result-bit-array i)
     84            (logxor (row-major-aref bit-array i) 1)))))
Note: See TracChangeset for help on using the changeset viewer.