Skip to content

Commit

Permalink
Fixes for readability-braces-around-statements checks
Browse files Browse the repository at this point in the history
- Added braces to 2 if statments for clarity
- Disable google-readability-braces-around-statements and
hicpp-braces-around-statements since they didn't appear to respect the
readability-braces-around-statements.ShortStatementLines setting
  • Loading branch information
bcaddy committed Oct 12, 2023
1 parent 5f5d025 commit 2d4b8fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Checks: "*,
-cert-dcl37-c,
-cert-dcl51-cpp,
-cppcoreguidelines-pro-bounds-constant-array-index,
-google-readability-braces-around-statements,
-hicpp-braces-around-statements,
google-readability-avoid-underscore-in-googletest-name,
google-upgrade-googletest-case,
Expand All @@ -45,7 +47,6 @@ Checks: "*,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-narrowing-conversions,
-bugprone-switch-missing-default-case,
-bugprone-switch-missing-default-case,
-cert-env33-c,
-cert-err33-c,
-cert-err34-c,
Expand Down
6 changes: 4 additions & 2 deletions src/reconstruction/ppmp_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -738,10 +738,12 @@ __device__ void Interface_Values_PPM(Real q_imo, Real q_i, Real q_ipo, Real del_
if ((*q_R - q_i) * (q_i - *q_L) <= 0) *q_L = *q_R = q_i;

// steep gradient criterion (Fryxell Eqn 53, Fig 12)
if (6.0 * (*q_R - *q_L) * (q_i - 0.5 * (*q_L + *q_R)) > (*q_R - *q_L) * (*q_R - *q_L))
if (6.0 * (*q_R - *q_L) * (q_i - 0.5 * (*q_L + *q_R)) > (*q_R - *q_L) * (*q_R - *q_L)) {
*q_L = 3.0 * q_i - 2.0 * (*q_R);
if (6.0 * (*q_R - *q_L) * (q_i - 0.5 * (*q_L + *q_R)) < -(*q_R - *q_L) * (*q_R - *q_L))
}
if (6.0 * (*q_R - *q_L) * (q_i - 0.5 * (*q_L + *q_R)) < -(*q_R - *q_L) * (*q_R - *q_L)) {
*q_R = 3.0 * q_i - 2.0 * (*q_L);
}

*q_L = fmax(fmin(q_i, q_imo), *q_L);
*q_L = fmin(fmax(q_i, q_imo), *q_L);
Expand Down

0 comments on commit 2d4b8fe

Please sign in to comment.