mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +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-assignment-in-if-condition,
|
||||||
bugprone-branch-clone,
|
bugprone-branch-clone,
|
||||||
bugprone-implicit-widening-of-multiplication-result,
|
bugprone-implicit-widening-of-multiplication-result,
|
||||||
|
bugprone-incorrect-division,
|
||||||
]
|
]
|
||||||
|
|
|
@ -60,7 +60,7 @@ void RandTest::add(const void* buf, int bufl) {
|
||||||
montey = 0;
|
montey = 0;
|
||||||
for ( int mj = 0; mj < RT_MONTEN / 2; mj++ ) {
|
for ( int mj = 0; mj < RT_MONTEN / 2; mj++ ) {
|
||||||
montex = (montex * 256.0) + monte[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 ) {
|
if ( montex * montex + montey * montey <= RT_INCIRC ) {
|
||||||
inmont++;
|
inmont++;
|
||||||
|
|
|
@ -4,11 +4,9 @@
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#define RT_MONTEN \
|
// Bytes used as Monte Carlo co-ordinates. This should be no more bits than the mantissa
|
||||||
6 /* Bytes used as Monte Carlo \
|
// of your "double" floating point type.
|
||||||
co-ordinates. This should be no more \
|
constexpr int RT_MONTEN = 6;
|
||||||
bits than the mantissa of your "double" \
|
|
||||||
floating point type. */
|
|
||||||
|
|
||||||
namespace zeek {
|
namespace zeek {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue