diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-09-21 16:28:34 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-09-21 16:28:34 +0300 |
commit | b11c895bdd77ec87618079ea5037610e68599e07 (patch) | |
tree | 1e429d0aeef9d846af35a95077625d083613ea34 | |
parent | af57879ea050c7258c92a6aef840dd5da51ccbd3 (diff) | |
download | rpm-b11c895bdd77ec87618079ea5037610e68599e07.tar.gz rpm-b11c895bdd77ec87618079ea5037610e68599e07.tar.bz2 rpm-b11c895bdd77ec87618079ea5037610e68599e07.zip |
Move PTOK type enum out of the sprintfToken struct
- 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.
-rw-r--r-- | lib/headerfmt.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/headerfmt.c b/lib/headerfmt.c index d2fa30996..e25f13a3c 100644 --- a/lib/headerfmt.c +++ b/lib/headerfmt.c @@ -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 { |