diff --git a/.clang-tidy b/.clang-tidy index 1e228494a..2bd4310f7 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -19,6 +19,7 @@ Checks: > -misc-include-cleaner, -misc-non-private-member-variables-in-classes, -misc-use-anonymous-namespace, + -misc-use-internal-linkage, modernize-*, -modernize-avoid-c-arrays, -modernize-use-trailing-return-type, @@ -29,12 +30,14 @@ Checks: > -readability-avoid-const-params-in-decls, -readability-braces-around-statements, -readability-else-after-return, + -readability-enum-initial-value, -readability-function-cognitive-complexity, -readability-function-size, -readability-identifier-length, -readability-implicit-bool-conversion, -readability-isolate-declaration, -readability-magic-numbers, + -readability-math-missing-parentheses, -readability-named-parameter, -readability-simplify-boolean-expr, mpi-*, diff --git a/integration/VODE/vode_dvhin.H b/integration/VODE/vode_dvhin.H index 055ddc139..20c674722 100644 --- a/integration/VODE/vode_dvhin.H +++ b/integration/VODE/vode_dvhin.H @@ -122,17 +122,13 @@ void dvhin (BurnT& state, DvodeT& vstate, amrex::Real& H0, int& NITER, int& IER) } - // Iteration done. Apply bounds, bias factor, and sign. Then exit. + // Iteration done. Apply bounds and bias factor. Then exit. H0 = hnew * 0.5_rt; - if (H0 < HLB) { - H0 = HLB; - } - if (H0 > HUB) { - H0 = HUB; - } + H0 = std::clamp(H0, HLB, HUB); } + // apply sign H0 = std::copysign(H0, vstate.tout - vstate.t); NITER = iter; IER = 0; diff --git a/networks/aprox13/actual_network.H b/networks/aprox13/actual_network.H index 937585dd8..f67812327 100644 --- a/networks/aprox13/actual_network.H +++ b/networks/aprox13/actual_network.H @@ -134,7 +134,7 @@ namespace NSE_INDEX #endif namespace Rates { - enum NetworkRates { + enum NetworkRates: std::uint8_t { He4_He4_He4_to_C12 = 1, C12_He4_to_O16, C12_C12_to_Ne20_He4, diff --git a/networks/aprox21/actual_network.H b/networks/aprox21/actual_network.H index dcade97f0..9fca91944 100644 --- a/networks/aprox21/actual_network.H +++ b/networks/aprox21/actual_network.H @@ -152,7 +152,7 @@ namespace NSE_INDEX #endif namespace Rates { - enum NetworkRates { + enum NetworkRates : std::uint8_t { H1_H1_to_He3 = 1, H1_H1_H1_to_He3, P_to_N, diff --git a/networks/iso7/actual_network.H b/networks/iso7/actual_network.H index ea60bd035..a2748ab99 100644 --- a/networks/iso7/actual_network.H +++ b/networks/iso7/actual_network.H @@ -114,7 +114,7 @@ namespace NSE_INDEX #endif namespace Rates { - enum NetworkRates { + enum NetworkRates : std::uinit8_t { C12_He4_to_O16 = 1, He4_He4_He4_to_C12, C12_C12_to_Ne20_He4, diff --git a/networks/rprox/actual_network.H b/networks/rprox/actual_network.H index c16d12dc6..4afd4fc8b 100644 --- a/networks/rprox/actual_network.H +++ b/networks/rprox/actual_network.H @@ -112,7 +112,7 @@ namespace network namespace Rates { - enum NetworkRates + enum NetworkRates : std::uint8_t { He4_He4_He4_to_C12 = 1, C12_H1_to_N13,