From: Panu Matilainen Date: Fri, 22 Oct 2010 06:37:20 +0000 (+0300) Subject: Use concrete integer types for entryInfo and rpmtd members X-Git-Tag: tznext/4.11.0.1.tizen20130304~1512 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b1e48298324cab35e5cac030dac06e7f37bf66b;p=tools%2Flibrpm-tizen.git Use concrete integer types for entryInfo and rpmtd members - 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" --- diff --git a/lib/header_internal.h b/lib/header_internal.h index cc8b893..82b96e3 100644 --- a/lib/header_internal.h +++ b/lib/header_internal.h @@ -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. */ }; diff --git a/lib/rpmtd.h b/lib/rpmtd.h index d395aef..ace6994 100644 --- a/lib/rpmtd.h +++ b/lib/rpmtd.h @@ -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 */ diff --git a/lib/rpmtypes.h b/lib/rpmtypes.h index 8e2bb7d..5e49375 100644 --- a/lib/rpmtypes.h +++ b/lib/rpmtypes.h @@ -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;