From ba91309937b2fcbf33e8055954773b555e9becaf Mon Sep 17 00:00:00 2001 From: Marco Callieri Date: Wed, 21 Mar 2018 12:01:01 +0100 Subject: [PATCH] warning cleanup --- vcg/complex/algorithms/clean.h | 2 +- vcg/complex/algorithms/create/advancing_front.h | 2 +- vcg/complex/algorithms/create/ball_pivoting.h | 14 +++++++------- vcg/complex/algorithms/hole.h | 2 +- vcg/complex/algorithms/stat.h | 2 +- vcg/complex/algorithms/update/color.h | 1 + vcg/space/index/spatial_hashing.h | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/vcg/complex/algorithms/clean.h b/vcg/complex/algorithms/clean.h index b0babc0c..71daded7 100644 --- a/vcg/complex/algorithms/clean.h +++ b/vcg/complex/algorithms/clean.h @@ -585,7 +585,7 @@ public: firstVp++; } - return ToSplitVec.size(); + return int(ToSplitVec.size()); } diff --git a/vcg/complex/algorithms/create/advancing_front.h b/vcg/complex/algorithms/create/advancing_front.h index a6de09ab..a3955f32 100644 --- a/vcg/complex/algorithms/create/advancing_front.h +++ b/vcg/complex/algorithms/create/advancing_front.h @@ -99,7 +99,7 @@ template class AdvancingFront { void BuildMesh(CallBackPos call = NULL, int interval = 512) { float finalfacesext = mesh.vert.size() * 2.0f; - if(call) call(0, "Advancing front"); + if (call) (*call)(0, "Advancing front"); while(1) { for(int i = 0; i < interval; i++) { diff --git a/vcg/complex/algorithms/create/ball_pivoting.h b/vcg/complex/algorithms/create/ball_pivoting.h index be8c3552..be1c6413 100644 --- a/vcg/complex/algorithms/create/ball_pivoting.h +++ b/vcg/complex/algorithms/create/ball_pivoting.h @@ -120,7 +120,7 @@ template class BallPivoting: public AdvancingFront { targets.push_back(vp); } - int n = targets.size(); + int n = int(targets.size()); if(n<3) continue; bool success = true; @@ -205,10 +205,10 @@ template class BallPivoting: public AdvancingFront { Mark(vv1); Mark(vv2); - v0 = tri::Index(this->mesh,vv0); - v1 = tri::Index(this->mesh,vv1); - v2 = tri::Index(this->mesh,vv2); - return true; + v0 = int(tri::Index(this->mesh, vv0)); + v1 = int(tri::Index(this->mesh, vv1)); + v2 = int(tri::Index(this->mesh, vv2)); + return true; } return false; } @@ -252,7 +252,7 @@ template class BallPivoting: public AdvancingFront { if(nn==0) return -1; VertexType *candidate = NULL; - ScalarType min_angle = M_PI; + ScalarType min_angle = ScalarType(M_PI); // // Loop over all the nearest vertexes and choose the best one according the ball pivoting strategy. // @@ -312,7 +312,7 @@ template class BallPivoting: public AdvancingFront { assert((candidate->P() - v1).Norm() > min_edge); } - int candidateIndex = tri::Index(this->mesh,candidate); + int candidateIndex = int(tri::Index(this->mesh,candidate)); assert(candidateIndex != edge.v0 && candidateIndex != edge.v1); Point3x newnormal = ((candidate->P() - v0)^(v1 - v0)).Normalize(); diff --git a/vcg/complex/algorithms/hole.h b/vcg/complex/algorithms/hole.h index ed687fb7..064d1807 100644 --- a/vcg/complex/algorithms/hole.h +++ b/vcg/complex/algorithms/hole.h @@ -283,7 +283,7 @@ public: template class MinimumWeightEar : public TrivialEar { public: - static float &DiedralWeight() { static float _dw=0.1; return _dw;} + static float &DiedralWeight() { static float _dw=0.1f; return _dw;} typedef TrivialEar TE; typename MESH::ScalarType dihedralRad; typename MESH::ScalarType aspectRatio; diff --git a/vcg/complex/algorithms/stat.h b/vcg/complex/algorithms/stat.h index 5c45ddb4..8b3c8d90 100644 --- a/vcg/complex/algorithms/stat.h +++ b/vcg/complex/algorithms/stat.h @@ -162,7 +162,7 @@ public: for (vi = m.vert.begin(); vi != m.vert.end(); ++vi) if (!(*vi).IsD()) { - ScalarType weight = useQualityAsWeight ? (*vi).Q() : 1.0; + ScalarType weight = useQualityAsWeight ? (*vi).Q() : 1.0f; accumulator[0] += (double)((*vi).P()[0] * weight); accumulator[1] += (double)((*vi).P()[1] * weight); accumulator[2] += (double)((*vi).P()[2] * weight); diff --git a/vcg/complex/algorithms/update/color.h b/vcg/complex/algorithms/update/color.h index 8a24b5aa..dc5fbe81 100644 --- a/vcg/complex/algorithms/update/color.h +++ b/vcg/complex/algorithms/update/color.h @@ -790,6 +790,7 @@ static Color4b ColorDesaturate(Color4b c, int method) } default: assert(0); } + return Color4b(255, 255, 255, 255); } //ausiliary function to compute average lightness. value = (R+G+B)/3 diff --git a/vcg/space/index/spatial_hashing.h b/vcg/space/index/spatial_hashing.h index 24f64a96..449017c0 100644 --- a/vcg/space/index/spatial_hashing.h +++ b/vcg/space/index/spatial_hashing.h @@ -206,7 +206,7 @@ protected: inSphVec.push_back(hi); } } - return inSphVec.size(); + return int(inSphVec.size()); } size_t RemoveInSphere(const Point3 &p, const ScalarType radius)