Browse Source

prefer std::u?int[0-9]+_t and include <cstdint> else include <stdint.h> (#2302)

Alec Jacobson 2 years ago
parent
commit
7c9387c92b

+ 5 - 4
include/igl/Timer.h

@@ -22,6 +22,7 @@
 #include <sys/time.h>
 #include <sys/time.h>
 #endif
 #endif
 #include <cstddef>
 #include <cstddef>
+#include <cstdint>
 
 
 namespace igl
 namespace igl
 {
 {
@@ -69,9 +70,9 @@ namespace igl
     /// @param[in] endTime   end time
     /// @param[in] endTime   end time
     /// @param[in] startTime start time
     /// @param[in] startTime start time
     /// @return time
     /// @return time
-    double subtractTimes( uint64_t endTime, uint64_t startTime )
+    double subtractTimes( std::uint64_t endTime, std::uint64_t startTime )
     {
     {
-      uint64_t difference = endTime - startTime;
+      std::uint64_t difference = endTime - startTime;
       static double conversion = 0.0;
       static double conversion = 0.0;
 
 
       if( conversion == 0.0 )
       if( conversion == 0.0 )
@@ -175,8 +176,8 @@ namespace igl
     LARGE_INTEGER startCount;     
     LARGE_INTEGER startCount;     
     LARGE_INTEGER endCount;       
     LARGE_INTEGER endCount;       
 #elif __APPLE__
 #elif __APPLE__
-    uint64_t startCount;           
-    uint64_t endCount;             
+    std::uint64_t startCount;           
+    std::uint64_t endCount;             
 #else
 #else
     timeval startCount;           
     timeval startCount;           
     timeval endCount;             
     timeval endCount;             

+ 2 - 1
include/igl/blue_noise.cpp

@@ -15,12 +15,13 @@
 #include <algorithm>
 #include <algorithm>
 #include <vector>
 #include <vector>
 #include <random>
 #include <random>
+#include <cstdint>
 
 
 namespace igl
 namespace igl
 {
 {
   // It is very important that we use 64bit keys to avoid out of bounds (easy to
   // It is very important that we use 64bit keys to avoid out of bounds (easy to
   // get to happen with dense samplings (e.g., r = 0.0005*bbd)
   // get to happen with dense samplings (e.g., r = 0.0005*bbd)
-  typedef int64_t BlueNoiseKeyType;
+  typedef std::int64_t BlueNoiseKeyType;
 }
 }
 
 
 // Helper functions
 // Helper functions

+ 2 - 2
include/igl/boundary_conditions.cpp

@@ -122,7 +122,7 @@ IGL_INLINE bool igl::boundary_conditions(
     }
     }
   }
   }
 
 
-  std::vector<uint8_t> vertices_marked(V.rows(), 0);
+  std::vector<bool> vertices_marked(V.rows(), false);
   // loop over cage faces
   // loop over cage faces
   for(int f = 0;f<CF.rows();f++)
   for(int f = 0;f<CF.rows();f++)
   {
   {
@@ -158,7 +158,7 @@ IGL_INLINE bool igl::boundary_conditions(
 
 
         if (u>=0. && u<=1.0 && v>=0. && v<=1.0 && w >=0. && w<=1.0)
         if (u>=0. && u<=1.0 && v>=0. && v<=1.0 && w >=0. && w<=1.0)
         {
         {
-          vertices_marked[i] = 1;
+          vertices_marked[i] = true;
           bci.push_back(i);
           bci.push_back(i);
           bcj.push_back(CF(f, 0));
           bcj.push_back(CF(f, 0));
           bcv.push_back(u);
           bcv.push_back(u);

+ 8 - 13
include/igl/copyleft/cgal/peel_outer_hull_layers.cpp

@@ -22,7 +22,7 @@ template <
   typename DerivedF,
   typename DerivedF,
   typename DerivedI,
   typename DerivedI,
   typename Derivedflip>
   typename Derivedflip>
-IGL_INLINE size_t igl::copyleft::cgal::peel_outer_hull_layers(
+IGL_INLINE int igl::copyleft::cgal::peel_outer_hull_layers(
   const Eigen::PlainObjectBase<DerivedV > & V,
   const Eigen::PlainObjectBase<DerivedV > & V,
   const Eigen::PlainObjectBase<DerivedF > & F,
   const Eigen::PlainObjectBase<DerivedF > & F,
   Eigen::PlainObjectBase<DerivedI> & I,
   Eigen::PlainObjectBase<DerivedI> & I,
@@ -31,10 +31,9 @@ IGL_INLINE size_t igl::copyleft::cgal::peel_outer_hull_layers(
   using namespace Eigen;
   using namespace Eigen;
   using namespace std;
   using namespace std;
   typedef Matrix<typename DerivedF::Scalar,Dynamic,DerivedF::ColsAtCompileTime> MatrixXF;
   typedef Matrix<typename DerivedF::Scalar,Dynamic,DerivedF::ColsAtCompileTime> MatrixXF;
-  typedef typename DerivedF::Scalar Index;
-  typedef Matrix<Index,Dynamic,1> MatrixXI;
+  typedef Matrix<int,Dynamic,1> MatrixXI;
   typedef Matrix<typename Derivedflip::Scalar,Dynamic,Derivedflip::ColsAtCompileTime> MatrixXflip;
   typedef Matrix<typename Derivedflip::Scalar,Dynamic,Derivedflip::ColsAtCompileTime> MatrixXflip;
-  const Index m = F.rows();
+  const int m = F.rows();
 #ifdef IGL_PEEL_OUTER_HULL_LAYERS_DEBUG
 #ifdef IGL_PEEL_OUTER_HULL_LAYERS_DEBUG
   cout<<"peel outer hull layers..."<<endl;
   cout<<"peel outer hull layers..."<<endl;
 #endif
 #endif
@@ -54,7 +53,7 @@ IGL_INLINE size_t igl::copyleft::cgal::peel_outer_hull_layers(
   MatrixXI IM = igl::LinSpaced<MatrixXI >(m,0,m-1);
   MatrixXI IM = igl::LinSpaced<MatrixXI >(m,0,m-1);
   // This is O(n * layers)
   // This is O(n * layers)
   MatrixXI P(m,1);
   MatrixXI P(m,1);
-  Index iter = 0;
+  int iter = 0;
   while(Fr.size() > 0)
   while(Fr.size() > 0)
   {
   {
     assert(Fr.rows() == IM.rows());
     assert(Fr.rows() == IM.rows());
@@ -84,7 +83,7 @@ IGL_INLINE size_t igl::copyleft::cgal::peel_outer_hull_layers(
     assert(Fo.rows() == Jo.rows());
     assert(Fo.rows() == Jo.rows());
     // all faces in Fo of Fr
     // all faces in Fo of Fr
     vector<bool> in_outer(Fr.rows(),false);
     vector<bool> in_outer(Fr.rows(),false);
-    for(Index g = 0;g<Jo.rows();g++)
+    for(int g = 0;g<Jo.rows();g++)
     {
     {
       I(IM(Jo(g))) = iter;
       I(IM(Jo(g))) = iter;
       P(IM(Jo(g))) = iter;
       P(IM(Jo(g))) = iter;
@@ -98,8 +97,8 @@ IGL_INLINE size_t igl::copyleft::cgal::peel_outer_hull_layers(
     Fr.resize(prev_Fr.rows() - Fo.rows(),F.cols());
     Fr.resize(prev_Fr.rows() - Fo.rows(),F.cols());
     IM.resize(Fr.rows());
     IM.resize(Fr.rows());
     {
     {
-      Index g = 0;
-      for(Index f = 0;f<prev_Fr.rows();f++)
+      int g = 0;
+      for(int f = 0;f<prev_Fr.rows();f++)
       {
       {
         if(!in_outer[f])
         if(!in_outer[f])
         {
         {
@@ -119,9 +118,5 @@ IGL_INLINE size_t igl::copyleft::cgal::peel_outer_hull_layers(
 #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
 #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template size_t igl::copyleft::cgal::peel_outer_hull_layers<Eigen::Matrix<CGAL::Epeck::FT, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Epeck::FT, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-#include <cstdint>
-#ifdef WIN32
-template uint64_t igl::copyleft::cgal::peel_outer_hull_layers<Eigen::Matrix<CGAL::Epeck::FT, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Epeck::FT, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-#endif
+template int igl::copyleft::cgal::peel_outer_hull_layers<Eigen::Matrix<CGAL::Epeck::FT, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Epeck::FT, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 #endif
 #endif

+ 1 - 1
include/igl/copyleft/cgal/peel_outer_hull_layers.h

@@ -30,7 +30,7 @@ namespace igl
         typename DerivedF,
         typename DerivedF,
         typename DerivedI,
         typename DerivedI,
         typename Derivedflip>
         typename Derivedflip>
-      IGL_INLINE size_t peel_outer_hull_layers(
+      IGL_INLINE int peel_outer_hull_layers(
         const Eigen::PlainObjectBase<DerivedV > & V,
         const Eigen::PlainObjectBase<DerivedV > & V,
         const Eigen::PlainObjectBase<DerivedF > & F,
         const Eigen::PlainObjectBase<DerivedF > & F,
         Eigen::PlainObjectBase<DerivedI > & I,
         Eigen::PlainObjectBase<DerivedI > & I,

+ 8 - 7
include/igl/dual_contouring.cpp

@@ -6,6 +6,7 @@
 #include <vector>
 #include <vector>
 #include <unordered_map>
 #include <unordered_map>
 #include <iostream>
 #include <iostream>
+#include <cstdint>
 
 
 namespace igl
 namespace igl
 {
 {
@@ -14,17 +15,17 @@ namespace igl
   {
   {
     public:
     public:
       // https://stackoverflow.com/a/26348708/148668
       // https://stackoverflow.com/a/26348708/148668
-      uint64_t operator()(const std::tuple<int, int, int> & key) const
+      std::uint64_t operator()(const std::tuple<int, int, int> & key) const
       {
       {
         // Check that conversion is safe. Could use int16_t directly everywhere
         // Check that conversion is safe. Could use int16_t directly everywhere
         // below but it's an uncommon type to expose and grid indices should
         // below but it's an uncommon type to expose and grid indices should
         // never be more than 2¹⁵-1 in the first place.
         // never be more than 2¹⁵-1 in the first place.
-        assert( std::get<0>(key) == (int)(int16_t)std::get<0>(key));
-        assert( std::get<1>(key) == (int)(int16_t)std::get<1>(key));
-        assert( std::get<2>(key) == (int)(int16_t)std::get<2>(key));
-        uint64_t result = uint16_t(std::get<0>(key));
-        result = (result << 16) + uint16_t(std::get<1>(key));
-        result = (result << 16) + uint16_t(std::get<2>(key));
+        assert( std::get<0>(key) == (int)(std::int16_t)std::get<0>(key));
+        assert( std::get<1>(key) == (int)(std::int16_t)std::get<1>(key));
+        assert( std::get<2>(key) == (int)(std::int16_t)std::get<2>(key));
+        std::uint64_t result = std::uint16_t(std::get<0>(key));
+        result = (result << 16) + std::uint16_t(std::get<1>(key));
+        result = (result << 16) + std::uint16_t(std::get<2>(key));
         return result;
         return result;
       };
       };
   };
   };

+ 36 - 42
include/igl/extract_manifold_patches.cpp

@@ -17,7 +17,7 @@ template <
   typename DeriveduEC,
   typename DeriveduEC,
   typename DeriveduEE,
   typename DeriveduEE,
   typename DerivedP>
   typename DerivedP>
-IGL_INLINE size_t igl::extract_manifold_patches(
+IGL_INLINE int igl::extract_manifold_patches(
   const Eigen::MatrixBase<DerivedF>& F,
   const Eigen::MatrixBase<DerivedF>& F,
   const Eigen::MatrixBase<DerivedEMAP>& EMAP,
   const Eigen::MatrixBase<DerivedEMAP>& EMAP,
   const Eigen::MatrixBase<DeriveduEC>& uEC,
   const Eigen::MatrixBase<DeriveduEC>& uEC,
@@ -25,25 +25,25 @@ IGL_INLINE size_t igl::extract_manifold_patches(
   Eigen::PlainObjectBase<DerivedP>& P)
   Eigen::PlainObjectBase<DerivedP>& P)
 {
 {
   assert(F.cols() == 3);
   assert(F.cols() == 3);
-  const size_t num_faces = F.rows();
+  const int num_faces = F.rows();
 
 
   // given directed edge index return corresponding face index
   // given directed edge index return corresponding face index
-  auto e2f = [&](size_t ei) { return ei % num_faces; };
+  auto e2f = [&](int ei) { return ei % num_faces; };
   // given face index and corner given index of opposite directed edge
   // given face index and corner given index of opposite directed edge
-  auto fc2e = [&](size_t fi, size_t ci) { return ci*num_faces + fi; };
+  auto fc2e = [&](int fi, int ci) { return ci*num_faces + fi; };
   // given face index and corner return whether unique edge has incidence == 2
   // given face index and corner return whether unique edge has incidence == 2
-  auto is_manifold_edge = [&](size_t fi, size_t ci) -> bool 
+  auto is_manifold_edge = [&](int fi, int ci) -> bool 
   {
   {
-    const size_t ei = fc2e(fi, ci);
-    const size_t u = EMAP(ei);
+    const int ei = fc2e(fi, ci);
+    const int u = EMAP(ei);
     //return uE2E[EMAP(ei)].size() == 2;
     //return uE2E[EMAP(ei)].size() == 2;
     return (uEC(u+1)-uEC(u))==2;
     return (uEC(u+1)-uEC(u))==2;
   };
   };
   // given face and corner index return adjacent face index (assumes manifold)
   // given face and corner index return adjacent face index (assumes manifold)
-  auto fc2a = [&](size_t fi, size_t ci) -> size_t 
+  auto fc2a = [&](int fi, int ci) -> int 
   {
   {
-    const size_t ei = fc2e(fi, ci);
-    const size_t u = EMAP(ei);
+    const int ei = fc2e(fi, ci);
+    const int u = EMAP(ei);
     //const auto& adj_faces = uE2E[EMAP(ei)];
     //const auto& adj_faces = uE2E[EMAP(ei)];
     //assert(adj_faces.size() == 2);
     //assert(adj_faces.size() == 2);
     assert(uEC(u+1)-uEC(u) == 2);
     assert(uEC(u+1)-uEC(u) == 2);
@@ -62,23 +62,23 @@ IGL_INLINE size_t igl::extract_manifold_patches(
   const Scalar INVALID = std::numeric_limits<Scalar>::max();
   const Scalar INVALID = std::numeric_limits<Scalar>::max();
   P.resize(num_faces,1);
   P.resize(num_faces,1);
   P.setConstant(INVALID);
   P.setConstant(INVALID);
-  size_t num_patches = 0;
-  for (size_t i=0; i<num_faces; i++) 
+  int num_patches = 0;
+  for (int i=0; i<num_faces; i++) 
   {
   {
     if (P(i,0) != INVALID) continue;
     if (P(i,0) != INVALID) continue;
 
 
-    std::queue<size_t> Q;
+    std::queue<int> Q;
     Q.push(i);
     Q.push(i);
     P(i,0) = num_patches;
     P(i,0) = num_patches;
     while (!Q.empty()) 
     while (!Q.empty()) 
     {
     {
-      const size_t fid = Q.front();
+      const int fid = Q.front();
       Q.pop();
       Q.pop();
-      for (size_t j=0; j<3; j++) 
+      for (int j=0; j<3; j++) 
       {
       {
         if (is_manifold_edge(fid, j)) 
         if (is_manifold_edge(fid, j)) 
         {
         {
-          const size_t adj_fid = fc2a(fid, j);
+          const int adj_fid = fc2a(fid, j);
           if (P(adj_fid,0) == INVALID) 
           if (P(adj_fid,0) == INVALID) 
           {
           {
             Q.push(adj_fid);
             Q.push(adj_fid);
@@ -99,25 +99,25 @@ template<
   typename DerivedEMAP,
   typename DerivedEMAP,
   typename uE2EType,
   typename uE2EType,
   typename DerivedP>
   typename DerivedP>
-IGL_INLINE size_t igl::extract_manifold_patches(
+IGL_INLINE int igl::extract_manifold_patches(
   const Eigen::MatrixBase<DerivedF>& F,
   const Eigen::MatrixBase<DerivedF>& F,
   const Eigen::MatrixBase<DerivedEMAP>& EMAP,
   const Eigen::MatrixBase<DerivedEMAP>& EMAP,
   const std::vector<std::vector<uE2EType> >& uE2E,
   const std::vector<std::vector<uE2EType> >& uE2E,
   Eigen::PlainObjectBase<DerivedP>& P)
   Eigen::PlainObjectBase<DerivedP>& P)
 {
 {
     assert(F.cols() == 3);
     assert(F.cols() == 3);
-    const size_t num_faces = F.rows();
+    const int num_faces = F.rows();
 
 
-    auto edge_index_to_face_index = [&](size_t ei) { return ei % num_faces; };
-    auto face_and_corner_index_to_edge_index = [&](size_t fi, size_t ci) {
+    auto edge_index_to_face_index = [&](int ei) { return ei % num_faces; };
+    auto face_and_corner_index_to_edge_index = [&](int fi, int ci) {
         return ci*num_faces + fi;
         return ci*num_faces + fi;
     };
     };
-    auto is_manifold_edge = [&](size_t fi, size_t ci) -> bool {
-        const size_t ei = face_and_corner_index_to_edge_index(fi, ci);
+    auto is_manifold_edge = [&](int fi, int ci) -> bool {
+        const int ei = face_and_corner_index_to_edge_index(fi, ci);
         return uE2E[EMAP(ei, 0)].size() == 2;
         return uE2E[EMAP(ei, 0)].size() == 2;
     };
     };
-    auto get_adj_face_index = [&](size_t fi, size_t ci) -> size_t {
-        const size_t ei = face_and_corner_index_to_edge_index(fi, ci);
+    auto get_adj_face_index = [&](int fi, int ci) -> int {
+        const int ei = face_and_corner_index_to_edge_index(fi, ci);
         const auto& adj_faces = uE2E[EMAP(ei, 0)];
         const auto& adj_faces = uE2E[EMAP(ei, 0)];
         assert(adj_faces.size() == 2);
         assert(adj_faces.size() == 2);
         if (adj_faces[0] == ei) {
         if (adj_faces[0] == ei) {
@@ -132,19 +132,19 @@ IGL_INLINE size_t igl::extract_manifold_patches(
     const Scalar INVALID = std::numeric_limits<Scalar>::max();
     const Scalar INVALID = std::numeric_limits<Scalar>::max();
     P.resize(num_faces,1);
     P.resize(num_faces,1);
     P.setConstant(INVALID);
     P.setConstant(INVALID);
-    size_t num_patches = 0;
-    for (size_t i=0; i<num_faces; i++) {
+    int num_patches = 0;
+    for (int i=0; i<num_faces; i++) {
         if (P(i,0) != INVALID) continue;
         if (P(i,0) != INVALID) continue;
 
 
-        std::queue<size_t> Q;
+        std::queue<int> Q;
         Q.push(i);
         Q.push(i);
         P(i,0) = num_patches;
         P(i,0) = num_patches;
         while (!Q.empty()) {
         while (!Q.empty()) {
-            const size_t fid = Q.front();
+            const int fid = Q.front();
             Q.pop();
             Q.pop();
-            for (size_t j=0; j<3; j++) {
+            for (int j=0; j<3; j++) {
                 if (is_manifold_edge(fid, j)) {
                 if (is_manifold_edge(fid, j)) {
-                    const size_t adj_fid = get_adj_face_index(fid, j);
+                    const int adj_fid = get_adj_face_index(fid, j);
                     if (P(adj_fid,0) == INVALID) {
                     if (P(adj_fid,0) == INVALID) {
                         Q.push(adj_fid);
                         Q.push(adj_fid);
                         P(adj_fid,0) = num_patches;
                         P(adj_fid,0) = num_patches;
@@ -162,13 +162,13 @@ IGL_INLINE size_t igl::extract_manifold_patches(
 template <
 template <
     typename DerivedF,
     typename DerivedF,
     typename DerivedP>
     typename DerivedP>
-IGL_INLINE size_t igl::extract_manifold_patches(
+IGL_INLINE int igl::extract_manifold_patches(
     const Eigen::MatrixBase<DerivedF> &F,
     const Eigen::MatrixBase<DerivedF> &F,
     Eigen::PlainObjectBase<DerivedP> &P)
     Eigen::PlainObjectBase<DerivedP> &P)
 {
 {
   Eigen::MatrixXi E, uE;
   Eigen::MatrixXi E, uE;
   Eigen::VectorXi EMAP;
   Eigen::VectorXi EMAP;
-  std::vector<std::vector<size_t> > uE2E;
+  std::vector<std::vector<int> > uE2E;
   igl::unique_edge_map(F, E, uE, EMAP, uE2E);
   igl::unique_edge_map(F, E, uE, EMAP, uE2E);
   return igl::extract_manifold_patches(F, EMAP, uE2E, P);
   return igl::extract_manifold_patches(F, EMAP, uE2E, P);
 }
 }
@@ -177,14 +177,8 @@ IGL_INLINE size_t igl::extract_manifold_patches(
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template size_t igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-// generated by autoexplicit.sh
-template size_t igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>,   Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-template size_t igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-template size_t igl::extract_manifold_patches<Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&); 
-#ifdef WIN32
-template uint64_t igl::extract_manifold_patches<class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>, uint64_t, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> const &, class std::vector<class std::vector<uint64_t, class std::allocator<uint64_t>>, class std::allocator<class std::vector<uint64_t, class std::allocator<uint64_t>>>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
-template uint64_t igl::extract_manifold_patches<class Eigen::Matrix<int, -1, 3, 1, -1, 3>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>, uint64_t, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<int, -1, 3, 1, -1, 3>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> const &, class std::vector<class std::vector<uint64_t, class std::allocator<uint64_t>>, class std::allocator<class std::vector<uint64_t, class std::allocator<uint64_t>>>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
-template uint64_t igl::extract_manifold_patches<class Eigen::Matrix<int,-1,-1,0,-1,-1>,class Eigen::Matrix<int,-1,1,0,-1,1>,class Eigen::Matrix<int,-1,1,0,-1,1>,class Eigen::Matrix<int,-1,1,0,-1,1>,class Eigen::Matrix<int,-1,1,0,-1,1> >(class Eigen::MatrixBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > const &,class Eigen::MatrixBase<class Eigen::Matrix<int,-1,1,0,-1,1> > const &,class Eigen::MatrixBase<class Eigen::Matrix<int,-1,1,0,-1,1> > const &,class Eigen::MatrixBase<class Eigen::Matrix<int,-1,1,0,-1,1> > const &,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,1,0,-1,1> > &);
-#endif
+template int igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template int igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>,   Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template int igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template int igl::extract_manifold_patches<Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&); 
 #endif
 #endif

+ 3 - 3
include/igl/extract_manifold_patches.h

@@ -29,7 +29,7 @@ namespace igl {
     typename DeriveduEC,
     typename DeriveduEC,
     typename DeriveduEE,
     typename DeriveduEE,
     typename DerivedP>
     typename DerivedP>
-  IGL_INLINE size_t extract_manifold_patches(
+  IGL_INLINE int extract_manifold_patches(
     const Eigen::MatrixBase<DerivedF>& F,
     const Eigen::MatrixBase<DerivedF>& F,
     const Eigen::MatrixBase<DerivedEMAP>& EMAP,
     const Eigen::MatrixBase<DerivedEMAP>& EMAP,
     const Eigen::MatrixBase<DeriveduEC>& uEC,
     const Eigen::MatrixBase<DeriveduEC>& uEC,
@@ -42,7 +42,7 @@ namespace igl {
     typename DerivedEMAP,
     typename DerivedEMAP,
     typename uE2EType,
     typename uE2EType,
     typename DerivedP>
     typename DerivedP>
-  IGL_INLINE size_t extract_manifold_patches(
+  IGL_INLINE int extract_manifold_patches(
     const Eigen::MatrixBase<DerivedF>& F,
     const Eigen::MatrixBase<DerivedF>& F,
     const Eigen::MatrixBase<DerivedEMAP>& EMAP,
     const Eigen::MatrixBase<DerivedEMAP>& EMAP,
     const std::vector<std::vector<uE2EType> >& uE2E,
     const std::vector<std::vector<uE2EType> >& uE2E,
@@ -51,7 +51,7 @@ namespace igl {
   template <
   template <
       typename DerivedF,
       typename DerivedF,
       typename DerivedP>
       typename DerivedP>
-  IGL_INLINE size_t extract_manifold_patches(
+  IGL_INLINE int extract_manifold_patches(
       const Eigen::MatrixBase<DerivedF> &F,
       const Eigen::MatrixBase<DerivedF> &F,
       Eigen::PlainObjectBase<DerivedP> &P);
       Eigen::PlainObjectBase<DerivedP> &P);
 }
 }

+ 7 - 6
include/igl/march_cube.cpp

@@ -6,6 +6,7 @@
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can 
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can 
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "march_cube.h"
 #include "march_cube.h"
+#include <cstdint>
 
 
 // Something bad is happening when I made this a function. Maybe
 // Something bad is happening when I made this a function. Maybe
 // something is not inlining? It ends up 1.25× slower than if the code is pasted
 // something is not inlining? It ends up 1.25× slower than if the code is pasted
@@ -33,7 +34,7 @@ IGL_INLINE void igl::march_cube(
   Index & n,
   Index & n,
   Eigen::PlainObjectBase<DerivedF> &F,
   Eigen::PlainObjectBase<DerivedF> &F,
   Index & m,
   Index & m,
-  std::unordered_map<int64_t,int> & E2V)
+  std::unordered_map<std::int64_t,int> & E2V)
 {
 {
 
 
 // These consts get stored reasonably
 // These consts get stored reasonably
@@ -45,7 +46,7 @@ IGL_INLINE void igl::march_cube(
       (const Index & i, const Index & j, const Scalar & t)->Index
       (const Index & i, const Index & j, const Scalar & t)->Index
   {
   {
     // Seems this is successfully inlined.
     // Seems this is successfully inlined.
-    const auto ij2key = [](int32_t i,int32_t j)
+    const auto ij2key = [](std::int32_t i,std::int32_t j)
     {
     {
       if(i>j){ std::swap(i,j); }
       if(i>j){ std::swap(i,j); }
       std::int64_t ret = 0;
       std::int64_t ret = 0;
@@ -126,10 +127,10 @@ IGL_INLINE void igl::march_cube(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::march_cube<Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >, float, unsigned int, Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<float, 8, 1, 0, 8, 1> const&, Eigen::Matrix<unsigned int, 8, 1, 0, 8, 1> const&, float const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, unsigned int&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&, unsigned int&, std::unordered_map<int64_t, int, std::hash<int64_t>, std::equal_to<int64_t>, std::allocator<std::pair<int64_t const, int> > >&);
-template void igl::march_cube<Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >, double, unsigned int, Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<double, 8, 1, 0, 8, 1> const&, Eigen::Matrix<unsigned int, 8, 1, 0, 8, 1> const&, double const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&, unsigned int&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&, unsigned int&, std::unordered_map<int64_t, int, std::hash<int64_t>, std::equal_to<int64_t>, std::allocator<std::pair<int64_t const, int> > >&);
-template void igl::march_cube<Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >, double, long, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<double, 8, 1, 0, 8, 1> const&, Eigen::Matrix<long, 8, 1, 0, 8, 1> const&, double const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, long&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, long&, std::unordered_map<int64_t, int, std::hash<int64_t>, std::equal_to<int64_t>, std::allocator<std::pair<int64_t const, int> > >&);
-template void igl::march_cube<Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >, double, unsigned int, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<double, 8, 1, 0, 8, 1> const&, Eigen::Matrix<unsigned int, 8, 1, 0, 8, 1> const&, double const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, unsigned int&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, unsigned int&, std::unordered_map<int64_t, int, std::hash<int64_t>, std::equal_to<int64_t>, std::allocator<std::pair<int64_t const, int> > >&);
+template void igl::march_cube<Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >, float, unsigned int, Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<float, 8, 1, 0, 8, 1> const&, Eigen::Matrix<unsigned int, 8, 1, 0, 8, 1> const&, float const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, unsigned int&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&, unsigned int&, std::unordered_map<std::int64_t, int, std::hash<std::int64_t>, std::equal_to<std::int64_t>, std::allocator<std::pair<std::int64_t const, int> > >&);
+template void igl::march_cube<Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >, double, unsigned int, Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<double, 8, 1, 0, 8, 1> const&, Eigen::Matrix<unsigned int, 8, 1, 0, 8, 1> const&, double const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&, unsigned int&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&, unsigned int&, std::unordered_map<std::int64_t, int, std::hash<std::int64_t>, std::equal_to<std::int64_t>, std::allocator<std::pair<std::int64_t const, int> > >&);
+template void igl::march_cube<Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >, double, long, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<double, 8, 1, 0, 8, 1> const&, Eigen::Matrix<long, 8, 1, 0, 8, 1> const&, double const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, long&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, long&, std::unordered_map<std::int64_t, int, std::hash<std::int64_t>, std::equal_to<std::int64_t>, std::allocator<std::pair<std::int64_t const, int> > >&);
+template void igl::march_cube<Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >, double, unsigned int, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<double, 8, 1, 0, 8, 1> const&, Eigen::Matrix<unsigned int, 8, 1, 0, 8, 1> const&, double const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, unsigned int&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, unsigned int&, std::unordered_map<std::int64_t, int, std::hash<std::int64_t>, std::equal_to<std::int64_t>, std::allocator<std::pair<std::int64_t const, int> > >&);
 #ifdef WIN32
 #ifdef WIN32
 template void __cdecl igl::march_cube<class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> >,double,__int64,class Eigen::Matrix<double,-1,-1,0,-1,-1>,class Eigen::Matrix<int,-1,-1,0,-1,-1> >(class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &,class Eigen::Matrix<double,8,1,0,8,1> const &,class Eigen::Matrix<__int64,8,1,0,8,1> const &,double const &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > &,__int64 &,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > &,__int64 &,class std::unordered_map<__int64,int,struct std::hash<__int64>,struct std::equal_to<__int64>,class std::allocator<struct std::pair<__int64 const ,int> > > &);
 template void __cdecl igl::march_cube<class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> >,double,__int64,class Eigen::Matrix<double,-1,-1,0,-1,-1>,class Eigen::Matrix<int,-1,-1,0,-1,-1> >(class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &,class Eigen::Matrix<double,8,1,0,8,1> const &,class Eigen::Matrix<__int64,8,1,0,8,1> const &,double const &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > &,__int64 &,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > &,__int64 &,class std::unordered_map<__int64,int,struct std::hash<__int64>,struct std::equal_to<__int64>,class std::allocator<struct std::pair<__int64 const ,int> > > &);
 #endif
 #endif

+ 2 - 1
include/igl/march_cube.h

@@ -10,6 +10,7 @@
 #include "igl_inline.h"
 #include "igl_inline.h"
 #include <Eigen/Core>
 #include <Eigen/Core>
 #include <unordered_map>
 #include <unordered_map>
+#include <cstdint>
 namespace igl
 namespace igl
 {
 {
   /// Process a single cube of a marching cubes grid.
   /// Process a single cube of a marching cubes grid.
@@ -42,7 +43,7 @@ namespace igl
     Index & n,
     Index & n,
     Eigen::PlainObjectBase<DerivedF> &F,
     Eigen::PlainObjectBase<DerivedF> &F,
     Index & m,
     Index & m,
-    std::unordered_map<int64_t,int> & E2V);
+    std::unordered_map<std::int64_t,int> & E2V);
 }
 }
 
 
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 3 - 2
include/igl/marching_cubes.cpp

@@ -13,6 +13,7 @@
 
 
 #include <unordered_map>
 #include <unordered_map>
 #include <iostream>
 #include <iostream>
+#include <cstdint>
 
 
 template <typename DerivedS, typename DerivedGV, typename DerivedV, typename DerivedF>
 template <typename DerivedS, typename DerivedGV, typename DerivedV, typename DerivedF>
 IGL_INLINE void igl::marching_cubes(
 IGL_INLINE void igl::marching_cubes(
@@ -31,7 +32,7 @@ IGL_INLINE void igl::marching_cubes(
   const unsigned ioffset[8] = {0,1,1+nx,nx,nx*ny,1+nx*ny,1+nx+nx*ny,nx+nx*ny};
   const unsigned ioffset[8] = {0,1,1+nx,nx,nx*ny,1+nx*ny,1+nx+nx*ny,nx+nx*ny};
 
 
 
 
-  std::unordered_map<int64_t,int> E2V;
+  std::unordered_map<std::int64_t,int> E2V;
   V.resize(std::pow(nx*ny*nz,2./3.),3);
   V.resize(std::pow(nx*ny*nz,2./3.),3);
   F.resize(std::pow(nx*ny*nz,2./3.),3);
   F.resize(std::pow(nx*ny*nz,2./3.),3);
   Index n = 0;
   Index n = 0;
@@ -103,7 +104,7 @@ IGL_INLINE void igl::marching_cubes(
   typedef Eigen::Index Index;
   typedef Eigen::Index Index;
   typedef typename DerivedV::Scalar Scalar;
   typedef typename DerivedV::Scalar Scalar;
 
 
-  std::unordered_map<int64_t,int> E2V;
+  std::unordered_map<std::int64_t,int> E2V;
   V.resize(4*GV.rows(),3);
   V.resize(4*GV.rows(),3);
   F.resize(4*GV.rows(),3);
   F.resize(4*GV.rows(),3);
   Index n = 0;
   Index n = 0;

+ 3 - 3
include/igl/marching_tets.cpp

@@ -40,7 +40,7 @@ void igl::marching_tets(
   // 32 bits of a key are the indices of vertices in the mesh. The implication is
   // 32 bits of a key are the indices of vertices in the mesh. The implication is
   // that you can only have 2^32 vertices which I have deemed sufficient for
   // that you can only have 2^32 vertices which I have deemed sufficient for
   // anything reasonable.
   // anything reasonable.
-  const auto make_edge_key = [](const pair<int32_t, int32_t>& p) -> int64_t
+  const auto make_edge_key = [](const pair<int32_t, int32_t>& p) -> std::int64_t
   {
   {
     std::int64_t ret = 0;
     std::int64_t ret = 0;
     ret |= p.first;
     ret |= p.first;
@@ -144,7 +144,7 @@ void igl::marching_tets(
   bc_triplets.reserve(edge_table.size());
   bc_triplets.reserve(edge_table.size());
 
 
   // Deduplicate vertices
   // Deduplicate vertices
-  unordered_map<int64_t, int> emap;
+  unordered_map<std::int64_t, int> emap;
   emap.max_load_factor(0.5);
   emap.max_load_factor(0.5);
   emap.reserve(edge_table.size());
   emap.reserve(edge_table.size());
 
 
@@ -158,7 +158,7 @@ void igl::marching_tets(
     {
     {
       const int vi = faces[f].first[v];
       const int vi = faces[f].first[v];
       const pair<int32_t, int32_t> edge = edge_table[vi];
       const pair<int32_t, int32_t> edge = edge_table[vi];
-      const int64_t key = make_edge_key(edge);
+      const std::int64_t key = make_edge_key(edge);
       auto it = emap.find(key);
       auto it = emap.find(key);
       if (it == emap.end()) // New unique vertex, insert it
       if (it == emap.end()) // New unique vertex, insert it
       {
       {

+ 2 - 2
include/igl/opengl/MeshGL.h

@@ -104,7 +104,7 @@ public:
   // Text Rendering
   // Text Rendering
   struct TextGL
   struct TextGL
   { 
   { 
-    uint32_t dirty_flag;
+    std::uint32_t dirty_flag;
     GLuint vao_labels;
     GLuint vao_labels;
     GLuint vbo_labels_pos;
     GLuint vbo_labels_pos;
     GLuint vbo_labels_characters;
     GLuint vbo_labels_characters;
@@ -133,7 +133,7 @@ public:
   Eigen::Matrix<unsigned, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> points_F_vbo;
   Eigen::Matrix<unsigned, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> points_F_vbo;
 
 
   /// Marks dirty buffers that need to be uploaded to OpenGL
   /// Marks dirty buffers that need to be uploaded to OpenGL
-  uint32_t dirty;
+  std::uint32_t dirty;
 
 
   IGL_INLINE MeshGL();
   IGL_INLINE MeshGL();
 
 

+ 1 - 1
include/igl/path_to_executable.cpp

@@ -22,7 +22,7 @@ IGL_INLINE std::string igl::path_to_executable()
   using namespace std;
   using namespace std;
   std::string path;
   std::string path;
   char buffer[1024];
   char buffer[1024];
-  uint32_t size = sizeof(buffer);
+  std::uint32_t size = sizeof(buffer);
 #if defined (WIN32)
 #if defined (WIN32)
   GetModuleFileName(nullptr,buffer,size);
   GetModuleFileName(nullptr,buffer,size);
   path = buffer;
   path = buffer;

+ 14 - 13
include/igl/readPLY.cpp

@@ -3,6 +3,7 @@
 #include <set>
 #include <set>
 #include <fstream>
 #include <fstream>
 #include <iostream>
 #include <iostream>
+#include <cstdint>
 #include <Eigen/Core>
 #include <Eigen/Core>
 
 
 #include "tinyply.h"
 #include "tinyply.h"
@@ -39,17 +40,17 @@ IGL_INLINE bool tinyply_buffer_to_matrix(
   switch(D.t)
   switch(D.t)
   {
   {
     case tinyply::Type::INT8 :
     case tinyply::Type::INT8 :
-      return   _tinyply_buffer_to_matrix<int8_t,Derived>(D, M,rows,cols);
+      return   _tinyply_buffer_to_matrix<std::int8_t,Derived>(D, M,rows,cols);
     case tinyply::Type::UINT8 :
     case tinyply::Type::UINT8 :
-      return   _tinyply_buffer_to_matrix<uint8_t,Derived>(D, M,rows,cols);
+      return   _tinyply_buffer_to_matrix<std::uint8_t,Derived>(D, M,rows,cols);
     case tinyply::Type::INT16 :
     case tinyply::Type::INT16 :
-      return   _tinyply_buffer_to_matrix<int16_t,Derived>(D, M,rows,cols);
+      return   _tinyply_buffer_to_matrix<std::int16_t,Derived>(D, M,rows,cols);
     case tinyply::Type::UINT16 :
     case tinyply::Type::UINT16 :
-      return   _tinyply_buffer_to_matrix<uint16_t,Derived>(D, M,rows,cols);
+      return   _tinyply_buffer_to_matrix<std::uint16_t,Derived>(D, M,rows,cols);
     case tinyply::Type::INT32 :
     case tinyply::Type::INT32 :
-      return   _tinyply_buffer_to_matrix<int32_t,Derived>(D, M,rows,cols);
+      return   _tinyply_buffer_to_matrix<std::int32_t,Derived>(D, M,rows,cols);
     case tinyply::Type::UINT32 :
     case tinyply::Type::UINT32 :
-      return   _tinyply_buffer_to_matrix<uint32_t,Derived>(D, M,rows,cols);
+      return   _tinyply_buffer_to_matrix<std::uint32_t,Derived>(D, M,rows,cols);
     case tinyply::Type::FLOAT32 :
     case tinyply::Type::FLOAT32 :
       return   _tinyply_buffer_to_matrix<float,Derived>(D, M,rows,cols);
       return   _tinyply_buffer_to_matrix<float,Derived>(D, M,rows,cols);
     case tinyply::Type::FLOAT64 :
     case tinyply::Type::FLOAT64 :
@@ -119,17 +120,17 @@ IGL_INLINE bool tinyply_tristrips_to_faces(
   switch(D.t)
   switch(D.t)
   {
   {
     case tinyply::Type::INT8 :
     case tinyply::Type::INT8 :
-      return   _tinyply_tristrips_to_trifaces<int8_t,Derived>(D, M,el,el_len);
+      return   _tinyply_tristrips_to_trifaces<std::int8_t,Derived>(D, M,el,el_len);
     case tinyply::Type::UINT8 :
     case tinyply::Type::UINT8 :
-      return   _tinyply_tristrips_to_trifaces<uint8_t,Derived>(D, M,el,el_len);
+      return   _tinyply_tristrips_to_trifaces<std::uint8_t,Derived>(D, M,el,el_len);
     case tinyply::Type::INT16 :
     case tinyply::Type::INT16 :
-      return   _tinyply_tristrips_to_trifaces<int16_t,Derived>(D, M,el,el_len);
+      return   _tinyply_tristrips_to_trifaces<std::int16_t,Derived>(D, M,el,el_len);
     case tinyply::Type::UINT16 :
     case tinyply::Type::UINT16 :
-      return   _tinyply_tristrips_to_trifaces<uint16_t,Derived>(D, M,el,el_len);
+      return   _tinyply_tristrips_to_trifaces<std::uint16_t,Derived>(D, M,el,el_len);
     case tinyply::Type::INT32 :
     case tinyply::Type::INT32 :
-      return   _tinyply_tristrips_to_trifaces<int32_t,Derived>(D, M,el,el_len);
+      return   _tinyply_tristrips_to_trifaces<std::int32_t,Derived>(D, M,el,el_len);
     case tinyply::Type::UINT32 :
     case tinyply::Type::UINT32 :
-      return   _tinyply_tristrips_to_trifaces<uint32_t,Derived>(D, M,el,el_len);
+      return   _tinyply_tristrips_to_trifaces<std::uint32_t,Derived>(D, M,el,el_len);
     case tinyply::Type::FLOAT32 :
     case tinyply::Type::FLOAT32 :
       return   _tinyply_tristrips_to_trifaces<float,Derived>(D, M,el,el_len);
       return   _tinyply_tristrips_to_trifaces<float,Derived>(D, M,el,el_len);
     case tinyply::Type::FLOAT64 :
     case tinyply::Type::FLOAT64 :
@@ -170,7 +171,7 @@ IGL_INLINE bool readPLY(
   // then read from memory buffer
   // then read from memory buffer
   try
   try
   {
   {
-    std::vector<uint8_t> fileBufferBytes;
+    std::vector<std::uint8_t> fileBufferBytes;
     // read_file_binary will call fclose
     // read_file_binary will call fclose
     read_file_binary(fp,fileBufferBytes);
     read_file_binary(fp,fileBufferBytes);
     FileMemoryStream stream((char*)fileBufferBytes.data(), fileBufferBytes.size());
     FileMemoryStream stream((char*)fileBufferBytes.data(), fileBufferBytes.size());

+ 4 - 3
include/igl/readSTL.cpp

@@ -15,6 +15,7 @@
 #include "FileMemoryStream.h"
 #include "FileMemoryStream.h"
 
 
 #include <iostream>
 #include <iostream>
+#include <cstdint>
 
 
 namespace igl {
 namespace igl {
 
 
@@ -62,7 +63,7 @@ IGL_INLINE bool is_stl_binary(std::istream &input) {
   // Check if filesize matches the number of faces claimed.
   // Check if filesize matches the number of faces claimed.
   char buf[4];
   char buf[4];
   input.read(buf, 4);
   input.read(buf, 4);
-  size_t num_faces = *reinterpret_cast<uint32_t *>(buf);
+  size_t num_faces = *reinterpret_cast<std::uint32_t *>(buf);
   input.seekg(0, input.end);
   input.seekg(0, input.end);
   size_t file_size = input.tellg();
   size_t file_size = input.tellg();
 
 
@@ -211,7 +212,7 @@ IGL_INLINE bool read_stl_binary(std::istream &input,
   }
   }
 
 
   input.read(buf, 4);
   input.read(buf, 4);
-  const size_t num_faces = *reinterpret_cast<uint32_t *>(buf);
+  const size_t num_faces = *reinterpret_cast<std::uint32_t *>(buf);
   if (!input.good()) {
   if (!input.good()) {
     throw std::runtime_error("Unable to parse STL number of faces.");
     throw std::runtime_error("Unable to parse STL number of faces.");
   }
   }
@@ -304,7 +305,7 @@ IGL_INLINE bool readSTL(
   Eigen::PlainObjectBase<DerivedF> & F,
   Eigen::PlainObjectBase<DerivedF> & F,
   Eigen::PlainObjectBase<DerivedN> & N)
   Eigen::PlainObjectBase<DerivedN> & N)
 {
 {
-  std::vector<uint8_t> fileBufferBytes;
+  std::vector<std::uint8_t> fileBufferBytes;
   read_file_binary(fp,fileBufferBytes);
   read_file_binary(fp,fileBufferBytes);
   FileMemoryStream stream((char*)fileBufferBytes.data(), fileBufferBytes.size());
   FileMemoryStream stream((char*)fileBufferBytes.data(), fileBufferBytes.size());
   return readSTL(stream, V, F, N);
   return readSTL(stream, V, F, N);

+ 2 - 1
include/igl/read_file_binary.cpp

@@ -9,10 +9,11 @@
 #include "read_file_binary.h"
 #include "read_file_binary.h"
 
 
 #include <cstring>
 #include <cstring>
+#include <cstdint>
 
 
 IGL_INLINE void igl::read_file_binary(
 IGL_INLINE void igl::read_file_binary(
   FILE *fp,
   FILE *fp,
-  std::vector<uint8_t> &fileBufferBytes) 
+  std::vector<std::uint8_t> &fileBufferBytes) 
 {
 {
   if (!ferror(fp)) 
   if (!ferror(fp)) 
   {
   {

+ 1 - 1
include/igl/read_file_binary.h

@@ -28,7 +28,7 @@ namespace igl {
   /// \throws runtime_error on error
   /// \throws runtime_error on error
   IGL_INLINE void read_file_binary(
   IGL_INLINE void read_file_binary(
     FILE *fp,
     FILE *fp,
-    std::vector<uint8_t> &fileBufferBytes);
+    std::vector<std::uint8_t> &fileBufferBytes);
 }
 }
 
 
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 9 - 9
include/igl/serialize.h

@@ -731,14 +731,14 @@ namespace igl
     inline typename std::enable_if<std::is_fundamental<T>::value>::type serialize(const T& obj,std::vector<char>& /*buffer*/,std::vector<char>::iterator& iter)
     inline typename std::enable_if<std::is_fundamental<T>::value>::type serialize(const T& obj,std::vector<char>& /*buffer*/,std::vector<char>::iterator& iter)
     {
     {
       //serialization::updateMemoryMap(obj,sizeof(T));
       //serialization::updateMemoryMap(obj,sizeof(T));
-      const uint8_t* ptr = reinterpret_cast<const uint8_t*>(&obj);
+      const std::uint8_t* ptr = reinterpret_cast<const std::uint8_t*>(&obj);
       iter = std::copy(ptr,ptr+sizeof(T),iter);
       iter = std::copy(ptr,ptr+sizeof(T),iter);
     }
     }
 
 
     template <typename T>
     template <typename T>
     inline typename std::enable_if<std::is_fundamental<T>::value>::type deserialize(T& obj,std::vector<char>::const_iterator& iter)
     inline typename std::enable_if<std::is_fundamental<T>::value>::type deserialize(T& obj,std::vector<char>::const_iterator& iter)
     {
     {
-      uint8_t* ptr = reinterpret_cast<uint8_t*>(&obj);
+      std::uint8_t* ptr = reinterpret_cast<std::uint8_t*>(&obj);
       std::copy(iter,iter+sizeof(T),ptr);
       std::copy(iter,iter+sizeof(T),ptr);
       iter += sizeof(T);
       iter += sizeof(T);
     }
     }
@@ -747,7 +747,7 @@ namespace igl
 
 
     inline size_t getByteSize(const std::string& obj)
     inline size_t getByteSize(const std::string& obj)
     {
     {
-      return getByteSize(obj.length())+obj.length()*sizeof(uint8_t);
+      return getByteSize(obj.length())+obj.length()*sizeof(std::uint8_t);
     }
     }
 
 
     inline void serialize(const std::string& obj,std::vector<char>& buffer,std::vector<char>::iterator& iter)
     inline void serialize(const std::string& obj,std::vector<char>& buffer,std::vector<char>::iterator& iter)
@@ -784,14 +784,14 @@ namespace igl
     template <typename T>
     template <typename T>
     inline typename std::enable_if<std::is_enum<T>::value>::type serialize(const T& obj,std::vector<char>& /*buffer*/,std::vector<char>::iterator& iter)
     inline typename std::enable_if<std::is_enum<T>::value>::type serialize(const T& obj,std::vector<char>& /*buffer*/,std::vector<char>::iterator& iter)
     {
     {
-      const uint8_t* ptr = reinterpret_cast<const uint8_t*>(&obj);
+      const std::uint8_t* ptr = reinterpret_cast<const std::uint8_t*>(&obj);
       iter = std::copy(ptr,ptr+sizeof(T),iter);
       iter = std::copy(ptr,ptr+sizeof(T),iter);
     }
     }
 
 
     template <typename T>
     template <typename T>
     inline typename std::enable_if<std::is_enum<T>::value>::type deserialize(T& obj,std::vector<char>::const_iterator& iter)
     inline typename std::enable_if<std::is_enum<T>::value>::type deserialize(T& obj,std::vector<char>::const_iterator& iter)
     {
     {
-      uint8_t* ptr = reinterpret_cast<uint8_t*>(&obj);
+      std::uint8_t* ptr = reinterpret_cast<std::uint8_t*>(&obj);
       std::copy(iter,iter+sizeof(T),ptr);
       std::copy(iter,iter+sizeof(T),ptr);
       iter += sizeof(T);
       iter += sizeof(T);
     }
     }
@@ -1020,7 +1020,7 @@ namespace igl
       serialization::serialize(obj.rows(),buffer,iter);
       serialization::serialize(obj.rows(),buffer,iter);
       serialization::serialize(obj.cols(),buffer,iter);
       serialization::serialize(obj.cols(),buffer,iter);
       size_t size = sizeof(T)*obj.rows()*obj.cols();
       size_t size = sizeof(T)*obj.rows()*obj.cols();
-      auto ptr = reinterpret_cast<const uint8_t*>(obj.data());
+      auto ptr = reinterpret_cast<const std::uint8_t*>(obj.data());
       iter = std::copy(ptr,ptr+size,iter);
       iter = std::copy(ptr,ptr+size,iter);
     }
     }
 
 
@@ -1032,7 +1032,7 @@ namespace igl
       serialization::deserialize(cols,iter);
       serialization::deserialize(cols,iter);
       size_t size = sizeof(T)*rows*cols;
       size_t size = sizeof(T)*rows*cols;
       obj.resize(rows,cols);
       obj.resize(rows,cols);
-      auto ptr = reinterpret_cast<uint8_t*>(obj.data());
+      auto ptr = reinterpret_cast<std::uint8_t*>(obj.data());
       std::copy(iter,iter+size,ptr);
       std::copy(iter,iter+size,ptr);
       iter+=size;
       iter+=size;
     }
     }
@@ -1050,7 +1050,7 @@ namespace igl
       serialization::serialize(obj.rows(),buffer,iter);
       serialization::serialize(obj.rows(),buffer,iter);
       serialization::serialize(obj.cols(),buffer,iter);
       serialization::serialize(obj.cols(),buffer,iter);
       size_t size = sizeof(T)*obj.rows()*obj.cols();
       size_t size = sizeof(T)*obj.rows()*obj.cols();
-      auto ptr = reinterpret_cast<const uint8_t*>(obj.data());
+      auto ptr = reinterpret_cast<const std::uint8_t*>(obj.data());
       iter = std::copy(ptr,ptr+size,iter);
       iter = std::copy(ptr,ptr+size,iter);
     }
     }
 
 
@@ -1062,7 +1062,7 @@ namespace igl
       serialization::deserialize(cols,iter);
       serialization::deserialize(cols,iter);
       size_t size = sizeof(T)*rows*cols;
       size_t size = sizeof(T)*rows*cols;
       obj.resize(rows,cols);
       obj.resize(rows,cols);
-      auto ptr = reinterpret_cast<uint8_t*>(obj.data());
+      auto ptr = reinterpret_cast<std::uint8_t*>(obj.data());
       std::copy(iter,iter+size,ptr);
       std::copy(iter,iter+size,ptr);
       iter+=size;
       iter+=size;
     }
     }

+ 3 - 2
include/igl/sparse_voxel_grid.cpp

@@ -3,6 +3,7 @@
 #include <unordered_map>
 #include <unordered_map>
 #include <array>
 #include <array>
 #include <vector>
 #include <vector>
+#include <cstdint>
 
 
 
 
 template <typename DerivedP0, typename Func, typename DerivedS, typename DerivedV, typename DerivedI>
 template <typename DerivedP0, typename Func, typename DerivedS, typename DerivedV, typename DerivedI>
@@ -113,8 +114,8 @@ IGL_INLINE void igl::sparse_voxel_grid(const Eigen::MatrixBase<DerivedP0>& p0,
 
 
     // Add the cube vertices and indices to the output arrays if they are not there already
     // Add the cube vertices and indices to the output arrays if they are not there already
     IndexRowVector cube;
     IndexRowVector cube;
-    uint8_t vertexAlreadyAdded = 0; // This is a bimask. If a bit is 1, it has been visited already by the BFS
-    constexpr std::array<uint8_t, 26> zv = {
+    std::uint8_t vertexAlreadyAdded = 0; // This is a bimask. If a bit is 1, it has been visited already by the BFS
+    constexpr std::array<std::uint8_t, 26> zv = {
       (1 << 0) | (1 << 1) | (1 << 4) | (1 << 5),
       (1 << 0) | (1 << 1) | (1 << 4) | (1 << 5),
       (1 << 2) | (1 << 3) | (1 << 6) | (1 << 7),
       (1 << 2) | (1 << 3) | (1 << 6) | (1 << 7),
       (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
       (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),

+ 1 - 0
include/igl/tinyply.cpp

@@ -10,6 +10,7 @@
 #include <iostream>
 #include <iostream>
 #include <cstring>
 #include <cstring>
 #include <cassert>
 #include <cassert>
+#include <stdint.h>
 
 
 namespace igl
 namespace igl
 {
 {

+ 1 - 0
include/igl/tinyply.h

@@ -34,6 +34,7 @@
 #include <map>
 #include <map>
 #include <algorithm>
 #include <algorithm>
 #include <functional>
 #include <functional>
+#include <stdint.h>
 
 
 namespace igl
 namespace igl
 {
 {

+ 1 - 0
include/igl/writePLY.cpp

@@ -2,6 +2,7 @@
 #include <fstream>
 #include <fstream>
 
 
 #include "tinyply.h"
 #include "tinyply.h"
+#include <stdint.h>
 
 
 
 
 namespace igl
 namespace igl