From: Zhigang Gong Date: Tue, 3 Dec 2013 02:49:51 +0000 (+0800) Subject: Fixed some implicitly type conversions between vector and scalar data type. X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1314^2~725^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6ce03b04842292ce507a49ed435d50b2e20c5f2c;p=platform%2Fupstream%2Fopencv.git Fixed some implicitly type conversions between vector and scalar data type. There are some mixed implicitly/explicitly type conversion between scalar and vector. Although the spec allows those conversion, I prefer to make them consistent and use explicitly all the cases. Signed-off-by: Zhigang Gong --- diff --git a/modules/ocl/src/opencl/imgproc_threshold.cl b/modules/ocl/src/opencl/imgproc_threshold.cl index 63e4102..85631be 100644 --- a/modules/ocl/src/opencl/imgproc_threshold.cl +++ b/modules/ocl/src/opencl/imgproc_threshold.cl @@ -74,11 +74,11 @@ __kernel void threshold(__global const T * restrict src, int src_offset, int src VT vthresh = (VT)(thresh); #ifdef THRESH_BINARY - VT vecValue = sdata > vthresh ? max_val : (VT)(0); + VT vecValue = sdata > vthresh ? (VT)max_val : (VT)(0); #elif defined THRESH_BINARY_INV - VT vecValue = sdata > vthresh ? (VT)(0) : max_val; + VT vecValue = sdata > vthresh ? (VT)(0) : (VT)max_val; #elif defined THRESH_TRUNC - VT vecValue = sdata > vthresh ? thresh : sdata; + VT vecValue = sdata > vthresh ? (VT)thresh : sdata; #elif defined THRESH_TOZERO VT vecValue = sdata > vthresh ? sdata : (VT)(0); #elif defined THRESH_TOZERO_INV