svn: r5594

original commit: 4b765cfa5a580e49bff9177104b5ec962d45b79c
This commit is contained in:
Matthew Flatt 2007-02-14 02:41:49 +00:00
parent bd70478f11
commit 8cbc701049
2 changed files with 8 additions and 7 deletions

View File

@ -58,12 +58,13 @@
(provide* ctype-sizeof ctype-alignof compiler-sizeof
malloc free end-stubborn-change
cpointer? ptr-equal? (unsafe ptr-ref) (unsafe ptr-set!)
cpointer? ptr-equal? ptr-add (unsafe ptr-ref) (unsafe ptr-set!)
ctype? make-ctype make-cstruct-type make-sized-byte-string
_void _int8 _uint8 _int16 _uint16 _int32 _uint32 _int64 _uint64
_fixint _ufixint _fixnum _ufixnum
_float _double _double*
_bool _pointer _scheme _fpointer)
_bool _pointer _scheme _fpointer
(unsafe memcpy) (unsafe memmove) (unsafe memset))
(define-syntax define*
(syntax-rules ()

View File

@ -134,8 +134,8 @@
#xFFF #x1FFF #x3FFF #x7FFF #xFFFF)])
(lambda (a s)
(let-values ([(hi lo s)
(cond [(< 0 s 16) (values (car a) (cdr a) s)]
[(< s 32) (values (cdr a) (car a) (- s 16))]
(cond [(< s 16) (values (car a) (cdr a) s)]
[(< s 32) (values (cdr a) (car a) (- s 16))]
[else (error 'word<<< "shift out of range: ~e"
s)])])
(cons! a
@ -161,12 +161,12 @@
;; (error 'bytes->word-vector! "something bad happened"))
(let loop ([n 15])
(when (<= 0 n)
(let ([m (* 4 n)])
(let ([m (arithmetic-shift n 2)])
(cons! (vector-ref result n)
(+ (bytes-ref l-raw (+ 2 m))
(* 256 (bytes-ref l-raw (+ 3 m))))
(arithmetic-shift (bytes-ref l-raw (+ 3 m)) 8))
(+ (bytes-ref l-raw m)
(* 256 (bytes-ref l-raw (+ 1 m))))))
(arithmetic-shift (bytes-ref l-raw (+ 1 m)) 8))))
(loop (sub1 n)))))
(define empty-port (open-input-bytes #""))