From 077315581ebab63f28bed96c28fd62626fed42ef Mon Sep 17 00:00:00 2001 From: Brian Mastenbrook Date: Sat, 27 Aug 2005 17:14:57 +0000 Subject: [PATCH] 0.9.4.11: Some alien changes: * SAPs are now valid arguments to a callback (thanks to Andreas Scholta). * Enumeration values can be used more than once in an alien enum (thanks to Cyrus Harmon). --- src/code/host-alieneval.lisp | 2 +- src/code/target-alieneval.lisp | 3 ++- tests/alien.impure.lisp | 11 +++++++++++ version.lisp-expr | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/code/host-alieneval.lisp b/src/code/host-alieneval.lisp index 56e743d..bb0956c 100644 --- a/src/code/host-alieneval.lisp +++ b/src/code/host-alieneval.lisp @@ -656,7 +656,7 @@ (unless (and max (> max val)) (setq max val)) (unless (and min (< min val)) (setq min val)) (when (rassoc val from-alist) - (error "The element value ~S is used more than once." val)) + (warn "The element value ~S is used more than once." val)) (when (assoc sym from-alist :test #'eq) (error "The enumeration element ~S is used more than once." sym)) (push (cons sym val) from-alist))) diff --git a/src/code/target-alieneval.lisp b/src/code/target-alieneval.lisp index 822dd7d..c670384 100644 --- a/src/code/target-alieneval.lisp +++ b/src/code/target-alieneval.lisp @@ -852,7 +852,8 @@ ENTER-ALIEN-CALLBACK pulls the corresponsing trampoline out and calls it.") (let ((type (parse-alien-type spec env))) (if (or (alien-integer-type-p type) (alien-float-type-p type) - (alien-pointer-type-p type)) + (alien-pointer-type-p type) + (alien-system-area-pointer-type-p type)) (ceiling (alien-type-word-aligned-bits type) sb!vm:n-byte-bits) (error "Unsupported callback argument type: ~A" type)))) diff --git a/tests/alien.impure.lisp b/tests/alien.impure.lisp index 7192ba3..e215ad2 100644 --- a/tests/alien.impure.lisp +++ b/tests/alien.impure.lisp @@ -115,6 +115,17 @@ (deref integer-array 1))) (assert (eql (deref enum-array 2) 'k-two)))) +;; enums used to allow values to be used only once +;; C enums allow for multiple tags to point to the same value +(define-alien-type enum.4 + (enum nil (:key1 1) (:key2 2) (:keytwo 2))) +(with-alien ((enum-array (array enum.4 3))) + (setf (deref enum-array 0) :key1) + (setf (deref enum-array 1) :key2) + (setf (deref enum-array 2) :keytwo) + (assert (and (eql (deref enum-array 1) (deref enum-array 2)) + (eql (deref enum-array 1) :key2)))) + ;;; As reported by Baughn on #lisp, ALIEN-FUNCALL loops forever when ;;; compiled with (DEBUG 3). (sb-kernel::values-specifier-type-cache-clear) diff --git a/version.lisp-expr b/version.lisp-expr index a917079..06af1b2 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,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".) -"0.9.4.10" +"0.9.4.11" -- 1.7.10.4