Fixed 9 more build warnings
authorAndrey Kamaev <no@email>
Thu, 12 Apr 2012 16:21:08 +0000 (16:21 +0000)
committerAndrey Kamaev <no@email>
Thu, 12 Apr 2012 16:21:08 +0000 (16:21 +0000)
modules/contrib/src/spinimages.cpp
modules/core/src/matmul.cpp
modules/core/test/test_math.cpp
modules/highgui/src/grfmt_png.cpp
modules/ml/test/test_emknearestkmeans.cpp
modules/video/perf/perf_optflowpyrlk.cpp
modules/videostab/src/precomp.hpp

index 88de109..e2818ad 100644 (file)
@@ -440,7 +440,7 @@ cv::Mesh3D::~Mesh3D() {}
 void cv::Mesh3D::buildOctree() { if (octree.getNodes().empty()) octree.buildTree(vtx); }
 void cv::Mesh3D::clearOctree(){ octree = Octree(); }
 
-float cv::Mesh3D::estimateResolution(float tryRatio)
+float cv::Mesh3D::estimateResolution(float /*tryRatio*/)
 {
 #if 0
     const int neighbors = 3;
index c634201..dbfa36e 100644 (file)
@@ -2148,7 +2148,7 @@ void cv::calcCovarMatrix( InputArray _data, OutputArray _covar, InputOutputArray
 
         ctype = std::max(std::max(CV_MAT_DEPTH(ctype >= 0 ? ctype : type), _mean.depth()), CV_32F);
 
-        Mat _data(src.size(), size.area(), type);
+        Mat _data(static_cast<int>(src.size()), size.area(), type);
 
         int i = 0;
         for(vector<cv::Mat>::iterator each = src.begin(); each != src.end(); each++, i++ )
index ffed098..a847574 100644 (file)
@@ -2544,7 +2544,7 @@ TEST(CovariationMatrixVectorOfMat, accuracy)
     std::vector<cv::Mat> srcVec;
     for(size_t i = 0; i < vector_size; i++)
     {
-        srcVec.push_back(src.row(i).reshape(0,col_problem_size));
+        srcVec.push_back(src.row(static_cast<int>(i)).reshape(0,col_problem_size));
     }
 
     cv::Mat actual;
@@ -2579,7 +2579,7 @@ TEST(CovariationMatrixVectorOfMatWithMean, accuracy)
     std::vector<cv::Mat> srcVec;
     for(size_t i = 0; i < vector_size; i++)
     {
-        srcVec.push_back(src.row(i).reshape(0,col_problem_size));
+        srcVec.push_back(src.row(static_cast<int>(i)).reshape(0,col_problem_size));
     }
 
     cv::Mat actual;
index d58760d..66aa6c9 100644 (file)
 #include <zlib.h>
 #include "grfmt_png.hpp"
 
+#if defined _MSC_VER && _MSC_VER >= 1200
+    // disable warnings related to _setjmp
+    #pragma warning( disable: 4611 )
+#endif
+
 namespace cv
 {
 
index 31a9bee..ba0dec7 100644 (file)
@@ -77,9 +77,9 @@ void generateData( Mat& data, Mat& labels, const vector<int>& sizes, const Mat&
     int total = 0;
     for( ; sit != sizes.end(); ++sit )
         total += *sit;
-    assert( _means.rows == (int)sizes.size() && covs.size() == sizes.size() );
-    assert( !data.empty() && data.rows == total );
-    assert( data.type() == dataType );
+    CV_Assert( _means.rows == (int)sizes.size() && covs.size() == sizes.size() );
+    CV_Assert( !data.empty() && data.rows == total );
+    CV_Assert( data.type() == dataType );
     
     labels.create( data.rows, 1, labelType );
 
index 9633ef0..d0325da 100644 (file)
@@ -22,7 +22,7 @@ void FormTrackingPointsArray(vector<Point2f>& points, int width, int height, int
     {
         for( int y = stepY / 2; y < height; y += stepY )
         {
-            Point2f pt(x,y);
+            Point2f pt(static_cast<float>(x), static_cast<float>(y));
             points.push_back(pt);
         }
     }
index bdf1e49..ec70beb 100644 (file)
@@ -74,12 +74,12 @@ template <typename T> inline const T& at(int index, const T *items, int size)
 
 template <typename T> inline T& at(int index, std::vector<T> &items)
 {
-    return at(index, &items[0], items.size());
+    return at(index, &items[0], static_cast<int>(items.size()));
 }
 
 template <typename T> inline const T& at(int index, const std::vector<T> &items)
 {
-    return items[cv::borderInterpolate(index, items.size(), cv::BORDER_WRAP)];
+    return items[cv::borderInterpolate(index, static_cast<int>(items.size()), cv::BORDER_WRAP)];
 }
 
 #endif