Skip to content

Commit 3ceedde

Browse files
authored
some clang-tidy 19 fixes (AMReX-Astro#1664)
1 parent 1ac4c12 commit 3ceedde

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

.clang-tidy

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Checks: >
1919
-misc-include-cleaner,
2020
-misc-non-private-member-variables-in-classes,
2121
-misc-use-anonymous-namespace,
22+
-misc-use-internal-linkage,
2223
modernize-*,
2324
-modernize-avoid-c-arrays,
2425
-modernize-use-trailing-return-type,
@@ -29,12 +30,14 @@ Checks: >
2930
-readability-avoid-const-params-in-decls,
3031
-readability-braces-around-statements,
3132
-readability-else-after-return,
33+
-readability-enum-initial-value,
3234
-readability-function-cognitive-complexity,
3335
-readability-function-size,
3436
-readability-identifier-length,
3537
-readability-implicit-bool-conversion,
3638
-readability-isolate-declaration,
3739
-readability-magic-numbers,
40+
-readability-math-missing-parentheses,
3841
-readability-named-parameter,
3942
-readability-simplify-boolean-expr,
4043
mpi-*,

integration/VODE/vode_dvhin.H

+3-7
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,13 @@ void dvhin (BurnT& state, DvodeT& vstate, amrex::Real& H0, int& NITER, int& IER)
122122

123123
}
124124

125-
// Iteration done. Apply bounds, bias factor, and sign. Then exit.
125+
// Iteration done. Apply bounds and bias factor. Then exit.
126126
H0 = hnew * 0.5_rt;
127-
if (H0 < HLB) {
128-
H0 = HLB;
129-
}
130-
if (H0 > HUB) {
131-
H0 = HUB;
132-
}
127+
H0 = std::clamp(H0, HLB, HUB);
133128

134129
}
135130

131+
// apply sign
136132
H0 = std::copysign(H0, vstate.tout - vstate.t);
137133
NITER = iter;
138134
IER = 0;

networks/aprox13/actual_network.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ namespace NSE_INDEX
134134
#endif
135135

136136
namespace Rates {
137-
enum NetworkRates {
137+
enum NetworkRates: std::uint8_t {
138138
He4_He4_He4_to_C12 = 1,
139139
C12_He4_to_O16,
140140
C12_C12_to_Ne20_He4,

networks/aprox21/actual_network.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ namespace NSE_INDEX
152152
#endif
153153

154154
namespace Rates {
155-
enum NetworkRates {
155+
enum NetworkRates : std::uint8_t {
156156
H1_H1_to_He3 = 1,
157157
H1_H1_H1_to_He3,
158158
P_to_N,

networks/iso7/actual_network.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ namespace NSE_INDEX
114114
#endif
115115

116116
namespace Rates {
117-
enum NetworkRates {
117+
enum NetworkRates : std::uint8_t {
118118
C12_He4_to_O16 = 1,
119119
He4_He4_He4_to_C12,
120120
C12_C12_to_Ne20_He4,

networks/rprox/actual_network.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ namespace network
112112

113113
namespace Rates
114114
{
115-
enum NetworkRates
115+
enum NetworkRates : std::uint8_t
116116
{
117117
He4_He4_He4_to_C12 = 1,
118118
C12_H1_to_N13,

0 commit comments

Comments
 (0)