From 7cdf2191d0cdf7ddff0a32169ce2b68f3ef0eb01 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Thu, 1 Dec 2016 17:22:41 +0300 Subject: [PATCH] win32 warnings --- modules/line_descriptor/src/binary_descriptor_matcher.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/line_descriptor/src/binary_descriptor_matcher.cpp b/modules/line_descriptor/src/binary_descriptor_matcher.cpp index c0caef70e..eb4d28352 100644 --- a/modules/line_descriptor/src/binary_descriptor_matcher.cpp +++ b/modules/line_descriptor/src/binary_descriptor_matcher.cpp @@ -830,7 +830,7 @@ int BinaryDescriptorMatcher::SparseHashtable::init( int _b ) return 1; size = UINT64_1 << ( b - 5 ); // size = 2 ^ b - table = std::vector(size, BucketGroup(false)); + table = std::vector((size_t)size, BucketGroup(false)); return 0; @@ -844,13 +844,13 @@ BinaryDescriptorMatcher::SparseHashtable::~SparseHashtable() /* insert data */ void BinaryDescriptorMatcher::SparseHashtable::insert( UINT64 index, UINT32 data ) { - table[index >> 5].insert( (int) ( index % 32 ), data ); + table[(size_t)(index >> 5)].insert( (int) ( index & 31 ), data ); } /* query data */ UINT32* BinaryDescriptorMatcher::SparseHashtable::query( UINT64 index, int *Size ) { - return table[index >> 5].query( (int) ( index % 32 ), Size ); + return table[(size_t)(index >> 5)].query( (int) ( index & 31 ), Size ); } /* constructor */