From f966f3a8344cd96bd675c79a5c470c66920b890c Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Wed, 8 Dec 2010 15:13:36 +1000 Subject: Use size_t for alpm_list sizes There is a lot of swtiching between size_t and int for alpm_list sizes in the codebase. Start converting these to all be size_t by adjusting the return type of alpm_list_count and fixing all additional warnings given by -Wconversion that are generated by this change. Dan: a few more small changes to ensure things compile, adjusting some printf format string characters to accommodate the larger size on x86_64. Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- lib/libalpm/remove.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libalpm/remove.c') diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index be349977..bcc8dc45 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -369,7 +369,7 @@ int _alpm_remove_packages(pmtrans_t *trans, pmdb_t *db) { pmpkg_t *info; alpm_list_t *targ, *lp; - int pkg_count; + size_t pkg_count; ALPM_LOG_FUNC; @@ -383,7 +383,7 @@ int _alpm_remove_packages(pmtrans_t *trans, pmdb_t *db) char scriptlet[PATH_MAX]; info = (pmpkg_t*)targ->data; const char *pkgname = NULL; - int targcount = alpm_list_count(targ); + size_t targcount = alpm_list_count(targ); if(handle->trans->state == STATE_INTERRUPTED) { return(0); @@ -414,9 +414,9 @@ int _alpm_remove_packages(pmtrans_t *trans, pmdb_t *db) } } - int filenum = alpm_list_count(files); + size_t filenum = alpm_list_count(files); alpm_list_t *newfiles; - _alpm_log(PM_LOG_DEBUG, "removing %d files\n", filenum); + _alpm_log(PM_LOG_DEBUG, "removing %ld files\n", (unsigned long)filenum); /* init progress bar */ PROGRESS(trans, PM_TRANS_PROGRESS_REMOVE_START, info->name, 0, -- cgit v1.2.3-24-g4f1b