X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fhost-alieneval.lisp;h=9c343d5b39d031a63d5d6c0c2ef53ac3a13d8fe6;hb=731d5dd65a7b94b5d49d1663d9b60c3a406ce38c;hp=bd3ad14f116a9364c28352a5d00a3fa2330e0952;hpb=e86c7368eb115287ec44672390f790d54b5df940;p=sbcl.git diff --git a/src/code/host-alieneval.lisp b/src/code/host-alieneval.lisp index bd3ad14..9c343d5 100644 --- a/src/code/host-alieneval.lisp +++ b/src/code/host-alieneval.lisp @@ -607,8 +607,8 @@ (define-alien-type-class (enum :include (integer (bits 32)) :include-args (signed)) name ; name of this enum (if any) - from ; alist from keywords to integers - to ; alist or vector from integers to keywords + from ; alist from symbols to integers + to ; alist or vector from integers to symbols kind ; kind of from mapping, :VECTOR or :ALIST offset) ; offset to add to value for :VECTOR from mapping @@ -649,8 +649,8 @@ (values (first el) (second el)) (values el (1+ prev))) (setf prev val) - (unless (keywordp sym) - (error "The enumeration element ~S is not a keyword." sym)) + (unless (symbolp sym) + (error "The enumeration element ~S is not a symbol." sym)) (unless (integerp val) (error "The element value ~S is not an integer." val)) (unless (and max (> max val)) (setq max val)) @@ -718,7 +718,7 @@ (:alist `(ecase ,alien ,@(mapcar (lambda (mapping) - `(,(car mapping) ,(cdr mapping))) + `(,(car mapping) ',(cdr mapping))) (alien-enum-type-to type)))))) (define-alien-type-method (enum :deport-gen) (type value) @@ -837,10 +837,10 @@ `(sap+ ,sap (/ ,offset sb!vm:n-byte-bits))) (define-alien-type-method (mem-block :deposit-gen) (type sap offset value) - (let ((bits (alien-mem-block-type-bits type))) - (unless bits + (let ((bytes (truncate (alien-mem-block-type-bits type) sb!vm:n-byte-bits))) + (unless bytes (error "can't deposit aliens of type ~S (unknown size)" type)) - `(sb!kernel:system-area-copy ,value 0 ,sap ,offset ',bits))) + `(sb!kernel:system-area-ub8-copy ,value 0 ,sap ,offset ',bytes))) ;;;; the ARRAY type