From 56b27bcc7ebdaa921f36ad8ce32099b7036a77b8 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Wed, 10 Oct 2012 00:31:22 +0400 Subject: [PATCH] Fix inconsistent argument type in HammingLUT distance (flann) this fixes 64-bit MSVC warning --- modules/flann/include/opencv2/flann/dist.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/flann/include/opencv2/flann/dist.h b/modules/flann/include/opencv2/flann/dist.h index ab78b253ef..04fb1ea0af 100644 --- a/modules/flann/include/opencv2/flann/dist.h +++ b/modules/flann/include/opencv2/flann/dist.h @@ -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;