Hi,

in my efforts on using the openexr I spottet a bunch of 'warning C4018: '<' : signed/unsigned mismatch' warnings (with VS 2010 64 bit). All of them in the ImathMatrixAlgo.cpp file.

Appending you find a patch which should solve this issues (applied to the openexr-IlmBase project). I would appreciate if someone could add this to cvs, since it means hundreds of output lines less during compilation.

Thanks in advance,
Daniel

Index: Imath/ImathMatrixAlgo.cpp
===================================================================
RCS file: /sources/openexr/IlmBase/Imath/ImathMatrixAlgo.cpp,v
retrieving revision 1.2
diff -u -r1.2 ImathMatrixAlgo.cpp
--- Imath/ImathMatrixAlgo.cpp   26 Apr 2011 23:54:30 -0000      1.2
+++ Imath/ImathMatrixAlgo.cpp   11 Jun 2011 12:02:38 -0000
@@ -959,7 +959,7 @@
 {
     typedef typename TM::BaseType T;
 
-    for (int i = 0; i < TM::dimensions(); ++i)
+    for (unsigned int i = 0; i < TM::dimensions(); ++i)
     {
         const T nu1 = A[i][j];
         const T nu2 = A[i][k];
@@ -1094,8 +1094,8 @@
 {
     typedef typename TM::BaseType T;
     T result = 0;
-    for (int i = 0; i < TM::dimensions(); ++i)
-        for (int j = i+1; j < TM::dimensions(); ++j)
+    for (unsigned int i = 0; i < TM::dimensions(); ++i)
+        for (unsigned int j = i+1; j < TM::dimensions(); ++j)
             result = std::max (result, std::abs (A[i][j]));
 
    return result;
@@ -1189,13 +1189,13 @@
     jacobiEigenSolver(A, S, MV);
 
     int maxIdx(0);
-    for(int i = 1; i < TV::dimensions(); ++i)
+    for(unsigned int i = 1; i < TV::dimensions(); ++i)
     {
         if(std::abs(S[i]) > std::abs(S[maxIdx]))
             maxIdx = i;
     }
 
-    for(int i = 0; i < TV::dimensions(); ++i)
+    for(unsigned int i = 0; i < TV::dimensions(); ++i)
         V[i] = MV[i][maxIdx];
 }
 
@@ -1208,13 +1208,13 @@
     jacobiEigenSolver(A, S, MV);
 
     int minIdx(0);
-    for(int i = 1; i < TV::dimensions(); ++i)
+    for(unsigned int i = 1; i < TV::dimensions(); ++i)
     {
         if(std::abs(S[i]) < std::abs(S[minIdx]))
             minIdx = i;
     }
 
-   for(int i = 0; i < TV::dimensions(); ++i)
+   for(unsigned int i = 0; i < TV::dimensions(); ++i)
         V[i] = MV[i][minIdx];
 }
 

_______________________________________________
Openexr-devel mailing list
Openexr-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/openexr-devel

Reply via email to