From df494a7e517281f21fde265bc31badae3245bb26 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sun, 1 Jul 2018 22:51:21 +0900 Subject: transaction_apply: use float for quotient Pre-dividing 1000/60 would lose 2/3 due to round-up Found through static analysis --- sway/desktop/transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index d2932c87..cb524999 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c @@ -186,8 +186,8 @@ static void transaction_apply(struct sway_transaction *transaction) { (now.tv_nsec - commit->tv_nsec) / 1000000.0; float ms_total = ms_arranging + ms_waiting; wlr_log(L_DEBUG, "Transaction %p: %.1fms arranging, %.1fms waiting, " - "%.1fms total (%.1f frames if 60Hz)", transaction, - ms_arranging, ms_waiting, ms_total, ms_total / (1000 / 60)); + "%.1fms total (%.1f frames if 60Hz)", transaction, + ms_arranging, ms_waiting, ms_total, ms_total / (1000.0f / 60)); } // Apply the instruction state to the container's current state -- cgit v1.2.3-54-g00ecf