summaryrefslogtreecommitdiff
path: root/Lisp/type-handling.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-12 18:20:54 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-12 18:20:54 +0100
commit308b848cc4e6630356d84fc43530739a72374130 (patch)
tree5bc36df8d4fca2906951c473c508adbd75537dd5 /Lisp/type-handling.lisp
parent1f87c8d3385203966e88711eae9bf0e5a7493b43 (diff)
When overriding a return type specification, save the nominal type for later use.
darcs-hash:40bdaeb5687e6ad142766f1ee041231e875c1d49
Diffstat (limited to 'Lisp/type-handling.lisp')
-rw-r--r--Lisp/type-handling.lisp26
1 files changed, 20 insertions, 6 deletions
diff --git a/Lisp/type-handling.lisp b/Lisp/type-handling.lisp
index 601afab..b8ff2a2 100644
--- a/Lisp/type-handling.lisp
+++ b/Lisp/type-handling.lisp
@@ -175,22 +175,30 @@ Returns: (VALUES typespec byte-position string-position)"
(#\c (if (and (eq +runtime-type+ :next)
(or return-type-p
(featurep 'cffi-features:ppc32)))
- :int
+ (prog1 :int
+ (push '(nominally :char)
+ qualifiers))
:char))
(#\C (if (and (eq +runtime-type+ :next)
(or return-type-p
(featurep 'cffi-features:ppc32)))
- :unsigned-int
+ (prog1 :unsigned-int
+ (push '(nominally :unsigned-char)
+ qualifiers))
:unsigned-char))
(#\s (if (and (eq +runtime-type+ :next)
(or return-type-p
(featurep 'cffi-features:ppc32)))
- :int
+ (prog1 :int
+ (push '(nominally :short)
+ qualifiers))
:short))
(#\S (if (and (eq +runtime-type+ :next)
(or return-type-p
(featurep 'cffi-features:ppc32)))
- :unsigned-int
+ (prog1 :unsigned-int
+ (push '(nominally :unsigned-short)
+ qualifiers))
:unsigned-short))
(#\i :int)
(#\I :unsigned-int)
@@ -233,7 +241,7 @@ Returns: (VALUES typespec byte-position string-position)"
(destructuring-bind (type-name modifiers &rest rest)
typespec
(dolist (modifier modifiers)
- (format stream "~A" (ecase modifier
+ (format stream "~A" (case modifier
(const #\r)
(in #\n)
(inout #\N)
@@ -241,7 +249,13 @@ Returns: (VALUES typespec byte-position string-position)"
(bycopy #\O)
(oneway #\V)
(byref #\R)
- (opaque ""))))
+ (opaque "")
+ (otherwise
+ (assert (listp modifier))
+ (ecase (first modifier)
+ ((nominally) (setq type-name
+ (second modifier))))
+ ""))))
(case type-name
((struct union) (destructuring-bind (name . children) rest
(format stream "~C~A"