File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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)
You can’t perform that action at this time.
0 commit comments