[pacman-dev] [PATCH] Explicitly test time difference is greater than zero

Allan McRae allan at archlinux.org
Wed Dec 8 00:18:09 EST 2010


We are comparing a floating point number so should use an inequality
rather than implicitly testing != 0.

Prevents warning given by -Wfloat-equal.

Signed-off-by: Allan McRae <allan at archlinux.org>
---
 src/pacman/callback.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index f585b28..c8f604f 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -352,7 +352,7 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent,
 		timediff = get_update_timediff(0);
 	}
 
-	if(percent > 0 && percent < 100 && !timediff) {
+	if(percent > 0 && percent < 100 && timediff > 0) {
 		/* only update the progress bar when
 		 * a) we first start
 		 * b) we end the progress
-- 
1.7.3.3



More information about the pacman-dev mailing list