From fd19feefa421c7dcc374770d46d7bf729abcb05b Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 15 Dec 2014 18:55:03 +0100 Subject: [PATCH] bliss: Remove unnecessary cast to double Coverity is still not happy when the result of an integer division is assigned to a double (without e.g. casting the result to an int first to indicate the intent). The shift should avoid this issue. --- src/libstrongswan/plugins/bliss/bliss_huffman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstrongswan/plugins/bliss/bliss_huffman.c b/src/libstrongswan/plugins/bliss/bliss_huffman.c index 5b7a7e0c88..647234fd8a 100644 --- a/src/libstrongswan/plugins/bliss/bliss_huffman.c +++ b/src/libstrongswan/plugins/bliss/bliss_huffman.c @@ -276,7 +276,7 @@ int main(int argc, char *argv[]) /* Probability distribution for z2 */ dx = 1 << set->d; k_top = 1 + set->B_inf / dx; - x = (double)(dx/2) - 0.5; + x = (dx >> 1) - 0.5; p_sum = 0; for (k = 0; k < k_top; k++) -- 2.47.2