From e858a6c347cdf6e4c4122a8717b72137591e5d79 Mon Sep 17 00:00:00 2001 From: peng xiao Date: Fri, 28 Jun 2013 10:39:09 +0800 Subject: [PATCH] Renew function logic. --- modules/ocl/src/initialization.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/ocl/src/initialization.cpp b/modules/ocl/src/initialization.cpp index bd6a8e9..780c245 100644 --- a/modules/ocl/src/initialization.cpp +++ b/modules/ocl/src/initialization.cpp @@ -168,13 +168,13 @@ namespace cv }; // global variables to hold binary cache properties - static bool enable_disk_cache = + static int enable_disk_cache = #ifdef _DEBUG false; #else true; #endif - static bool update_disk_cache = false; + static int update_disk_cache = false; static String binpath = ""; Info::Impl::Impl() @@ -506,8 +506,14 @@ namespace cv void setBinaryDiskCache(int mode, String path) { - update_disk_cache = (mode & CACHE_UPDATE) == CACHE_UPDATE; - enable_disk_cache = + if(mode == CACHE_NONE) + { + update_disk_cache = 0; + enable_disk_cache = 0; + return; + } + update_disk_cache |= (mode & CACHE_UPDATE) == CACHE_UPDATE; + enable_disk_cache |= #ifdef _DEBUG (mode & CACHE_DEBUG) == CACHE_DEBUG; #else -- 2.7.4