Commit 76112a13 authored by Michael Kuron's avatar Michael Kuron 💡

Turn on header checks too

parent 5929a6d7
Pipeline #1530 failed with stages
in 16 minutes and 12 seconds
......@@ -326,7 +326,7 @@ if(WARNINGS_ARE_ERRORS)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xcompiler -Werror")
endif()
endif(WARNINGS_ARE_ERRORS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-sign-compare -Wno-unused-function -Wno-unused-private-field")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-sign-compare -Wno-unused-function -Wno-unused-private-field -Wno-unused-variable")
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8.5")
# older versions don't support -Wno-pedantic which we need in src/python
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
......@@ -349,7 +349,7 @@ if( WITH_CLANG_TIDY )
message(STATUS "clang-tidy not found.")
else()
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*,-clang-analyzer-alpha.*,-misc-unused-*,-google-*,-llvm-*,-modernize-*,-readability-*,-cppcoreguidelines-*,-clang-analyzer-deadcode*,-cert-*,-clang-analyzer-core.NullDereference,-clang-analyzer-core.DivideZero,-misc-misplaced-widening-cast,-misc-macro-parentheses,-clang-analyzer-security.FloatLoopCounter,-clang-analyzer-optin.mpi.MPI-Checker" "-warnings-as-errors=*")
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*,-clang-analyzer-alpha.*,-misc-unused-*,-google-*,-llvm-*,-modernize-*,-readability-*,-cppcoreguidelines-*,-clang-analyzer-deadcode*,-cert-*,-clang-analyzer-core.NullDereference,-clang-analyzer-core.DivideZero,-misc-misplaced-widening-cast,-misc-macro-parentheses,-clang-analyzer-security.FloatLoopCounter,-clang-analyzer-optin.mpi.MPI-Checker,-boost-use-to-string" "-header-filter=.*" "-warnings-as-errors=*")
endif()
endif()
......
......@@ -19,7 +19,7 @@ public:
: m_shape(std::make_shared<Shapes::NoWhere>()),
m_reflection_type(ReflectionType::NONE), m_penetrable(false),
m_only_positive(false), m_tuneable_slip(0), m_type(-1) {
reset_force();
ShapeBasedConstraint::reset_force();
}
virtual void add_energy(Particle *p, double *folded_pos,
......
......@@ -178,7 +178,7 @@ public:
*/
Correlator(int tau_lin, double tau_max, double dt,
std::string const &compress1_, std::string const &compress2_,
std::string const &corr_operation, obs_ptr obs1, obs_ptr obs2)
std::string const &corr_operation, const obs_ptr &obs1, const obs_ptr &obs2)
: autoupdate(0), finalized(0), t(0), m_tau_lin(tau_lin),
m_dt(dt), m_tau_max(tau_max), compressA_name(compress1_),
compressB_name(compress2_), corr_operation_name(corr_operation),
......
......@@ -75,7 +75,7 @@ static double d3q18_w[18] = { 1., 1., 1., 1., 1., 1.,
1./2., 1./2., 1./2., 1./2.,
1./2., 1./2., 1./2., 1./2. };
LB_Model d3q18_model = { 18, d3q18_lattice, d3q18_coefficients, d3q18_w, nullptr, 1./2. };
//LB_Model d3q18_model = { 18, d3q18_lattice, d3q18_coefficients, d3q18_w, nullptr, 1./2. };
#endif /* LB */
......
......@@ -10,7 +10,7 @@ namespace Observables {
int mpi_observable_lb_radial_velocity_profile_parallel(void *pdata_, double *A,
unsigned int n_A);
void mpi_observable_lb_radial_velocity_profile_slave_implementation() {
inline void mpi_observable_lb_radial_velocity_profile_slave_implementation() {
radial_profile_data pdata;
MPI_Bcast(&pdata, sizeof(radial_profile_data), MPI_BYTE, 0, comm_cart);
unsigned int n_A = 3 * pdata.n_r_bins * pdata.n_phi_bins * pdata.n_z_bins;
......@@ -20,7 +20,7 @@ void mpi_observable_lb_radial_velocity_profile_slave_implementation() {
free(data);
}
int mpi_observable_lb_radial_velocity_profile_parallel(void *pdata_, double *A,
inline int mpi_observable_lb_radial_velocity_profile_parallel(void *pdata_, double *A,
unsigned int n_A) {
unsigned int i, j, k;
unsigned int maxi, maxj, maxk;
......
......@@ -30,7 +30,7 @@
namespace Utils {
size_t calculate_bin_index(double value, double bin_size, double offset) {
inline size_t calculate_bin_index(double value, double bin_size, double offset) {
return std::floor((value - offset) / bin_size);
}
......
......@@ -59,11 +59,11 @@ public:
List(List &&rhs) noexcept : List() { move(std::move(rhs)); }
List &operator=(List const &rhs) {
copy(rhs);
return *this;
return *this; // NOLINT
}
List &operator=(List &&rhs) noexcept {
move(std::move(rhs));
return *this;
return *this; // NOLINT
}
T *begin() { return e; }
......
......@@ -34,7 +34,7 @@ namespace detail {
template <typename T>
int size_and_offset(std::vector<int> &sizes, std::vector<int> &displ,
int n_elem, boost::mpi::communicator comm, int root = 0) {
int n_elem, const boost::mpi::communicator &comm, int root = 0) {
sizes.resize(comm.size());
displ.resize(comm.size());
......@@ -52,7 +52,7 @@ int size_and_offset(std::vector<int> &sizes, std::vector<int> &displ,
return total_size;
}
inline void size_and_offset(int n_elem, boost::mpi::communicator comm, int root = 0) {
inline void size_and_offset(int n_elem, const boost::mpi::communicator &comm, int root = 0) {
/* Send local size */
boost::mpi::gather(comm, n_elem, root);
}
......
......@@ -35,7 +35,7 @@ namespace Parallel {
class Callback {
public:
Callback(Communication::MpiCallbacks &cb,
Communication::MpiCallbacks::function_type callback) : m_cb(cb) {
const Communication::MpiCallbacks::function_type &callback) : m_cb(cb) {
m_callback_id = m_cb.add(callback);
}
......
......@@ -89,8 +89,8 @@ protected:
void add_parameters(std::vector<AutoParameter> &&params) {
for (auto const &p : params) {
m_parameters.emplace(std::make_pair(
std::move(p.name),
Parameter{p.type, p.length, std::move(p.set), std::move(p.get)}));
p.name,
Parameter{p.type, p.length, p.set, p.get}));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment