diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-12-13 18:16:39 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-12-13 18:16:39 +0200 |
commit | cbd7a684a4cd88bfa3383658790be3c37230707a (patch) | |
tree | 61c4cbe890438131ad44949fa92f1642508e48a5 /rpmdb | |
parent | c8f2927227471758abbdb36781d885b01798f0f8 (diff) | |
download | rpm-cbd7a684a4cd88bfa3383658790be3c37230707a.tar.gz rpm-cbd7a684a4cd88bfa3383658790be3c37230707a.tar.bz2 rpm-cbd7a684a4cd88bfa3383658790be3c37230707a.zip |
Use rpm_count_t everywhere for header data count
- typedef'ed as uint32_t as that's the key size limit imposed by BDB,
relevant for RPM_BIN_TYPE
- easy to change to whatever later on as it's now consistent everywhere
- explicit casts where needed to avoid new warnings from signedness
Diffstat (limited to 'rpmdb')
-rw-r--r-- | rpmdb/header.c | 12 | ||||
-rw-r--r-- | rpmdb/header.h | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/rpmdb/header.c b/rpmdb/header.c index 9d100db86..35251026a 100644 --- a/rpmdb/header.c +++ b/rpmdb/header.c @@ -1759,7 +1759,7 @@ int _headerAddI18NString(Header h, int32_t tag, const char * string, const char ** strArray; int length; int ghosts; - int i, langNum; + rpm_count_t i, langNum; char * buf; table = findEntry(h, HEADER_I18NTABLE, RPM_STRING_ARRAY_TYPE); @@ -1770,7 +1770,7 @@ int _headerAddI18NString(Header h, int32_t tag, const char * string, if (!table && !entry) { const char * charArray[2]; - int count = 0; + rpm_count_t count = 0; if (!lang || (lang[0] == 'C' && lang[1] == '\0')) { charArray[count++] = "C"; } else { @@ -2735,7 +2735,8 @@ static char * formatValue(headerSprintfArgs hsa, sprintfTag tag, int element) strarray = (const char **)data; if (tag->fmt) - val = tag->fmt(RPM_STRING_TYPE, strarray[element], buf, tag->pad, element); + val = tag->fmt(RPM_STRING_TYPE, strarray[element], buf, tag->pad, + (rpm_count_t) element); if (val) { need = strlen(val); @@ -2781,7 +2782,8 @@ static char * formatValue(headerSprintfArgs hsa, sprintfTag tag, int element) } if (tag->fmt) - val = tag->fmt(RPM_INT32_TYPE, &intVal, buf, tag->pad, element); + val = tag->fmt(RPM_INT32_TYPE, &intVal, buf, tag->pad, + (rpm_count_t) element); if (val) { need = strlen(val); @@ -2796,7 +2798,7 @@ static char * formatValue(headerSprintfArgs hsa, sprintfTag tag, int element) case RPM_BIN_TYPE: /* XXX HACK ALERT: element field abused as no. bytes of binary data. */ if (tag->fmt) - val = tag->fmt(RPM_BIN_TYPE, data, buf, tag->pad, count); + val = tag->fmt(RPM_BIN_TYPE, data, buf, tag->pad, (rpm_count_t) count); if (val) { need = strlen(val); diff --git a/rpmdb/header.h b/rpmdb/header.h index 37114ba27..dd5993027 100644 --- a/rpmdb/header.h +++ b/rpmdb/header.h @@ -143,7 +143,7 @@ enum headerSprintfExtensionType { */ typedef char * (*headerTagFormatFunction)(int32_t type, const void * data, char * formatPrefix, - int padding, int element); + int padding, rpm_count_t element); /** \ingroup header * HEADER_EXT_FORMAT format function prototype. |