From 6d735c11c651a71f39e8390c62691d2983aa6252 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Thu, 18 Apr 2013 10:27:56 +0400 Subject: [PATCH] removed const qualifier (it produces warnings) --- .../opencv2/core/cuda/border_interpolate.hpp | 58 +++++++++++----------- modules/core/include/opencv2/core/cuda/filters.hpp | 10 ++-- .../core/include/opencv2/core/cuda/functional.hpp | 26 +++++----- modules/gpuarithm/src/cuda/cmp_scalar.cu | 8 +-- modules/gpuarithm/src/cuda/math.cu | 2 +- modules/gpuimgproc/src/cuda/canny.cu | 4 +- 6 files changed, 54 insertions(+), 54 deletions(-) diff --git a/modules/core/include/opencv2/core/cuda/border_interpolate.hpp b/modules/core/include/opencv2/core/cuda/border_interpolate.hpp index 1347a2f..6c53f09 100644 --- a/modules/core/include/opencv2/core/cuda/border_interpolate.hpp +++ b/modules/core/include/opencv2/core/cuda/border_interpolate.hpp @@ -73,8 +73,8 @@ namespace cv { namespace gpu { namespace cudev return (x >= 0 && x < width) ? saturate_cast(data[x]) : val; } - const int width; - const D val; + int width; + D val; }; template struct BrdColConstant @@ -98,8 +98,8 @@ namespace cv { namespace gpu { namespace cudev return (y >= 0 && y < height) ? saturate_cast(*(const T*)((const char*)data + y * step)) : val; } - const int height; - const D val; + int height; + D val; }; template struct BrdConstant @@ -120,9 +120,9 @@ namespace cv { namespace gpu { namespace cudev return (x >= 0 && x < width && y >= 0 && y < height) ? saturate_cast(src(y, x)) : val; } - const int height; - const int width; - const D val; + int height; + int width; + D val; }; ////////////////////////////////////////////////////////////// @@ -165,7 +165,7 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(data[idx_col(x)]); } - const int last_col; + int last_col; }; template struct BrdColReplicate @@ -205,7 +205,7 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(*(const T*)((const char*)data + idx_row(y) * step)); } - const int last_row; + int last_row; }; template struct BrdReplicate @@ -255,8 +255,8 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(src(idx_row(y), idx_col(x))); } - const int last_row; - const int last_col; + int last_row; + int last_col; }; ////////////////////////////////////////////////////////////// @@ -299,7 +299,7 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(data[idx_col(x)]); } - const int last_col; + int last_col; }; template struct BrdColReflect101 @@ -339,7 +339,7 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(*(const D*)((const char*)data + idx_row(y) * step)); } - const int last_row; + int last_row; }; template struct BrdReflect101 @@ -389,8 +389,8 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(src(idx_row(y), idx_col(x))); } - const int last_row; - const int last_col; + int last_row; + int last_col; }; ////////////////////////////////////////////////////////////// @@ -433,7 +433,7 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(data[idx_col(x)]); } - const int last_col; + int last_col; }; template struct BrdColReflect @@ -473,7 +473,7 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(*(const D*)((const char*)data + idx_row(y) * step)); } - const int last_row; + int last_row; }; template struct BrdReflect @@ -523,8 +523,8 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(src(idx_row(y), idx_col(x))); } - const int last_row; - const int last_col; + int last_row; + int last_col; }; ////////////////////////////////////////////////////////////// @@ -567,7 +567,7 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(data[idx_col(x)]); } - const int width; + int width; }; template struct BrdColWrap @@ -607,7 +607,7 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(*(const D*)((const char*)data + idx_row(y) * step)); } - const int height; + int height; }; template struct BrdWrap @@ -664,8 +664,8 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(src(idx_row(y), idx_col(x))); } - const int height; - const int width; + int height; + int width; }; ////////////////////////////////////////////////////////////// @@ -683,8 +683,8 @@ namespace cv { namespace gpu { namespace cudev return b.at(y, x, ptr); } - const Ptr2D ptr; - const B b; + Ptr2D ptr; + B b; }; // under win32 there is some bug with templated types that passed as kernel parameters @@ -704,10 +704,10 @@ namespace cv { namespace gpu { namespace cudev return (x >= 0 && x < width && y >= 0 && y < height) ? saturate_cast(src(y, x)) : val; } - const Ptr2D src; - const int height; - const int width; - const D val; + Ptr2D src; + int height; + int width; + D val; }; }}} // namespace cv { namespace gpu { namespace cudev diff --git a/modules/core/include/opencv2/core/cuda/filters.hpp b/modules/core/include/opencv2/core/cuda/filters.hpp index 19a8c58..f35f662 100644 --- a/modules/core/include/opencv2/core/cuda/filters.hpp +++ b/modules/core/include/opencv2/core/cuda/filters.hpp @@ -67,7 +67,7 @@ namespace cv { namespace gpu { namespace cudev return src(__float2int_rz(y), __float2int_rz(x)); } - const Ptr2D src; + Ptr2D src; }; template struct LinearFilter @@ -107,7 +107,7 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(out); } - const Ptr2D src; + Ptr2D src; }; template struct CubicFilter @@ -166,7 +166,7 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(res); } - const Ptr2D src; + Ptr2D src; }; // for integer scaling template struct IntegerAreaFilter @@ -203,7 +203,7 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(out); } - const Ptr2D src; + Ptr2D src; float scale_x, scale_y ,scale; }; @@ -269,7 +269,7 @@ namespace cv { namespace gpu { namespace cudev return saturate_cast(out); } - const Ptr2D src; + Ptr2D src; float scale_x, scale_y; int width, haight; }; diff --git a/modules/core/include/opencv2/core/cuda/functional.hpp b/modules/core/include/opencv2/core/cuda/functional.hpp index 506ccd8..95706ca 100644 --- a/modules/core/include/opencv2/core/cuda/functional.hpp +++ b/modules/core/include/opencv2/core/cuda/functional.hpp @@ -552,8 +552,8 @@ namespace cv { namespace gpu { namespace cudev __device__ __forceinline__ thresh_binary_func():unary_function(){} - const T thresh; - const T maxVal; + T thresh; + T maxVal; }; template struct thresh_binary_inv_func : unary_function @@ -570,8 +570,8 @@ namespace cv { namespace gpu { namespace cudev __device__ __forceinline__ thresh_binary_inv_func():unary_function(){} - const T thresh; - const T maxVal; + T thresh; + T maxVal; }; template struct thresh_trunc_func : unary_function @@ -588,7 +588,7 @@ namespace cv { namespace gpu { namespace cudev __device__ __forceinline__ thresh_trunc_func():unary_function(){} - const T thresh; + T thresh; }; template struct thresh_to_zero_func : unary_function @@ -604,7 +604,7 @@ namespace cv { namespace gpu { namespace cudev __device__ __forceinline__ thresh_to_zero_func():unary_function(){} - const T thresh; + T thresh; }; template struct thresh_to_zero_inv_func : unary_function @@ -620,7 +620,7 @@ namespace cv { namespace gpu { namespace cudev __device__ __forceinline__ thresh_to_zero_inv_func():unary_function(){} - const T thresh; + T thresh; }; //bound!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ============> // Function Object Adaptors @@ -636,7 +636,7 @@ namespace cv { namespace gpu { namespace cudev __device__ __forceinline__ unary_negate(const unary_negate& other) : unary_function(){} __device__ __forceinline__ unary_negate() : unary_function(){} - const Predicate pred; + Predicate pred; }; template __host__ __device__ __forceinline__ unary_negate not1(const Predicate& pred) @@ -659,7 +659,7 @@ namespace cv { namespace gpu { namespace cudev __device__ __forceinline__ binary_negate() : binary_function(){} - const Predicate pred; + Predicate pred; }; template __host__ __device__ __forceinline__ binary_negate not2(const BinaryPredicate& pred) @@ -679,8 +679,8 @@ namespace cv { namespace gpu { namespace cudev __device__ __forceinline__ binder1st(const binder1st& other) : unary_function(){} - const Op op; - const typename Op::first_argument_type arg1; + Op op; + typename Op::first_argument_type arg1; }; template __host__ __device__ __forceinline__ binder1st bind1st(const Op& op, const T& x) @@ -700,8 +700,8 @@ namespace cv { namespace gpu { namespace cudev __device__ __forceinline__ binder2nd(const binder2nd& other) : unary_function(), op(other.op), arg2(other.arg2){} - const Op op; - const typename Op::second_argument_type arg2; + Op op; + typename Op::second_argument_type arg2; }; template __host__ __device__ __forceinline__ binder2nd bind2nd(const Op& op, const T& x) diff --git a/modules/gpuarithm/src/cuda/cmp_scalar.cu b/modules/gpuarithm/src/cuda/cmp_scalar.cu index 09ff0e6..678f253 100644 --- a/modules/gpuarithm/src/cuda/cmp_scalar.cu +++ b/modules/gpuarithm/src/cuda/cmp_scalar.cu @@ -72,7 +72,7 @@ namespace arithm template struct CmpScalar : unary_function { - const T val; + T val; __host__ explicit CmpScalar(T val_) : val(val_) {} @@ -85,7 +85,7 @@ namespace arithm template struct CmpScalar : unary_function { - const TYPE_VEC(T, 2) val; + TYPE_VEC(T, 2) val; __host__ explicit CmpScalar(TYPE_VEC(T, 2) val_) : val(val_) {} @@ -98,7 +98,7 @@ namespace arithm template struct CmpScalar : unary_function { - const TYPE_VEC(T, 3) val; + TYPE_VEC(T, 3) val; __host__ explicit CmpScalar(TYPE_VEC(T, 3) val_) : val(val_) {} @@ -111,7 +111,7 @@ namespace arithm template struct CmpScalar : unary_function { - const TYPE_VEC(T, 4) val; + TYPE_VEC(T, 4) val; __host__ explicit CmpScalar(TYPE_VEC(T, 4) val_) : val(val_) {} diff --git a/modules/gpuarithm/src/cuda/math.cu b/modules/gpuarithm/src/cuda/math.cu index 30093d5..86be98e 100644 --- a/modules/gpuarithm/src/cuda/math.cu +++ b/modules/gpuarithm/src/cuda/math.cu @@ -253,7 +253,7 @@ namespace arithm }; template<> struct PowOp : unary_function { - const float power; + float power; PowOp(double power_) : power(static_cast(power_)) {} diff --git a/modules/gpuimgproc/src/cuda/canny.cu b/modules/gpuimgproc/src/cuda/canny.cu index 042e9af..77b185a 100644 --- a/modules/gpuimgproc/src/cuda/canny.cu +++ b/modules/gpuimgproc/src/cuda/canny.cu @@ -94,8 +94,8 @@ namespace canny texture tex_src(false, cudaFilterModePoint, cudaAddressModeClamp); struct SrcTex { - const int xoff; - const int yoff; + int xoff; + int yoff; __host__ SrcTex(int _xoff, int _yoff) : xoff(_xoff), yoff(_yoff) {} __device__ __forceinline__ int operator ()(int y, int x) const -- 2.7.4