Browse Source

fix warnings

Former-commit-id: e3512bdd2c7a278681c4a041a6bf174c07ba9a88
Alec Jacobson 10 years ago
parent
commit
6db3868e24
1 changed files with 7 additions and 7 deletions
  1. 7 7
      include/igl/doublearea.cpp

+ 7 - 7
include/igl/doublearea.cpp

@@ -23,7 +23,7 @@ IGL_INLINE void igl::doublearea(
   const int dim = V.cols();
   // Only support triangles
   assert(F.cols() == 3);
-  const int m = F.rows();
+  const size_t m = F.rows();
   // Compute edge lengths
   Eigen::PlainObjectBase<DerivedV> l;
   // "Lecture Notes on Geometric Robustness" Shewchuck 09, Section 3.1
@@ -45,7 +45,7 @@ IGL_INLINE void igl::doublearea(
     case 3:
     {
       dblA = Eigen::PlainObjectBase<DeriveddblA>::Zero(m,1);
-      for(int f = 0;f<F.rows();f++)
+      for(size_t f = 0;f<m;f++)
       {
         for(int d = 0;d<3;d++)
         {
@@ -59,7 +59,7 @@ IGL_INLINE void igl::doublearea(
     case 2:
     {
       dblA.resize(m,1);
-      for(int f = 0;f<m;f++)
+      for(size_t f = 0;f<m;f++)
       {
         dblA(f) = proj_doublearea(0,1,f);
       }
@@ -118,7 +118,7 @@ IGL_INLINE void igl::doublearea(
   // Only support triangles
   assert(ul.cols() == 3);
   // Number of triangles
-  const int m = ul.rows();
+  const size_t m = ul.rows();
   Eigen::PlainObjectBase<Derivedl> l;
   MatrixXi _;
   sort(ul,2,false,l,_);
@@ -132,7 +132,7 @@ IGL_INLINE void igl::doublearea(
   #  define IGL_OMP_MIN_VALUE 1000
   #endif
   #pragma omp parallel for if (m>IGL_OMP_MIN_VALUE)
-  for(int i = 0;i<m;i++)
+  for(size_t i = 0;i<m;i++)
   {
     //// Heron's formula for area
     //const typename Derivedl::Scalar arg =
@@ -159,12 +159,12 @@ Eigen::PlainObjectBase<DeriveddblA> & dblA)
 {
   assert(V.cols() == 3); // Only supports points in 3D
   assert(F.cols() == 4); // Only support quads
-  const int m = F.rows();
+  const size_t m = F.rows();
 
   // Split the quads into triangles
   Eigen::MatrixXi Ft(F.rows()*2,3);
 
-  for(unsigned i=0; i<F.rows();++i)
+  for(size_t i=0; i<m;++i)
   {
     Ft.row(i*2    ) << F(i,0), F(i,1), F(i,2);
     Ft.row(i*2 + 1) << F(i,2), F(i,3), F(i,0);