Commit 28b02e3e by Jan Möbius

Cppcheck fixes

parent b5039f0f
Pipeline #4307 failed with stage
in 48 seconds
......@@ -27,7 +27,7 @@ void print() {
template <typename Iterator>
class netgen_grammar : public qi::grammar<Iterator/*, qi::space_type*/> {
public:
netgen_grammar(MeshGenerator& _generator) :
explicit netgen_grammar(MeshGenerator& _generator) :
netgen_grammar::base_type(content),
generator_(_generator) {
......
......@@ -22,7 +22,7 @@ namespace spirit = boost::spirit;
template <typename Iterator>
class tetmesh_grammar : public qi::grammar<Iterator, qi::space_type> {
public:
tetmesh_grammar(MeshGenerator& _generator) :
explicit tetmesh_grammar(MeshGenerator& _generator) :
tetmesh_grammar::base_type(content),
generator_(_generator) {
......
......@@ -39,7 +39,7 @@ public:
typedef OpenVolumeMesh::Geometry::Vec3d Vec3d;
MeshGenerator(PolyhedralMesh& _mesh) : v_component_(0), mesh_(_mesh), progress_() {}
explicit MeshGenerator(PolyhedralMesh& _mesh) : v_component_(0), mesh_(_mesh), progress_() {}
MeshGenerator(const MeshGenerator& _cpy) :
v_component_(_cpy.v_component_),
vertex_(0.0, 0.0, 0.0),
......
......@@ -55,7 +55,7 @@ template <class GeomKernelT>
class NormalAttrib {
public:
NormalAttrib(GeomKernelT& _kernel);
explicit NormalAttrib(GeomKernelT& _kernel);
virtual ~NormalAttrib();
/** \brief A simple heuristic to estimate the vertex normals
......
......@@ -90,7 +90,7 @@ std::ostream& operator<<(std::ostream& _os, const OpenVolumeMeshEdge& _edge);
class OpenVolumeMeshFace {
friend class TopologyKernel;
public:
OpenVolumeMeshFace(const std::vector<HalfEdgeHandle>& _halfedges) :
explicit OpenVolumeMeshFace(const std::vector<HalfEdgeHandle>& _halfedges) :
halfedges_(_halfedges) {
}
......@@ -119,7 +119,7 @@ std::ostream& operator<<(std::ostream& _os, const OpenVolumeMeshFace& _face);
class OpenVolumeMeshCell {
friend class TopologyKernel;
public:
OpenVolumeMeshCell(const std::vector<HalfFaceHandle>& _halffaces) :
explicit OpenVolumeMeshCell(const std::vector<HalfFaceHandle>& _halffaces) :
halffaces_(_halffaces) {
}
......
......@@ -55,7 +55,7 @@ class BaseProperty {
public:
friend class ResourceManager;
BaseProperty(ResourceManager& _resMan) : resMan_(_resMan), lock_(false) {}
explicit BaseProperty(ResourceManager& _resMan) : resMan_(_resMan), lock_(false) {}
BaseProperty(const BaseProperty& _cpy) : resMan_(_cpy.resMan_), lock_(_cpy.lock_) {}
......
......@@ -1159,7 +1159,7 @@ public:
typedef BaseIterator<FaceHandle> BaseIter;
BoundaryFaceIter(const TopologyKernel* _mesh);
explicit BoundaryFaceIter(const TopologyKernel* _mesh);
// Post increment/decrement operator
BoundaryFaceIter operator++(int) {
......
......@@ -71,7 +71,7 @@ public:
public:
OpenVolumeMeshBaseProperty(const std::string& _name = "<unknown>") :
explicit OpenVolumeMeshBaseProperty(const std::string& _name = "<unknown>") :
name_(_name), persistent_(false), handle_(-1) {
}
......
......@@ -95,19 +95,19 @@ private:
// Default entity handles
class VertexHandle : public OpenVolumeMeshHandle { public: VertexHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class EdgeHandle : public OpenVolumeMeshHandle { public: EdgeHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class FaceHandle : public OpenVolumeMeshHandle { public: FaceHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class CellHandle : public OpenVolumeMeshHandle { public: CellHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class HalfEdgeHandle : public OpenVolumeMeshHandle { public: HalfEdgeHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class HalfFaceHandle : public OpenVolumeMeshHandle { public: HalfFaceHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class VertexHandle : public OpenVolumeMeshHandle { public: explicit VertexHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class EdgeHandle : public OpenVolumeMeshHandle { public: explicit EdgeHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class FaceHandle : public OpenVolumeMeshHandle { public: explicit FaceHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class CellHandle : public OpenVolumeMeshHandle { public: explicit CellHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class HalfEdgeHandle : public OpenVolumeMeshHandle { public: explicit HalfEdgeHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class HalfFaceHandle : public OpenVolumeMeshHandle { public: explicit HalfFaceHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
// Helper class that is used to decrease all handles
// exceeding a certain threshold
class VHandleCorrection {
public:
VHandleCorrection(VertexHandle _thld) : thld_(_thld) {}
explicit VHandleCorrection(VertexHandle _thld) : thld_(_thld) {}
void correctValue(VertexHandle& _h) {
if(_h > thld_) _h.idx(_h.idx() - 1);
}
......@@ -116,7 +116,7 @@ private:
};
class HEHandleCorrection {
public:
HEHandleCorrection(HalfEdgeHandle _thld) : thld_(_thld) {}
explicit HEHandleCorrection(HalfEdgeHandle _thld) : thld_(_thld) {}
void correctVecValue(std::vector<HalfEdgeHandle>& _vec) {
#if defined(__clang_major__) && (__clang_major__ >= 5)
for(std::vector<HalfEdgeHandle>::iterator it = _vec.begin(), end = _vec.end(); it != end; ++it) {
......@@ -134,7 +134,7 @@ private:
};
class HFHandleCorrection {
public:
HFHandleCorrection(HalfFaceHandle _thld) : thld_(_thld) {}
explicit HFHandleCorrection(HalfFaceHandle _thld) : thld_(_thld) {}
void correctVecValue(std::vector<HalfFaceHandle>& _vec) {
#if defined(__clang_major__) && (__clang_major__ >= 5)
for(std::vector<HalfFaceHandle>::iterator it = _vec.begin(), end = _vec.end(); it != end; ++it) {
......@@ -152,7 +152,7 @@ private:
};
class CHandleCorrection {
public:
CHandleCorrection(CellHandle _thld) : thld_(_thld) {}
explicit CHandleCorrection(CellHandle _thld) : thld_(_thld) {}
void correctValue(CellHandle& _h) {
if(_h > thld_) _h.idx(_h.idx() - 1);
}
......
......@@ -48,13 +48,13 @@
namespace OpenVolumeMesh {
// Defines for property handles
class VertexPropHandle : public OpenVolumeMeshHandle { public: VertexPropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class EdgePropHandle : public OpenVolumeMeshHandle { public: EdgePropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class HalfEdgePropHandle : public OpenVolumeMeshHandle { public: HalfEdgePropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class FacePropHandle : public OpenVolumeMeshHandle { public: FacePropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class HalfFacePropHandle : public OpenVolumeMeshHandle { public: HalfFacePropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class CellPropHandle : public OpenVolumeMeshHandle { public: CellPropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class MeshPropHandle : public OpenVolumeMeshHandle { public: MeshPropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class VertexPropHandle : public OpenVolumeMeshHandle { public: explicit VertexPropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class EdgePropHandle : public OpenVolumeMeshHandle { public: explicit EdgePropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class HalfEdgePropHandle : public OpenVolumeMeshHandle { public: explicit HalfEdgePropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class FacePropHandle : public OpenVolumeMeshHandle { public: explicit FacePropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class HalfFacePropHandle : public OpenVolumeMeshHandle { public: explicit HalfFacePropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class CellPropHandle : public OpenVolumeMeshHandle { public: explicit CellPropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class MeshPropHandle : public OpenVolumeMeshHandle { public: explicit MeshPropHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
} // Namespace OpenVolumeMesh
......
......@@ -542,7 +542,7 @@ protected:
class EdgeCorrector {
public:
EdgeCorrector(const std::vector<int>& _newIndices) :
explicit EdgeCorrector(const std::vector<int>& _newIndices) :
newIndices_(_newIndices) {}
void operator()(Edge& _edge) {
......@@ -555,7 +555,7 @@ protected:
class FaceCorrector {
public:
FaceCorrector(const std::vector<int>& _newIndices) :
explicit FaceCorrector(const std::vector<int>& _newIndices) :
newIndices_(_newIndices) {}
void operator()(Face& _face) {
......@@ -575,7 +575,7 @@ protected:
class CellCorrector {
public:
CellCorrector(const std::vector<int>& _newIndices) :
explicit CellCorrector(const std::vector<int>& _newIndices) :
newIndices_(_newIndices) {}
void operator()(Cell& _cell) {
......
......@@ -127,7 +127,7 @@ protected:
// Printer class (for STL compliance test)
class Print {
public:
Print(bool _mute = false) : mute_(_mute) {}
explicit Print(bool _mute = false) : mute_(_mute) {}
void mute(bool _mute) { mute_ = _mute; }
bool mute() const { return mute_; }
void operator()(const OpenVolumeMesh::OpenVolumeMeshHandle& _h) const {
......
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