diff --git a/src/OpenMesh/Apps/QtViewer/QGLViewerWidget.cc b/src/OpenMesh/Apps/QtViewer/QGLViewerWidget.cc index 817df274..5a589852 100644 --- a/src/OpenMesh/Apps/QtViewer/QGLViewerWidget.cc +++ b/src/OpenMesh/Apps/QtViewer/QGLViewerWidget.cc @@ -154,10 +154,10 @@ QGLViewerWidget::~QGLViewerWidget() void QGLViewerWidget::setDefaultMaterial(void) { - GLfloat mat_a[] = {0.1, 0.1, 0.1, 1.0}; - GLfloat mat_d[] = {0.7, 0.7, 0.5, 1.0}; - GLfloat mat_s[] = {1.0, 1.0, 1.0, 1.0}; - GLfloat shine[] = {120.0}; + GLfloat mat_a[] = {0.1f, 0.1f, 0.1f, 1.0f}; + GLfloat mat_d[] = {0.7f, 0.7f, 0.5f, 1.0f}; + GLfloat mat_s[] = {1.0f, 1.0f, 1.0f, 1.0f}; + GLfloat shine[] = {120.0f}; glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_a); glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_d); @@ -171,12 +171,12 @@ QGLViewerWidget::setDefaultMaterial(void) void QGLViewerWidget::setDefaultLight(void) { - GLfloat pos1[] = { 0.1, 0.1, -0.02, 0.0}; - GLfloat pos2[] = {-0.1, 0.1, -0.02, 0.0}; - GLfloat pos3[] = { 0.0, 0.0, 0.1, 0.0}; - GLfloat col1[] = { 0.7, 0.7, 0.8, 1.0}; - GLfloat col2[] = { 0.8, 0.7, 0.7, 1.0}; - GLfloat col3[] = { 1.0, 1.0, 1.0, 1.0}; + GLfloat pos1[] = { 0.1f, 0.1f, -0.02f, 0.0f}; + GLfloat pos2[] = {-0.1f, 0.1f, -0.02f, 0.0f}; + GLfloat pos3[] = { 0.0f, 0.0f, 0.1f, 0.0f}; + GLfloat col1[] = { 0.7f, 0.7f, 0.8f, 1.0f}; + GLfloat col2[] = { 0.8f, 0.7f, 0.7f, 1.0f}; + GLfloat col3[] = { 1.0f, 1.0f, 1.0f, 1.0f}; glEnable(GL_LIGHT0); glLightfv(GL_LIGHT0,GL_POSITION, pos1); @@ -214,10 +214,10 @@ QGLViewerWidget::initializeGL() setDefaultLight(); // Fog - GLfloat fogColor[4] = { 0.3, 0.3, 0.4, 1.0 }; + GLfloat fogColor[4] = { 0.3f, 0.3f, 0.4f, 1.0f }; glFogi(GL_FOG_MODE, GL_LINEAR); glFogfv(GL_FOG_COLOR, fogColor); - glFogf(GL_FOG_DENSITY, 0.35); + glFogf(GL_FOG_DENSITY, 0.35f); glHint(GL_FOG_HINT, GL_DONT_CARE); glFogf(GL_FOG_START, 5.0f); glFogf(GL_FOG_END, 25.0f); diff --git a/src/OpenMesh/Core/IO/reader/PLYReader.cc b/src/OpenMesh/Core/IO/reader/PLYReader.cc index df42756c..e601ee63 100644 --- a/src/OpenMesh/Core/IO/reader/PLYReader.cc +++ b/src/OpenMesh/Core/IO/reader/PLYReader.cc @@ -1077,7 +1077,7 @@ bool _PLYReader_::can_u_read(std::istream& _is) const { trim(line); // Handle '\r\n' newlines - const int s = line.size(); + const size_t s = line.size(); if( s > 0 && line[s - 1] == '\r') line.resize(s - 1); //Check if this file is really a ply format diff --git a/src/OpenMesh/Tools/Smoother/JacobiLaplaceSmootherT.cc b/src/OpenMesh/Tools/Smoother/JacobiLaplaceSmootherT.cc index 1d33ff86..c88ac13d 100644 --- a/src/OpenMesh/Tools/Smoother/JacobiLaplaceSmootherT.cc +++ b/src/OpenMesh/Tools/Smoother/JacobiLaplaceSmootherT.cc @@ -123,7 +123,7 @@ compute_new_positions_C0() u -= vector_cast(Base::mesh_.point(*v_it)); // damping - u *= 0.5; + u *= static_cast< typename Mesh::Scalar >(0.5); // store new position p = vector_cast(Base::mesh_.point(*v_it)); diff --git a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc index cfea2e98..ba335f6f 100644 --- a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc +++ b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc @@ -863,7 +863,7 @@ void VF::raise(typename M::FaceHandle& _fh, state_t _target_state) if (Base::number() == Base::subdiv_rule()->number() + 1 && Base::mesh_.is_boundary(_fh) && !MOBJ(_fh).final()) - position *= 0.5; + position *= static_cast(0.5); MOBJ(_fh).set_position(_target_state, position); MOBJ(_fh).inc_state(); diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc index b36be58b..ec7a9682 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc +++ b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc @@ -309,7 +309,7 @@ CatmullClarkT::compute_midpoint( MeshType& _m, const EdgeHand // this yields the [1/2 1/2] mask if (_m.is_boundary(_eh) || !_update_points) { - pos *= 0.5; + pos *= static_cast(0.5); } // else if (_m.status(_eh).selected() ) // { @@ -321,7 +321,7 @@ CatmullClarkT::compute_midpoint( MeshType& _m, const EdgeHand { pos += _m.property(fp_pos_, _m.face_handle(heh)); pos += _m.property(fp_pos_, _m.face_handle(opp_heh)); - pos *= 0.25; + pos *= static_cast(0.25); } _m.property( ep_pos_, _eh ) = pos; } diff --git a/src/Unittests/unittests_smoother.cc b/src/Unittests/unittests_smoother.cc index 1f95ad40..62848a6b 100644 --- a/src/Unittests/unittests_smoother.cc +++ b/src/Unittests/unittests_smoother.cc @@ -111,10 +111,10 @@ TEST_F(OpenMeshSmoother_Poly, Smoother_Triangle_Laplace) { OpenMesh::Smoother::JacobiLaplaceSmootherT smoother(mesh_);; // Just call function to instantiate template - smoother.set_absolute_local_error(0.5); + smoother.set_absolute_local_error(0.5f); // Set an error - smoother.set_relative_local_error(0.1); + smoother.set_relative_local_error(0.1f); // Run algorithm with 5 steps smoother.smooth(5);