mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Fix clang-tidy bugprone-incorrect-division warnings
This commit is contained in:
parent
18983aed02
commit
87f1b1a7b3
3 changed files with 5 additions and 6 deletions
|
@ -2,4 +2,5 @@ Checks: [-*,
|
|||
bugprone-assignment-in-if-condition,
|
||||
bugprone-branch-clone,
|
||||
bugprone-implicit-widening-of-multiplication-result,
|
||||
bugprone-incorrect-division,
|
||||
]
|
||||
|
|
|
@ -60,7 +60,7 @@ void RandTest::add(const void* buf, int bufl) {
|
|||
montey = 0;
|
||||
for ( int mj = 0; mj < RT_MONTEN / 2; mj++ ) {
|
||||
montex = (montex * 256.0) + monte[mj];
|
||||
montey = (montey * 256.0) + monte[(RT_MONTEN / 2) + mj];
|
||||
montey = (montey * 256.0) + monte[static_cast<size_t>((RT_MONTEN / 2) + mj)];
|
||||
}
|
||||
if ( montex * montex + montey * montey <= RT_INCIRC ) {
|
||||
inmont++;
|
||||
|
|
|
@ -4,11 +4,9 @@
|
|||
|
||||
#include <cstdint>
|
||||
|
||||
#define RT_MONTEN \
|
||||
6 /* Bytes used as Monte Carlo \
|
||||
co-ordinates. This should be no more \
|
||||
bits than the mantissa of your "double" \
|
||||
floating point type. */
|
||||
// Bytes used as Monte Carlo co-ordinates. This should be no more bits than the mantissa
|
||||
// of your "double" floating point type.
|
||||
constexpr int RT_MONTEN = 6;
|
||||
|
||||
namespace zeek {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue