|
[Sbcl-commits] 1.0.46.18: terser C-STRING unparsing
From: Nikodemus Siivola <nikodemus@ra...> - 2011-03-02 09:30
|
1.0.46.18: terser C-STRING unparsing
Omit parts with default values from the unparsing: just
(C-STRING :EXTERNAL-FORMAT :DEFAULT :ELEMENT-TYPE CHARACTER)
becomes C-STRING, and
(C-STRING :EXTERNAL-FORMAT :UTF-8 :ELEMENT-TYPE CHARACTER)
becomes (C-STRING :EXTERNAL-FORMAT :UTF-8), etc.
Index: version.lisp-expr
===================================================================
RCS file: /cvsroot/sbcl/sbcl/version.lisp-expr,v
retrieving revision 1.5202
diff -u -r1.5202 version.lisp-expr
--- version.lisp-expr 28 Feb 2011 12:12:19 -0000 1.5202
+++ version.lisp-expr 2 Mar 2011 09:20:24 -0000
@@ -20,4 +20,4 @@
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.46.17"
+"1.0.46.18"
Index: src/code/host-c-call.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/host-c-call.lisp,v
retrieving revision 1.13
diff -u -r1.13 host-c-call.lisp
--- src/code/host-c-call.lisp 29 Sep 2009 01:02:20 -0000 1.13
+++ src/code/host-c-call.lisp 2 Mar 2011 09:20:25 -0000
@@ -30,9 +30,16 @@
external-format)))
(define-alien-type-method (c-string :unparse) (type)
- (list 'c-string
- :external-format (alien-c-string-type-external-format type)
- :element-type (alien-c-string-type-element-type type)))
+ (let* ((external-format (alien-c-string-type-external-format type))
+ (element-type (alien-c-string-type-element-type type))
+ (tail
+ (append (unless (eq :default external-format)
+ (list :external-format external-format))
+ (unless (eq 'character element-type)
+ (list :element-type element-type))) ))
+ (if tail
+ (cons 'c-string tail)
+ 'c-string)))
(define-alien-type-method (c-string :lisp-rep) (type)
(declare (ignore type))
|
| Thread | Author | Date |
|---|---|---|
| [Sbcl-commits] 1.0.46.18: terser C-STRING unparsing | Nikodemus Siivola <nikodemus@ra...> |