Use concrete integer types for entryInfo and rpmtd members
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 22 Oct 2010 06:37:20 +0000 (09:37 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 22 Oct 2010 06:40:20 +0000 (09:40 +0300)
- Start undoing self-introduced enum braindamage from 2007: the lowlevel
  tag data in header structures are NOT rpmTag/rpmTagType enums, but a
  32bit integer of any arbitrary value. While these can be legally mixed in
  C the same is not true of C++ and even in C using enum here is not "correct"

lib/header_internal.h
lib/rpmtd.h
lib/rpmtypes.h

index cc8b893..82b96e3 100644 (file)
@@ -12,8 +12,8 @@
  */
 typedef struct entryInfo_s * entryInfo;
 struct entryInfo_s {
-    rpmTag tag;                        /*!< Tag identifier. */
-    rpmTagType type;           /*!< Tag data type. */
+    rpm_tag_t tag;             /*!< Tag identifier. */
+    rpm_tagtype_t type;                /*!< Tag data type. */
     int32_t offset;            /*!< Offset into data segment (ondisk only). */
     rpm_count_t count;         /*!< Number of tag elements. */
 };
index d395aef..ace6994 100644 (file)
@@ -23,8 +23,8 @@ typedef rpmFlags rpmtdFlags;
  * @todo               Make this opaque (at least outside rpm itself)
  */
 struct rpmtd_s {
-    rpmTag tag;                /* rpm tag of this data entry*/
-    rpmTagType type;   /* data type */
+    rpm_tag_t tag;     /* rpm tag of this data entry*/
+    rpm_tagtype_t type;        /* data type */
     rpm_count_t count; /* number of entries */
     rpm_data_t data;   /* pointer to actual data */
     rpmtdFlags flags;  /* flags on memory allocation etc */
index 8e2bb7d..5e49375 100644 (file)
@@ -25,7 +25,7 @@ typedef struct headerToken_s * Header;
 typedef struct headerIterator_s * HeaderIterator;
 
 typedef int32_t                rpm_tag_t;
-typedef uint32_t       rpm_tagtype_t;          /* unused */
+typedef uint32_t       rpm_tagtype_t;
 typedef uint32_t       rpm_count_t;
 
 typedef void *         rpm_data_t;