/[cmucl]/src/code/fd-stream.lisp
ViewVC logotype

Diff of /src/code/fd-stream.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.85.4.1.2.12 by rtoy, Tue May 12 16:31:48 2009 UTC revision 1.85.4.1.2.13 by rtoy, Thu May 28 18:52:35 2009 UTC
# Line 121  Line 121 
121    
122  (defun endian-swap-value (vector endian-swap)  (defun endian-swap-value (vector endian-swap)
123    (case endian-swap    (case endian-swap
124      (:network-order #+big-endian 0      (:network-order
125                      #+little-endian (1- (vector-elt-width vector)))       #+big-endian 0
126         ;; This is needed because the little-endian (x86) architectures
127         ;; store the lowest indexed element in the least significant part
128         ;; of a byte.  On a big-endian machine (sparc, ppc), the lowest
129         ;; indexed element is at the most significant part of a byte.
130         #+little-endian
131         (typecase vector
132           ((array (unsigned-byte 4) (*))
133            -1)
134           ((array (unsigned-byte 2) (*))
135            -2)
136           ((array (unsigned-byte 1) (*))
137            -8)
138           (t
139            (1- (vector-elt-width vector)))))
140      (:byte-8 0)      (:byte-8 0)
141      (:byte-16 1)      (:byte-16 1)
142      (:byte-32 3)      (:byte-32 3)
# Line 130  Line 144 
144      (:byte-128 15)      (:byte-128 15)
145      ;; additions by Lynn Quam      ;; additions by Lynn Quam
146      (:machine-endian 0)      (:machine-endian 0)
147      (:big-endian #+big-endian 0      (:big-endian
148                   #+little-endian (1- (vector-elt-width vector)))       #+big-endian 0
149      (:little-endian #+big-endian (1- (vector-elt-width vector))       #+little-endian
150                      #+little-endian 0)       (typecase vector
151           ((array (unsigned-byte 4) (*))
152            -1)
153           ((array (unsigned-byte 2) (*))
154            -2)
155           ((array (unsigned-byte 1) (*))
156            -8)
157           (t
158            (1- (vector-elt-width vector)))))
159        (:little-endian
160         #+big-endian
161         (typecase vector
162           ((array (unsigned-byte 4) (*))
163            -1)
164           ((array (unsigned-byte 2) (*))
165            -2)
166           ((array (unsigned-byte 1) (*))
167            -8)
168           (t
169            (1- (vector-elt-width vector))))
170         #+little-endian 0)
171      (otherwise endian-swap)))      (otherwise endian-swap)))
172    
173    

Legend:
Removed from v.1.85.4.1.2.12  
changed lines
  Added in v.1.85.4.1.2.13

  ViewVC Help
Powered by ViewVC 1.1.5