Skip to content

Commit 0ea1de8

Browse files
committed
Merge pull request #94 from vpisarev/fixed_win32_compile_errors2
another fix in line descriptor module for Win32 MSVC
2 parents 70252d9 + f1f579f commit 0ea1de8

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

modules/line_descriptor/src/binary_descriptor_matcher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ int BinaryDescriptorMatcher::SparseHashtable::init( int _b )
835835
return 1;
836836

837837
size = UINT64_1 << ( b - 5 ); // size = 2 ^ b
838-
table = (BucketGroup*) calloc( size, sizeof(BucketGroup) );
838+
table = (BucketGroup*) calloc( (size_t)size, sizeof(BucketGroup) );
839839

840840
return 0;
841841

modules/saliency/src/BING/kyheader.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,11 @@ inline cv::Rect Vec4i2Rect( cv::Vec4i &v )
149149
}
150150

151151

152-
#if defined(_MSC_VER)
153-
# include <intrin.h>
154-
# define POPCNT(x) __popcnt(x)
155-
# define POPCNT64(x) __popcnt64(x)
156-
#endif
157-
152+
#if defined(_MSC_VER)
153+
# include <intrin.h>
154+
# define POPCNT(x) __popcnt(x)
155+
# define POPCNT64(x) (__popcnt((unsigned)(x)) + __popcnt((unsigned)((uint64_t)(x) >> 32)))
156+
#endif
158157

159158
#if defined(__GNUC__)
160159
# define POPCNT(x) __builtin_popcount(x)

0 commit comments

Comments
 (0)