Fix inconsistent argument type in HammingLUT distance (flann)
authorAndrey Kamaev <andrey.kamaev@itseez.com>
Tue, 9 Oct 2012 20:31:22 +0000 (00:31 +0400)
committerAndrey Kamaev <andrey.kamaev@itseez.com>
Tue, 9 Oct 2012 20:31:22 +0000 (00:31 +0400)
this fixes 64-bit MSVC warning

modules/flann/include/opencv2/flann/dist.h

index ab78b25..04fb1ea 100644 (file)
@@ -382,7 +382,7 @@ struct HammingLUT
 
     /** this will count the bits in a ^ b
      */
-    ResultType operator()(const unsigned char* a, const unsigned char* b, int size) const
+    ResultType operator()(const unsigned char* a, const unsigned char* b, size_t size) const
     {
         static const uchar popCountTable[] = 
         {
@@ -396,7 +396,7 @@ struct HammingLUT
             3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
         };
         ResultType result = 0;
-        for (int i = 0; i < size; i++) {
+        for (size_t i = 0; i < size; i++) {
             result += popCountTable[a[i] ^ b[i]];
         }
         return result;