blob: ca20582fd187a4456967674d7e21e2bb5158dc85 [file] [log] [blame]
Fix clang errors from [-Wc++11-narrowing]:
constant expression evaluates to 4294967295 which cannot be narrowed to type 'int'
case value evaluates to 2147483680, which cannot be narrowed to type 'int'
The issue is already fixed in upstream opencv.
--- OpenCV-2.3.0/modules/core/src/arithm.cpp
+++ OpenCV-2.3.0/modules/core/src/arithm.cpp
@@ -430,7 +430,7 @@ struct _VSub64f { __m128d operator()(const __m128d& a, const __m128d& b) const {
struct _VMin64f { __m128d operator()(const __m128d& a, const __m128d& b) const { return _mm_min_pd(a,b); }};
struct _VMax64f { __m128d operator()(const __m128d& a, const __m128d& b) const { return _mm_max_pd(a,b); }};
-static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
+static int CV_DECL_ALIGNED(16) v64f_absmask[] = { (int)0xffffffff, 0x7fffffff, (int)0xffffffff, 0x7fffffff };
struct _VAbsDiff64f
{
__m128d operator()(const __m128d& a, const __m128d& b) const
--- OpenCV-2.3.0/modules/python/src1/cv.cpp
+++ OpenCV-2.3.0/modules/python/src1/cv.cpp
@@ -269,7 +269,7 @@ static PyObject *iplimage_tostring(PyObject *self, PyObject *args)
if (i == NULL)
return NULL;
int bps;
- switch (i->depth) {
+ switch ((unsigned int)i->depth) {
case IPL_DEPTH_8U:
case IPL_DEPTH_8S:
bps = 1;