Fix rpmdbAppendIterator() argument signedness
- Header numbers and the number of header numbers can never be negative here, and mismatches with everything else. Changing this is somewhat nasty as its a public API but then I dont think anything at all outside rpm itself has ever used this for anything, and the types were incorrect to begin with. - Fixup the used types in the sole caller markReplacedFiles() accordingly. These type mismatches go deeper than that (rpmfs and shared file info and all) but that's a story for some other day...
This commit is contained in:
parent
1a9d3421ea
commit
f26513cce3
|
@ -133,9 +133,9 @@ static rpmRC markReplacedFiles(const rpmpsm psm)
|
|||
sharedFileInfo sfi;
|
||||
rpmdbMatchIterator mi;
|
||||
Header h;
|
||||
int * offsets;
|
||||
unsigned int * offsets;
|
||||
unsigned int prev;
|
||||
int num;
|
||||
unsigned int num;
|
||||
|
||||
if (!replaced)
|
||||
return RPMRC_OK;
|
||||
|
|
|
@ -1642,15 +1642,16 @@ int rpmdbPruneIterator(rpmdbMatchIterator mi, removedHash hdrNums)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int rpmdbAppendIterator(rpmdbMatchIterator mi, const int * hdrNums, int nHdrNums)
|
||||
int rpmdbAppendIterator(rpmdbMatchIterator mi,
|
||||
const unsigned int * hdrNums, unsigned int nHdrNums)
|
||||
{
|
||||
if (mi == NULL || hdrNums == NULL || nHdrNums <= 0)
|
||||
if (mi == NULL || hdrNums == NULL || nHdrNums == 0)
|
||||
return 1;
|
||||
|
||||
if (mi->mi_set == NULL)
|
||||
mi->mi_set = dbiIndexSetNew(nHdrNums);
|
||||
|
||||
for (int i = 0; i < nHdrNums; i++) {
|
||||
for (unsigned int i = 0; i < nHdrNums; i++) {
|
||||
struct dbiIndexItem rec = { .hdrNum = hdrNums[i], .tagNum = 0 };
|
||||
dbiIndexSetAppend(mi->mi_set, &rec, 1, 0);
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi);
|
|||
* @return 0 on success, 1 on failure (bad args)
|
||||
*/
|
||||
int rpmdbAppendIterator(rpmdbMatchIterator mi,
|
||||
const int * hdrNums, int nHdrNums);
|
||||
const unsigned int * hdrNums, unsigned int nHdrNums);
|
||||
|
||||
/** \ingroup rpmdb
|
||||
* Add pattern to iterator selector.
|
||||
|
|
Loading…
Reference in New Issue