Use rpm_count_t everywhere for header data count
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 13 Dec 2007 07:25:10 +0000 (09:25 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 13 Dec 2007 07:25:10 +0000 (09:25 +0200)
- 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

29 files changed:
build/files.c
build/pack.c
build/parsePreamble.c
build/reqprov.c
lib/formats.c
lib/fs.c
lib/idtx.c
lib/legacy.c
lib/package.c
lib/psm.c
lib/rpmchecksig.c
lib/rpmds.c
lib/rpmfi.c
lib/rpmfi.h
lib/rpmfi_internal.h
lib/rpminstall.c
lib/rpmlib.h
lib/rpmts.c
lib/rpmts_internal.h
lib/signature.c
python/header-py.c
rpmdb/hdrNVR.c
rpmdb/header.c
rpmdb/header.h
rpmdb/header_common.c
rpmdb/header_internal.c
rpmdb/header_internal.h
rpmdb/header_method.h
rpmdb/rpmdb.c

index dca32e6..1e9b1d0 100644 (file)
@@ -240,7 +240,7 @@ static void timeCheck(int tc, Header h)
     int * mtime;
     const char ** files;
     rpmTagType fnt;
-    int count, x;
+    rpm_count_t count, x;
     time_t currentTime = time(NULL);
 
     x = hge(h, RPMTAG_OLDFILENAMES, &fnt, (void **) &files, &count);
@@ -2018,7 +2018,8 @@ exit:
 void initSourceHeader(rpmSpec spec)
 {
     HeaderIterator hi;
-    int32_t tag, type, count;
+    int32_t tag, type;
+    rpm_count_t count;
     const void * ptr;
 
     spec->sourceHeader = headerNew();
index 761f871..0555465 100644 (file)
@@ -565,7 +565,7 @@ exit:
     if (sig != NULL && pkgidp != NULL) {
        int32_t tagType;
        unsigned char * MD5 = NULL;
-       int32_t c;
+       rpm_count_t c;
        int xx;
        xx = headerGetEntry(sig, RPMSIGTAG_MD5, &tagType, (void **)&MD5, &c);
        if (tagType == RPM_BIN_TYPE && MD5 != NULL && c == 16)
index bce36b0..71da7ab 100644 (file)
@@ -192,7 +192,7 @@ static int isMemberInEntry(Header h, const char *name, rpmTag tag)
     HFD_t hfd = headerFreeData;
     const char ** names;
     rpmTagType type;
-    int count;
+    rpm_count_t count;
 
     if (!hge(h, tag, &type, (void **)&names, &count))
        return -1;
@@ -428,7 +428,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
     rpmsenseFlags tagflags;
     rpmTagType type;
     int len;
-    int num;
+    rpm_count_t num;
     int rc;
     int xx;
     
@@ -566,16 +566,18 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
        delMacro(NULL, "_docdir");
        addMacro(NULL, "_docdir", NULL, field, RMIL_SPEC);
        break;
-    case RPMTAG_EPOCH:
+    case RPMTAG_EPOCH: {
        SINGLE_TOKEN_ONLY;
-       if (parseNum(field, &num)) {
+       int epoch;
+       if (parseNum(field, &epoch)) {
            rpmlog(RPMLOG_ERR,
                     _("line %d: Epoch/Serial field must be a number: %s\n"),
                     spec->lineNum, spec->line);
            return RPMRC_FAIL;
        }
-       xx = headerAddEntry(pkg->header, tag, RPM_INT32_TYPE, &num, 1);
+       xx = headerAddEntry(pkg->header, tag, RPM_INT32_TYPE, &epoch, 1);
        break;
+    }
     case RPMTAG_AUTOREQPROV:
        pkg->autoReq = parseYesNo(field);
        pkg->autoProv = pkg->autoReq;
index 1b02aee..b9ef8b3 100644 (file)
@@ -20,7 +20,7 @@ int addReqProv(rpmSpec spec, Header h, rpmTag tagN,
     rpmTag versiontag = 0;
     rpmTag flagtag = 0;
     rpmTag indextag = 0;
-    int len;
+    rpm_count_t len;
     rpmsenseFlags extra = RPMSENSE_ANY;
     int xx;
     
index 393a782..38d893d 100644 (file)
@@ -488,7 +488,7 @@ static char * depflagsFormat(int32_t type, const void * data,
  * @return             0 on success
  */
 static int fsnamesTag( Header h, int32_t * type,
-               void ** data, int32_t * count,
+               void ** data, rpm_count_t * count,
                int * freeData)
 {
     const char ** list;
@@ -514,7 +514,7 @@ static int fsnamesTag( Header h, int32_t * type,
  */
 static int instprefixTag(Header h, rpmTagType * type,
                const void ** data,
-               int32_t * count,
+               rpm_count_t * count,
                int * freeData)
 {
     HGE_t hge = (HGE_t)headerGetEntryMinMemory;
@@ -546,14 +546,14 @@ static int instprefixTag(Header h, rpmTagType * type,
  * @return             0 on success
  */
 static int fssizesTag(Header h, rpmTagType * type,
-               const void ** data, int32_t * count,
+               const void ** data, rpm_count_t * count,
                int * freeData)
 {
     HGE_t hge = (HGE_t)headerGetEntryMinMemory;
     const char ** filenames;
     int32_t * filesizes;
     uint32_t * usages;
-    int numFiles;
+    rpm_count_t numFiles;
 
     if (!hge(h, RPMTAG_FILESIZES, NULL, (void **) &filesizes, &numFiles)) {
        filesizes = NULL;
@@ -596,7 +596,7 @@ static int fssizesTag(Header h, rpmTagType * type,
  * @return             0 on success
  */
 static int triggercondsTag(Header h, rpmTagType * type,
-               const void ** data, int32_t * count,
+               const void ** data, rpm_count_t * count,
                int * freeData)
 {
     HGE_t hge = (HGE_t)headerGetEntryMinMemory;
@@ -604,11 +604,12 @@ static int triggercondsTag(Header h, rpmTagType * type,
     rpmTagType tnt, tvt, tst;
     int32_t * indices, * flags;
     char ** names, ** versions;
-    int numNames, numScripts;
+    rpm_count_t numNames, numScripts;
+    rpm_count_t i, j;
     char ** conds, ** s;
     char * item, * flagsStr;
     char * chptr;
-    int i, j, xx;
+    int xx;
     char buf[5];
 
     if (!hge(h, RPMTAG_TRIGGERNAME, &tnt, (void **) &names, &numNames)) {
@@ -668,7 +669,7 @@ static int triggercondsTag(Header h, rpmTagType * type,
  * @return             0 on success
  */
 static int triggertypeTag(Header h, rpmTagType * type,
-               const void ** data, int32_t * count,
+               const void ** data, rpm_count_t * count,
                int * freeData)
 {
     HGE_t hge = (HGE_t)headerGetEntryMinMemory;
@@ -677,8 +678,9 @@ static int triggertypeTag(Header h, rpmTagType * type,
     int32_t * indices, * flags;
     const char ** conds;
     const char ** s;
-    int i, j, xx;
-    int numScripts, numNames;
+    int xx;
+    rpm_count_t numScripts, numNames;
+    rpm_count_t i, j;
 
     if (!hge(h, RPMTAG_TRIGGERINDEX, NULL, (void **) &indices, &numNames)) {
        *freeData = 0;
@@ -725,7 +727,7 @@ static int triggertypeTag(Header h, rpmTagType * type,
  * @return             0 on success
  */
 static int filenamesTag(Header h, rpmTagType * type,
-               const void ** data, int32_t * count,
+               const void ** data, rpm_count_t * count,
                int * freeData)
 {
     *type = RPM_STRING_ARRAY_TYPE;
@@ -744,7 +746,7 @@ static int filenamesTag(Header h, rpmTagType * type,
  * @return             0 on success
  */
 static int fileclassTag(Header h, rpmTagType * type,
-               const void ** data, int32_t * count,
+               const void ** data, rpm_count_t * count,
                int * freeData)
 {
     *type = RPM_STRING_ARRAY_TYPE;
@@ -763,7 +765,7 @@ static int fileclassTag(Header h, rpmTagType * type,
  * @return             0 on success
  */
 static int fileprovideTag(Header h, rpmTagType * type,
-               const void ** data, int32_t * count,
+               const void ** data, rpm_count_t * count,
                int * freeData)
 {
     *type = RPM_STRING_ARRAY_TYPE;
@@ -782,7 +784,7 @@ static int fileprovideTag(Header h, rpmTagType * type,
  * @return             0 on success
  */
 static int filerequireTag(Header h, rpmTagType * type,
-               const void ** data, int32_t * count,
+               const void ** data, rpm_count_t * count,
                int * freeData)
 {
     *type = RPM_STRING_ARRAY_TYPE;
@@ -811,7 +813,7 @@ static const char * _macro_i18ndomains = "%{?_i18ndomains}";
  * @return             0 on success
  */
 static int i18nTag(Header h, int32_t tag, rpmTagType * type,
-               const void ** data, int32_t * count,
+               const void ** data, rpm_count_t * count,
                int * freeData)
 {
     HGE_t hge = (HGE_t)headerGetEntryMinMemory;
@@ -903,7 +905,7 @@ static int i18nTag(Header h, int32_t tag, rpmTagType * type,
  * @return             0 on success
  */
 static int summaryTag(Header h, rpmTagType * type,
-               const void ** data, int32_t * count,
+               const void ** data, rpm_count_t * count,
                int * freeData)
 {
     return i18nTag(h, RPMTAG_SUMMARY, type, data, count, freeData);
@@ -919,7 +921,7 @@ static int summaryTag(Header h, rpmTagType * type,
  * @return             0 on success
  */
 static int descriptionTag(Header h, rpmTagType * type,
-               const void ** data, int32_t * count,
+               const void ** data, rpm_count_t * count,
                int * freeData)
 {
     return i18nTag(h, RPMTAG_DESCRIPTION, type, data, count, freeData);
@@ -935,7 +937,7 @@ static int descriptionTag(Header h, rpmTagType * type,
  * @return             0 on success
  */
 static int groupTag(Header h, rpmTagType * type,
-               const void ** data, int32_t * count,
+               const void ** data, rpm_count_t * count,
                int * freeData)
 {
     return i18nTag(h, RPMTAG_GROUP, type, data, count, freeData);
index f630cdd..075731c 100644 (file)
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -241,7 +241,7 @@ static int getFilesystemList(void)
 }
 #endif /* HAVE_MNTCTL */
 
-int rpmGetFilesystemList(const char *** listptr, int * num)
+int rpmGetFilesystemList(const char *** listptr, unsigned int * num)
 {
     if (!fsnames) 
        if (getFilesystemList())
@@ -253,7 +253,8 @@ int rpmGetFilesystemList(const char *** listptr, int * num)
     return 0;
 }
 
-int rpmGetFilesystemUsage(const char ** fileList, int32_t * fssizes, int numFiles,
+int rpmGetFilesystemUsage(const char ** fileList, int32_t * fssizes, 
+                         unsigned int numFiles,
                          uint32_t ** usagesPtr, int flags)
 {
     uint32_t * usages;
index 4553f72..3c22400 100644 (file)
@@ -77,7 +77,7 @@ IDTX IDTXload(rpmts ts, rpmTag tag)
 #endif
     while ((h = rpmdbNextIterator(mi)) != NULL) {
        rpmTagType type = RPM_NULL_TYPE;
-       int32_t count = 0;
+       rpm_count_t count = 0;
        int32_t * tidp;
 
        tidp = NULL;
@@ -126,7 +126,7 @@ IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag)
     if (xx == 0)
     for (i = 0; i < ac; i++) {
        rpmTagType type;
-       int32_t count;
+       rpm_count_t count;
        int isSource;
 
        fd = Fopen(av[i], "r.ufdio");
index ba0d034..fde9b4b 100644 (file)
@@ -34,8 +34,8 @@ void compressFilelist(Header h)
     const char ** baseNames;
     uint32_t * dirIndexes;
     rpmTagType fnt;
-    int count;
-    int i, xx;
+    rpm_count_t count, i;
+    int xx;
     int dirIndex = -1;
 
     /*
@@ -115,7 +115,7 @@ void expandFilelist(Header h)
     HAE_t hae = (HAE_t)headerAddEntry;
     HRE_t hre = (HRE_t)headerRemoveEntry;
     const char ** fileNames = NULL;
-    int count = 0;
+    rpm_count_t count = 0;
     int xx;
 
     if (!headerIsEntry(h, RPMTAG_OLDFILENAMES)) {
@@ -149,8 +149,8 @@ void providePackageNVR(Header h)
     const char ** providesEVR = NULL;
     rpmTagType pnt, pvt;
     int32_t * provideFlags = NULL;
-    int providesCount;
-    int i, xx;
+    rpm_count_t providesCount, i;
+    int xx;
     int bingo = 1;
 
     /* Generate provides for this package name-version-release. */
index f345b3b..d2884c8 100644 (file)
@@ -87,7 +87,8 @@ void headerMergeLegacySigs(Header h, const Header sigh)
     HFD_t hfd = (HFD_t) headerFreeData;
     HAE_t hae = (HAE_t) headerAddEntry;
     HeaderIterator hi;
-    int32_t tag, type, count;
+    int32_t tag, type;
+    rpm_count_t count;
     const void * ptr;
     int xx;
 
@@ -167,7 +168,8 @@ Header headerRegenSigHeader(const Header h, int noArchiveSize)
     HFD_t hfd = (HFD_t) headerFreeData;
     Header sigh = rpmNewSignature();
     HeaderIterator hi;
-    int32_t tag, stag, type, count;
+    rpm_count_t count;
+    int32_t tag, stag, type;
     const void * ptr;
     int xx;
 
@@ -682,7 +684,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
     int32_t sigtag;
     int32_t sigtype;
     const void * sig;
-    int32_t siglen;
+    rpm_count_t siglen;
     rpmtsOpX opx;
     size_t nb;
     Header h = NULL;
@@ -822,7 +824,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
        }
     {  void * uh = NULL;
        int32_t uht;
-       int32_t uhc;
+       rpm_count_t uhc;
 
        if (!headerGetEntry(h, RPMTAG_HEADERIMMUTABLE, &uht, &uh, &uhc))
            break;
@@ -849,7 +851,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
     case RPMSIGTAG_SHA1:
     {  void * uh = NULL;
        int32_t uht;
-       int32_t uhc;
+       rpm_count_t uhc;
 
        if (!headerGetEntry(h, RPMTAG_HEADERIMMUTABLE, &uht, &uh, &uhc))
            break;
index c21aa16..b2fd2a3 100644 (file)
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -178,7 +178,7 @@ static rpmRC markReplacedFiles(const rpmpsm psm)
     while ((h = rpmdbNextIterator(mi)) != NULL) {
        char * secStates;
        int modified;
-       int count;
+       rpm_count_t count;
 
        modified = 0;
 
@@ -582,7 +582,7 @@ static rpmRC runScript(rpmpsm psm, Header h, rpmTag stag,
     const char ** argv = NULL;
     int argc = 0;
     const char ** prefixes = NULL;
-    int numPrefixes;
+    rpm_count_t numPrefixes;
     rpmTagType ipt;
     const char * oldPrefix;
     int maxPrefixLength;
@@ -908,7 +908,7 @@ static rpmRC runInstScript(rpmpsm psm)
     HGE_t hge = fi->hge;
     HFD_t hfd = (fi->hfd ? fi->hfd : headerFreeData);
     void ** progArgv;
-    int progArgc;
+    rpm_count_t progArgc;
     const char ** argv;
     rpmTagType ptt, stt;
     const char * script;
@@ -1095,10 +1095,9 @@ static rpmRC runImmedTriggers(rpmpsm psm)
     HGE_t hge = fi->hge;
     HFD_t hfd = (fi->hfd ? fi->hfd : headerFreeData);
     const char ** triggerNames;
-    int numTriggers;
-    int32_t * triggerIndices;
+    rpm_count_t numTriggers, numTriggerIndices;
+    rpm_count_t * triggerIndices;
     rpmTagType tnt, tit;
-    int numTriggerIndices;
     unsigned char * triggersRun;
     rpmRC rc = RPMRC_OK;
 
@@ -1477,7 +1476,8 @@ assert(psm->mi == NULL);
 
            /* Regenerate original header. */
            {   void * uh = NULL;
-               int32_t uht, uhc;
+               int32_t uht;
+               rpm_count_t uhc;
 
                if (headerGetEntry(fi->h, RPMTAG_HEADERIMMUTABLE, &uht, &uh, &uhc)) {
                    psm->oh = headerCopyLoad(uh);
@@ -1486,7 +1486,8 @@ assert(psm->mi == NULL);
                if (headerGetEntry(fi->h, RPMTAG_HEADERIMAGE, &uht, &uh, &uhc))
                {
                    HeaderIterator hi;
-                   int32_t tag, type, count;
+                   int32_t tag, type;
+                   rpm_count_t count;
                    hPTR_t ptr;
                    Header oh;
 
index f4fd56c..8e7d9bb 100644 (file)
@@ -125,7 +125,7 @@ static int getSignid(Header sig, int sigtag, pgpKeyID_t signid)
 {
     void * pkt = NULL;
     int32_t pkttyp = 0;
-    int32_t pktlen = 0;
+    rpm_count_t pktlen = 0;
     int rc = 1;
 
     if (headerGetEntry(sig, sigtag, &pkttyp, &pkt, &pktlen) && pkt != NULL) {
@@ -162,7 +162,8 @@ static int rpmReSign(rpmts ts,
     Header sigh = NULL;
     const char * msg;
     void * uh = NULL;
-    int32_t uht, uhc;
+    int32_t uht;
+    rpm_count_t uhc;
     int res = EXIT_FAILURE;
     int deleting = (qva->qva_mode == RPMSIGN_DEL_SIGNATURE);
     rpmRC rc;
@@ -217,7 +218,8 @@ static int rpmReSign(rpmts ts,
        /* Dump the immutable region (if present). */
        if (headerGetEntry(sigh, RPMTAG_HEADERSIGNATURES, &uht, &uh, &uhc)) {
            HeaderIterator hi;
-           int32_t tag, type, count;
+           int32_t tag, type;
+           rpm_count_t count;
            hPTR_t ptr;
            Header oh;
            Header nh;
@@ -475,7 +477,8 @@ static int readFile(FD_t fd, const char * fn, pgpDig dig)
 
        if (headerIsEntry(h, RPMTAG_HEADERIMMUTABLE)) {
            void * uh;
-           int32_t uht, uhc;
+           int32_t uht;
+           rpm_count_t uhc;
        
            if (!headerGetEntry(h, RPMTAG_HEADERIMMUTABLE, &uht, &uh, &uhc)
            ||   uh == NULL)
@@ -523,7 +526,7 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
     const void * sig;
     pgpDig dig;
     pgpDigParams sigp;
-    int32_t siglen;
+    rpm_count_t siglen;
     Header sigh = NULL;
     HeaderIterator hi;
     const char * msg;
index fc1a69b..4bbdd66 100644 (file)
@@ -130,7 +130,7 @@ rpmds rpmdsNew(Header h, rpmTag tagN, int flags)
     const char * Type;
     const char ** N;
     rpmTagType Nt;
-    int32_t Count;
+    rpm_count_t Count;
 
     if (tagN == RPMTAG_PROVIDENAME) {
        Type = "Provides";
index dd3e862..9b386c1 100644 (file)
@@ -630,13 +630,11 @@ Header relocateFileList(const rpmts ts, rpmfi fi,
     int numRelocations;
     const char ** validRelocations;
     rpmTagType validType;
-    int numValid;
     const char ** baseNames;
     const char ** dirNames;
     uint32_t * dirIndexes;
     uint32_t * newDirIndexes;
-    int32_t fileCount;
-    int32_t dirCount;
+    rpm_count_t fileCount, dirCount, numValid;
     uint32_t mydColor = rpmExpandNumeric("%{?_autorelocate_dcolor}");
     uint32_t * fFlags = NULL;
     uint32_t * fColors = NULL;
@@ -1003,7 +1001,7 @@ dColors[j] |= fColors[i];
 
     /* Save original filenames in header and replace (relocated) filenames. */
     if (nrelocated) {
-       int c;
+       rpm_count_t c;
        void * d;
        rpmTagType t;
 
@@ -1392,8 +1390,7 @@ fprintf(stderr, "*** fi %p\t%s[%d]\n", fi, Type, (fi ? fi->fc : 0));
     return rpmfiLink(fi, (fi ? fi->Type : NULL));
 }
 
-void rpmfiBuildFClasses(Header h,
-       const char *** fclassp, int * fcp)
+void rpmfiBuildFClasses(Header h, const char *** fclassp, rpm_count_t * fcp)
 {
     int scareMem = 0;
     rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem);
@@ -1445,7 +1442,7 @@ exit:
 }
 
 void rpmfiBuildFDeps(Header h, rpmTag tagN,
-       const char *** fdepsp, int * fcp)
+       const char *** fdepsp, rpm_count_t * fcp)
 {
     int scareMem = 0;
     rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem);
@@ -1540,14 +1537,14 @@ exit:
 }
 
 void rpmfiBuildFNames(Header h, rpmTag tagN,
-       const char *** fnp, int * fcp)
+       const char *** fnp, rpm_count_t * fcp)
 {
     HGE_t hge = (HGE_t)headerGetEntryMinMemory;
     HFD_t hfd = headerFreeData;
     const char ** baseNames;
     const char ** dirNames;
     uint32_t * dirIndexes;
-    int count;
+    rpm_count_t count;
     const char ** fileNames;
     int size;
     rpmTag dirNameTag = 0;
index 021a0b8..0107962 100644 (file)
@@ -354,7 +354,7 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpmTag tagN, int scareMem);
  * @retval *fcp                number of files
  */
 void rpmfiBuildFClasses(Header h,
-               const char *** fclassp, int * fcp);
+               const char *** fclassp, rpm_count_t * fcp);
 
 
 /** \ingroup rpmfi
@@ -368,7 +368,7 @@ void rpmfiBuildFClasses(Header h,
  * @retval *fcp                number of files
  */
 void rpmfiBuildFDeps(Header h, rpmTag tagN,
-               const char *** fdepsp, int * fcp);
+               const char *** fdepsp, rpm_count_t * fcp);
 
 /** \ingroup rpmfi
  * Retrieve file names from header.
@@ -388,7 +388,7 @@ void rpmfiBuildFDeps(Header h, rpmTag tagN,
  * @retval *fcp                number of files
  */
 void rpmfiBuildFNames(Header h, rpmTag tagN,
-               const char *** fnp, int * fcp);
+               const char *** fnp, rpm_count_t * fcp);
 
 /** \ingroup rpmfi
  * Return file type from mode_t.
index 551d298..4d51e1e 100644 (file)
@@ -61,19 +61,19 @@ struct rpmfi_s {
     const char ** fcontexts;   /*! FIle security contexts. */
 
     const char ** cdict;       /*!< File class dictionary (header) */
-    int32_t ncdict;            /*!< No. of class entries. */
+    rpm_count_t ncdict;                /*!< No. of class entries. */
     const uint32_t * fcdictx;  /*!< File class dictionary index (header) */
 
     const uint32_t * ddict;    /*!< File depends dictionary (header) */
-    int32_t nddict;            /*!< No. of depends entries. */
+    rpm_count_t nddict;                /*!< No. of depends entries. */
     const uint32_t * fddictx;  /*!< File depends dictionary start (header) */
     const uint32_t * fddictn;  /*!< File depends dictionary count (header) */
 
 /*?null?*/
     const uint32_t * vflags;   /*!< File verify flag(s) (from header) */
 
-    int32_t dc;                        /*!< No. of directories. */
-    int32_t fc;                        /*!< No. of files. */
+    rpm_count_t dc;            /*!< No. of directories. */
+    rpm_count_t fc;            /*!< No. of files. */
 
 /*=============================*/
     rpmte te;
index ade1bae..16aac52 100644 (file)
@@ -474,7 +474,7 @@ if (fileURL[0] == '=') {
        if (eiu->relocations) {
            const char ** paths;
            int pft;
-           int c;
+           rpm_count_t c;
 
            if (headerGetEntry(eiu->h, RPMTAG_PREFIXES, &pft,
                                       (void **) &paths, &c) && (c == 1))
index 4ac5dcb..6f7b9f8 100644 (file)
@@ -207,7 +207,7 @@ typedef
 typedef int (*HGE_t) (Header h, rpmTag tag,
                        rpmTagType * type,
                        void ** p,
-                       int32_t * c);
+                       rpm_count_t * c);
 
 /**
  * Prototype for headerAddEntry() vector.
@@ -225,7 +225,7 @@ typedef int (*HGE_t) (Header h, rpmTag tag,
  * @return              1 on success, 0 on failure
  */
 typedef int (*HAE_t) (Header h, rpmTag tag, rpmTagType type,
-                       const void * p, int32_t c);
+                       const void * p, rpm_count_t c);
 
 /**
  * Prototype for headerModifyEntry() vector.
@@ -239,7 +239,7 @@ typedef int (*HAE_t) (Header h, rpmTag tag, rpmTagType type,
  * @return             1 on success, 0 on failure
  */
 typedef int (*HME_t) (Header h, rpmTag tag, rpmTagType type,
-                       const void * p, int32_t c);
+                       const void * p, rpm_count_t c);
 
 /**
  * Prototype for headerRemoveEntry() vector.
@@ -382,7 +382,7 @@ void rpmFreeFilesystems(void);
  * @return                     0 on success, 1 on error
  */
 int rpmGetFilesystemList( const char *** listptr,
-               int * num);
+               unsigned int * num);
 
 /**
  * Determine per-file system usage for a list of files.
@@ -394,7 +394,7 @@ int rpmGetFilesystemList( const char *** listptr,
  * @return                     0 on success, 1 on error
  */
 int rpmGetFilesystemUsage(const char ** fileList, int32_t * fssizes,
-               int numFiles, uint32_t ** usagesPtr,
+               unsigned int numFiles, uint32_t ** usagesPtr,
                int flags);
 
 /* ==================================================================== */
index ccb2b15..3014674 100644 (file)
@@ -298,7 +298,8 @@ fprintf(stderr, "*** free pkt %p[%d] id %08x %08x\n", ts->pkpkt, ts->pkpktlen, p
        mi = rpmtsInitIterator(ts, RPMTAG_PUBKEYS, sigp->signid, sizeof(sigp->signid));
        while ((h = rpmdbNextIterator(mi)) != NULL) {
            const char ** pubkeys;
-           int32_t pt, pc;
+           int32_t pt;
+           rpm_count_t pc;
 
            if (!headerGetEntry(h, RPMTAG_PUBKEYS, &pt, (void **)&pubkeys, &pc))
                continue;
index 3a41bf8..a437193 100644 (file)
@@ -54,7 +54,7 @@ struct rpmts_s {
     rpmprobFilterFlags ignoreSet;
                                /*!< Bits to filter current problems. */
 
-    int filesystemCount;       /*!< No. of mounted filesystems. */
+    unsigned int filesystemCount;      /*!< No. of mounted filesystems. */
     const char ** filesystems; /*!< Mounted filesystem names. */
     rpmDiskSpaceInfo dsi;      /*!< Per filesystem disk/inode usage. */
 
index f28f034..fa72311 100644 (file)
@@ -638,7 +638,8 @@ static int makeHDRSignature(Header sigh, const char * file, int32_t sigTag,
        if (headerIsEntry(h, RPMTAG_HEADERIMMUTABLE)) {
            DIGEST_CTX ctx;
            void * uh;
-           int32_t uht, uhc;
+           int32_t uht;
+           rpm_count_t uhc;
        
            if (!headerGetEntry(h, RPMTAG_HEADERIMMUTABLE, &uht, &uh, &uhc)
             ||  uh == NULL)
index 09568b3..da2086e 100644 (file)
@@ -228,7 +228,7 @@ static PyObject * hdrCompressFilelist(hdrObject * s)
 static void mungeFilelist(Header h)
 {
     const char ** fileNames = NULL;
-    int count = 0;
+    rpm_count_t count = 0;
 
     if (!headerIsEntry (h, RPMTAG_BASENAMES)
        || !headerIsEntry (h, RPMTAG_DIRNAMES)
@@ -357,12 +357,12 @@ long tagNumFromPyObject (PyObject *item)
  * @return             0 on success, 1 on bad magic, 2 on error
  */
 static int dressedHeaderGetEntry(Header h, int32_t tag, int32_t *type,
-       void **p, int32_t *c)
+       void **p, rpm_count_t *c)
 {
     switch (tag) {
     case RPMTAG_OLDFILENAMES:
     {  const char ** fl = NULL;
-       int count;
+       rpm_count_t count;
        rpmfiBuildFNames(h, RPMTAG_BASENAMES, &fl, &count);
        if (count > 0) {
            *p = fl;
@@ -407,7 +407,8 @@ static int dressedHeaderGetEntry(Header h, int32_t tag, int32_t *type,
  */
 static PyObject * hdr_subscript(hdrObject * s, PyObject * item)
 {
-    int tagtype, type, count, i, tag = -1;
+    int tagtype, type, tag = -1;
+    rpm_count_t count, i;
     void * data;
     PyObject * o, * metao;
     char ** stringArray;
@@ -771,8 +772,8 @@ int rpmMergeHeaders(PyObject * list, FD_t fd, int matchTag)
     int32_t * newMatch;
     int32_t * oldMatch;
     hdrObject * hdr;
-    int count = 0;
-    int type, c, tag;
+    rpm_count_t c, count = 0;
+    int type, tag;
     void * p;
 
     Py_BEGIN_ALLOW_THREADS
index ae24ece..398e326 100644 (file)
@@ -9,7 +9,7 @@
 int headerNVR(Header h, const char **np, const char **vp, const char **rp)
 {
     int type;
-    int count;
+    rpm_count_t count;
 
     if (np) {
        if (!(headerGetEntry(h, RPMTAG_NAME, &type, (void **) np, &count)
@@ -34,7 +34,7 @@ int headerNEVRA(Header h, const char **np,
                const char **ap)
 {
     int type;
-    int count;
+    rpm_count_t count;
 
     headerNVR(h, np, vp, rp);
     if (ap) {
@@ -88,7 +88,7 @@ uint32_t headerGetColor(Header h)
     HGE_t hge = (HGE_t)headerGetEntryMinMemory;
     uint32_t hcolor = 0;
     uint32_t * fcolors;
-    int32_t ncolors;
+    rpm_count_t ncolors;
     int i;
 
     fcolors = NULL;
index 4321403..9d100db 100644 (file)
@@ -316,7 +316,7 @@ unsigned int _headerSizeof(Header h, enum hMagic magicp)
  * @param pend         pointer to end of data (or NULL)
  * @return             no. bytes in data, -1 on failure
  */
-static int dataLength(int32_t type, hPTR_t p, int32_t count, int onDisk,
+static int dataLength(int32_t type, hPTR_t p, rpm_count_t count, int onDisk,
                hPTR_t pend)
 {
     const unsigned char * s = p;
@@ -1199,10 +1199,10 @@ int _headerIsEntry(Header h, int32_t tag)
 static int copyEntry(const indexEntry entry,
                hTYP_t type,
                hPTR_t * p,
-               hCNT_t c,
+               rpm_count_t * c,
                int minMem)
 {
-    int32_t count = entry->info.count;
+    rpm_count_t count = entry->info.count;
     int rc = 1;                /* XXX 1 on success. */
 
     if (p)
@@ -1433,7 +1433,7 @@ headerFindI18NString(Header h, indexEntry entry)
 static int intGetEntry(Header h, int32_t tag,
                hTAG_t type,
                hPTR_t * p,
-               hCNT_t c,
+               rpm_count_t * c,
                int minMem)
 {
     indexEntry entry;
@@ -1502,7 +1502,7 @@ static
 int _headerGetEntry(Header h, int32_t tag,
                        hTYP_t type,
                        void ** p,
-                       hCNT_t c)
+                       rpm_count_t * c)
 {
     return intGetEntry(h, tag, type, (hPTR_t *)p, c, 0);
 }
@@ -1523,13 +1523,13 @@ static
 int _headerGetEntryMinMemory(Header h, int32_t tag,
                        hTYP_t type,
                        hPTR_t * p,
-                       hCNT_t c)
+                       rpm_count_t * c)
 {
     return intGetEntry(h, tag, type, p, c, 1);
 }
 
 int headerGetRawEntry(Header h, int32_t tag, int32_t * type, hPTR_t * p,
-               int32_t * c)
+               rpm_count_t * c)
 {
     indexEntry entry;
     int rc;
@@ -1554,7 +1554,7 @@ int headerGetRawEntry(Header h, int32_t tag, int32_t * type, hPTR_t * p,
 /**
  */
 static void copyData(int32_t type, void * dstPtr, const void * srcPtr,
-               int32_t cnt, int dataLength)
+               rpm_count_t cnt, int dataLength)
 {
     switch (type) {
     case RPM_STRING_ARRAY_TYPE:
@@ -1587,7 +1587,7 @@ static void copyData(int32_t type, void * dstPtr, const void * srcPtr,
  * @return             (malloc'ed) copy of entry data, NULL on error
  */
 static void *
-grabData(int32_t type, hPTR_t p, int32_t c, int * lengthPtr)
+grabData(int32_t type, hPTR_t p, rpm_count_t c, int * lengthPtr)
 {
     void * data = NULL;
     int length;
@@ -1618,7 +1618,7 @@ grabData(int32_t type, hPTR_t p, int32_t c, int * lengthPtr)
  * @return             1 on success, 0 on failure
  */
 static
-int _headerAddEntry(Header h, int32_t tag, int32_t type, const void * p, int32_t c)
+int _headerAddEntry(Header h, int32_t tag, int32_t type, const void * p, rpm_count_t c)
 {
     indexEntry entry;
     void * data;
@@ -1676,7 +1676,7 @@ int _headerAddEntry(Header h, int32_t tag, int32_t type, const void * p, int32_t
  */
 static
 int _headerAppendEntry(Header h, int32_t tag, int32_t type,
-               const void * p, int32_t c)
+               const void * p, rpm_count_t c)
 {
     indexEntry entry;
     int length;
@@ -1724,7 +1724,7 @@ int _headerAppendEntry(Header h, int32_t tag, int32_t type,
  */
 static
 int _headerAddOrAppendEntry(Header h, int32_t tag, int32_t type,
-               const void * p, int32_t c)
+               const void * p, rpm_count_t c)
 {
     return (findEntry(h, tag, type)
        ? _headerAppendEntry(h, tag, type, p, c)
@@ -1887,7 +1887,7 @@ int _headerAddI18NString(Header h, int32_t tag, const char * string,
  */
 static
 int _headerModifyEntry(Header h, int32_t tag, int32_t type,
-                       const void * p, int32_t c)
+                       const void * p, rpm_count_t c)
 {
     indexEntry entry;
     void * oldData;
@@ -2034,7 +2034,7 @@ int _headerNextIterator(HeaderIterator hi,
                hTAG_t tag,
                hTYP_t type,
                hPTR_t * p,
-               hCNT_t c)
+               rpm_count_t * c)
 {
     Header h = hi->h;
     int slot = hi->next_index;
@@ -2072,7 +2072,8 @@ Header _headerCopy(Header h)
 {
     Header nh = _headerNew();
     HeaderIterator hi;
-    int32_t tag, type, count;
+    int32_t tag, type;
+    rpm_count_t count;
     hPTR_t ptr;
    
     for (hi = _headerInitIterator(h);
@@ -2148,7 +2149,7 @@ static sprintfToken hsaNext(headerSprintfArgs hsa)
        } else {
            int32_t tagno;
            int32_t type;
-           int32_t count;
+           rpm_count_t count;
 
            if (!_headerNextIterator(hsa->hi, &tagno, &type, NULL, &count))
                fmt = NULL;
@@ -2647,7 +2648,7 @@ static int parseExpression(headerSprintfArgs hsa, sprintfToken token,
 static int getExtension(headerSprintfArgs hsa, headerTagTagFunction fn,
                hTYP_t typeptr,
                hPTR_t * data,
-               hCNT_t countptr,
+               rpm_count_t * countptr,
                rpmec ec)
 {
     if (!ec->avail) {
@@ -2676,7 +2677,8 @@ static char * formatValue(headerSprintfArgs hsa, sprintfTag tag, int element)
     size_t need = 0;
     char * t, * te;
     char buf[20];
-    int32_t count, type;
+    int32_t type;
+    rpm_count_t count;
     hPTR_t data;
     unsigned int intVal;
     const char ** strarray;
@@ -2837,7 +2839,7 @@ static char * singleSprintf(headerSprintfArgs hsa, sprintfToken token,
     int i, j;
     int numElements;
     int32_t type;
-    int32_t count;
+    rpm_count_t count;
     sprintfToken spft;
     int condNumFormats;
     size_t need;
@@ -3282,7 +3284,7 @@ void _headerCopyTags(Header headerFrom, Header headerTo, hTAG_t tagstocopy)
     for (p = tagstocopy; *p != 0; p++) {
        char *s;
        int32_t type;
-       int32_t count;
+       rpm_count_t count;
        if (_headerIsEntry(headerTo, *p))
            continue;
        if (!_headerGetEntryMinMemory(headerFrom, *p, &type,
index 3b1d4d0..37114ba 100644 (file)
@@ -95,7 +95,8 @@ typedef const char *  errmsg_t;
 typedef int32_t *      hTAG_t;
 typedef int32_t *      hTYP_t;
 typedef const void *   hPTR_t;
-typedef int32_t *      hCNT_t;
+
+typedef uint32_t       rpm_count_t;
 
 /** \ingroup header
  */
@@ -158,7 +159,7 @@ typedef char * (*headerTagFormatFunction)(int32_t type,
 typedef int (*headerTagTagFunction) (Header h,
                hTYP_t type,
                hPTR_t * data,
-               hCNT_t count,
+               rpm_count_t * count,
                int * freeData);
 
 /** \ingroup header
@@ -273,7 +274,7 @@ typedef struct HE_s {
        hPTR_t * ptr;
        hRET_t * ret;
     } u;
-    hCNT_t cnt;
+    rpm_count_t * cnt;
 } * HE_t;
 #endif
 
@@ -411,7 +412,7 @@ void * headerFreeTag(Header h, const void * data, rpmTagType type);
 int headerGetEntry(Header h, int32_t tag,
                        hTYP_t type,
                        void ** p,
-                       hCNT_t c);
+                       rpm_count_t * c);
 
 /** \ingroup header
  * Retrieve tag value using header internal array.
@@ -428,7 +429,7 @@ int headerGetEntry(Header h, int32_t tag,
 int headerGetEntryMinMemory(Header h, int32_t tag,
                        hTYP_t type,
                        hPTR_t * p, 
-                       hCNT_t c);
+                       rpm_count_t * c);
 
 /** \ingroup header
  * Add tag to header.
@@ -444,7 +445,7 @@ int headerGetEntryMinMemory(Header h, int32_t tag,
  * @param c            number of values
  * @return             1 on success, 0 on failure
  */
-int headerAddEntry(Header h, int32_t tag, int32_t type, const void * p, int32_t c);
+int headerAddEntry(Header h, int32_t tag, int32_t type, const void * p, rpm_count_t c);
 
 /** \ingroup header
  * Append element to tag array in header.
@@ -461,7 +462,7 @@ int headerAddEntry(Header h, int32_t tag, int32_t type, const void * p, int32_t
  * @return             1 on success, 0 on failure
  */
 int headerAppendEntry(Header h, int32_t tag, int32_t type,
-               const void * p, int32_t c);
+               const void * p, rpm_count_t c);
 
 /** \ingroup header
  * Add or append element to tag array in header.
@@ -474,7 +475,7 @@ int headerAppendEntry(Header h, int32_t tag, int32_t type,
  * @return             1 on success, 0 on failure
  */
 int headerAddOrAppendEntry(Header h, int32_t tag, int32_t type,
-               const void * p, int32_t c);
+               const void * p, rpm_count_t c);
 
 /** \ingroup header
  * Add locale specific tag to header.
@@ -510,7 +511,7 @@ int headerAddI18NString(Header h, int32_t tag, const char * string,
  * @return             1 on success, 0 on failure
  */
 int headerModifyEntry(Header h, int32_t tag, int32_t type,
-                       const void * p, int32_t c);
+                       const void * p, rpm_count_t c);
 
 /** \ingroup header
  * Delete tag in header.
@@ -574,7 +575,7 @@ int headerNextIterator(HeaderIterator hi,
                hTAG_t tag,
                hTYP_t type,
                hPTR_t * p,
-               hCNT_t c);
+               rpm_count_t * c);
 
 
 
index fe3f468..bc9e892 100644 (file)
@@ -110,7 +110,7 @@ void * headerFreeTag(Header h,
 int headerGetEntry(Header h, int32_t tag,
                        hTYP_t type,
                        void ** p,
-                       hCNT_t c)
+                       rpm_count_t * c)
 {
     return (h2hv(h)->hdrget) (h, tag, type, p, c);
 }
@@ -118,24 +118,24 @@ int headerGetEntry(Header h, int32_t tag,
 int headerGetEntryMinMemory(Header h, int32_t tag,
                        hTYP_t type,
                        hPTR_t * p, 
-                       hCNT_t c)
+                       rpm_count_t * c)
 {
     return (h2hv(h)->hdrgetmin) (h, tag, type, p, c);
 }
 
-int headerAddEntry(Header h, int32_t tag, int32_t type, const void * p, int32_t c)
+int headerAddEntry(Header h, int32_t tag, int32_t type, const void * p, rpm_count_t c)
 {
     return (h2hv(h)->hdradd) (h, tag, type, p, c);
 }
 
 int headerAppendEntry(Header h, int32_t tag, int32_t type,
-               const void * p, int32_t c)
+               const void * p, rpm_count_t c)
 {
     return (h2hv(h)->hdrappend) (h, tag, type, p, c);
 }
 
 int headerAddOrAppendEntry(Header h, int32_t tag, int32_t type,
-               const void * p, int32_t c)
+               const void * p, rpm_count_t c)
 {
     return (h2hv(h)->hdraddorappend) (h, tag, type, p, c);
 }
@@ -147,7 +147,7 @@ int headerAddI18NString(Header h, int32_t tag, const char * string,
 }
 
 int headerModifyEntry(Header h, int32_t tag, int32_t type,
-                       const void * p, int32_t c)
+                       const void * p, rpm_count_t c)
 {
     return (h2hv(h)->hdrmodify) (h, tag, type, p, c);
 }
@@ -186,7 +186,7 @@ int headerNextIterator(HeaderIterator hi,
                hTAG_t tag,
                hTYP_t type,
                hPTR_t * p,
-               hCNT_t c)
+               rpm_count_t * c)
 {
     return hdrVec->hdrnextiter(hi, tag, type, p, c);
 }
index 914d990..36cb84e 100644 (file)
@@ -11,7 +11,8 @@
 char ** headerGetLangs(Header h)
 {
     char **s, *e, **table;
-    int i, type, count;
+    int type;
+    rpm_count_t i, count;
 
     if (!headerGetRawEntry(h, HEADER_I18NTABLE, &type, (const void **)&s, &count))
        return NULL;
index 2b6a224..b0b2abb 100644 (file)
@@ -26,7 +26,7 @@ struct entryInfo_s {
     int32_t tag;                       /*!< Tag identifier. */
     int32_t type;              /*!< Tag data type. */
     int32_t offset;            /*!< Offset into data segment (ondisk only). */
-    int32_t count;             /*!< Number of tag elements. */
+    rpm_count_t count;         /*!< Number of tag elements. */
 };
 
 #define        REGION_TAG_TYPE         RPM_BIN_TYPE
@@ -85,7 +85,7 @@ struct sprintfTag_s {
 typedef struct rpmec_s * rpmec;
 struct rpmec_s {
     int32_t type;
-    int32_t count;
+    rpm_count_t count;
     int avail;
     int freeit;
     const void * data;
@@ -150,7 +150,7 @@ char ** headerGetLangs(Header h);
 int headerGetRawEntry(Header h, int32_t tag,
                        hTYP_t type,
                        hPTR_t * p, 
-                       hCNT_t c);
+                       rpm_count_t * c);
 
 /** \ingroup header
  * Return header reference count.
index 535b9a5..c926714 100644 (file)
@@ -162,7 +162,7 @@ typedef
 int (*HDRget) (Header h, int32_t tag,
                        hTYP_t type,
                        void ** p,
-                       hCNT_t c);
+                       rpm_count_t * c);
 
 /** \ingroup header
  * Retrieve tag value using header internal array.
@@ -180,7 +180,7 @@ typedef
 int (*HDRgetmin) (Header h, int32_t tag,
                        hTYP_t type,
                        hPTR_t * p,
-                       hCNT_t c);
+                       rpm_count_t * c);
 
 /** \ingroup header
  * Add tag to header.
@@ -197,7 +197,7 @@ int (*HDRgetmin) (Header h, int32_t tag,
  * @return             1 on success, 0 on failure
  */
 typedef
-int (*HDRadd) (Header h, int32_t tag, int32_t type, const void * p, int32_t c);
+int (*HDRadd) (Header h, int32_t tag, int32_t type, const void * p, rpm_count_t c);
 
 /** \ingroup header
  * Append element to tag array in header.
@@ -214,7 +214,7 @@ int (*HDRadd) (Header h, int32_t tag, int32_t type, const void * p, int32_t c);
  * @return             1 on success, 0 on failure
  */
 typedef
-int (*HDRappend) (Header h, int32_t tag, int32_t type, const void * p, int32_t c);
+int (*HDRappend) (Header h, int32_t tag, int32_t type, const void * p, rpm_count_t c);
 
 /** \ingroup header
  * Add or append element to tag array in header.
@@ -227,7 +227,7 @@ int (*HDRappend) (Header h, int32_t tag, int32_t type, const void * p, int32_t c
  * @return             1 on success, 0 on failure
  */
 typedef
-int (*HDRaddorappend) (Header h, int32_t tag, int32_t type, const void * p, int32_t c);
+int (*HDRaddorappend) (Header h, int32_t tag, int32_t type, const void * p, rpm_count_t c);
 
 /** \ingroup header
  * Add locale specific tag to header.
@@ -264,7 +264,7 @@ int (*HDRaddi18n) (Header h, int32_t tag, const char * string,
  * @return             1 on success, 0 on failure
  */
 typedef
-int (*HDRmodify) (Header h, int32_t tag, int32_t type, const void * p, int32_t c);
+int (*HDRmodify) (Header h, int32_t tag, int32_t type, const void * p, rpm_count_t c);
 
 /** \ingroup header
  * Delete tag in header.
@@ -334,7 +334,7 @@ int (*HDRnextiter) (HeaderIterator hi,
                hTAG_t tag,
                hTYP_t type,
                hPTR_t * p,
-               hCNT_t c);
+               rpm_count_t * c);
 
 /** \ingroup header
  * Header method vectors.
index c05b5d9..01c96b4 100644 (file)
@@ -1843,7 +1843,7 @@ static int mireSkip (const rpmdbMatchIterator mi)
     } u;
     char numbuf[32];
     rpmTagType t;
-    int32_t c;
+    rpm_count_t c;
     miRE mire;
     static int32_t zero = 0;
     int ntags = 0;
@@ -2471,10 +2471,10 @@ memset(data, 0, sizeof(*data));
            const char *av[1];
            const char ** rpmvals = NULL;
            rpmTagType rpmtype = 0;
-           int rpmcnt = 0;
+           rpm_count_t rpmcnt = 0;
            int rpmtag;
            int xx;
-           int i, j;
+           rpm_count_t i, j;
 
            dbi = NULL;
            rpmtag = dbiTags[dbix];
@@ -2704,7 +2704,7 @@ DBT * data = alloca(sizeof(*data));
     sigset_t signalMask;
     const char ** baseNames;
     rpmTagType bnt;
-    int count = 0;
+    rpm_count_t count = 0;
     dbiIndex dbi;
     int dbix;
     union _dbswap mi_offset;
@@ -2824,7 +2824,7 @@ memset(data, 0, sizeof(*data));
            const char *av[1];
            const char **rpmvals = NULL;
            rpmTagType rpmtype = 0;
-           int rpmcnt = 0;
+           rpm_count_t rpmcnt = 0;
            int rpmtag;
            int32_t * requireFlags;
            rpmRC rpmrc;
@@ -2893,7 +2893,7 @@ data->size = 0;
                break;
            }
 
-           if (rpmcnt <= 0) {
+           if (rpmcnt == 0) {
                if (rpmtag != RPMTAG_GROUP)
                    continue;