Fixed MSVC warnings
authorAndrey Kamaev <andrey.kamaev@itseez.com>
Wed, 13 Mar 2013 07:34:04 +0000 (11:34 +0400)
committerAndrey Kamaev <andrey.kamaev@itseez.com>
Wed, 13 Mar 2013 07:34:04 +0000 (11:34 +0400)
3rdparty/libwebp/CMakeLists.txt
modules/highgui/src/grfmt_webp.cpp
modules/imgproc/src/convhull.cpp
modules/imgproc/src/demosaicing.cpp
modules/imgproc/test/test_color.cpp
modules/softcascade/src/softcascade.cpp

index 6c6c1a6..54bda49 100644 (file)
@@ -41,6 +41,7 @@ if(UNIX)
 endif()
 
 ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-variable -Wshadow)
+ocv_warnings_disable(CMAKE_C_FLAGS /wd4244 /wd4267) # vs2005
 
 set_target_properties(${WEBP_LIBRARY}
   PROPERTIES OUTPUT_NAME ${WEBP_LIBRARY}
index b2722cc..40ed595 100644 (file)
@@ -176,7 +176,7 @@ bool WebPEncoder::write(const Mat& img, const std::vector<int>& params)
 
     const Mat *image = &img;
     Mat temp;
-    int size = 0;
+    size_t size = 0;
 
     bool comp_lossless = true;
     int quality = 100;
index 7fad264..019c996 100644 (file)
@@ -206,9 +206,9 @@ void convexHull( InputArray _points, OutputArray _hull, bool clockwise, bool ret
         }
 
         for( i = 0; i < tl_count-1; i++ )
-            hullbuf[nout++] = pointer[tl_stack[i]] - data0;
+            hullbuf[nout++] = int(pointer[tl_stack[i]] - data0);
         for( i = tr_count - 1; i > 0; i-- )
-            hullbuf[nout++] = pointer[tr_stack[i]] - data0;
+            hullbuf[nout++] = int(pointer[tr_stack[i]] - data0);
         int stop_idx = tr_count > 2 ? tr_stack[1] : tl_count > 2 ? tl_stack[tl_count - 2] : -1;
 
         // lower half
@@ -244,9 +244,9 @@ void convexHull( InputArray _points, OutputArray _hull, bool clockwise, bool ret
         }
 
         for( i = 0; i < bl_count-1; i++ )
-            hullbuf[nout++] = pointer[bl_stack[i]] - data0;
+            hullbuf[nout++] = int(pointer[bl_stack[i]] - data0);
         for( i = br_count-1; i > 0; i-- )
-            hullbuf[nout++] = pointer[br_stack[i]] - data0;
+            hullbuf[nout++] = int(pointer[br_stack[i]] - data0);
     }
 
     if( !returnPoints )
index 14bcea6..a3156dd 100644 (file)
@@ -316,7 +316,7 @@ public:
             _mm_storel_epi64((__m128i*)(dst+6*6), g1);
         }
 
-        return bayer - (bayer_end - width);
+        return int(bayer - (bayer_end - width));
     }
 
     bool use_simd;
index 33b5bcf..86f9c67 100644 (file)
@@ -1960,7 +1960,7 @@ static void test_Bayer2RGB_EdgeAware_8u(const Mat& src, Mat& dst, int code)
     int dcn = dst.channels();
     CV_Assert(dcn == 3);
 
-    int step = src.step;
+    int step = (int)src.step;
     const uchar* S = src.ptr<uchar>(1) + 1;
     uchar* D = dst.ptr<uchar>(1) + dcn;
 
index 4377244..197230d 100644 (file)
@@ -53,7 +53,7 @@ namespace {
 struct SOctave
 {
     SOctave(const int i, const cv::Size& origObjSize, const cv::FileNode& fn)
-    : index(i), weaks((int)fn[SC_OCT_WEAKS]), scale(std::pow(2,(float)fn[SC_OCT_SCALE])),
+    : index(i), weaks((int)fn[SC_OCT_WEAKS]), scale((float)std::pow(2,(float)fn[SC_OCT_SCALE])),
       size(cvRound(origObjSize.width * scale), cvRound(origObjSize.height * scale)) {}
 
     int   index;