Move PTOK type enum out of the sprintfToken struct
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Sep 2010 13:28:34 +0000 (16:28 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Sep 2010 13:28:34 +0000 (16:28 +0300)
- While legal in C++, the enum and its values are only visible within
  the scope it was declared in, making it invisible to the rest of
  the program.

lib/headerfmt.c

index d2fa309..e25f13a 100644 (file)
@@ -27,17 +27,19 @@ struct sprintfTag_s {
     char * type;
 };
 
+typedef enum {
+    PTOK_NONE = 0,
+    PTOK_TAG,
+    PTOK_ARRAY,
+    PTOK_STRING,
+    PTOK_COND
+} ptokType;
+
 /** \ingroup header
  */
 typedef struct sprintfToken_s * sprintfToken;
 struct sprintfToken_s {
-    enum {
-       PTOK_NONE = 0,
-       PTOK_TAG,
-       PTOK_ARRAY,
-       PTOK_STRING,
-       PTOK_COND
-    } type;
+    ptokType type;
     union {
        struct sprintfTag_s tag;        /*!< PTOK_TAG */
        struct {