From 591b1a7e70e15f337f4ee0cd9503f5f29f9712bb Mon Sep 17 00:00:00 2001 From: Vladimir Bystricky Date: Fri, 6 Dec 2013 14:42:06 +0400 Subject: [PATCH] Another fix for disable "conditional expression is constant" --- modules/imgproc/src/smooth.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/imgproc/src/smooth.cpp b/modules/imgproc/src/smooth.cpp index 7791a0279..e334c99ed 100644 --- a/modules/imgproc/src/smooth.cpp +++ b/modules/imgproc/src/smooth.cpp @@ -669,6 +669,7 @@ static bool ocl_boxFilter( InputArray _src, OutputArray _dst, int ddepth, size_t maxWorkItemSizes[32]; device.maxWorkItemSizes(maxWorkItemSizes); size_t tryWorkItems = maxWorkItemSizes[0]; + bool dummy = true; // for make compiler happy do { size_t BLOCK_SIZE = tryWorkItems; while (BLOCK_SIZE > 32 && BLOCK_SIZE >= (size_t)ksize.width * 2 && BLOCK_SIZE > (size_t)sz.width * 2) @@ -709,15 +710,15 @@ static bool ocl_boxFilter( InputArray _src, OutputArray _dst, int ddepth, size_t kernelWorkGroupSize = kernel.workGroupSize(); if (localsize[0] <= kernelWorkGroupSize) + { + dummy = false; break; + } if (BLOCK_SIZE < kernelWorkGroupSize) return false; tryWorkItems = kernelWorkGroupSize; -#pragma warning( push ) -#pragma warning( disable : 4127 ) - } while (true); -#pragma warning( pop ) + } while (dummy); _dst.create(sz, CV_MAKETYPE(ddepth, cn)); UMat dst = _dst.getUMat();