From: Andrey Pavlenko Date: Thu, 3 Apr 2014 07:26:25 +0000 (+0400) Subject: removing `SuppressWarning` and `CV_OPENCL_RUN` X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~3303^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=925178749acef34d40b49aa5178c0015b3f25215;p=platform%2Fupstream%2Fopencv.git removing `SuppressWarning` and `CV_OPENCL_RUN` --- diff --git a/modules/core/include/opencv2/core/utility.hpp b/modules/core/include/opencv2/core/utility.hpp index a8957f7..3e844cc 100644 --- a/modules/core/include/opencv2/core/utility.hpp +++ b/modules/core/include/opencv2/core/utility.hpp @@ -495,11 +495,6 @@ template<> inline std::string CommandLineParser::get(const String& } #endif // OPENCV_NOSTL -#if !defined(OPENCV_SKIP_SUPPRESS_WARNING) || !OPENCV_SKIP_SUPPRESS_WARNING -// Use this to bypass "warning C4127: conditional expression is constant" -template T SuppressWarning(T v) { return v; } -#endif - } //namespace cv #endif //__OPENCV_CORE_UTILITY_H__ diff --git a/modules/stitching/src/blenders.cpp b/modules/stitching/src/blenders.cpp index a82da97..03aad75 100644 --- a/modules/stitching/src/blenders.cpp +++ b/modules/stitching/src/blenders.cpp @@ -367,11 +367,11 @@ void MultiBandBlender::feed(InputArray _img, InputArray mask, Point tl) for (int i = 0; i <= num_bands_; ++i) { Rect rc(x_tl, y_tl, x_br - x_tl, y_br - y_tl); - CV_OPENCL_RUN(SuppressWarning(true), - ocl_MultiBandBlender_feed(src_pyr_laplace[i], weight_pyr_gauss[i], - dst_pyr_laplace_[i](rc), - dst_band_weights_[i](rc)), - goto next_band;) +#ifdef HAVE_OPENCL + if ( !cv::ocl::useOpenCL() || + !ocl_MultiBandBlender_feed(src_pyr_laplace[i], weight_pyr_gauss[i], + dst_pyr_laplace_[i](rc), dst_band_weights_[i](rc)) ) +#endif { Mat _src_pyr_laplace = src_pyr_laplace[i].getMat(ACCESS_READ); Mat _dst_pyr_laplace = dst_pyr_laplace_[i](rc).getMat(ACCESS_RW); @@ -414,9 +414,7 @@ void MultiBandBlender::feed(InputArray _img, InputArray mask, Point tl) } } } -#ifdef HAVE_OPENCL -next_band: -#endif + x_tl /= 2; y_tl /= 2; x_br /= 2; y_br /= 2; } @@ -477,9 +475,10 @@ void normalizeUsingWeightMap(InputArray _weight, InputOutputArray _src) return; #endif - CV_OPENCL_RUN(SuppressWarning(true), - ocl_normalizeUsingWeightMap(_weight, _src), - return;) +#ifdef HAVE_OPENCL + if ( !cv::ocl::useOpenCL() || + !ocl_normalizeUsingWeightMap(_weight, _src) ) +#endif { Mat weight = _weight.getMat(); Mat src = _src.getMat();