feat(CI): add cppcheck (#15211)

Co-authored-by: Skjalf <47818697+Nyeriah@users.noreply.github.com>
This commit is contained in:
Stefano Borzì
2023-03-05 18:47:18 +01:00
committed by GitHub
parent a5b4aecd52
commit 034b521501
22 changed files with 91 additions and 41 deletions

View File

@@ -187,9 +187,9 @@ public:
while (true)
{
uint32 tn = tree[node];
uint32 axis = (tn & (3 << 30)) >> 30;
bool BVH2 = tn & (1 << 29);
int offset = tn & ~(7 << 29);
uint32 axis = (tn & (3 << 30)) >> 30; // cppcheck-suppress integerOverflow
bool BVH2 = tn & (1 << 29); // cppcheck-suppress integerOverflow
int offset = tn & ~(7 << 29); // cppcheck-suppress integerOverflow
if (!BVH2)
{
if (axis < 3)
@@ -297,9 +297,9 @@ public:
while (true)
{
uint32 tn = tree[node];
uint32 axis = (tn & (3 << 30)) >> 30;
bool BVH2 = tn & (1 << 29);
int offset = tn & ~(7 << 29);
uint32 axis = (tn & (3 << 30)) >> 30; // cppcheck-suppress integerOverflow
bool BVH2 = tn & (1 << 29); // cppcheck-suppress integerOverflow
int offset = tn & ~(7 << 29); // cppcheck-suppress integerOverflow
if (!BVH2)
{
if (axis < 3)
@@ -425,7 +425,7 @@ protected:
void createNode(std::vector<uint32>& tempTree, int nodeIndex, uint32 left, uint32 right) const
{
// write leaf node
tempTree[nodeIndex + 0] = (3 << 30) | left;
tempTree[nodeIndex + 0] = (3 << 30) | left; // cppcheck-suppress integerOverflow
tempTree[nodeIndex + 1] = right - left + 1;
}