From afe85e7e516ab76f8e321b40e1f2905a9d81ace5 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Wed, 6 Feb 2013 20:57:36 +0400 Subject: [PATCH] Fix some warnings from -O0 build --- modules/core/src/precomp.hpp | 10 +++++----- modules/imgproc/src/morph.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/core/src/precomp.hpp b/modules/core/src/precomp.hpp index a40cd2dcff..84f7f5e2be 100644 --- a/modules/core/src/precomp.hpp +++ b/modules/core/src/precomp.hpp @@ -94,7 +94,7 @@ template struct OpAdd typedef T1 type1; typedef T2 type2; typedef T3 rtype; - T3 operator ()(T1 a, T2 b) const { return saturate_cast(a + b); } + T3 operator ()(const T1 a, const T2 b) const { return saturate_cast(a + b); } }; template struct OpSub @@ -102,7 +102,7 @@ template struct OpSub typedef T1 type1; typedef T2 type2; typedef T3 rtype; - T3 operator ()(T1 a, T2 b) const { return saturate_cast(a - b); } + T3 operator ()(const T1 a, const T2 b) const { return saturate_cast(a - b); } }; template struct OpRSub @@ -110,7 +110,7 @@ template struct OpRSub typedef T1 type1; typedef T2 type2; typedef T3 rtype; - T3 operator ()(T1 a, T2 b) const { return saturate_cast(b - a); } + T3 operator ()(const T1 a, const T2 b) const { return saturate_cast(b - a); } }; template struct OpMin @@ -118,7 +118,7 @@ template struct OpMin typedef T type1; typedef T type2; typedef T rtype; - T operator ()(T a, T b) const { return std::min(a, b); } + T operator ()(const T a, const T b) const { return std::min(a, b); } }; template struct OpMax @@ -126,7 +126,7 @@ template struct OpMax typedef T type1; typedef T type2; typedef T rtype; - T operator ()(T a, T b) const { return std::max(a, b); } + T operator ()(const T a, const T b) const { return std::max(a, b); } }; inline Size getContinuousSize( const Mat& m1, int widthScale=1 ) diff --git a/modules/imgproc/src/morph.cpp b/modules/imgproc/src/morph.cpp index 344a7a926a..a63e08ff01 100644 --- a/modules/imgproc/src/morph.cpp +++ b/modules/imgproc/src/morph.cpp @@ -56,7 +56,7 @@ template struct MinOp typedef T type1; typedef T type2; typedef T rtype; - T operator ()(T a, T b) const { return std::min(a, b); } + T operator ()(const T a, const T b) const { return std::min(a, b); } }; template struct MaxOp @@ -64,7 +64,7 @@ template struct MaxOp typedef T type1; typedef T type2; typedef T rtype; - T operator ()(T a, T b) const { return std::max(a, b); } + T operator ()(const T a, const T b) const { return std::max(a, b); } }; #undef CV_MIN_8U @@ -72,8 +72,8 @@ template struct MaxOp #define CV_MIN_8U(a,b) ((a) - CV_FAST_CAST_8U((a) - (b))) #define CV_MAX_8U(a,b) ((a) + CV_FAST_CAST_8U((b) - (a))) -template<> inline uchar MinOp::operator ()(uchar a, uchar b) const { return CV_MIN_8U(a, b); } -template<> inline uchar MaxOp::operator ()(uchar a, uchar b) const { return CV_MAX_8U(a, b); } +template<> inline uchar MinOp::operator ()(const uchar a, const uchar b) const { return CV_MIN_8U(a, b); } +template<> inline uchar MaxOp::operator ()(const uchar a, const uchar b) const { return CV_MAX_8U(a, b); } struct MorphRowNoVec {