diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-11-29 12:04:46 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-11-29 12:04:46 +0200 |
commit | 881f14d277eefc70d65bf48b1837f0219572f397 (patch) | |
tree | c426f376620e983d4eb5360743ba150e448223a8 | |
parent | 2d918b5aa0a4afec407937bb6e1d4b7ae6ba4be3 (diff) | |
download | rpm-881f14d277eefc70d65bf48b1837f0219572f397.tar.gz rpm-881f14d277eefc70d65bf48b1837f0219572f397.tar.bz2 rpm-881f14d277eefc70d65bf48b1837f0219572f397.zip |
Use proper type (unsigned) for index set offset/count
-rw-r--r-- | lib/rpmdb.c | 20 | ||||
-rw-r--r-- | lib/rpmdb_internal.h | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/lib/rpmdb.c b/lib/rpmdb.c index 4ecd5463e..6659f8d9d 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -346,7 +346,7 @@ static int dbt2set(dbiIndex dbi, DBT * data, dbiIndexSet * setp) int _dbbyteswapped = dbiByteSwapped(dbi); const char * sdbir; dbiIndexSet set; - int i; + unsigned int i; if (dbi == NULL || data == NULL || setp == NULL) return -1; @@ -407,7 +407,7 @@ static int set2dbt(dbiIndex dbi, DBT * data, dbiIndexSet set) { int _dbbyteswapped = dbiByteSwapped(dbi); char * tdbir; - int i; + unsigned int i; if (dbi == NULL || data == NULL || set == NULL) return -1; @@ -460,7 +460,7 @@ static int set2dbt(dbiIndex dbi, DBT * data, dbiIndexSet set) /* XXX assumes hdrNum is first int in dbiIndexItem */ static int hdrNumCmp(const void * one, const void * two) { - const int * a = one, * b = two; + const unsigned int * a = one, * b = two; return (*a - *b); } @@ -512,10 +512,10 @@ static int dbiAppendSet(dbiIndexSet set, const void * recs, static int dbiPruneSet(dbiIndexSet set, void * recs, int nrecs, size_t recsize, int sorted) { - int from; - int to = 0; - int num = set->count; - int numCopied = 0; + unsigned int from; + unsigned int to = 0; + unsigned int num = set->count; + unsigned int numCopied = 0; assert(set->count > 0); if (nrecs > 1 && !sorted) @@ -1065,7 +1065,7 @@ static int rpmdbFindByFile(rpmdb db, const char * filespec, DBC * dbcursor; dbiIndexSet allMatches = NULL; dbiIndexItem rec = NULL; - int i; + unsigned int i; int rc; int xx; @@ -1263,9 +1263,9 @@ static rpmRC dbiFindMatches(dbiIndex dbi, DBC * dbcursor, const char * release, dbiIndexSet * matches) { - int gotMatches = 0; + unsigned int gotMatches = 0; int rc; - int i; + unsigned int i; key->data = (void *) name; key->size = strlen(name); diff --git a/lib/rpmdb_internal.h b/lib/rpmdb_internal.h index 485d9adf9..d19733c4e 100644 --- a/lib/rpmdb_internal.h +++ b/lib/rpmdb_internal.h @@ -36,8 +36,8 @@ struct _dbiIndexItem { * Items retrieved from the index database. */ struct _dbiIndexSet { -struct _dbiIndexItem * recs; /*!< array of records */ - int count; /*!< number of records */ + struct _dbiIndexItem * recs; /*!< array of records */ + unsigned int count; /*!< number of records */ }; /** \ingroup dbi |