FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 05-01-2008, 10:26 PM
Nagy Gabor
 
Default Unify the order of alpm_list_fn_cmp parameters

>From 82de17753e8be6c125781e331cd8b526876008fb Mon Sep 17 00:00:00 2001
From: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Date: Fri, 2 May 2008 00:25:08 +0200
Subject: [PATCH] Unify the order of alpm_list_fn_cmp parameters

In some cases we pass tricky asymmetric alpm_list_fn_cmp functions to alpm_list_find
and alpm_list_remove, and the order of parameters wasn't coherent.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
---
lib/libalpm/alpm_list.c | 2 +-
lib/libalpm/db.c | 2 +-
lib/libalpm/deps.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/libalpm/alpm_list.c b/lib/libalpm/alpm_list.c
index ae54e19..ecfef25 100644
--- a/lib/libalpm/alpm_list.c
+++ b/lib/libalpm/alpm_list.c
@@ -577,7 +577,7 @@ void SYMEXPORT *alpm_list_find(const alpm_list_t *haystack, const void *needle,
{
const alpm_list_t *lp = haystack;
while(lp) {
- if(lp->data && fn(lp->data, needle) == 0) {
+ if(lp->data && fn(needle, lp->data) == 0) {
return(lp->data);
}
lp = lp->next;
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index e8ae11a..bc11ad7 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -627,7 +627,7 @@ pmdb_t *_alpm_db_register_sync(const char *treename)
*
* @return "provision.name" == needle (as string)
*/
-int _alpm_prov_cmp(const void *provision, const void *needle)
+int _alpm_prov_cmp(const void *needle, const void *provision)
{
char *tmpptr;
char *provname = strdup(provision);
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 9cae0e2..bbc8cd5 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -195,7 +195,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int reverse)
}

/* Little helper function for alpm_list_find */
-static int satisfycmp(const void *pkg, const void *depend)
+static int satisfycmp(const void *depend, const void *pkg)
{
return(!alpm_depcmp((pmpkg_t*) pkg, (pmdepend_t*) depend));
}
--
1.5.3.8


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 10:43 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org