Skip to content

Commit 47fbdd0

Browse files
committed
Merge pull request #882 from alalek:fix_warnings
2 parents fde8a6a + 7cdf219 commit 47fbdd0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/line_descriptor/src/binary_descriptor_matcher.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ int BinaryDescriptorMatcher::SparseHashtable::init( int _b )
830830
return 1;
831831

832832
size = UINT64_1 << ( b - 5 ); // size = 2 ^ b
833-
table = std::vector<BucketGroup>(size, BucketGroup(false));
833+
table = std::vector<BucketGroup>((size_t)size, BucketGroup(false));
834834

835835
return 0;
836836

@@ -844,13 +844,13 @@ BinaryDescriptorMatcher::SparseHashtable::~SparseHashtable()
844844
/* insert data */
845845
void BinaryDescriptorMatcher::SparseHashtable::insert( UINT64 index, UINT32 data )
846846
{
847-
table[index >> 5].insert( (int) ( index % 32 ), data );
847+
table[(size_t)(index >> 5)].insert( (int) ( index & 31 ), data );
848848
}
849849

850850
/* query data */
851851
UINT32* BinaryDescriptorMatcher::SparseHashtable::query( UINT64 index, int *Size )
852852
{
853-
return table[index >> 5].query( (int) ( index % 32 ), Size );
853+
return table[(size_t)(index >> 5)].query( (int) ( index & 31 ), Size );
854854
}
855855

856856
/* constructor */

0 commit comments

Comments
 (0)