From fc75c0c62d7c241c33261b57ceb654d90c4b0405 Mon Sep 17 00:00:00 2001 From: cignoni Date: Tue, 9 Oct 2012 07:05:45 +0000 Subject: [PATCH] Harmless gcc warnings --- .../algorithms/local_optimization/tri_edge_flip.h | 2 +- vcg/complex/algorithms/polygon_support.h | 10 +++++----- vcg/complex/algorithms/update/halfedge_indexed.h | 4 +--- vcg/space/planar_polygon_tessellation.h | 14 +++++++------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/vcg/complex/algorithms/local_optimization/tri_edge_flip.h b/vcg/complex/algorithms/local_optimization/tri_edge_flip.h index 90541668..5f0bfbc3 100644 --- a/vcg/complex/algorithms/local_optimization/tri_edge_flip.h +++ b/vcg/complex/algorithms/local_optimization/tri_edge_flip.h @@ -284,7 +284,7 @@ public: const char* Info(TRIMESH_TYPE &m) { static char dump[60]; - sprintf(dump,"%d -> %d %g\n", _pos.F()->V(0)-&m.vert[0], _pos.F()->V(1)-&m.vert[0],-_priority); + sprintf(dump,"%lu -> %lu %g\n", tri::Index(m,_pos.F()->V(0)), tri::Index(m,_pos.F()->V(1)),-_priority); return dump; } diff --git a/vcg/complex/algorithms/polygon_support.h b/vcg/complex/algorithms/polygon_support.h index e7d3403a..c7ea8b17 100644 --- a/vcg/complex/algorithms/polygon_support.h +++ b/vcg/complex/algorithms/polygon_support.h @@ -93,14 +93,14 @@ namespace tri { faces.clear(); TessellatePlanarPolygon3(points,faces); tfib = tfi = Allocator::AddFaces(tm,faces.size()/3); - for(int i = 0; tfi != tm.face.end();++tfi){ + for(size_t i = 0; tfi != tm.face.end();++tfi){ (*tfi).V(0) = &tm.vert[ (*fi).V( faces[i] ) - &(*pm.vert.begin())]; (*tfi).V(1) = &tm.vert[ (*fi).V( faces[i+1]) - &(*pm.vert.begin())]; (*tfi).V(2) = &tm.vert[ (*fi).V( faces[i+2]) - &(*pm.vert.begin())]; // set the F flags - if( (faces[i]+1)%points.size() != faces[i+1]) (*tfi).SetF(0); - if( (faces[i+1]+1)%points.size() != faces[i+2]) (*tfi).SetF(1); - if( (faces[i+2]+1)%points.size() != faces[i]) (*tfi).SetF(2); + if( (faces[i ]+1)%points.size() != size_t(faces[i+1])) (*tfi).SetF(0); + if( (faces[i+1]+1)%points.size() != size_t(faces[i+2])) (*tfi).SetF(1); + if( (faces[i+2]+1)%points.size() != size_t(faces[i ])) (*tfi).SetF(2); i+=3; } @@ -153,7 +153,7 @@ namespace tri { //now vs contains all the vertices of the polygon (still in the trimesh) typename PolyMeshType::FaceIterator pfi = vcg::tri::Allocator::AddFaces(pm,1); (*pfi).Alloc(vs.size()); - for( int i = 0 ; i < vs.size(); ++i) + for(size_t i = 0 ; i < vs.size(); ++i) (*pfi).V(i) = ( typename PolyMeshType::VertexType*) & pm.vert[vs[i]-&(*tm.vert.begin())]; // here handle the other compoenents of the face (how the conponents of the n triangle faces goes in the // the property of the polygon (e.g. the normal, the color, the quality and so on) diff --git a/vcg/complex/algorithms/update/halfedge_indexed.h b/vcg/complex/algorithms/update/halfedge_indexed.h index 9bbf4a3f..039dcc62 100644 --- a/vcg/complex/algorithms/update/halfedge_indexed.h +++ b/vcg/complex/algorithms/update/halfedge_indexed.h @@ -479,10 +479,8 @@ namespace vcg ----e0_HEPp-> X ----- e0 ------> */ static void AddHEdge(MeshType &m, HEdgeType * e0, HEdgeType * e1){ - HEdgeType *iii =e0->HNp(); assert(e1!=e0->HNp()); assert(e0!=e1->HNp()); - HEdgePointer tmp; bool hasP = MeshType::HEdgeType::HasHPrevAdjacency(); assert(e0->HOp() != e1); // the hedge already exists assert(e0!=e1->HNp()); @@ -653,7 +651,7 @@ namespace vcg fp ->Alloc(vpts.size()); } //int idbg1 =fp->VN(); - for(unsigned int i = 0; i < vpts.size();++i) fp ->V(i) = vpts[i];// set the pointer from face to vertex + for(size_t i = 0; i < vpts.size();++i) fp ->V(i) = vpts[i];// set the pointer from face to vertex hV[(*ei)] = true; } diff --git a/vcg/space/planar_polygon_tessellation.h b/vcg/space/planar_polygon_tessellation.h index b235de0f..085ea4a0 100644 --- a/vcg/space/planar_polygon_tessellation.h +++ b/vcg/space/planar_polygon_tessellation.h @@ -51,8 +51,8 @@ namespace vcg { } template - bool Intersect(int cur , int v2, std::vector & next, std::vector > & points2){ - for(int i = 0; i < points2.size();++i) + bool Intersect(size_t cur , int v2, std::vector & next, std::vector > & points2){ + for(size_t i = 0; i < points2.size();++i) if( (next[i]!=-1) && (i!=cur)) if( Cross(points2[cur], points2[v2],points2[i],points2[next[i]])) return true; @@ -67,12 +67,12 @@ namespace vcg { // tessellate // first very inefficient implementation std::vector next,prev; - for(int i = 0; i < points2.size(); ++i) next.push_back((i+1)%points2.size()); - for(int i = 0; i < points2.size(); ++i) prev.push_back((i+points2.size()-1)%points2.size()); + for(size_t i = 0; i < points2.size(); ++i) next.push_back((i+1)%points2.size()); + for(size_t i = 0; i < points2.size(); ++i) prev.push_back((i+points2.size()-1)%points2.size()); int v1,v2; // check orientation S orient = 0.0; - for(int i = 0 ; i < points2.size(); ++i){ + for(size_t i = 0 ; i < points2.size(); ++i){ v1 = next[i]; v2 = next[v1]; orient+= (points2[v1] - points2[0]) ^ (points2[v2] - points2[0]); @@ -119,7 +119,7 @@ namespace vcg { int i12[2]; S bestsn = -1.0; Point3x bestn,u,v; - for(int i =0; i < points.size();++i){ + for(size_t i =0; i < points.size();++i){ for(int j = 0; j < 2; ++j){ i12[j] = i; while(i12[j]==i) i12[j] = rg.generate(points.size()-1);} n = (points[i12[0]]-points[i])^(points[i12[1]]-points[i]); S sn = n.SquaredNorm(); @@ -129,7 +129,7 @@ namespace vcg { GetUV(n,u,v); // project the coordinates std::vector > points2; - for(int i = 0; i < points.size(); ++i){ + for(size_t i = 0; i < points.size(); ++i){ Point3x & p = points[i]; points2.push_back(Point2(p*u,p*v)); }