From 58b3bc2d7e1d8e859d4bdb30bfb1b3467838d1fc Mon Sep 17 00:00:00 2001 From: jaco Date: Tue, 12 Aug 2014 15:28:39 +0200 Subject: [PATCH 1/3] #pragma warning4127 fixed for cvstd.inl.hpp --- modules/core/include/opencv2/core/cvstd.inl.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/core/include/opencv2/core/cvstd.inl.hpp b/modules/core/include/opencv2/core/cvstd.inl.hpp index ce18da30a..7e4c38757 100644 --- a/modules/core/include/opencv2/core/cvstd.inl.hpp +++ b/modules/core/include/opencv2/core/cvstd.inl.hpp @@ -49,6 +49,10 @@ # include #endif +#ifdef _MSC_VER +#pragma warning( disable: 4127 ) +#endif + namespace cv { #ifndef OPENCV_NOSTL From b81dcbdf2a0db0770893630d5cf38c2a3b3d5041 Mon Sep 17 00:00:00 2001 From: jaco Date: Wed, 13 Aug 2014 17:59:16 +0200 Subject: [PATCH 2/3] #pragma warning4127 fixation modified Now use cleaner approach: #pragma warning( push ) #pragma warning( disable: ThatWarning ) //code with ThatWarning here #pragma warning( pop ) --- modules/core/include/opencv2/core/cvstd.inl.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/core/include/opencv2/core/cvstd.inl.hpp b/modules/core/include/opencv2/core/cvstd.inl.hpp index 7e4c38757..f43798e16 100644 --- a/modules/core/include/opencv2/core/cvstd.inl.hpp +++ b/modules/core/include/opencv2/core/cvstd.inl.hpp @@ -49,10 +49,6 @@ # include #endif -#ifdef _MSC_VER -#pragma warning( disable: 4127 ) -#endif - namespace cv { #ifndef OPENCV_NOSTL @@ -224,7 +220,10 @@ std::ostream& operator << (std::ostream& out, const Vec<_Tp, n>& vec) { out << "["; +#pragma warning( push ) +#pragma warning( disable: 4127 ) if(Vec<_Tp, n>::depth < CV_32F) +#pragma warning( pop ) { for (int i = 0; i < n - 1; ++i) { out << (int)vec[i] << ", "; From dbb0fcdc7aef579ee9e5526acd5d0a62c8bd33bf Mon Sep 17 00:00:00 2001 From: jaco Date: Thu, 14 Aug 2014 19:27:53 +0200 Subject: [PATCH 3/3] #pragma warning4127 fixation modified 2 --- modules/core/include/opencv2/core/cvstd.inl.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/core/include/opencv2/core/cvstd.inl.hpp b/modules/core/include/opencv2/core/cvstd.inl.hpp index f43798e16..faa7fdb0d 100644 --- a/modules/core/include/opencv2/core/cvstd.inl.hpp +++ b/modules/core/include/opencv2/core/cvstd.inl.hpp @@ -219,11 +219,14 @@ template static inline std::ostream& operator << (std::ostream& out, const Vec<_Tp, n>& vec) { out << "["; - +#ifdef _MSC_VER #pragma warning( push ) #pragma warning( disable: 4127 ) +#endif if(Vec<_Tp, n>::depth < CV_32F) +#ifdef _MSC_VER #pragma warning( pop ) +#endif { for (int i = 0; i < n - 1; ++i) { out << (int)vec[i] << ", ";