Skip to content

Commit

Permalink
fix some header issues identified by clang-tidy (#1533)
Browse files Browse the repository at this point in the history
most adding inline to avoid ODR issues
  • Loading branch information
zingale authored Apr 16, 2024
1 parent d4312a6 commit b130fa5
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nse_solver/make_table/burn_cell.H
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef BURN_CELL_H
#define BURN_CELL_H

#include <extern_parameters.H>
#include <eos.H>
Expand Down Expand Up @@ -67,3 +69,5 @@ void burn_cell_c()
}
}
}

#endif
1 change: 1 addition & 0 deletions unit_test/burn_cell/burn_cell.H
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

using namespace unit_test_rp;

AMREX_INLINE
void burn_cell_c()
{

Expand Down
5 changes: 5 additions & 0 deletions unit_test/burn_cell_primordial_chem/burn_cell.H
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifndef BURN_CELL_H
#define BURN_CELL_H

#include <extern_parameters.H>
#include <eos.H>
#include <network.H>
Expand All @@ -7,6 +10,7 @@

Real grav_constant = 6.674e-8;

AMREX_INLINE
void burn_cell_c()
{

Expand Down Expand Up @@ -253,3 +257,4 @@ void burn_cell_c()
}

}
#endif
1 change: 1 addition & 0 deletions unit_test/burn_cell_sdc/burn_cell.H
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

using namespace unit_test_rp;

AMREX_INLINE
void burn_cell_c()
{

Expand Down
4 changes: 4 additions & 0 deletions unit_test/eos_cell/eos_cell.H
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef EOS_CELL_H
#define EOS_CELL_H

#include <extern_parameters.H>
#include <eos.H>
Expand All @@ -7,6 +9,7 @@

using namespace unit_test_rp;

AMREX_INLINE
void eos_cell_c()
{

Expand Down Expand Up @@ -40,3 +43,4 @@ void eos_cell_c()
std::cout << state;

}
#endif
4 changes: 4 additions & 0 deletions unit_test/nse_table_cell/nse_cell.H
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef NSE_CELL_H
#define NSE_CELL_H

#include <extern_parameters.H>
#include <eos.H>
Expand All @@ -11,6 +13,7 @@

using namespace unit_test_rp;

AMREX_INLINE
void nse_cell_c()
{

Expand All @@ -33,3 +36,4 @@ void nse_cell_c()
}

}
#endif
4 changes: 4 additions & 0 deletions unit_test/test_ase/burn_cell.H
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef BURN_CELL_H
#define BURN_CELL_H

#include <extern_parameters.H>
#include <eos.H>
Expand All @@ -9,6 +11,7 @@

using namespace unit_test_rp;

AMREX_INLINE
void burn_cell_c()
{

Expand Down Expand Up @@ -64,3 +67,4 @@ void burn_cell_c()
}

}
#endif
4 changes: 4 additions & 0 deletions unit_test/test_ase/make_table/burn_cell.H
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef BURN_CELL_H
#define BURN_CELL_H

#include <extern_parameters.H>
#include <eos.H>
Expand All @@ -10,6 +12,7 @@

using namespace unit_test_rp;

AMREX_INLINE
void burn_cell_c()
{

Expand Down Expand Up @@ -78,3 +81,4 @@ void burn_cell_c()
}
}
}
#endif
1 change: 1 addition & 0 deletions unit_test/test_linear_algebra/test_linear_algebra.H
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ using namespace amrex::literals;

constexpr Real eps = 1.e-2_rt;

AMREX_INLINE
void create_A(RArray2D& A) {

// create a diagonally-dominant matrix with non-zero
Expand Down
4 changes: 4 additions & 0 deletions unit_test/test_nse/nse_example.H
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef NSE_EXAMPLE_H
#define NSE_EXAMPLE_H

#include <extern_parameters.H>
#include <eos.H>
Expand All @@ -10,6 +12,7 @@

using namespace unit_test_rp;

AMREX_INLINE
void nse_example_c()
{

Expand Down Expand Up @@ -77,3 +80,4 @@ void nse_example_c()
std::cout << short_spec_names_cxx[n] << " : " << NSE_STATE.xn[n] << std::endl;
}
}
#endif
4 changes: 4 additions & 0 deletions unit_test/test_nse_interp/nse_cell.H
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef NSE_CELL_H
#define NSE_CELL_H

#include <extern_parameters.H>
#include <eos.H>
Expand All @@ -9,6 +11,7 @@
#include <nse_table_type.H>
#include <nse_eos.H>

AMREX_INLINE
void nse_cell_c()
{

Expand Down Expand Up @@ -435,3 +438,4 @@ void nse_cell_c()


}
#endif
4 changes: 4 additions & 0 deletions unit_test/test_part_func/pf_cell.H
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef PF_CELL_H
#define PF_CELL_H

#include <extern_parameters.H>
#include <eos.H>
Expand All @@ -11,6 +13,7 @@

using namespace unit_test_rp;

AMREX_INLINE
void pf_cell_c()
{

Expand All @@ -32,3 +35,4 @@ void pf_cell_c()
std::cout << "spins: " << get_spin_state(H1) << " " << get_spin_state(He4) << " " << get_spin_state(Fe52) << " " << get_spin_state(Co55) << " " << get_spin_state(Ni56) << std::endl;

}
#endif
1 change: 1 addition & 0 deletions unit_test/test_sdc_vode_rhs/vode_rhs_test.H
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

using namespace unit_test_rp;

AMREX_INLINE
void do_vode_rhs()
{

Expand Down

0 comments on commit b130fa5

Please sign in to comment.