From d03b57f459fb9ab9288991a70c4e7297a7c1d150 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 9 Jan 2011 20:36:42 -0600 Subject: Remove need for floating point division in backend All of these can be done with integer division; the only slightly interesting part is ensuring we round up like before with calling the ceil() function. We can also remove the math library from requirements; now that the only ceil() calls are gone, we don't need this anymore. Signed-off-by: Dan McGee --- lib/libalpm/conflict.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/conflict.c') diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 0eaf4373..fc25e7d3 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -425,8 +425,8 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans, continue; } - double percent = (double)current / (double)numtargs; - PROGRESS(trans, PM_TRANS_PROGRESS_CONFLICTS_START, "", (int)(percent * 100), + int percent = (current * 100) / numtargs; + PROGRESS(trans, PM_TRANS_PROGRESS_CONFLICTS_START, "", percent, numtargs, current); /* CHECK 1: check every target against every target */ _alpm_log(PM_LOG_DEBUG, "searching for file conflicts: %s\n", -- cgit v1.2.3