From 4ceda1908bf49507b3abd205b2047ae3dfb124b9 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Wed, 1 Feb 2017 18:09:17 +0200 Subject: [PATCH] Fix OS-X compiler warning rdo.c:475:25: warning: absolute value function 'abs' given an argument of type 'int64_t' (aka 'long long') but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value] current.cost = -abs(quant_cost_in_bits) + (bits << PRECISION_INC); ^ rdo.c:475:25: note: use function 'llabs' instead current.cost = -abs(quant_cost_in_bits) + (bits << PRECISION_INC); --- src/rdo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rdo.c b/src/rdo.c index 48faf5ce..3697eeab 100644 --- a/src/rdo.c +++ b/src/rdo.c @@ -472,7 +472,7 @@ void kvz_rdoq_sign_hiding( // Add sign bit, other bits and sig_coeff goes to one. int bits = CTX_FRAC_ONE_BIT + sh_rates->inc[current.pos] + sh_rates->sig_coeff_inc[current.pos]; - current.cost = -abs(quant_cost_in_bits) + (bits << PRECISION_INC); + current.cost = -llabs(quant_cost_in_bits) + (bits << PRECISION_INC); current.change = 1; if (coeff_scan < first_nz_scan) {