Prechádzať zdrojové kódy

fixed compilation error with clang

Former-commit-id: aeb1dcaaddc906eb8e4227b8a6d26fb8b35766c3
Daniele Panozzo 11 rokov pred
rodič
commit
5e178e4771

+ 1 - 0
Makefile.conf

@@ -78,6 +78,7 @@ endif
 ifeq ($(IGL_USERNAME),daniele)
 	IGL_WITH_MATLAB=0
 	AFLAGS = -m64
+	#GG=g++-mp-4.8
 endif
 
 ifeq ($(IGL_USERNAME),chrsch)

+ 7 - 6
include/igl/remove_duplicate_vertices.cpp

@@ -50,12 +50,13 @@ IGL_INLINE void igl::remove_duplicate_vertices(
   using namespace std;
   remove_duplicate_vertices(V,epsilon,SV,SVI,SVJ);
   // remap faces
-#ifndef _WIN32
-  SF = F.unaryExpr(bind1st(mem_fun( 
-    static_cast<VectorXi::Scalar&(VectorXi::*)(VectorXi::Index)>
-      (&VectorXi::operator())), &SVJ)).eval();
-#else
+// #ifndef _WIN32
+//   SF = F.unaryExpr(bind1st(mem_fun( 
+//     static_cast<VectorXi::Scalar&(VectorXi::*)(VectorXi::Index)>
+//       (&VectorXi::operator())), &SVJ)).eval();
+// #else
   // Why doesn't the above compile on windows?
+  // Daniele: it also does not compile with CLANG
   SF.resize(F.rows(),F.cols());
   for(int f = 0;f<F.rows();f++)
   {
@@ -64,7 +65,7 @@ IGL_INLINE void igl::remove_duplicate_vertices(
       SF(f,c) = SVJ(F(f,c));
     }
   }
-#endif
+// #endif
 }
 
 #ifndef IGL_HEADER_ONLY

+ 1 - 1
include/igl/tga.cpp

@@ -508,7 +508,7 @@ unsigned char TGAHeaderBW[12] =
 // image size is written in correct format 
 // and byte order (least first)
 void write16bit(int n, FILE* fp) { 
-  unsigned char bytes[] = { n % 256, n / 256 };
+  unsigned char bytes[] = { static_cast<unsigned char>(n % 256), static_cast<unsigned char>(n / 256) };
   fwrite(bytes, 2, sizeof(unsigned char),fp);
 }