Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=c4418a0088c42086eba14802554e21422949560c
commit c4418a0088c42086eba14802554e21422949560c Author: Michel Hermier <[email protected]> Date: Fri Sep 5 16:01:35 2014 +0200 libpacman: Remove some f_ptrlist_new calls within the c++ code. diff --git a/lib/libpacman/deps.cpp b/lib/libpacman/deps.cpp index fd200c6..bbb45d4 100644 --- a/lib/libpacman/deps.cpp +++ b/lib/libpacman/deps.cpp @@ -725,7 +725,7 @@ int inList(FPtrList *lst, char *lItem) { extern "C" { int pacman_output_generate(FPtrList *targets, FPtrList *dblist) { - FPtrList *found = f_ptrlist_new(); + FPtrList found; Package *pkg = NULL; char *match = NULL; int foundMatch = 0; @@ -747,13 +747,13 @@ int pacman_output_generate(FPtrList *targets, FPtrList *dblist) { continue; } strcpy(fullDep, depend.name); - if(!inList(found, fullDep) && !inList(targets, fullDep)) { + if(!inList(&found, fullDep) && !inList(targets, fullDep)) { targets = targets->add(fullDep); } } - if(!inList(found,pname)) { + if(!inList(&found,pname)) { printf("%s ", pname); - found = found->add(pname); + found.add(pname); } FREE(match); } @@ -762,7 +762,6 @@ int pacman_output_generate(FPtrList *targets, FPtrList *dblist) { db->rewind(); } while(foundMatch); } - FREELISTPTR(found); FREELISTPTR(targets); printf("\n"); return 0; diff --git a/lib/libpacman/trans_sysupgrade.cpp b/lib/libpacman/trans_sysupgrade.cpp index 9e12241..3918636 100644 --- a/lib/libpacman/trans_sysupgrade.cpp +++ b/lib/libpacman/trans_sysupgrade.cpp @@ -116,7 +116,7 @@ int _pacman_trans_sysupgrade(pmtrans_t *trans) /* none found -- enter pkg into the final sync list */ ps = new __pmsyncpkg_t(PM_SYNC_TYPE_REPLACE, spkg, NULL); lpkg->acquire(); - ps->data = f_ptrlist_new(); + ps->data = new FPtrList(); ps->data = ((FPtrList *)ps->data)->add(lpkg); trans->syncpkgs.add(ps); } _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
