From ec7d6955b821c51a28efce31268c9c23cb1b5928 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 26 Apr 2007 20:11:30 -0400 Subject: Remove FREESYNC macro and correctly type _alpm_sync_free Signed-off-by: Dan McGee --- lib/libalpm/sync.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/libalpm/sync.c') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index de235d71..73c61873 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -74,10 +74,8 @@ pmsyncpkg_t *_alpm_sync_new(int type, pmpkg_t *spkg, void *data) return(sync); } -void _alpm_sync_free(void *data) +void _alpm_sync_free(pmsyncpkg_t *sync) { - pmsyncpkg_t *sync = data; - ALPM_LOG_FUNC; if(sync == NULL) { @@ -90,6 +88,7 @@ void _alpm_sync_free(void *data) FREEPKG(sync->data); } FREE(sync); + sync = NULL; } /* Find recommended replacements for packages during a sync. @@ -433,7 +432,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync sync = _alpm_sync_find(trans->packages, pkgname); trans->packages = alpm_list_remove(trans->packages, sync, syncpkg_cmp, &vpkg); - FREESYNC(vpkg); + _alpm_sync_free(vpkg); } } } @@ -565,7 +564,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync void *vpkg; _alpm_log(PM_LOG_DEBUG, _("removing '%s' from target list"), rsync->pkg->name); trans->packages = alpm_list_remove(trans->packages, rsync, syncpkg_cmp, &vpkg); - FREESYNC(vpkg); + _alpm_sync_free(vpkg); continue; } } @@ -602,7 +601,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync void *vpkg; _alpm_log(PM_LOG_DEBUG, _("removing '%s' from target list"), miss->depend.name); trans->packages = alpm_list_remove(trans->packages, rsync, syncpkg_cmp, &vpkg); - FREESYNC(vpkg); + _alpm_sync_free(vpkg); } } else { /* abort */ -- cgit v1.2.3-54-g00ecf