From d22ba88cc51c685052b774aea960cc86fce4aaae Mon Sep 17 00:00:00 2001 From: nik gaffney Date: Wed, 26 Jan 2005 23:19:43 +0800 Subject: [PATCH] acroscopic darcs-hash:20050126151943-2648a-fa2e062470c777a1b3cd7b5874e0d0bfeab979d3.gz --- osc-examples.lisp | 2 ++ osc.lisp | 19 +++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/osc-examples.lisp b/osc-examples.lisp index 71e9bef..a853094 100644 --- a/osc-examples.lisp +++ b/osc-examples.lisp @@ -30,6 +30,8 @@ (require :sb-bsd-sockets) ;(require :osc) +(use-package :sb-bsd-sockets) + (defun osc-listen (port) "a basic test function which attempts to decode osc stuff a given port. default ogreOSC port is 4178" diff --git a/osc.lisp b/osc.lisp index 333123d..caa3eec 100644 --- a/osc.lisp +++ b/osc.lisp @@ -16,7 +16,7 @@ ;; ;; requirements ;; -;; dependent on sbcl for sb-bsd-sockets and float encoding +;; dependent on sbcl for float encoding, other suggestions welcome. ;; ;; commentary ;; @@ -42,9 +42,7 @@ ;; - blobs ;; known BUGS -;; -;; - multiple arg messages containing strings can corrupt further output. . -;; probably need to collect a few more testcases. . +;; - only unknown for now.. . ;; changes ;; @@ -53,7 +51,8 @@ ;; Mon, 24 Jan 2005 15:43:20 +0100 ;; - sends and receives multiple arguments ;; - tests in osc-test.lisp -;; +;; Wed, 26 Jan 2005 16:18:36 +0100 +;; - fixed string handling bug ;;;;;; ; ;; ; ; ; ; ; ; ; @@ -160,12 +159,12 @@ result) (setf acc (subseq acc 4))) ((eq x (char-code #\s)) - (push (decode-string - (subseq acc 0 - (+ (osc-padding-length (position 0 acc)) + (let ((pointer (+ (osc-padding-length (position 0 acc)) (position 0 acc)))) - result) - (setf acc (subseq acc (position 0 acc)))) + (push (decode-string + (subseq acc 0 pointer)) + result) + (setf acc (subseq acc pointer)))) ((eq x (char-code #\b)) (decode-blob x)) (t (error "unrecognised typetag")))) tags)