Harmless gcc warnings

This commit is contained in:
Paolo Cignoni 2012-10-09 07:05:45 +00:00
parent 707577cbf9
commit fc75c0c62d
4 changed files with 14 additions and 16 deletions

View File

@ -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;
}

View File

@ -93,14 +93,14 @@ namespace tri {
faces.clear();
TessellatePlanarPolygon3(points,faces);
tfib = tfi = Allocator<TriMeshType>::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<PolyMeshType>::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)

View File

@ -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;
}

View File

@ -51,8 +51,8 @@ namespace vcg {
}
template <class S>
bool Intersect(int cur , int v2, std::vector<int> & next, std::vector<Point2<S> > & points2){
for(int i = 0; i < points2.size();++i)
bool Intersect(size_t cur , int v2, std::vector<int> & next, std::vector<Point2<S> > & 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<int> 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<Point2<S> > 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<S>(p*u,p*v));
}