diff --git a/README.txt b/README.txt index 795dc97..64132f4 100644 --- a/README.txt +++ b/README.txt @@ -42,6 +42,9 @@ things to do in :osc-ex[tensions|tras] changes + 2005-12-05 + - version 0.3 + - fixed openmcl float bug (decode-uint32) 2005-11-29 - version 0.2 - openmcl float en/decoding diff --git a/osc.asd b/osc.asd index dbb5398..c850ef6 100644 --- a/osc.asd +++ b/osc.asd @@ -7,5 +7,5 @@ :author "nik gaffney " :licence "LLGPL" :description "The Open Sound Control protocol, aka OSC" - :version "0.2" + :version "0.3" :components ((:file "osc"))) diff --git a/osc.lisp b/osc.lisp index 58cb841..e1ce391 100644 --- a/osc.lisp +++ b/osc.lisp @@ -258,7 +258,7 @@ "ieee754 float from a vector of 4 bytes in network byte order" #+sbcl (sb-kernel:make-single-float (decode-int32 s)) #+cmucl (kernel:make-single-float (decode-int32 s)) - #+openmcl (CCL::HOST-SINGLE-FLOAT-FROM-UNSIGNED-BYTE-32 (decode-int32 s)) + #+openmcl (CCL::HOST-SINGLE-FLOAT-FROM-UNSIGNED-BYTE-32 (decode-uint32 s)) #-(or sbcl cmucl openmcl) (error "cant decode floats using this implementation")) (defun decode-int32 (s) @@ -271,6 +271,14 @@ (- 0 (- #x100000000 i)) i))) +(defun decode-uint32 (s) + "4 byte -> 32 bit unsigned int" + (let ((i (+ (ash (elt s 0) 24) + (ash (elt s 1) 16) + (ash (elt s 2) 8) + (elt s 3)))) + i)) + (defun encode-int32 (i) "convert an integer into a sequence of 4 bytes in network byte order." (declare (type integer i))