From: David Engster Date: Sun, 25 Jan 2015 21:32:25 +0000 (+0100) Subject: semantic: Apply enum-type to all members X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=05d6b4be45cbef29b9f1eed745825071a67f1bb8;p=emacs.git semantic: Apply enum-type to all members * lisp/cedet/semantic/bovine/c.el (semantic-expand-c-tag): For typed enums, apply the :enum-type attribute as :type to all members. --- diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el index c6a2ef9bd25..5d7d5a6af5f 100644 --- a/lisp/cedet/semantic/bovine/c.el +++ b/lisp/cedet/semantic/bovine/c.el @@ -1022,6 +1022,15 @@ now. (setq return-list (car tag)) (setq tag (cdr tag))) + ;; Check if we have a typed enum, and if so, apply its type to all + ;; members. + (when (and (semantic-tag-of-type-p tag "enum") + (semantic-tag-get-attribute tag :enum-type)) + (let ((enumtype (semantic-tag-get-attribute tag :enum-type)) + (members (semantic-tag-get-attribute tag :members))) + (dolist (cur members) + (semantic-tag-put-attribute cur :type enumtype)))) + ;; Name of the tag is a list, so expand it. Tag lists occur ;; for variables like this: int var1, var2, var3; ;;