Commit 1da75f94 authored by Michael Kuron's avatar Michael Kuron 💡

Fix issues found by clang-tidy

parent dd40b787
......@@ -389,7 +389,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-*,-fuchsia-*,-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,-boost-use-to-string,-hicpp-*" "-header-filter=.*" "-warnings-as-errors=*")
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*,-clang-analyzer-alpha.*,-misc-unused-*,-android-*,-fuchsia-*,-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,-hicpp-*" "-header-filter=.*" "-warnings-as-errors=*")
endif()
endif()
......
......@@ -9,6 +9,7 @@ public:
: m_delta_N(delta_N){};
void auto_update();
int &delta_N() {return m_delta_N;};
virtual ~AccumulatorBase() {}
private:
virtual void update() = 0;
// Number of timesteps between automatic updates.
......
......@@ -15,6 +15,8 @@ public:
const Vector3d &folded_pos) = 0;
virtual void reset_force(){};
virtual ~Constraint() {}
};
} /* namespace Constraints */
......
......@@ -383,7 +383,7 @@ void dp3m_init() {
dp3m_interpolate_dipole_assignment_function();
dp3m.pos_shift =
(double)((dp3m.params.cao - 1) / 2) - (dp3m.params.cao % 2) / 2.0;
std::floor((dp3m.params.cao - 1) / 2.0) - (dp3m.params.cao % 2) / 2.0;
P3M_TRACE(fprintf(stderr, "%d: dipolar pos_shift = %f\n", this_node,
dp3m.pos_shift));
......
......@@ -361,7 +361,7 @@ void p3m_init() {
/* position offset for calc. of first meshpoint */
p3m.pos_shift =
(double)((p3m.params.cao - 1) / 2) - (p3m.params.cao % 2) / 2.0;
std::floor((p3m.params.cao - 1) / 2) - (p3m.params.cao % 2) / 2.0;
P3M_TRACE(
fprintf(stderr, "%d: p3m.pos_shift = %f\n", this_node, p3m.pos_shift));
......
......@@ -25,6 +25,7 @@ class PairCriterion {
const bool res = decide(p1, p2);
return res;
}
virtual ~PairCriterion() {}
};
/** @brief True if two particles are closer than a cut off distance, respecting minimum image convention */
......
......@@ -34,6 +34,7 @@ struct CollectiveVariable {
virtual double determine_current_state() = 0; // use pure virtual, otherwise
// this will be used in vector
// of collective variables
virtual ~CollectiveVariable() {}
};
class WangLandauReactionEnsemble;
......
......@@ -28,6 +28,7 @@ class Shape {
public:
virtual int calculate_dist(const double *ppos, double *dist,
double *vec) const = 0;
virtual ~Shape() {}
};
} /* namespace Shapes */
......
......@@ -35,7 +35,7 @@ bool check_distance_function(const Shapes::Shape &s) {
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
double theta = 2. * i / N * M_PI;
double v = j / (N - 1);
double v = j / (N - 1.);
double dist[3];
double d;
......
......@@ -33,6 +33,7 @@ namespace Testing {
struct TestClass {
virtual void method() {}
virtual ~TestClass() {}
};
struct DerivedTestClass : public TestClass {
......
......@@ -67,6 +67,7 @@ class VirtualSites {
virtual bool need_ghost_comm_before_vel_update() const =0;
/** Is a ghost comm needed before the back_transfer */
virtual bool need_ghost_comm_before_back_transfer() const =0;
virtual ~VirtualSites() {}
private:
bool m_have_velocity;
bool m_have_quaternion;
......
......@@ -175,6 +175,7 @@ ParallelScriptInterface::map_local_to_parallel_id(Variant const &value) const {
} else if (is_vector(value)) {
auto const &in_vec = boost::get<std::vector<Variant>>(value);
std::vector<Variant> out_vec;
out_vec.reserve(in_vec.size());
for (auto const &e : in_vec) {
out_vec.emplace_back(map_local_to_parallel_id(e));
......
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