From 0d68cbf48efe57c4adf57a409df4bd57acc1bebd Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 26 Mar 2010 09:31:00 +0200 Subject: [PATCH] Use the new problem set iterator where it makes more sense --- lib/verify.c | 5 +++-- python/rpmps-py.c | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/verify.c b/lib/verify.c index e68297d..8dd3c91 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -409,9 +409,10 @@ static int verifyDependencies(QVA_t qva, rpmts ts, Header h) rpmlog(RPMLOG_NOTICE, _("Unsatisfied dependencies for %s:\n"), rpmteNEVRA(te)); rpmpsi psi = rpmpsInitIterator(ps); + rpmProblem p; - while (rpmpsNextIterator(psi) >= 0) { - char * ps = rpmProblemString(rpmpsGetProblem(psi)); + while ((p = rpmpsiNext(psi)) != NULL) { + char * ps = rpmProblemString(p); rpmlog(RPMLOG_NOTICE, "\t%s\n", ps); free(ps); } diff --git a/python/rpmps-py.c b/python/rpmps-py.c index c003dd8..fa7e91e 100644 --- a/python/rpmps-py.c +++ b/python/rpmps-py.c @@ -129,10 +129,12 @@ PyObject *rpmps_AsList(rpmps ps) { PyObject *problems = PyList_New(0); rpmpsi psi = rpmpsInitIterator(ps); - while (rpmpsNextIterator(psi) >= 0) { - PyObject *prob = rpmprob_Wrap(&rpmProblem_Type, rpmpsGetProblem(psi)); - PyList_Append(problems, prob); - Py_DECREF(prob); + rpmProblem prob; + + while ((prob = rpmpsiNext(psi))) { + PyObject *pyprob = rpmprob_Wrap(&rpmProblem_Type, prob); + PyList_Append(problems, pyprob); + Py_DECREF(pyprob); } rpmpsFreeIterator(psi); return problems; -- 2.7.4