[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] 06c4cc: qht: Fix threshold rate calculation
From: |
Richard Henderson |
Subject: |
[Qemu-commits] [qemu/qemu] 06c4cc: qht: Fix threshold rate calculation |
Date: |
Fri, 19 Jun 2020 12:00:27 -0700 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: 06c4cc3660b366278bdc7bc8b6677032d7b1118c
https://github.com/qemu/qemu/commit/06c4cc3660b366278bdc7bc8b6677032d7b1118c
Author: Richard Henderson <richard.henderson@linaro.org>
Date: 2020-06-19 (Fri, 19 Jun 2020)
Changed paths:
M tests/qht-bench.c
Log Message:
-----------
qht: Fix threshold rate calculation
tests/qht-bench.c:287:29: error: implicit conversion from 'unsigned long'
to 'double' changes value from 18446744073709551615
to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion]
*threshold = rate * UINT64_MAX;
~ ^~~~~~~~~~
Fix this by splitting the 64-bit constant into two halves,
each of which is individually perfectly representable, the
sum of which produces the correct arithmetic result.
This is very likely just a sticking plaster over some underlying
incorrect code, but it will suppress the warning for the moment.
Cc: Emilio G. Cota <cota@braap.org>
Reported-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-commits] [qemu/qemu] 06c4cc: qht: Fix threshold rate calculation,
Richard Henderson <=