From: Andrey Kamaev Date: Thu, 12 Apr 2012 16:21:08 +0000 (+0000) Subject: Fixed 9 more build warnings X-Git-Tag: accepted/2.0/20130307.220821~681 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97835a8f3294903d8c5f8ee9d4bb6d0da46e6d5a;p=profile%2Fivi%2Fopencv.git Fixed 9 more build warnings --- diff --git a/modules/contrib/src/spinimages.cpp b/modules/contrib/src/spinimages.cpp index 88de109..e2818ad 100644 --- a/modules/contrib/src/spinimages.cpp +++ b/modules/contrib/src/spinimages.cpp @@ -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; diff --git a/modules/core/src/matmul.cpp b/modules/core/src/matmul.cpp index c634201..dbfa36e 100644 --- a/modules/core/src/matmul.cpp +++ b/modules/core/src/matmul.cpp @@ -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(src.size()), size.area(), type); int i = 0; for(vector::iterator each = src.begin(); each != src.end(); each++, i++ ) diff --git a/modules/core/test/test_math.cpp b/modules/core/test/test_math.cpp index ffed098..a847574 100644 --- a/modules/core/test/test_math.cpp +++ b/modules/core/test/test_math.cpp @@ -2544,7 +2544,7 @@ TEST(CovariationMatrixVectorOfMat, accuracy) std::vector 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(i)).reshape(0,col_problem_size)); } cv::Mat actual; @@ -2579,7 +2579,7 @@ TEST(CovariationMatrixVectorOfMatWithMean, accuracy) std::vector 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(i)).reshape(0,col_problem_size)); } cv::Mat actual; diff --git a/modules/highgui/src/grfmt_png.cpp b/modules/highgui/src/grfmt_png.cpp index d58760d..66aa6c9 100644 --- a/modules/highgui/src/grfmt_png.cpp +++ b/modules/highgui/src/grfmt_png.cpp @@ -59,6 +59,11 @@ #include #include "grfmt_png.hpp" +#if defined _MSC_VER && _MSC_VER >= 1200 + // disable warnings related to _setjmp + #pragma warning( disable: 4611 ) +#endif + namespace cv { diff --git a/modules/ml/test/test_emknearestkmeans.cpp b/modules/ml/test/test_emknearestkmeans.cpp index 31a9bee..ba0dec7 100644 --- a/modules/ml/test/test_emknearestkmeans.cpp +++ b/modules/ml/test/test_emknearestkmeans.cpp @@ -77,9 +77,9 @@ void generateData( Mat& data, Mat& labels, const vector& 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 ); diff --git a/modules/video/perf/perf_optflowpyrlk.cpp b/modules/video/perf/perf_optflowpyrlk.cpp index 9633ef0..d0325da 100644 --- a/modules/video/perf/perf_optflowpyrlk.cpp +++ b/modules/video/perf/perf_optflowpyrlk.cpp @@ -22,7 +22,7 @@ void FormTrackingPointsArray(vector& points, int width, int height, int { for( int y = stepY / 2; y < height; y += stepY ) { - Point2f pt(x,y); + Point2f pt(static_cast(x), static_cast(y)); points.push_back(pt); } } diff --git a/modules/videostab/src/precomp.hpp b/modules/videostab/src/precomp.hpp index bdf1e49..ec70beb 100644 --- a/modules/videostab/src/precomp.hpp +++ b/modules/videostab/src/precomp.hpp @@ -74,12 +74,12 @@ template inline const T& at(int index, const T *items, int size) template inline T& at(int index, std::vector &items) { - return at(index, &items[0], items.size()); + return at(index, &items[0], static_cast(items.size())); } template inline const T& at(int index, const std::vector &items) { - return items[cv::borderInterpolate(index, items.size(), cv::BORDER_WRAP)]; + return items[cv::borderInterpolate(index, static_cast(items.size()), cv::BORDER_WRAP)]; } #endif