From ffdc4f04a2775d3df75088de0d50134c23917e5c Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 19 Dec 2011 10:26:17 -0700 Subject: [PATCH] Automated commit for upstream build of version 2.1.0 --- ChangeLog | 4 ++++ debian/changelog | 6 ++++++ src/strings.lisp | 13 +++++++------ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07c8141..f3a1afd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-12-20 Kevin Rosenberg + * src/strings.lisp: Improvments for sb-unicode from + Elias Martenson + 2010-10-20 Kevin Rosenberg * src/{strings,i18n}.lisp: Rework foreign string conversion for Lispworks so that wide-character strings diff --git a/debian/changelog b/debian/changelog index 6749dc3..6086e5d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-uffi (2.1.0-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Mon, 19 Dec 2011 10:01:23 -0700 + cl-uffi (2.0.0-1) unstable; urgency=low * Update upstream version for ASDF version dependency checking diff --git a/src/strings.lisp b/src/strings.lisp index f5b5634..4f2eae3 100644 --- a/src/strings.lisp +++ b/src/strings.lisp @@ -144,7 +144,8 @@ that LW/CMU automatically converts strings from c-calls." (string (locally (declare (optimize (speed 3) (safety 0))) - (let* ((fe (or encoding *default-foreign-encoding*)) + (let* ((fe (or encoding *default-foreign-encoding* + sb-impl::*default-external-format*)) (ife (when fe (lookup-foreign-encoding fe)))) (if ife (let* ((octets (sb-ext:string-to-octets str :external-format ife)) @@ -154,7 +155,7 @@ that LW/CMU automatically converts strings from c-calls." (setq storage (sb-alien:cast storage (* (sb-alien:unsigned 8)))) (dotimes (i size) (declare (fixnum i)) - (setf (sb-alien:deref storage i) (svref octets i))) + (setf (sb-alien:deref storage i) (aref octets i))) ;; terminate with 2 nulls, maybe needed for some encodings (setf (sb-alien:deref storage size) 0) (setf (sb-alien:deref storage (1+ size)) 0) @@ -395,10 +396,10 @@ that LW/CMU automatically converts strings from c-calls." (defun foreign-string-length (foreign-string) #+allegro `(ff:foreign-strlen ,foreign-string) #-allegro - `(loop with size = 0 - until (char= (deref-array ,foreign-string '(:array :unsigned-char) size) #\Null) - do (incf size) - finally return size)) + `(loop + for size from 0 + until (char= (deref-array ,foreign-string '(:array :unsigned-char) size) #\Null) + finally (return size))) (defmacro with-foreign-string ((foreign-string lisp-string &optional encoding) -- 2.34.1