Commit 28b02e3e authored by Jan Möbius's avatar Jan Möbius

Cppcheck fixes

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