From: Mark Wooding Date: Thu, 26 May 2016 08:26:09 +0000 (+0100) Subject: src/c-types-parse.lisp: Use the new `find-simple-c-type' function. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/commitdiff_plain/a47b5b286ee7c98c16b4023e5d6954cfdd9faa88?ds=sidebyside src/c-types-parse.lisp: Use the new `find-simple-c-type' function. New simple types added using `define-simple-c-type' won't be present in the `*declspec-map*', or the `*module-type-map*', so they won't be found at all using the previous search. Now, look use `find-simple-c-type' if the other two lookups don't work. Now that this works, we don't need `void' or `bool' in the `*declspec- map*', because they don't accept any modifiers. --- diff --git a/src/c-types-parse.lisp b/src/c-types-parse.lisp index 13f9145..ce70ef7 100644 --- a/src/c-types-parse.lisp +++ b/src/c-types-parse.lisp @@ -89,8 +89,7 @@ (default-slot (ds 'name slot-names) (defparameter *declspec-map* (let ((map (make-hash-table :test #'equal))) - (dolist (item '((type :void :char :int :float :double - (:bool :compat "_Bool")) + (dolist (item '((type :char :int :float :double) (complexity (:complex :compat "_Complex") (:imaginary :compat "_Imaginary")) ((type :taggedp t) :enum :struct :union) @@ -260,7 +259,8 @@ (defun scan-simple-declspec (let ((kw (token-value scanner))) (or (gethash kw *declspec-map*) (and (boundp '*module-type-map*) - (gethash kw *module-type-map*))))))) + (gethash kw *module-type-map*)) + (find-simple-c-type kw)))))) (cond ((or (not ds) (and predicate (not (funcall predicate ds)))) (values (list indicator) nil nil)) ((and (typep ds 'declspec) (ds-taggedp ds))