From d966d44a3f75276019168efbd669f420ebba3aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 7 Nov 2016 14:52:07 +0100 Subject: [PATCH] More fixes including Unit tests --- src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc | 2 +- ...rimesh_circulator_current_halfedge_handle_replacement.cc | 2 +- src/Unittests/unittests_trimesh_others.cc | 2 +- src/Unittests/unittests_tutorials.cc | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc index d9838b99..1213cab7 100644 --- a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc +++ b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc @@ -650,7 +650,7 @@ Tvv4::raise(typename M::VertexHandle& _vh, state_t _target_state) this->update(_vh, _target_state); // multiply old position by 4 - MOBJ(_vh).set_position(_target_state, MOBJ(_vh).position(_target_state - 1) * 4.0); + MOBJ(_vh).set_position(_target_state, MOBJ(_vh).position(_target_state - 1) * static_cast(4.0)); MOBJ(_vh).inc_state(); } diff --git a/src/Unittests/unittests_trimesh_circulator_current_halfedge_handle_replacement.cc b/src/Unittests/unittests_trimesh_circulator_current_halfedge_handle_replacement.cc index 53111e14..e3efb09c 100644 --- a/src/Unittests/unittests_trimesh_circulator_current_halfedge_handle_replacement.cc +++ b/src/Unittests/unittests_trimesh_circulator_current_halfedge_handle_replacement.cc @@ -328,7 +328,7 @@ TEST_F(OpenMeshTrimeshCirculatorCurrentHalfedgeHandleReplacement, vf_iter_bounda * \ / * 5 */ - size_t current_halfedge_handles[9] = { + int current_halfedge_handles[9] = { 0,2,12,4,6,8,16,10,14 }; std::vector fh0; diff --git a/src/Unittests/unittests_trimesh_others.cc b/src/Unittests/unittests_trimesh_others.cc index 14d96e37..4d125335 100644 --- a/src/Unittests/unittests_trimesh_others.cc +++ b/src/Unittests/unittests_trimesh_others.cc @@ -164,7 +164,7 @@ TEST_F(OpenMeshOthers, CalcDihedralAngre ) { EXPECT_EQ( 0.0 , mesh_.calc_dihedral_angle(eh) ) << "Wrong Dihedral angle!" << std::endl; // Modify point - Mesh::Point tmp = ( Mesh::Point(0.0, 0.0, -1.0) + Mesh::Point(1.0, 1.0, -1.0) ) * 0.5; + Mesh::Point tmp = ( Mesh::Point(0.0, 0.0, -1.0) + Mesh::Point(1.0, 1.0, -1.0) ) * static_cast(0.5); mesh_.point(vhandle[2]) = tmp; double difference = fabs( 1.36944 - mesh_.calc_dihedral_angle(eh) ); diff --git a/src/Unittests/unittests_tutorials.cc b/src/Unittests/unittests_tutorials.cc index 552fa614..b2daf890 100644 --- a/src/Unittests/unittests_tutorials.cc +++ b/src/Unittests/unittests_tutorials.cc @@ -57,7 +57,7 @@ struct MyData bool operator != (const MyData& _rhs) const { return !(*this == _rhs); } }; -typedef std::map< std::string, unsigned int > MyMap; +typedef std::map< std::string, size_t > MyMap; namespace OpenMesh { namespace IO { @@ -114,7 +114,7 @@ namespace OpenMesh { return sizeof(unsigned int); value_type::const_iterator it = _v.begin(); - unsigned int N = _v.size(); + size_t N = _v.size(); size_t bytes = IO::size_of(N); for(;it!=_v.end(); ++it) { @@ -128,7 +128,7 @@ namespace OpenMesh { size_t store(std::ostream& _os, const value_type& _v, bool _swap=false) { size_t bytes = 0; - unsigned int N = _v.size(); + size_t N = _v.size(); value_type::const_iterator it = _v.begin(); bytes += IO::store( _os, N, _swap ); for (; it != _v.end() && _os.good(); ++it)