Skip to content

Commit f0a7fce

Browse files
authored
some clang-tidy enum type fixes (#1582)
these use smaller types now
1 parent f2ef85f commit f0a7fce

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

integration/integrator_data.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const int INT_NEQS = NumSpec + 1;
1212
// -failure_tolerance <= X <= 1.0 + failure_tolerance).
1313
const amrex::Real species_failure_tolerance = 1.e-2_rt;
1414

15-
enum integrator_errors {
15+
enum integrator_errors : std::int8_t {
1616
IERR_SUCCESS = 1,
1717
IERR_BAD_INPUTS = -1,
1818
IERR_DT_UNDERFLOW = -2,

interfaces/eos_type.H

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -398,26 +398,28 @@ std::ostream& operator<< (std::ostream& o, T const& eos_state)
398398
return print_state(o, eos_state);
399399
}
400400

401-
enum eos_input_t {eos_input_rt = 0,
402-
eos_input_rh,
403-
eos_input_tp,
404-
eos_input_rp,
405-
eos_input_re,
406-
eos_input_ps,
407-
eos_input_ph,
408-
eos_input_th};
401+
enum eos_input_t : std::uint8_t {
402+
eos_input_rt = 0,
403+
eos_input_rh,
404+
eos_input_tp,
405+
eos_input_rp,
406+
eos_input_re,
407+
eos_input_ps,
408+
eos_input_ph,
409+
eos_input_th};
409410

410411
// these are used to allow for a generic interface to the
411412
// root finding
412413

413414
namespace EOS {
414415

415-
enum eos_iter {itemp = 1,
416-
idens = 2,
417-
iener = 3,
418-
ienth = 4,
419-
ientr = 5,
420-
ipres = 6};
416+
enum eos_iter : std::uint8_t {
417+
itemp = 1,
418+
idens = 2,
419+
iener = 3,
420+
ienth = 4,
421+
ientr = 5,
422+
ipres = 6};
421423

422424
}
423425

networks/aprox19/actual_network.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ namespace NSE_INDEX
157157
#endif
158158

159159
namespace Rates {
160-
enum NetworkRates {
160+
enum NetworkRates : std::uint8_t {
161161
H1_H1_to_He3 = 1,
162162
H1_H1_H1_to_He3,
163163
P_to_N,

unit_test/burn_cell_sdc/burn_cell.H

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ void burn_cell_c()
4545
case 3:
4646
auxdata[n-1] = Aux3;
4747
break;
48-
48+
default:
49+
amrex::Error("invalid aux");
4950
}
5051

5152
}

0 commit comments

Comments
 (0)