From a6d558042c05d107571cd6528493a2c638017d2f Mon Sep 17 00:00:00 2001 From: peng xiao Date: Fri, 26 Jul 2013 14:32:37 +0800 Subject: [PATCH] Fix build errors --- modules/ocl/src/sort_by_key.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/ocl/src/sort_by_key.cpp b/modules/ocl/src/sort_by_key.cpp index 20f76f2..baabf46 100644 --- a/modules/ocl/src/sort_by_key.cpp +++ b/modules/ocl/src/sort_by_key.cpp @@ -69,13 +69,13 @@ const char * depth_strings[] = "double" //CV_64F }; -void genSortBuildOption(const oclMat& keys, const oclMat& vals, bool isGreaterThan, char * build_opt_buf) +void static genSortBuildOption(const oclMat& keys, const oclMat& vals, bool isGreaterThan, char * build_opt_buf) { sprintf(build_opt_buf, "-D IS_GT=%d -D K_T=%s -D V_T=%s", isGreaterThan?1:0, depth_strings[keys.depth()], depth_strings[vals.depth()]); if(vals.oclchannels() > 1) { - sprintf( build_opt_buf + strlen(build_opt_buf), "%d", vals.oclchannels(), 10); + sprintf( build_opt_buf + strlen(build_opt_buf), "%d", vals.oclchannels()); } } inline bool isSizePowerOf2(size_t size) @@ -176,7 +176,7 @@ namespace radix_sort // openCLExecuteKernel(cxt, &kernel_radix_sort_by_key, kernelname, globalThreads, localThreads, args, -1, -1); //} -void naive_scan_addition_cpu(oclMat& input, oclMat& output) +void static naive_scan_addition_cpu(oclMat& input, oclMat& output) { Mat m_input = input, m_output(output.size(), output.type()); MatIterator_ i_mit = m_input.begin(); @@ -277,7 +277,7 @@ static void sort_by_key(oclMat& keys, oclMat& vals, size_t origVecSize, bool isG String kernelnames[2] = {String("histogramRadixN"), String("permuteRadixN")}; int swap = 0; - for(int bits = 0; bits < (keys.elemSize() * 8); bits += RADIX) + for(int bits = 0; bits < (static_cast(keys.elemSize()) * 8); bits += RADIX) { args.clear(); //Do a histogram pass locally -- 2.7.4