DEFINT-DECODER: Add missing unquote
Otherwise we return the unbound symbol INT instead of the value of the
we built in the decoder.
Fixes bug introduced in 9facf44
.
This commit is contained in:
parent
db580d2eaf
commit
9436bc39ce
1 changed files with 13 additions and 0 deletions
13
osc.lisp
13
osc.lisp
|
@ -352,6 +352,19 @@ with the current time use (encode-timetag :time)."
|
|||
(ldb (byte 16 0) (decode-int32 s)))
|
||||
#-(or sbcl cmucl openmcl allegro) (error "cant decode floats using this implementation"))
|
||||
|
||||
(defmacro defint-decoder (num-of-octets &optional docstring)
|
||||
(let ((decoder-name (intern (format nil "~:@(decode-uint~)~D" (* 8 num-of-octets))))
|
||||
(seq (gensym))
|
||||
(int (gensym)))
|
||||
`(defun ,decoder-name (,seq)
|
||||
,@(when docstring
|
||||
(list docstring))
|
||||
(let* ((,int 0)
|
||||
,@(loop
|
||||
for n below num-of-octets
|
||||
collect `(,int (dpb (aref ,seq ,n) (byte 8 (* 8 (- (1- ,num-of-octets) ,n)))
|
||||
,int))))
|
||||
,int))))
|
||||
|
||||
(defun decode-uint32 (s)
|
||||
"4 byte -> 32 bit unsigned int"
|
||||
|
|
Loading…
Reference in a new issue