X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/b7fcf94152e4c1938fbca55d13b1e6a64b694bd6..8698accbb89627bf7358f6614de713be11bde3b8:/src/c-types-proto.lisp diff --git a/src/c-types-proto.lisp b/src/c-types-proto.lisp index 0c95d02..0ce2cf3 100644 --- a/src/c-types-proto.lisp +++ b/src/c-types-proto.lisp @@ -46,8 +46,11 @@ (export 'canonify-qualifiers) (defun canonify-qualifiers (qualifiers) - "Return a canonical list of qualifiers." - (delete-duplicates (sort (copy-list qualifiers) #'string<))) + "Return a canonical list of qualifiers. + + Duplicates and `nil' entries are deleted, and the remaining entries are + sorted." + (sort (delete-duplicates (delete nil (copy-list qualifiers))) #'string<)) (export 'qualify-c-type) (defgeneric qualify-c-type (type qualifiers) @@ -242,7 +245,7 @@ ((char= ch #\-) (write-char #\_ out)) (t - (error "Bad character in C name ~S." name)))))) + (error "Bad character in C name ~S" name)))))) (t name))) ;;;-------------------------------------------------------------------------- @@ -335,13 +338,15 @@ ;;;-------------------------------------------------------------------------- ;;; Function arguments. -(export '(argument argumentp make-argument argument-name argument-type)) -(defstruct (argument (:constructor make-argument (name type +(export '(argument argumentp make-argument + argument-name argument-type argument-default)) +(defstruct (argument (:constructor make-argument (name type &optional default &aux (%type type))) (:predicate argumentp)) "Simple structure representing a function argument." (name nil :type t :read-only t) - (%type nil :type c-type :read-only t)) + (%type nil :type c-type :read-only t) + (default nil :type t :read-only t)) (define-access-wrapper argument-type argument-%type :read-only t) (export 'commentify-argument-name)