Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=ff3c89ea183ffcd58fdb7ebe85dcdb5f0ec33e38
commit ff3c89ea183ffcd58fdb7ebe85dcdb5f0ec33e38 Author: Michel Hermier <[email protected]> Date: Tue Aug 19 11:55:19 2014 +0200 libpacman: Rename pmlist_t::next to m_next and use accessors where possible. diff --git a/lib/libpacman/cache.cpp b/lib/libpacman/cache.cpp index 31ee7a4..6e3660f 100644 --- a/lib/libpacman/cache.cpp +++ b/lib/libpacman/cache.cpp @@ -153,7 +153,7 @@ Group *_pacman_db_get_grpfromlist(FPtrList *list, const char *target) return(NULL); } - for(i = list; i; i = i->next) { + for(i = list; i; i = f_ptrlistitem_next(i)) { Group *info = f_ptrlistitem_data(i); if(strcmp(info->name, target) == 0) { @@ -176,7 +176,7 @@ int _pacman_db_load_grpcache(Database *db) _pacman_log(PM_LOG_DEBUG, _("loading group cache for repository '%s'"), db->treename); - for(; lp; lp = lp->next) { + for(; lp; lp = f_ptrlistitem_next(lp)) { pmlist_t *i; Package *pkg = f_ptrlistitem_data(lp); @@ -184,7 +184,7 @@ int _pacman_db_load_grpcache(Database *db) pkg->read(INFRQ_DESC); } - for(i = pkg->groups(); i; i = i->next) { + for(i = pkg->groups(); i; i = f_ptrlistitem_next(i)) { const char *grp_name = f_stringlistitem_to_str(i); Group *grp = _pacman_db_get_grpfromlist(db->grpcache, grp_name); diff --git a/lib/libpacman/conflict.cpp b/lib/libpacman/conflict.cpp index 0077b6b..aff6195 100644 --- a/lib/libpacman/conflict.cpp +++ b/lib/libpacman/conflict.cpp @@ -65,7 +65,7 @@ pmlist_t *_pacman_checkconflicts(pmtrans_t *trans, pmlist_t *packages) howmany = f_ptrlist_count(packages); - for(i = packages; i; i = i->next) { + for(i = packages; i; i = f_ptrlistitem_next(i)) { Package *tp = (Package *)f_ptrlistitem_data(i); if(tp == NULL) { continue; @@ -79,7 +79,7 @@ pmlist_t *_pacman_checkconflicts(pmtrans_t *trans, pmlist_t *packages) howmany - remain + 1); } - for(j = tp->conflicts(); j; j = j->next) { + for(j = tp->conflicts(); j; j = f_ptrlistitem_next(j)) { const char *conflict = f_stringlistitem_to_str(j); if(!strcmp(tp->name(), conflict)) { /* a package cannot conflict with itself -- that's just not nice */ @@ -87,7 +87,7 @@ pmlist_t *_pacman_checkconflicts(pmtrans_t *trans, pmlist_t *packages) } /* CHECK 1: check targets against database */ _pacman_log(PM_LOG_DEBUG, _("checkconflicts: targ '%s' vs db"), tp->name()); - for(k = _pacman_db_get_pkgcache(db_local); k; k = k->next) { + for(k = _pacman_db_get_pkgcache(db_local); k; k = f_ptrlistitem_next(k)) { Package *dp = (Package *)f_ptrlistitem_data(k); if(!strcmp(dp->name(), tp->name())) { /* a package cannot conflict with itself -- that's just not nice */ @@ -102,7 +102,7 @@ pmlist_t *_pacman_checkconflicts(pmtrans_t *trans, pmlist_t *packages) } else { /* see if dp provides something in tp's conflict list */ pmlist_t *m; - for(m = dp->provides(); m; m = m->next) { + for(m = dp->provides(); m; m = f_ptrlistitem_next(m)) { if(!strcmp(f_stringlistitem_to_str(m), conflict)) { /* confict */ _pacman_log(PM_LOG_DEBUG, _("targs vs db: found %s as a conflict for %s"), @@ -115,7 +115,7 @@ pmlist_t *_pacman_checkconflicts(pmtrans_t *trans, pmlist_t *packages) } /* CHECK 2: check targets against targets */ _pacman_log(PM_LOG_DEBUG, _("checkconflicts: targ '%s' vs targs"), tp->name()); - for(k = packages; k; k = k->next) { + for(k = packages; k; k = f_ptrlistitem_next(k)) { Package *otp = (Package *)f_ptrlistitem_data(k); if(!strcmp(otp->name(), tp->name())) { /* a package cannot conflict with itself -- that's just not nice */ @@ -130,7 +130,7 @@ pmlist_t *_pacman_checkconflicts(pmtrans_t *trans, pmlist_t *packages) } else { /* see if otp provides something in tp's conflict list */ pmlist_t *m; - for(m = otp->provides(); m; m = m->next) { + for(m = otp->provides(); m; m = f_ptrlistitem_next(m)) { if(!strcmp(f_stringlistitem_to_str(m), conflict)) { _pacman_log(PM_LOG_DEBUG, _("targs vs targs: found %s as a conflict for %s"), otp->name(), tp->name()); @@ -143,7 +143,7 @@ pmlist_t *_pacman_checkconflicts(pmtrans_t *trans, pmlist_t *packages) } /* CHECK 3: check database against targets */ _pacman_log(PM_LOG_DEBUG, _("checkconflicts: db vs targ '%s'"), tp->name()); - for(k = _pacman_db_get_pkgcache(db_local); k; k = k->next) { + for(k = _pacman_db_get_pkgcache(db_local); k; k = f_ptrlistitem_next(k)) { pmlist_t *conflicts = NULL; int usenewconflicts = 0; @@ -155,7 +155,7 @@ pmlist_t *_pacman_checkconflicts(pmtrans_t *trans, pmlist_t *packages) /* If this package (*info) is also in our packages pmlist_t, use the * conflicts list from the new package, not the old one (*info) */ - for(j = packages; j; j = j->next) { + for(j = packages; j; j = f_ptrlistitem_next(j)) { Package *pkg = (Package *)f_ptrlistitem_data(j); if(!strcmp(pkg->name(), info->name())) { /* Use the new, to-be-installed package's conflicts */ @@ -167,7 +167,7 @@ pmlist_t *_pacman_checkconflicts(pmtrans_t *trans, pmlist_t *packages) /* Use the old package's conflicts, it's the only set we have */ conflicts = info->conflicts(); } - for(j = conflicts; j; j = j->next) { + for(j = conflicts; j; j = f_ptrlistitem_next(j)) { if(!strcmp(tp->name(), f_stringlistitem_to_str(j))) { _pacman_log(PM_LOG_DEBUG, _("db vs targs: found %s as a conflict for %s"), info->name(), tp->name()); @@ -176,9 +176,9 @@ pmlist_t *_pacman_checkconflicts(pmtrans_t *trans, pmlist_t *packages) } else { /* see if the db package conflicts with something we provide */ pmlist_t *m; - for(m = conflicts; m; m = m->next) { + for(m = conflicts; m; m = f_ptrlistitem_next(m)) { pmlist_t *n; - for(n = tp->provides(); n; n = n->next) { + for(n = tp->provides(); n; n = f_ptrlistitem_next(n)) { if(!strcmp(f_stringlistitem_to_str(m), f_stringlistitem_to_str(n))) { _pacman_log(PM_LOG_DEBUG, _("db vs targs: found %s as a conflict for %s"), info->name(), tp->name()); @@ -209,22 +209,22 @@ static pmlist_t *chk_fileconflicts(pmlist_t *filesA, pmlist_t *filesB) const char *strB = f_stringlistitem_to_str(pB); /* skip directories, we don't care about dir conflicts */ if(strA[strlen(strA)-1] == '/') { - pA = pA->next; + pA = f_ptrlistitem_next(pA); } else if(strB[strlen(strB)-1] == '/') { - pB = pB->next; + pB = f_ptrlistitem_next(pB); } else { int cmp = strcmp(strA, strB); if(cmp < 0) { /* item only in filesA, ignore it */ - pA = pA->next; + pA = f_ptrlistitem_next(pA); } else if(cmp > 0) { /* item only in filesB, ignore it */ - pB = pB->next; + pB = f_ptrlistitem_next(pB); } else { /* item in both, record it */ ret = _pacman_stringlist_append(ret, strA); - pA = pA->next; - pB = pB->next; + pA = f_ptrlistitem_next(pA); + pB = f_ptrlistitem_next(pB); } } } @@ -252,16 +252,16 @@ pmlist_t *_pacman_db_find_conflicts(pmtrans_t *trans) howmany = f_ptrlist_count(targets); /* CHECK 1: check every target against every target */ - for(i = targets; i; i = i->next) { + for(i = targets; i; i = f_ptrlistitem_next(i)) { Package *p1 = (Package*)f_ptrlistitem_data(i); remain = f_ptrlist_count(i); percent = (double)(howmany - remain + 1) / howmany; PROGRESS(trans, PM_TRANS_PROGRESS_CONFLICTS_START, "", (percent * 100), howmany, howmany - remain + 1); - for(j = i; j; j = j->next) { + for(j = i; j; j = f_ptrlistitem_next(j)) { Package *p2 = (Package*)f_ptrlistitem_data(j); if(strcmp(p1->name(), p2->name())) { pmlist_t *ret = chk_fileconflicts(p1->files(), p2->files()); - for(k = ret; k; k = k->next) { + for(k = ret; k; k = f_ptrlistitem_next(k)) { pmconflict_t *conflict = _pacman_malloc(sizeof(pmconflict_t)); if(conflict == NULL) { continue; @@ -279,7 +279,7 @@ pmlist_t *_pacman_db_find_conflicts(pmtrans_t *trans) /* CHECK 2: check every target against the filesystem */ p = (Package*)f_ptrlistitem_data(i); dbpkg = NULL; - for(j = p->files(); j; j = j->next) { + for(j = p->files(); j; j = f_ptrlistitem_next(j)) { filestr = f_stringlistitem_to_str(j); snprintf(path, PATH_MAX, "%s%s", root, filestr); /* is this target a file or directory? */ @@ -307,7 +307,7 @@ pmlist_t *_pacman_db_find_conflicts(pmtrans_t *trans) /* Check if the conflicting file has been moved to another package/target */ if(!ok) { /* Look at all the targets */ - for(k = targets; k && !ok; k = k->next) { + for(k = targets; k && !ok; k = f_ptrlistitem_next(k)) { Package *p2 = (Package *)f_ptrlistitem_data(k); /* As long as they're not the current package */ if(strcmp(p2->name(), p->name())) { diff --git a/lib/libpacman/db.cpp b/lib/libpacman/db.cpp index 6dcb7dd..b2f8ed0 100644 --- a/lib/libpacman/db.cpp +++ b/lib/libpacman/db.cpp @@ -88,7 +88,7 @@ pmlist_t *Database::filter(const PackageMatcher &packagematcher) { pmlist_t *i, *ret = NULL; - for(i = _pacman_db_get_pkgcache(this); i; i = i->next) { + for(i = _pacman_db_get_pkgcache(this); i; i = f_ptrlistitem_next(i)) { Package *pkg = (Package *)f_ptrlistitem_data(i); if(packagematcher.match(pkg)) { @@ -107,7 +107,7 @@ FPtrList *Database::filter(const FStringList *needles, int packagestrmatcher_fla { pmlist_t *i, *j, *ret = NULL; - for(i = needles; i; i = i->next) { + for(i = needles; i; i = f_ptrlistitem_next(i)) { const char *pattern = f_stringlistitem_to_str(i); if(f_strempty(pattern)) { @@ -117,7 +117,7 @@ FPtrList *Database::filter(const FStringList *needles, int packagestrmatcher_fla PackageMatcher packagematcher(pattern, packagestrmatcher_flags, strmatcher_flags); - for(j = _pacman_db_get_pkgcache(this); j; j = j->next) { + for(j = _pacman_db_get_pkgcache(this); j; j = f_ptrlistitem_next(j)) { Package *pkg = (Package *)f_ptrlistitem_data(j); if(packagematcher.match(pkg)) { @@ -141,7 +141,7 @@ Package *Database::find(const PackageMatcher &packagematcher) Package *ret = NULL; pmlist_t *i; - for(i = _pacman_db_get_pkgcache(this); i; i = i->next) { + for(i = _pacman_db_get_pkgcache(this); i; i = f_ptrlistitem_next(i)) { Package *pkg = (Package *)f_ptrlistitem_data(i); if(packagematcher.match(pkg)) { diff --git a/lib/libpacman/db/localdb.cpp b/lib/libpacman/db/localdb.cpp index 7f50668..ff7661a 100644 --- a/lib/libpacman/db/localdb.cpp +++ b/lib/libpacman/db/localdb.cpp @@ -181,7 +181,7 @@ int _pacman_localpackage_remove(Package *pkg, pmtrans_t *trans, int howmany, int * explanation. */ int skipit = 0; pmlist_t *j; - for(j = trans->skiplist; j; j = j->next) { + for(j = trans->skiplist; j; j = f_ptrlistitem_next(j)) { if(!strcmp(file, f_stringlistitem_to_str(j))) { skipit = 1; } @@ -428,7 +428,7 @@ void _pacman_localdb_write_stringlist(const char *entry, const pmlist_t *values, if(values != NULL) { fprintf(stream, "%%%s%%\n", entry); - for(lp = values; lp; lp = lp->next) { + for(lp = values; lp; lp = f_ptrlistitem_next(lp)) { fprintf(stream, "%s\n", f_stringlistitem_to_str(lp)); } fputc('\n', stream); @@ -545,11 +545,11 @@ pmlist_t *LocalDatabase::getowners(const char *filename) rpath[strlen(rpath)] = '/'; } - for(lp = _pacman_db_get_pkgcache(this); lp; lp = lp->next) { + for(lp = _pacman_db_get_pkgcache(this); lp; lp = f_ptrlistitem_next(lp)) { Package *info = (Package *)f_ptrlistitem_data(lp); pmlist_t *i; - for(i = info->files(); i; i = i->next) { + for(i = info->files(); i; i = f_ptrlistitem_next(i)) { char path[PATH_MAX]; snprintf(path, PATH_MAX, "%s%s", m_handle->root, f_stringlistitem_to_str(i)); diff --git a/lib/libpacman/db/localdb_files.cpp b/lib/libpacman/db/localdb_files.cpp index e8aff6e..5620782 100644 --- a/lib/libpacman/db/localdb_files.cpp +++ b/lib/libpacman/db/localdb_files.cpp @@ -76,7 +76,7 @@ int _pacman_localdb_desc_fread(Package *info, FILE *fp) if(!strcmp(line, "%DESC%")) { _pacman_db_read_lines(&info->desc_localized, line, sline, fp); STRNCPY(info->m_description, f_stringlistitem_to_str(info->desc_localized), sizeof(info->m_description)); - for (i = info->desc_localized; i; i = i->next) { + for (i = info->desc_localized; i; i = f_ptrlistitem_next(i)) { const char *desc = f_stringlistitem_to_str(i); const size_t language_len = strlen(handle->language); if (!strncmp(desc, handle->language, language_len) && *(desc+language_len) == ' ') { diff --git a/lib/libpacman/deps.cpp b/lib/libpacman/deps.cpp index d8a9ae7..fed975b 100644 --- a/lib/libpacman/deps.cpp +++ b/lib/libpacman/deps.cpp @@ -79,7 +79,7 @@ int _pacman_depmiss_isin(pmdepmissing_t *needle, pmlist_t *haystack) { pmlist_t *i; - for(i = haystack; i; i = i->next) { + for(i = haystack; i; i = f_ptrlistitem_next(i)) { pmdepmissing_t *miss = f_ptrlistitem_data(i); if(!memcmp(needle, miss, sizeof(pmdepmissing_t)) && !memcmp(&needle->depend, &miss->depend, sizeof(pmdepend_t))) { @@ -130,22 +130,22 @@ pmlist_t *_pacman_sortbydeps(pmlist_t *targets, int mode) _pacman_log(PM_LOG_DEBUG, _("started sorting dependencies")); /* We create the vertices */ - for(i = targets; i; i = i->next) { + for(i = targets; i; i = f_ptrlistitem_next(i)) { pmgraph_t *v = _pacman_graph_new(); v->data = f_ptrlistitem_data(i); vertices = f_ptrlist_add(vertices, v); } /* We compute the edges */ - for(i = vertices; i; i = i->next) { + for(i = vertices; i; i = f_ptrlistitem_next(i)) { pmgraph_t *vertex_i = f_ptrlistitem_data(i); Package *p_i = vertex_i->data; /* TODO this should be somehow combined with _pacman_checkdeps */ - for(j = vertices; j; j = j->next) { + for(j = vertices; j; j = f_ptrlistitem_next(j)) { pmgraph_t *vertex_j = f_ptrlistitem_data(j); Package *p_j = vertex_j->data; int child = 0; - for(k = p_i->depends(); k && !child; k = k->next) { + for(k = p_i->depends(); k && !child; k = f_ptrlistitem_next(k)) { pmdepend_t depend; _pacman_splitdep(f_ptrlistitem_data(k), &depend); child = _pacman_depcmp(p_j, &depend); @@ -165,7 +165,7 @@ pmlist_t *_pacman_sortbydeps(pmlist_t *targets, int mode) found = 0; while(vertex->childptr && !found) { pmgraph_t *nextchild = f_ptrlistitem_data(vertex->childptr); - vertex->childptr = (vertex->childptr)->next; + vertex->childptr = f_ptrlistitem_next(vertex->childptr); if (nextchild->state == 0) { found = 1; nextchild->parent = vertex; @@ -180,11 +180,11 @@ pmlist_t *_pacman_sortbydeps(pmlist_t *targets, int mode) vertex->state = 1; vertex = vertex->parent; if(!vertex) { - vptr = vptr->next; + vptr = f_ptrlistitem_next(vptr); while(vptr) { vertex = f_ptrlistitem_data(vptr); if (vertex->state == 0) break; - vptr = vptr->next; + vptr = f_ptrlistitem_next(vptr); } } } @@ -223,7 +223,7 @@ pmlist_t *_pacman_checkdeps(pmtrans_t *trans, unsigned char op, pmlist_t *packag return(NULL); } - for(i = packages; i; i = i->next) { + for(i = packages; i; i = f_ptrlistitem_next(i)) { Package *tp = f_ptrlistitem_data(i); Package *pkg_local; @@ -239,7 +239,7 @@ pmlist_t *_pacman_checkdeps(pmtrans_t *trans, unsigned char op, pmlist_t *packag if(pkg_local != NULL) { found = 0; - for(j = pkg_local->requiredby(); j; j = j->next) { + for(j = pkg_local->requiredby(); j; j = f_ptrlistitem_next(j)) { const char *requiredby_name = f_stringlistitem_to_str(j); if(op == PM_TRANS_TYPE_UPGRADE) { @@ -256,7 +256,7 @@ pmlist_t *_pacman_checkdeps(pmtrans_t *trans, unsigned char op, pmlist_t *packag /* this package is also in the upgrade list, so don't worry about it */ continue; } - for(k = p->depends(); k; k = k->next) { + for(k = p->depends(); k; k = f_ptrlistitem_next(k)) { const char *depend_name = f_stringlistitem_to_str(k); /* don't break any existing dependencies (possible provides) */ @@ -273,14 +273,14 @@ pmlist_t *_pacman_checkdeps(pmtrans_t *trans, unsigned char op, pmlist_t *packag /* check requiredby fields */ if(!_pacman_pkg_isin(requiredby_name, packages)) { /* check if a package in trans->packages provides this package */ - for(k=trans->packages; !found && k; k=k->next) { + for(k=trans->packages; !found && k; k = f_ptrlistitem_next(k)) { Package *spkg = f_ptrlistitem_data(k); if(spkg && spkg->provides(pkg_local->name())) { found=1; } } - for(k=trans->syncpkgs; !found && k; k=k->next) { + for(k=trans->syncpkgs; !found && k; k = f_ptrlistitem_next(k)) { pmsyncpkg_t *ps = f_ptrlistitem_data(k); if(ps->pkg_new->provides(pkg_local->name())) { @@ -298,14 +298,14 @@ pmlist_t *_pacman_checkdeps(pmtrans_t *trans, unsigned char op, pmlist_t *packag } if(op == PM_TRANS_TYPE_ADD || op == PM_TRANS_TYPE_UPGRADE) { /* DEPENDENCIES -- look for unsatisfied dependencies */ - for(j = tp->depends(); j; j = j->next) { + for(j = tp->depends(); j; j = f_ptrlistitem_next(j)) { const char *depend_name = f_stringlistitem_to_str(j); /* split into name/version pairs */ _pacman_splitdep(depend_name, &depend); found = 0; /* check database for literal packages */ - for(k = _pacman_db_get_pkgcache(db_local); k && !found; k = k->next) { + for(k = _pacman_db_get_pkgcache(db_local); k && !found; k = f_ptrlistitem_next(k)) { Package *p = (Package *)f_ptrlistitem_data(k); if(!strcmp(p->name(), depend.name)) { if(depend.mod == PM_DEP_MOD_ANY) { @@ -337,7 +337,7 @@ pmlist_t *_pacman_checkdeps(pmtrans_t *trans, unsigned char op, pmlist_t *packag if(!found) { pmlist_t *m; k = db_local->whatPackagesProvide(depend.name); - for(m = k; m && !found; m = m->next) { + for(m = k; m && !found; m = f_ptrlistitem_next(m)) { /* look for a match that isn't one of the packages we're trying * to install. this way, if we match against a to-be-installed * package, we'll defer to the NEW one, not the one already @@ -345,7 +345,7 @@ pmlist_t *_pacman_checkdeps(pmtrans_t *trans, unsigned char op, pmlist_t *packag Package *p = f_ptrlistitem_data(m); pmlist_t *n; int skip = 0; - for(n = packages; n && !skip; n = n->next) { + for(n = packages; n && !skip; n = f_ptrlistitem_next(n)) { Package *ptp = f_ptrlistitem_data(n); if(!strcmp(ptp->name(), p->name())) { skip = 1; @@ -382,7 +382,7 @@ pmlist_t *_pacman_checkdeps(pmtrans_t *trans, unsigned char op, pmlist_t *packag FREELISTPTR(k); } /* check other targets */ - for(k = packages; k && !found; k = k->next) { + for(k = packages; k && !found; k = f_ptrlistitem_next(k)) { Package *p = (Package *)f_ptrlistitem_data(k); /* see if the package names match OR if p provides depend.name */ if(!strcmp(p->name(), depend.name) || p->provides(depend.name)) { @@ -488,8 +488,8 @@ pmlist_t *_pacman_removedeps(Database *db, pmlist_t *targs) return(newtargs); } - for(i = targs; i; i = i->next) { - for(j = ((Package *)f_ptrlistitem_data(i))->depends(); j; j = j->next) { + for(i = targs; i; i = f_ptrlistitem_next(i)) { + for(j = ((Package *)f_ptrlistitem_data(i))->depends(); j; j = f_ptrlistitem_next(j)) { pmdepend_t depend; Package *dep; int needed = 0; @@ -525,7 +525,7 @@ pmlist_t *_pacman_removedeps(Database *db, pmlist_t *targs) } /* see if other packages need it */ - for(k = dep->requiredby(); k && !needed; k = k->next) { + for(k = dep->requiredby(); k && !needed; k = f_ptrlistitem_next(k)) { Package *dummy = db->find(f_stringlistitem_to_str(k)); if(!_pacman_pkg_isin(dummy->name(), targs)) { needed = 1; @@ -575,13 +575,13 @@ int _pacman_resolvedeps(pmtrans_t *trans, Package *syncpkg, pmlist_t *list, return(0); } - for(i = deps; i; i = i->next) { + for(i = deps; i; i = f_ptrlistitem_next(i)) { int found = 0; pmdepmissing_t *miss = f_ptrlistitem_data(i); Package *ps = NULL; /* check if one of the packages in *list already provides this dependency */ - for(j = list; j && !found; j = j->next) { + for(j = list; j && !found; j = f_ptrlistitem_next(j)) { Package *sp = (Package *)f_ptrlistitem_data(j); if(sp->provides(miss->depend.name)) { _pacman_log(PM_LOG_DEBUG, _("%s provides dependency %s -- skipping"), @@ -595,11 +595,11 @@ int _pacman_resolvedeps(pmtrans_t *trans, Package *syncpkg, pmlist_t *list, /* find the package in one of the repositories */ /* check literals */ - for(j = dbs_sync; !ps && j; j = j->next) { + for(j = dbs_sync; !ps && j; j = f_ptrlistitem_next(j)) { ps = ((Database *)f_ptrlistitem_data(j))->find(miss->depend.name); } /* check provides */ - for(j = dbs_sync; !ps && j; j = j->next) { + for(j = dbs_sync; !ps && j; j = f_ptrlistitem_next(j)) { pmlist_t *provides; provides = ((Database *)f_ptrlistitem_data(j))->whatPackagesProvide(miss->depend.name); if(provides) { @@ -734,7 +734,7 @@ int inList(pmlist_t *lst, char *lItem) { if(!strcmp(lItem, (char *)f_ptrlistitem_data(ll))) { return 1; } - ll = ll->next; + ll = f_ptrlistitem_next(ll); } return 0; } @@ -747,7 +747,7 @@ int pacman_output_generate(pmlist_t *targets, pmlist_t *dblist) { char *match = NULL; int foundMatch = 0; unsigned int inforeq = INFRQ_DEPENDS; - for(j = dblist; j; j = j->next) { + for(j = dblist; j; j = f_ptrlistitem_next(j)) { Database *db = f_ptrlistitem_data(j); do { foundMatch = 0; @@ -757,7 +757,7 @@ int pacman_output_generate(pmlist_t *targets, pmlist_t *dblist) { targets = _pacman_list_remove(targets, (void*) pname, str_cmp, (void **)&match); if(match) { foundMatch = 1; - for(k = pkg->depends(); k; k = k->next) { + for(k = pkg->depends(); k; k = f_ptrlistitem_next(k)) { char *fullDep = f_stringlistitem_to_str(k); pmdepend_t depend; if(_pacman_splitdep(fullDep, &depend)) { diff --git a/lib/libpacman/handle.cpp b/lib/libpacman/handle.cpp index 7fd115b..82a63d2 100644 --- a/lib/libpacman/handle.cpp +++ b/lib/libpacman/handle.cpp @@ -175,7 +175,7 @@ Database *Handle::getDatabase(const char *treename) return db_local; } - for(i = dbs_sync; i; i = i->next) { + for(i = dbs_sync; i; i = f_ptrlistitem_next(i)) { Database *sdb = (Database *)f_ptrlistitem_data(i); if(strcmp(treename, sdb->treename) == 0) { return sdb; diff --git a/lib/libpacman/kernel/fstr.cpp b/lib/libpacman/kernel/fstr.cpp index 4423cc1..519f6bc 100644 --- a/lib/libpacman/kernel/fstr.cpp +++ b/lib/libpacman/kernel/fstr.cpp @@ -82,7 +82,7 @@ int f_stringlist_any_match(const FStringList *list, const FStrMatcher *matcher) { const FStringListItem *it; - for(it = f_ptrlist_first_const(list); it != f_ptrlist_end_const(list); it = it->next) { + for(it = f_ptrlist_first_const(list); it != f_ptrlist_end_const(list); it = f_ptrlistitem_next(it)) { if(matcher->match(f_stringlistitem_to_str(it)) != 0) { return 1; } diff --git a/lib/libpacman/package.cpp b/lib/libpacman/package.cpp index 31ef7c3..c4def29 100644 --- a/lib/libpacman/package.cpp +++ b/lib/libpacman/package.cpp @@ -167,7 +167,7 @@ Package *_pacman_pkg_isin(const char *needle, pmlist_t *haystack) return(NULL); } - for(lp = haystack; lp; lp = lp->next) { + for(lp = haystack; lp; lp = f_ptrlistitem_next(lp)) { Package *info = f_ptrlistitem_data(lp); if(info && !strcmp(info->name(), needle)) { @@ -257,7 +257,7 @@ char *Package::fileneedbackup(const char *file) const ASSERT(!_pacman_strempty(file), RET_ERR(PM_ERR_WRONG_ARGS, NULL)); /* run through the backup list and parse out the md5 or sha1 hash for our file */ - for(lp = m_backup; lp; lp = lp->next) { + for(lp = m_backup; lp; lp = f_ptrlistitem_next(lp)) { char *str = strdup(f_stringlistitem_to_str(lp)); char *ptr; diff --git a/lib/libpacman/package/packagecache.cpp b/lib/libpacman/package/packagecache.cpp index b553745..518cc1b 100644 --- a/lib/libpacman/package/packagecache.cpp +++ b/lib/libpacman/package/packagecache.cpp @@ -59,7 +59,7 @@ int _pacman_packagecache_clean(int level) } closedir(dir); - for(i = cache; i; i = i->next) { + for(i = cache; i; i = f_ptrlistitem_next(i)) { char *str = f_stringlistitem_to_str(i); char name[PKG_NAME_LEN], version[PKG_VERSION_LEN]; @@ -75,7 +75,7 @@ int _pacman_packagecache_clean(int level) clean = _pacman_stringlist_append(clean, str); continue; } - for(j = i->next; j; j = j->next) { + for(j = f_ptrlistitem_next(i); j; j = f_ptrlistitem_next(j)) { char *s = f_stringlistitem_to_str(j); char n[PKG_NAME_LEN], v[PKG_VERSION_LEN]; @@ -98,7 +98,7 @@ int _pacman_packagecache_clean(int level) } FREELIST(cache); - for(i = clean; i; i = i->next) { + for(i = clean; i; i = f_ptrlistitem_next(i)) { char path[PATH_MAX]; snprintf(path, PATH_MAX, "%s/%s", dirpath, f_stringlistitem_to_str(i)); diff --git a/lib/libpacman/packages_transaction.cpp b/lib/libpacman/packages_transaction.cpp index 4736e63..f83d231 100644 --- a/lib/libpacman/packages_transaction.cpp +++ b/lib/libpacman/packages_transaction.cpp @@ -56,7 +56,7 @@ _pacman_packages_transaction_set_state(pmtrans_t *trans, int new_state) } _pacman_log(PM_LOG_FLOW2, _("executing %s triggers..."), trigger_function); - for(lp = trans->triggers; lp; lp = lp->next) { + for(lp = trans->triggers; lp; lp = f_ptrlistitem_next(lp)) { const char *trigger = f_stringlistitem_to_str(lp); char buf[PATH_MAX]; diff --git a/lib/libpacman/pacman.cpp b/lib/libpacman/pacman.cpp index c806c47..d58468e 100644 --- a/lib/libpacman/pacman.cpp +++ b/lib/libpacman/pacman.cpp @@ -510,7 +510,7 @@ int pacman_db_setserver(pmdb_t *_db, char *url) } } else { pmlist_t *i; - for(i = handle->dbs_sync; i && !found; i = i->next) { + for(i = handle->dbs_sync; i && !found; i = f_ptrlistitem_next(i)) { Database *sdb = f_ptrlistitem_data(i); if(strcmp(db->treename, sdb->treename) == 0) { found = 1; @@ -1359,7 +1359,7 @@ pmlist_iterator_t *pacman_list_iterator_next(pmlist_iterator_t *iterator) { ASSERT(iterator != NULL, return NULL); - return c_cast(cxx_cast(iterator)->next); + return c_cast(f_ptrlistitem_next(cxx_cast(iterator))); } /** Get the data of a list iterator. diff --git a/lib/libpacman/server.cpp b/lib/libpacman/server.cpp index 5131714..4eb43d3 100644 --- a/lib/libpacman/server.cpp +++ b/lib/libpacman/server.cpp @@ -396,7 +396,7 @@ int _pacman_downloadfiles_forreal(Handle *handle, pmlist_t *servers, const char _pacman_log(PM_LOG_DEBUG, _("server check, %d\n"),servers); int count; - for(i = servers, count = 0; i && !done; i = i->next, count++) { + for(i = servers, count = 0; i && !done; i = f_ptrlistitem_next(i), count++) { pm_errno = 0; if (count < skip) continue; /* the caller requested skip of this server */ @@ -404,7 +404,7 @@ int _pacman_downloadfiles_forreal(Handle *handle, pmlist_t *servers, const char server = (pmserver_t*)f_ptrlistitem_data(i); /* get each file in the list */ - for(lp = files; lp; lp = lp->next) { + for(lp = files; lp; lp = f_ptrlistitem_next(lp)) { char *fn = f_stringlistitem_to_str(lp); if(_pacman_list_is_strin(fn, complete)) { diff --git a/lib/libpacman/trans.cpp b/lib/libpacman/trans.cpp index 9238cb1..745fb9d 100644 --- a/lib/libpacman/trans.cpp +++ b/lib/libpacman/trans.cpp @@ -133,12 +133,12 @@ int _pacman_trans_compute_triggers(pmtrans_t *trans) pmlist_t *lp; /* NOTE: Not the most efficient way, but will do until we add some string hash. */ - for(lp = trans->packages; lp; lp = lp->next) { + for(lp = trans->packages; lp; lp = f_ptrlistitem_next(lp)) { Package *pkg = f_ptrlistitem_data(lp); trans->triggers = f_stringlist_append_stringlist(trans->triggers, pkg->triggers()); } - for(lp = trans->syncpkgs; lp; lp = lp->next) { + for(lp = trans->syncpkgs; lp; lp = f_ptrlistitem_next(lp)) { Package *pkg = ((pmsyncpkg_t *)f_ptrlistitem_data(lp))->pkg_new; /* FIXME: might be incomplete */ @@ -199,7 +199,7 @@ pmsyncpkg_t *__pmtrans_t::find(const char *pkgname) const { pmlist_t *i; - for(i = syncpkgs; i != NULL ; i = i->next) { + for(i = syncpkgs; i != NULL ; i = f_ptrlistitem_next(i)) { pmsyncpkg_t *ps = f_ptrlistitem_data(i); if(ps && !strcmp(ps->pkg_name, pkgname)) { @@ -251,7 +251,7 @@ static int check_olddelay(Handle *handle) return(0); } - for(i = handle->dbs_sync; i; i= i->next) { + for(i = handle->dbs_sync; i; i= f_ptrlistitem_next(i)) { Database *db = f_ptrlistitem_data(i); if(db->gettimestamp(&tm) == -1) { continue; @@ -329,7 +329,7 @@ int __pmtrans_t::add(const char *target, pmtranstype_t type, int flags) if(targ) { *targ = '\0'; targ++; - for(i = dbs_sync; i && !spkg; i = i->next) { + for(i = dbs_sync; i && !spkg; i = f_ptrlistitem_next(i)) { Database *dbs = f_ptrlistitem_data(i); if(strcmp(dbs->treename, targline) == 0) { spkg = dbs->find(targ); @@ -349,14 +349,14 @@ int __pmtrans_t::add(const char *target, pmtranstype_t type, int flags) } } else { targ = targline; - for(i = dbs_sync; i && !spkg; i = i->next) { + for(i = dbs_sync; i && !spkg; i = f_ptrlistitem_next(i)) { Database *dbs = f_ptrlistitem_data(i); spkg = dbs->find(targ); } if(spkg == NULL) { /* Search provides */ _pacman_log(PM_LOG_FLOW2, _("target '%s' not found -- looking for provisions"), targ); - for(i = dbs_sync; i && !spkg; i = i->next) { + for(i = dbs_sync; i && !spkg; i = f_ptrlistitem_next(i)) { Database *dbs = f_ptrlistitem_data(i); pmlist_t *p = dbs->whatPackagesProvide(targ); if(p != NULL) { @@ -441,7 +441,7 @@ int __pmtrans_t::add(const char *target, pmtranstype_t type, int flags) /* check if an older version of said package is already in transaction packages. * if so, replace it in the list */ - for(i = packages; i; i = i->next) { + for(i = packages; i; i = f_ptrlistitem_next(i)) { Package *pkg = f_ptrlistitem_data(i); if(strcmp(pkg->name(), pkg_new->name()) == 0) { pkg_queued = pkg; @@ -520,7 +520,7 @@ int __pmtrans_t::prepare(pmlist_t **data) _pacman_trans_compute_triggers(this); if(m_type == PM_TRANS_TYPE_SYNC) { - for(i = syncpkgs; i; i = i->next) { + for(i = syncpkgs; i; i = f_ptrlistitem_next(i)) { pmsyncpkg_t *ps = f_ptrlistitem_data(i); list = f_ptrlist_add(list, ps->pkg_new); } @@ -531,7 +531,7 @@ int __pmtrans_t::prepare(pmlist_t **data) /* Resolve targets dependencies */ EVENT(this, PM_TRANS_EVT_RESOLVEDEPS_START, NULL, NULL); _pacman_log(PM_LOG_FLOW1, _("resolving targets dependencies")); - for(i = syncpkgs; i; i = i->next) { + for(i = syncpkgs; i; i = f_ptrlistitem_next(i)) { Package *spkg = ((pmsyncpkg_t *)f_ptrlistitem_data(i))->pkg_new; if(_pacman_resolvedeps(this, spkg, list, trail, data) == -1) { /* pm_errno is set by resolvedeps */ @@ -540,7 +540,7 @@ int __pmtrans_t::prepare(pmlist_t **data) } } - for(i = list; i; i = i->next) { + for(i = list; i; i = f_ptrlistitem_next(i)) { /* add the dependencies found by resolvedeps to the transaction set */ Package *spkg = f_ptrlistitem_data(i); if(!find(spkg->name())) { @@ -563,13 +563,13 @@ int __pmtrans_t::prepare(pmlist_t **data) /* re-order w.r.t. dependencies */ k = l = NULL; - for(i=syncpkgs; i; i=i->next) { + for(i=syncpkgs; i; i = f_ptrlistitem_next(i)) { pmsyncpkg_t *s = (pmsyncpkg_t*)f_ptrlistitem_data(i); k = f_ptrlist_add(k, s->pkg_new); } m = _pacman_sortbydeps(k, PM_TRANS_TYPE_ADD); - for(i=m; i; i=i->next) { - for(j=syncpkgs; j; j=j->next) { + for(i=m; i; i = f_ptrlistitem_next(i)) { + for(j=syncpkgs; j; j = f_ptrlistitem_next(j)) { pmsyncpkg_t *s = (pmsyncpkg_t*)f_ptrlistitem_data(j); if(s->pkg_new == f_ptrlistitem_data(i)) { l = f_ptrlist_add(l, s); @@ -606,7 +606,7 @@ int __pmtrans_t::prepare(pmlist_t **data) if(!f_ptrlist_empty(deps)) { int errorout = 0; - for(i = deps; i && !errorout; i = i->next) { + for(i = deps; i && !errorout; i = f_ptrlistitem_next(i)) { pmdepmissing_t *miss = f_ptrlistitem_data(i); int found = 0; pmsyncpkg_t *ps; @@ -618,7 +618,7 @@ int __pmtrans_t::prepare(pmlist_t **data) /* check if the conflicting package is one that's about to be removed/replaced. * if so, then just ignore it */ - for(j = syncpkgs; j && !found; j = j->next) { + for(j = syncpkgs; j && !found; j = f_ptrlistitem_next(j)) { ps = f_ptrlistitem_data(j); if(ps->type == PM_SYNC_TYPE_REPLACE) { if(_pacman_pkg_isin(miss->depend.name, ps->data)) { @@ -785,10 +785,10 @@ int __pmtrans_t::prepare(pmlist_t **data) * package that's in our final (upgrade) list. */ /*EVENT(this, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL);*/ - for(i = syncpkgs; i; i = i->next) { + for(i = syncpkgs; i; i = f_ptrlistitem_next(i)) { pmsyncpkg_t *ps = f_ptrlistitem_data(i); if(ps->type == PM_SYNC_TYPE_REPLACE) { - for(j = ps->data; j; j = j->next) { + for(j = ps->data; j; j = f_ptrlistitem_next(j)) { list = f_ptrlist_add(list, f_ptrlistitem_data(j)); } } @@ -798,7 +798,7 @@ int __pmtrans_t::prepare(pmlist_t **data) deps = _pacman_checkdeps(this, PM_TRANS_TYPE_REMOVE, list); if(deps) { int errorout = 0; - for(i = deps; i; i = i->next) { + for(i = deps; i; i = f_ptrlistitem_next(i)) { pmdepmissing_t *miss = f_ptrlistitem_data(i); if(!find(miss->depend.name)) { int pfound = 0; @@ -813,17 +813,17 @@ int __pmtrans_t::prepare(pmlist_t **data) } /* Look through the upset package's dependencies and try to match one up * to a provisio from the package we want to remove */ - for(k = conflictp->depends(); k && !pfound; k = k->next) { + for(k = conflictp->depends(); k && !pfound; k = f_ptrlistitem_next(k)) { pmlist_t *m; - for(m = leavingp->provides(); m && !pfound; m = m->next) { + for(m = leavingp->provides(); m && !pfound; m = f_ptrlistitem_next(m)) { if(!strcmp(f_stringlistitem_to_str(k), f_stringlistitem_to_str(m))) { /* Found a match -- now look through final for a package that * provides the same thing. If none are found, then it truly * is an unresolvable conflict. */ pmlist_t *n, *o; - for(n = syncpkgs; n && !pfound; n = n->next) { + for(n = syncpkgs; n && !pfound; n = f_ptrlistitem_next(n)) { pmsyncpkg_t *sp = f_ptrlistitem_data(n); - for(o = sp->pkg_new->provides(); o && !pfound; o = o->next) { + for(o = sp->pkg_new->provides(); o && !pfound; o = f_ptrlistitem_next(o)) { if(!strcmp(f_stringlistitem_to_str(m), f_stringlistitem_to_str(o))) { /* found matching provisio -- we're good to go */ _pacman_log(PM_LOG_FLOW2, _("found '%s' as a provision for '%s' -- conflict aborted"), @@ -898,7 +898,7 @@ cleanup: if((m_type == PM_TRANS_TYPE_REMOVE) && (flags & PM_TRANS_FLAG_CASCADE)) { while(lp) { pmlist_t *i; - for(i = lp; i; i = i->next) { + for(i = lp; i; i = f_ptrlistitem_next(i)) { pmdepmissing_t *miss = (pmdepmissing_t *)f_ptrlistitem_data(i); Package *pkg_local = db_local->scan(miss->depend.name, INFRQ_ALL); if(pkg_local) { @@ -965,11 +965,11 @@ cleanup: if(m_type & PM_TRANS_TYPE_ADD) { EVENT(this, PM_TRANS_EVT_CLEANUP_START, NULL, NULL); _pacman_log(PM_LOG_FLOW1, _("cleaning up")); - for (lp = packages; lp!=NULL; lp=lp->next) { + for (lp = packages; lp!=NULL; lp = f_ptrlistitem_next(lp)) { Package *pkg_new = (Package *)f_ptrlistitem_data(lp); pmlist_t *rmlist; - for (rmlist=pkg_new->removes(); rmlist!=NULL; rmlist=rmlist->next) { + for (rmlist=pkg_new->removes(); rmlist!=NULL; rmlist = f_ptrlistitem_next(rmlist)) { char rm_fname[PATH_MAX]; snprintf(rm_fname, PATH_MAX, "%s%s", m_handle->root, f_stringlistitem_to_str(rmlist)); @@ -1140,7 +1140,7 @@ int _pacman_fpmpackage_install(Package *pkg, pmtranstype_t type, pmtrans_t *tran /* append the new md5 or sha1 hash to it's respective entry in pkg->backup * (it will be the new orginal) */ - for(lp = pkg->backup(); lp; lp = lp->next) { + for(lp = pkg->backup(); lp; lp = f_ptrlistitem_next(lp)) { char *fn; char *file = f_stringlistitem_to_str(lp); @@ -1270,7 +1270,7 @@ int _pacman_fpmpackage_install(Package *pkg, pmtranstype_t type, pmtrans_t *tran errors++; } /* calculate an md5 or sha1 hash if this is in pkg->backup */ - for(lp = pkg->backup(); lp; lp = lp->next) { + for(lp = pkg->backup(); lp; lp = f_ptrlistitem_next(lp)) { char *fn, *md5, *sha1; char path[PATH_MAX]; char *file = f_stringlistitem_to_str(lp); @@ -1447,11 +1447,11 @@ int __pmtrans_t::commit(pmlist_t **data) retval = 0; FREELIST(*data); int done = 1; - for(i = m_handle->dbs_sync; i; i = i->next) { + for(i = m_handle->dbs_sync; i; i = f_ptrlistitem_next(i)) { struct stat buf; Database *current = f_ptrlistitem_data(i); - for(j = syncpkgs; j; j = j->next) { + for(j = syncpkgs; j; j = f_ptrlistitem_next(j)) { pmsyncpkg_t *ps = f_ptrlistitem_data(j); Package *spkg = ps->pkg_new; Database *dbs = spkg->database(); @@ -1517,7 +1517,7 @@ int __pmtrans_t::commit(pmlist_t **data) if(!(flags & PM_TRANS_FLAG_NOINTEGRITY)) { EVENT(this, PM_TRANS_EVT_INTEGRITY_START, NULL, NULL); - for(i = syncpkgs; i; i = i->next) { + for(i = syncpkgs; i; i = f_ptrlistitem_next(i)) { pmsyncpkg_t *ps = f_ptrlistitem_data(i); retval = _pacman_cachedpkg_check_integrity(ps->pkg_new, this, data); @@ -1556,10 +1556,10 @@ int __pmtrans_t::commit(pmlist_t **data) tr->event.connect(&event); tr->conv.connect(&conv); tr->progress.connect(&progress); - for(i = syncpkgs; i; i = i->next) { + for(i = syncpkgs; i; i = f_ptrlistitem_next(i)) { pmsyncpkg_t *ps = f_ptrlistitem_data(i); if(ps->type == PM_SYNC_TYPE_REPLACE) { - for(j = ps->data; j; j = j->next) { + for(j = ps->data; j; j = f_ptrlistitem_next(j)) { Package *pkg = f_ptrlistitem_data(j); if(!_pacman_pkg_isin(pkg->name(), tr->packages)) { if(tr->add(pkg->name(), tr->m_type, tr->flags) == -1) { @@ -1595,7 +1595,7 @@ int __pmtrans_t::commit(pmlist_t **data) tr->event.connect(&event); tr->conv.connect(&conv); tr->progress.connect(&progress); - for(i = syncpkgs; i; i = i->next) { + for(i = syncpkgs; i; i = f_ptrlistitem_next(i)) { pmsyncpkg_t *ps = f_ptrlistitem_data(i); Package *spkg = ps->pkg_new; char str[PATH_MAX]; @@ -1627,15 +1627,15 @@ int __pmtrans_t::commit(pmlist_t **data) /* propagate replaced packages' requiredby fields to their new owners */ if(replaces) { _pacman_log(PM_LOG_FLOW1, _("updating database for replaced packages' dependencies")); - for(i = syncpkgs; i; i = i->next) { + for(i = syncpkgs; i; i = f_ptrlistitem_next(i)) { pmsyncpkg_t *ps = f_ptrlistitem_data(i); if(ps->type == PM_SYNC_TYPE_REPLACE) { Package *pkg_new = db_local->find(ps->pkg_name); - for(j = ps->data; j; j = j->next) { + for(j = ps->data; j; j = f_ptrlistitem_next(j)) { pmlist_t *k; Package *old = f_ptrlistitem_data(j); /* merge lists */ - for(k = old->requiredby(); k; k = k->next) { + for(k = old->requiredby(); k; k = f_ptrlistitem_next(k)) { if(!_pacman_list_is_strin(f_stringlistitem_to_str(k), pkg_new->requiredby())) { /* replace old's name with new's name in the requiredby's dependency list */ pmlist_t *m; @@ -1647,7 +1647,7 @@ int __pmtrans_t::commit(pmlist_t **data) * here. */ continue; } - for(m = depender->depends(); m; m = m->next) { + for(m = depender->depends(); m; m = f_ptrlistitem_next(m)) { if(!strcmp(f_stringlistitem_to_str(m), old->name())) { FREE(m->m_data); m->m_data = strdup(pkg_new->name()); @@ -1678,7 +1678,7 @@ int __pmtrans_t::commit(pmlist_t **data) if(!varcache && !(flags & PM_TRANS_FLAG_DOWNLOADONLY)) { /* delete packages */ - for(i = files; i; i = i->next) { + for(i = files; i; i = f_ptrlistitem_next(i)) { unlink(f_stringlistitem_to_str(i)); } } @@ -1689,7 +1689,7 @@ int __pmtrans_t::commit(pmlist_t **data) howmany = f_ptrlist_count(packages); - for(targ = packages; targ; targ = targ->next) { + for(targ = packages; targ; targ = f_ptrlistitem_next(targ)) { Package *pkg_new = NULL, *pkg_local = NULL; void *event_arg0 = NULL, *event_arg1 = NULL; pmtranstype_t type = m_type; @@ -1787,7 +1787,7 @@ int __pmtrans_t::commit(pmlist_t **data) /* update dependency packages' REQUIREDBY fields */ _pacman_log(PM_LOG_FLOW2, _("updating dependency packages 'requiredby' fields")); - for(lp = pkg_local->depends(); lp; lp = lp->next) { + for(lp = pkg_local->depends(); lp; lp = f_ptrlistitem_next(lp)) { Package *depinfo = NULL; pmdepend_t depend; char *data; @@ -1850,13 +1850,13 @@ int __pmtrans_t::commit(pmlist_t **data) /* Update the requiredby field by scanning the whole database * looking for packages depending on the package to add */ - for(lp = _pacman_db_get_pkgcache(db_local); lp; lp = lp->next) { + for(lp = _pacman_db_get_pkgcache(db_local); lp; lp = f_ptrlistitem_next(lp)) { Package *tmpp = f_ptrlistitem_data(lp); pmlist_t *tmppm = NULL; if(tmpp == NULL) { continue; } - for(tmppm = tmpp->depends(); tmppm; tmppm = tmppm->next) { + for(tmppm = tmpp->depends(); tmppm; tmppm = f_ptrlistitem_next(tmppm)) { pmdepend_t depend; if(_pacman_splitdep(f_ptrlistitem_data(tmppm), &depend)) { continue; @@ -1888,7 +1888,7 @@ int __pmtrans_t::commit(pmlist_t **data) if(pkg_new->depends()) { _pacman_log(PM_LOG_FLOW2, _("updating dependency packages 'requiredby' fields")); } - for(lp = pkg_new->depends(); lp; lp = lp->next) { + for(lp = pkg_new->depends(); lp; lp = f_ptrlistitem_next(lp)) { Package *depinfo; pmdepend_t depend; if(_pacman_splitdep(f_stringlistitem_to_str(lp), &depend)) { diff --git a/lib/libpacman/trans_sysupgrade.cpp b/lib/libpacman/trans_sysupgrade.cpp index 5cab5e0..4ec2325 100644 --- a/lib/libpacman/trans_sysupgrade.cpp +++ b/lib/libpacman/trans_sysupgrade.cpp @@ -86,12 +86,12 @@ int _pacman_trans_sysupgrade(pmtrans_t *trans) /* check for "recommended" package replacements */ _pacman_log(PM_LOG_FLOW1, _("checking for package replacements")); - for(i = dbs_sync; i; i = i->next) { - for(j = _pacman_db_get_pkgcache(f_ptrlistitem_data(i)); j; j = j->next) { + for(i = dbs_sync; i; i = f_ptrlistitem_next(i)) { + for(j = _pacman_db_get_pkgcache(f_ptrlistitem_data(i)); j; j = f_ptrlistitem_next(j)) { Package *spkg = f_ptrlistitem_data(j); - for(k = spkg->replaces(); k; k = k->next) { + for(k = spkg->replaces(); k; k = f_ptrlistitem_next(k)) { pmlist_t *m; - for(m = _pacman_db_get_pkgcache(db_local); m; m = m->next) { + for(m = _pacman_db_get_pkgcache(db_local); m; m = f_ptrlistitem_next(m)) { Package *lpkg = f_ptrlistitem_data(m); if(!strcmp(f_stringlistitem_to_str(k), lpkg->name())) { _pacman_log(PM_LOG_DEBUG, _("checking replacement '%s' for package '%s'"), f_stringlistitem_to_str(k), spkg->name()); @@ -138,14 +138,14 @@ int _pacman_trans_sysupgrade(pmtrans_t *trans) /* match installed packages with the sync dbs and compare versions */ _pacman_log(PM_LOG_FLOW1, _("checking for package upgrades")); - for(i = _pacman_db_get_pkgcache(db_local); i; i = i->next) { + for(i = _pacman_db_get_pkgcache(db_local); i; i = f_ptrlistitem_next(i)) { int cmp; int replace=0; Package *local = f_ptrlistitem_data(i); Package *spkg = NULL; pmsyncpkg_t *ps; - for(j = dbs_sync; !spkg && j; j = j->next) { + for(j = dbs_sync; !spkg && j; j = f_ptrlistitem_next(j)) { spkg = ((Database *)f_ptrlistitem_data(j))->find(local->name()); } if(spkg == NULL) { @@ -154,7 +154,7 @@ int _pacman_trans_sysupgrade(pmtrans_t *trans) } /* we don't care about a to-be-replaced package's newer version */ - for(j = trans->syncpkgs; j && !replace; j=j->next) { + for(j = trans->syncpkgs; j && !replace; j = f_ptrlistitem_next(j)) { ps = f_ptrlistitem_data(j); if(ps->type == PM_SYNC_TYPE_REPLACE) { if(_pacman_pkg_isin(spkg->name(), ps->data)) { diff --git a/lib/libpacman/util.cpp b/lib/libpacman/util.cpp index 5e7dfb0..7a3740d 100644 --- a/lib/libpacman/util.cpp +++ b/lib/libpacman/util.cpp @@ -128,7 +128,7 @@ static int list_startswith(char *needle, pmlist_t *haystack) { pmlist_t *i; - for (i = haystack; i; i = i->next) { + for (i = haystack; i; i = f_ptrlistitem_next(i)) { cache_t *c = f_ptrlistitem_data(i); if (!strncmp(c->str, needle, strlen(c->str))) { c->hit = 1; @@ -198,7 +198,7 @@ int _pacman_unpack(const char *archive, const char *prefix, const char *fn) archive_read_finish (_archive); /* finally delete the old ones */ - for (i = cache; i; i = i->next) { + for (i = cache; i; i = f_ptrlistitem_next(i)) { cache_t *c = f_ptrlistitem_data(i); if (!c->hit) { snprintf(expath, PATH_MAX, "%s/%s", prefix, c->str); @@ -484,11 +484,11 @@ int _pacman_check_freespace(pmtrans_t *trans, pmlist_t **data) pmlist_t *i; long long pkgsize=0, freespace; - for(i = trans->packages; i; i = i->next) { + for(i = trans->packages; i; i = f_ptrlistitem_next(i)) { Package *pkg = f_ptrlistitem_data(i); pkgsize += pkg->size; } - for(i = trans->syncpkgs; i; i = i->next) { + for(i = trans->syncpkgs; i; i = f_ptrlistitem_next(i)) { pmsyncpkg_t *ps = f_ptrlistitem_data(i); if(ps->type != PM_SYNC_TYPE_REPLACE) { diff --git a/lib/libpacman/util/flist.h b/lib/libpacman/util/flist.h index 282b219..3476c66 100644 --- a/lib/libpacman/util/flist.h +++ b/lib/libpacman/util/flist.h @@ -29,7 +29,7 @@ /* Chained list struct */ struct __pmlist_t { struct __pmlist_t *m_previous; - struct __pmlist_t *next; + struct __pmlist_t *m_next; void *m_data; }; diff --git a/lib/libpacman/util/fptrlist.c b/lib/libpacman/util/fptrlist.c index c882ec3..6970068 100644 --- a/lib/libpacman/util/fptrlist.c +++ b/lib/libpacman/util/fptrlist.c @@ -40,19 +40,19 @@ FPtrList *f_ptrlist_add_sorted(FPtrList *list, void *data, _pacman_fn_cmp fn) while(iter != end) { if(fn(f_ptrlistitem_data(add), f_ptrlistitem_data(iter)) <= 0) break; previous = iter; - iter = iter->next; + iter = iter->m_next; } /* Insert node before insertion point. */ add->m_previous = previous; - add->next = iter; + add->m_next = iter; if(iter != NULL) { iter->m_previous = add; /* Not at end. */ } if(previous != NULL) { - previous->next = add; /* In middle. */ + previous->m_next = add; /* In middle. */ } else { list = add; /* Start or empty, new list head. */ } @@ -81,20 +81,20 @@ FPtrList *_pacman_list_remove(FPtrList *haystack, void *needle, _pacman_fn_cmp f if(fn(needle, i->m_data) == 0) { break; } - i = i->next; + i = i->m_next; } if(i) { /* we found a matching item */ - if(i->next) { - i->next->m_previous = i->m_previous; + if(i->m_next) { + i->m_next->m_previous = i->m_previous; } if(i->m_previous) { - i->m_previous->next = i->next; + i->m_previous->m_next = i->m_next; } if(i == haystack) { /* The item found is the first in the chain */ - haystack = haystack->next; + haystack = haystack->m_next; } if(data) { @@ -173,9 +173,9 @@ int f_ptrlistitem_insert_after(FPtrListItem *self, FPtrListItem *previous) ASSERT(self != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); ASSERT(previous != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); - next = previous->next; - previous->next = self; - self->next = next; + next = previous->m_next; + previous->m_next = self; + self->m_next = next; self->m_previous = previous; #ifndef F_NOCOMPAT if (next != NULL) @@ -188,7 +188,7 @@ FPtrListItem *f_ptrlistitem_next(FPtrListItem *self) { ASSERT(self != NULL, RET_ERR(PM_ERR_WRONG_ARGS, NULL)); - return self->next; + return self->m_next; } FPtrListItem *f_ptrlistitem_previous(FPtrListItem *self) @@ -246,12 +246,12 @@ FPtrList *f_ptrlist_append(FPtrList *list, void *data) if(lp == ptr && lp->m_data == NULL) { /* nada */ } else { - lp->next = f_ptrlist_new(); - if(lp->next == NULL) { + lp->m_next = f_ptrlist_new(); + if(lp->m_next == NULL) { return(NULL); } - lp->next->m_previous = lp; - lp = lp->next; + lp->m_next->m_previous = lp; + lp = lp->m_next; } lp->m_data = data; @@ -294,7 +294,7 @@ int f_ptrlist_count(const FPtrList *self) const FPtrListItem *it; int i; - for(i = 0, it = f_ptrlist_first_const(self); it != f_ptrlist_end_const(self); it = it->next, i++); + for(i = 0, it = f_ptrlist_first_const(self); it != f_ptrlist_end_const(self); it = it->m_next, i++); return i; } @@ -323,7 +323,7 @@ const FPtrListItem *f_ptrlist_find_const(const FPtrList *list, FPtrListItemCompa const FPtrListItem *end = f_ptrlist_end_const(list); const FPtrListItem *it; - for(it = f_ptrlist_first_const(list); it != end; it = it->next) { + for(it = f_ptrlist_first_const(list); it != end; it = it->m_next) { if(comparator(it, comparator_data) == 0) { break; } @@ -345,7 +345,7 @@ void f_list_foreach(const FPtrList *list, FPtrListItemVisitorFunc visitor, void { const FPtrListItem *it; - for(it = f_ptrlist_first_const(list); it != f_ptrlist_end_const(list); it = it->next) { + for(it = f_ptrlist_first_const(list); it != f_ptrlist_end_const(list); it = it->m_next) { visitor((FPtrListItem *)it, visitor_data); } } @@ -362,8 +362,8 @@ const FPtrListItem *f_ptrlist_last_const(const FPtrList *self) ASSERT(self != NULL, RET_ERR(PM_ERR_WRONG_ARGS, NULL)); it = f_ptrlist_first_const(self); - while(it->next != f_ptrlist_end_const(self)) { - it = it->next; + while(it->m_next != f_ptrlist_end_const(self)) { + it = it->m_next; } return it; } diff --git a/lib/libpacman/util/stringlist.c b/lib/libpacman/util/stringlist.c index 9d635f8..1f01592 100644 --- a/lib/libpacman/util/stringlist.c +++ b/lib/libpacman/util/stringlist.c @@ -36,7 +36,7 @@ int _pacman_list_is_strin(const char *needle, FStringList *haystack) { FStringList *lp; - for(lp = haystack; lp; lp = lp->next) { + for(lp = haystack; lp; lp = f_ptrlistitem_next(lp)) { const char *str = f_stringlistitem_to_str(lp); if(str && !strcmp(str, needle)) { @@ -56,7 +56,7 @@ FStringList *_pacman_list_remove_dupes(FStringList *list) { FStringList *i, *newlist = NULL; - for(i = list; i; i = i->next) { + for(i = list; i; i = f_ptrlistitem_next(i)) { const char *str = f_stringlistitem_to_str(i); if(!_pacman_list_is_strin(str, newlist)) { @@ -71,7 +71,7 @@ FStringList *_pacman_list_strdup(FStringList *list) FStringList *newlist = NULL; FStringList *lp; - for(lp = list; lp; lp = lp->next) { + for(lp = list; lp; lp = f_ptrlistitem_next(lp)) { newlist = f_stringlist_append(newlist, f_stringlistitem_to_str(lp)); } @@ -128,7 +128,7 @@ FStringList *f_stringlist_append_stringlist(FStringList *dest, const FStringList { const FStringList *lp; - for(lp = src; lp; lp = lp->next) { + for(lp = src; lp; lp = f_ptrlistitem_next(lp)) { dest = f_stringlist_append(dest, f_stringlistitem_to_str(lp)); } return dest; diff --git a/src/pacman-g2/deptest.c b/src/pacman-g2/deptest.c index ef3e9b8..763f27e 100644 --- a/src/pacman-g2/deptest.c +++ b/src/pacman-g2/deptest.c @@ -78,7 +78,7 @@ int deptestpkg(list_t *targets) goto cleanup; } strcpy(str, "name=dummy|version=1.0-1"); - for(i = targets; i; i = i->next) { + for(i = targets; i; i = list_next(i)) { str = (char *)realloc(str, strlen(str)+8+strlen(list_data(i))+1); strcat(str, "|depend="); strcat(str, list_data(i)); diff --git a/src/pacman-g2/list.c b/src/pacman-g2/list.c index 0b7925f..a0ed139 100644 --- a/src/pacman-g2/list.c +++ b/src/pacman-g2/list.c @@ -35,7 +35,7 @@ void list_free(list_t *list) list_t *ptr, *it = list; while(it) { - ptr = it->next; + ptr = list_next(it); free(list_data(it)); free(it); it = ptr; @@ -49,7 +49,7 @@ int list_is_strin(char *needle, list_t *haystack) { list_t *lp; - for(lp = haystack; lp; lp = lp->next) { + for(lp = haystack; lp; lp = list_next(lp)) { char *str = list_data(lp); if(str && !strcmp(str, needle)) { @@ -70,7 +70,7 @@ void list_display(const char *title, const FStringList *list) printf("%s ", title); if(list) { - for(lp = list, cols = len; lp; lp = lp->next) { + for(lp = list, cols = len; lp; lp = list_next(lp)) { int s = strlen((char *)list_data(lp))+1; if(s+cols >= maxcols) { int i; diff --git a/src/pacman-g2/list.h b/src/pacman-g2/list.h index a2db75e..0aafa64 100644 --- a/src/pacman-g2/list.h +++ b/src/pacman-g2/list.h @@ -33,6 +33,7 @@ void list_free(list_t *list); #define list_add f_ptrlist_add #define list_count f_ptrlist_count #define list_data f_ptrlistitem_data +#define list_next f_ptrlistitem_next int list_is_strin(char *needle, list_t *haystack); void list_display(const char *title, const FStringList *list); diff --git a/src/pacman-g2/pacman-g2.c b/src/pacman-g2/pacman-g2.c index 2d2ce14..5b681d4 100644 --- a/src/pacman-g2/pacman-g2.c +++ b/src/pacman-g2/pacman-g2.c @@ -586,7 +586,7 @@ int main(int argc, char *argv[]) FREE(config->cachedir); pacman_get_option(PM_OPT_CACHEDIR, (long *)&config->cachedir); - for(lp = config->op_s_ignore; lp; lp = lp->next) { + for(lp = config->op_s_ignore; lp; lp = list_next(lp)) { if(pacman_set_option(PM_OPT_IGNOREPKG, (long)list_data(lp)) == -1) { ERR(NL, _("failed to set option IGNOREPKG (%s)\n"), pacman_strerror(pm_errno)); cleanup(1); diff --git a/src/pacman-g2/ps.c b/src/pacman-g2/ps.c index 40cab4e..8b69022 100644 --- a/src/pacman-g2/ps.c +++ b/src/pacman-g2/ps.c @@ -213,7 +213,7 @@ int pspkg(int countonly) list_t* ret = ps_parse(fpout); - for (i = ret; i; i = i->next) { + for (i = ret; i; i = list_next(i)) { ps_t *ps = list_data(i); if (!ps) continue; diff --git a/src/pacman-g2/query.c b/src/pacman-g2/query.c index b5fe792..073d459 100644 --- a/src/pacman-g2/query.c +++ b/src/pacman-g2/query.c @@ -51,7 +51,7 @@ int querypkg(list_t *targets) int done = 0, errors = 0; if(config->op_q_search) { - for(i = targets; i; i = i->next) { + for(i = targets; i; i = list_next(i)) { pacman_set_option(PM_OPT_NEEDLES, (long)list_data(i)); } ret = pacman_db_search(db_local); @@ -87,11 +87,11 @@ int querypkg(list_t *targets) return(1); } - for(targ = targets; !done; targ = (targ ? targ->next : NULL)) { + for(targ = targets; !done; targ = (targ ? list_next(targ) : NULL)) { if(targets == NULL) { done = 1; } else { - if(targ->next == NULL) { + if(list_next(targ) == NULL) { done = 1; } package = list_data(targ); @@ -201,7 +201,7 @@ int querypkg(list_t *targets) } if(config->op_q_foreign) { int match = 0; - for(i = pmc_syncs; i; i = i->next) { + for(i = pmc_syncs; i; i = list_next(i)) { PM_DB *db = list_data(i); for(j = pacman_db_getpkgcache(db); j; j = pacman_list_next(j)) { PM_PKG *pkg = pacman_list_getdata(j); diff --git a/src/pacman-g2/sync.c b/src/pacman-g2/sync.c index 0b1d74c..54b482e 100644 --- a/src/pacman-g2/sync.c +++ b/src/pacman-g2/sync.c @@ -60,7 +60,7 @@ static int sync_synctree(int level, list_t *syncs) list_t *i; int success = 0, ret; - for(i = syncs; i; i = i->next) { + for(i = syncs; i; i = list_next(i)) { PM_DB *db = list_data(i); ret = pacman_db_update((level < 2 ? 0 : 1), db); @@ -86,11 +86,11 @@ static int sync_search(list_t *syncs, list_t *targets) PM_LIST *ret; PM_PKG *ipkg; - for(i = syncs; i; i = i->next) { + for(i = syncs; i; i = list_next(i)) { PM_DB *db = list_data(i); PM_LIST *lp; - for(j = targets; j; j = j->next) { + for(j = targets; j; j = list_next(j)) { pacman_set_option(PM_OPT_NEEDLES, (long)list_data(j)); } ret = pacman_db_search(db); @@ -126,9 +126,9 @@ static int sync_group(int level, list_t *syncs, list_t *targets) int ret = 0; if(targets) { - for(i = targets; i; i = i->next) { + for(i = targets; i; i = list_next(i)) { int found = 0; - for(j = syncs; j; j = j->next) { + for(j = syncs; j; j = list_next(j)) { PM_DB *db = list_data(j); PM_GRP *grp = pacman_db_readgrp(db, list_data(i)); @@ -144,7 +144,7 @@ static int sync_group(int level, list_t *syncs, list_t *targets) } } } else { - for(j = syncs; j; j = j->next) { + for(j = syncs; j; j = list_next(j)) { PM_DB *db = list_data(j); PM_LIST *lp; @@ -167,10 +167,10 @@ static int sync_info(list_t *syncs, list_t *targets) list_t *i, *j; if(targets) { - for(i = targets; i; i = i->next) { + for(i = targets; i; i = list_next(i)) { int found = 0; - for(j = syncs; j && !found; j = j->next) { + for(j = syncs; j && !found; j = list_next(j)) { PM_DB *db = list_data(j); PM_LIST *lp; @@ -190,7 +190,7 @@ static int sync_info(list_t *syncs, list_t *targets) } } } else { - for(j = syncs; j; j = j->next) { + for(j = syncs; j; j = list_next(j)) { PM_DB *db = list_data(j); PM_LIST *lp; @@ -210,11 +210,11 @@ static int sync_list(list_t *syncs, list_t *targets) list_t *ls = NULL; if(targets) { - for(i = targets; i; i = i->next) { + for(i = targets; i; i = list_next(i)) { list_t *j; PM_DB *db = NULL; - for(j = syncs; j && !db; j = j->next) { + for(j = syncs; j && !db; j = list_next(j)) { PM_DB *d = list_data(j); if(strcmp(list_data(i), (char *)pacman_db_getinfo(d, PM_DB_TREENAME)) == 0) { @@ -234,7 +234,7 @@ static int sync_list(list_t *syncs, list_t *targets) ls = syncs; } - for(i = ls; i; i = i->next) { + for(i = ls; i; i = list_next(i)) { PM_LIST *lp; PM_DB *db = list_data(i); @@ -372,7 +372,7 @@ int syncpkg(list_t *targets) } } else { /* process targets */ - for(i = targets; i; i = i->next) { + for(i = targets; i; i = list_next(i)) { char *targ = list_data(i); if(pacman_trans_addtarget(pacman_get_trans(), PM_TRANS_TYPE_SYNC, targ, config->flags) == -1) { PM_GRP *grp = NULL; @@ -388,7 +388,7 @@ int syncpkg(list_t *targets) goto cleanup; } /* target not found: check if it's a group */ - for(j = pmc_syncs; j; j = j->next) { + for(j = pmc_syncs; j; j = list_next(j)) { PM_DB *db = list_data(j); grp = pacman_db_readgrp(db, targ); if(grp) { @@ -402,11 +402,11 @@ int syncpkg(list_t *targets) pkgs = PM_LIST_remove_dupes(pmpkgs); list_display(" ", pkgs); if(yesno(_(":: Install whole content? [Y/n] "))) { - for(k = pkgs; k; k = k->next) { + for(k = pkgs; k; k = list_next(k)) { targets = list_add(targets, strdup(list_data(k))); } } else { - for(k = pkgs; k; k = k->next) { + for(k = pkgs; k; k = list_next(k)) { char *pkgname = list_data(k); if(yesno(_(":: Install %s from group %s? [Y/n] "), pkgname, targ)) { targets = list_add(targets, strdup(pkgname)); @@ -418,7 +418,7 @@ int syncpkg(list_t *targets) } /* targ is not a group, see if it's a regex */ if(!found && config->regex) { - for(j = pmc_syncs; j; j = j->next) { + for(j = pmc_syncs; j; j = list_next(j)) { PM_DB *db = list_data(j); PM_LIST *k; for(k = pacman_db_getpkgcache(db); k; k = pacman_list_next(k)) { @@ -441,7 +441,7 @@ int syncpkg(list_t *targets) PM_LIST *k = NULL; PM_PKG *pkg; char *pname; - for(j = pmc_syncs; j && !k; j = j->next) { + for(j = pmc_syncs; j && !k; j = list_next(j)) { PM_DB *db = list_data(j); k = pacman_db_whatprovides(db, targ); pkg = (PM_PKG*)pacman_list_getdata(pacman_list_first(k)); diff --git a/src/pacman-g2/trans.c b/src/pacman-g2/trans.c index 755f522..fe3c38c 100644 --- a/src/pacman-g2/trans.c +++ b/src/pacman-g2/trans.c @@ -394,7 +394,7 @@ int trans_commit(pmtranstype_t transtype, list_t *targets) case PM_TRANS_TYPE_UPGRADE: /* Check for URL targets and process them */ - for(i = targets; i; i = i->next) { + for(i = targets; i; i = list_next(i)) { if(strstr(list_data(i), "://")) { char *str = pacman_fetch_pkgurl(list_data(i)); if(str == NULL) { @@ -411,7 +411,7 @@ int trans_commit(pmtranstype_t transtype, list_t *targets) /* If the target is a group, ask if its packages should be removed * (the library can't remove groups for now) */ - for(i = targets; i; i = i->next) { + for(i = targets; i; i = list_next(i)) { PM_GRP *grp; grp = pacman_db_readgrp(db_local, list_data(i)); @@ -451,7 +451,7 @@ int trans_commit(pmtranstype_t transtype, list_t *targets) } /* and add targets to it */ MSG(NL, _("loading package data... ")); - for(i = finaltargs; i; i = i->next) { + for(i = finaltargs; i; i = list_next(i)) { if(pacman_trans_addtarget(pacman_get_trans(), transtype, list_data(i), config->flags) == -1) { int match = 0; diff --git a/src/pacman-g2/util.c b/src/pacman-g2/util.c index a4c2129..82c62c5 100644 --- a/src/pacman-g2/util.c +++ b/src/pacman-g2/util.c @@ -94,7 +94,7 @@ char *buildstring(list_t *strlist) int size = 1; list_t *lp; - for(lp = strlist; lp; lp = lp->next) { + for(lp = strlist; lp; lp = list_next(lp)) { size += strlen(list_data(lp)) + 1; } str = (char *)malloc(size); @@ -102,7 +102,7 @@ char *buildstring(list_t *strlist) ERR(NL, _("failed to allocated %d bytes\n"), size); } str[0] = '\0'; - for(lp = strlist; lp; lp = lp->next) { + for(lp = strlist; lp; lp = list_next(lp)) { strcat(str, list_data(lp)); strcat(str, " "); } diff --git a/src/pacman-g2/vercmp.c b/src/pacman-g2/vercmp.c index 6bea674..288d499 100644 --- a/src/pacman-g2/vercmp.c +++ b/src/pacman-g2/vercmp.c @@ -35,8 +35,8 @@ int vercmp(list_t *targets) { // FIXME: should count targets - if(targets != NULL && list_data(targets) && targets->next && list_data(targets->next)) { - int ret = pacman_pkg_vercmp(list_data(targets), list_data(targets->next)); + if(targets != NULL && list_data(targets) && list_next(targets) && list_data(list_next(targets))) { + int ret = pacman_pkg_vercmp(list_data(targets), list_data(list_next(targets))); printf("%d\n", ret); return(ret); } _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
