From: Tobias Brunner Date: Mon, 15 Dec 2014 17:55:03 +0000 (+0100) Subject: bliss: Remove unnecessary cast to double X-Git-Tag: 5.2.2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd19feefa421c7dcc374770d46d7bf729abcb05b;p=thirdparty%2Fstrongswan.git 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. --- 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++)