cppcheck
This commit is contained in:
@@ -252,7 +252,7 @@ namespace OMFormat {
|
||||
|
||||
PropertyName( ) { }
|
||||
|
||||
PropertyName( const std::string& _name ) { *this = _name; }
|
||||
explicit PropertyName( const std::string& _name ) { *this = _name; }
|
||||
|
||||
bool is_valid() const { return is_valid( size() ); }
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ class ExporterT : public BaseExporter
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
ExporterT(const Mesh& _mesh) : mesh_(_mesh) {}
|
||||
explicit ExporterT(const Mesh& _mesh) : mesh_(_mesh) {}
|
||||
|
||||
|
||||
// get vertex data
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
typedef std::vector<VertexHandle> VHandles;
|
||||
|
||||
|
||||
ImporterT(Mesh& _mesh) : mesh_(_mesh), halfedgeNormals_() {}
|
||||
explicit ImporterT(Mesh& _mesh) : mesh_(_mesh), halfedgeNormals_() {}
|
||||
|
||||
|
||||
virtual VertexHandle add_vertex(const Vec3f& _point) override
|
||||
|
||||
@@ -387,10 +387,12 @@ bool _OMReader_::read_binary_vertex_chunk(std::istream &_is, BaseImporter &_bi,
|
||||
default: // skip unknown chunks
|
||||
{
|
||||
omerr() << "Unknown chunk type ignored!\n";
|
||||
size_t size_of = header_.n_vertices_ * OMFormat::vector_size(chunk_header_);
|
||||
_is.ignore(size_of);
|
||||
bytes_ += size_of;
|
||||
size_t chunk_size = header_.n_vertices_ * OMFormat::vector_size(chunk_header_);
|
||||
_is.ignore(chunk_size);
|
||||
bytes_ += chunk_size;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// all chunk data has been read..?!
|
||||
@@ -505,9 +507,9 @@ bool _OMReader_::read_binary_face_chunk(std::istream &_is, BaseImporter &_bi, Op
|
||||
default: // skip unknown chunks
|
||||
{
|
||||
omerr() << "Unknown chunk type ignore!\n";
|
||||
size_t size_of = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(size_of);
|
||||
bytes_ += size_of;
|
||||
size_t chunk_size = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(chunk_size);
|
||||
bytes_ += chunk_size;
|
||||
}
|
||||
}
|
||||
return fidx == header_.n_faces_;
|
||||
@@ -549,9 +551,9 @@ bool _OMReader_::read_binary_edge_chunk(std::istream &_is, BaseImporter &_bi, Op
|
||||
|
||||
default:
|
||||
// skip unknown type
|
||||
size_t size_of = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(size_of);
|
||||
bytes_ += size_of;
|
||||
size_t chunk_size = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(chunk_size);
|
||||
bytes_ += chunk_size;
|
||||
}
|
||||
|
||||
return b < bytes_;
|
||||
@@ -627,9 +629,9 @@ bool _OMReader_::read_binary_halfedge_chunk(std::istream &_is, BaseImporter &_bi
|
||||
default:
|
||||
// skip unknown chunk
|
||||
omerr() << "Unknown chunk type ignored!\n";
|
||||
size_t size_of = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(size_of);
|
||||
bytes_ += size_of;
|
||||
size_t chunk_size = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(chunk_size);
|
||||
bytes_ += chunk_size;
|
||||
}
|
||||
|
||||
return b < bytes_;
|
||||
@@ -655,9 +657,9 @@ bool _OMReader_::read_binary_mesh_chunk(std::istream &_is, BaseImporter &_bi, Op
|
||||
|
||||
default:
|
||||
// skip unknown chunk
|
||||
size_t size_of = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(size_of);
|
||||
bytes_ += size_of;
|
||||
size_t chunk_size = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(chunk_size);
|
||||
bytes_ += chunk_size;
|
||||
}
|
||||
|
||||
return b < bytes_;
|
||||
|
||||
@@ -120,7 +120,7 @@ private:
|
||||
{
|
||||
ValueType type;
|
||||
const BaseProperty* property;
|
||||
CustomProperty(const BaseProperty* const _p):type(Unsupported),property(_p){}
|
||||
explicit CustomProperty(const BaseProperty* const _p):type(Unsupported),property(_p){}
|
||||
};
|
||||
|
||||
const char* nameOfType_[12];
|
||||
|
||||
@@ -340,10 +340,10 @@ public:
|
||||
void clean_keep_reservation();
|
||||
|
||||
// --- number of items ---
|
||||
size_t n_vertices() const { return vertices_.size(); }
|
||||
size_t n_halfedges() const { return 2*edges_.size(); }
|
||||
size_t n_edges() const { return edges_.size(); }
|
||||
size_t n_faces() const { return faces_.size(); }
|
||||
size_t n_vertices() const override { return vertices_.size(); }
|
||||
size_t n_halfedges() const override { return 2*edges_.size(); }
|
||||
size_t n_edges() const override { return edges_.size(); }
|
||||
size_t n_faces() const override { return faces_.size(); }
|
||||
|
||||
bool vertices_empty() const { return vertices_.empty(); }
|
||||
bool halfedges_empty() const { return edges_.empty(); }
|
||||
@@ -697,7 +697,7 @@ public:
|
||||
typedef StatusSetT<Handle> Base;
|
||||
|
||||
public:
|
||||
AutoStatusSetT(ArrayKernel& _kernel)
|
||||
explicit AutoStatusSetT(ArrayKernel& _kernel)
|
||||
: StatusSetT<Handle>(_kernel, _kernel.pop_bit_mask(Handle()))
|
||||
{ /*assert(size() == 0);*/ } //the set should be empty on creation
|
||||
|
||||
|
||||
@@ -1121,7 +1121,7 @@ public:
|
||||
typedef ITER_TYPE iterator;
|
||||
typedef ITER_TYPE const_iterator;
|
||||
|
||||
EntityRange(CONTAINER_TYPE &container) : container_(container) {}
|
||||
explicit EntityRange(CONTAINER_TYPE &container) : container_(container) {}
|
||||
ITER_TYPE begin() const { return (container_.*begin_fn)(); }
|
||||
ITER_TYPE end() const { return (container_.*end_fn)(); }
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
PropertyT(const std::string& _name = "<unknown>")
|
||||
explicit PropertyT(const std::string& _name = "<unknown>")
|
||||
: BaseProperty(_name)
|
||||
{ }
|
||||
|
||||
@@ -394,7 +394,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
PropertyT(const std::string& _name = "<unknown>")
|
||||
explicit PropertyT(const std::string& _name = "<unknown>")
|
||||
: BaseProperty(_name)
|
||||
{ }
|
||||
|
||||
|
||||
@@ -322,21 +322,21 @@ private:
|
||||
#ifndef DOXY_IGNORE_THIS
|
||||
struct Reserve
|
||||
{
|
||||
Reserve(size_t _n) : n_(_n) {}
|
||||
explicit Reserve(size_t _n) : n_(_n) {}
|
||||
void operator()(BaseProperty* _p) const { if (_p) _p->reserve(n_); }
|
||||
size_t n_;
|
||||
};
|
||||
|
||||
struct Resize
|
||||
{
|
||||
Resize(size_t _n) : n_(_n) {}
|
||||
explicit Resize(size_t _n) : n_(_n) {}
|
||||
void operator()(BaseProperty* _p) const { if (_p) _p->resize(n_); }
|
||||
size_t n_;
|
||||
};
|
||||
|
||||
struct ResizeIfSmaller
|
||||
{
|
||||
ResizeIfSmaller(size_t _n) : n_(_n) {}
|
||||
explicit ResizeIfSmaller(size_t _n) : n_(_n) {}
|
||||
void operator()(BaseProperty* _p) const { if (_p && _p->n_elements() < n_) _p->resize(n_); }
|
||||
size_t n_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user