From 74c72a1d7a7c398dceeae7cf45a187046ffb1da8 Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko Date: Thu, 18 Jul 2013 19:15:49 +0400 Subject: [PATCH 1/2] removing unreachible code --- modules/imgproc/src/histogram.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/src/histogram.cpp b/modules/imgproc/src/histogram.cpp index da39ca9b33..2397527ef0 100644 --- a/modules/imgproc/src/histogram.cpp +++ b/modules/imgproc/src/histogram.cpp @@ -778,7 +778,7 @@ calcHist_( vector& _ptrs, const vector& _deltas, calcHist1D_Invoker body(_ptrs, _deltas, hist, _uniranges, size[0], dims, imsize); parallel_for(BlockedRange(0, imsize.height), body); return; -#endif +#else double a = uniranges[0], b = uniranges[1]; int sz = size[0], d0 = deltas[0], step0 = deltas[1]; const T* p0 = (const T*)ptrs[0]; @@ -801,6 +801,7 @@ calcHist_( vector& _ptrs, const vector& _deltas, ((int*)H)[idx]++; } } +#endif //HAVE_TBB } else if( dims == 2 ) { @@ -808,7 +809,7 @@ calcHist_( vector& _ptrs, const vector& _deltas, calcHist2D_Invoker body(_ptrs, _deltas, hist, _uniranges, size, dims, imsize, hstep); parallel_for(BlockedRange(0, imsize.height), body); return; -#endif +#else double a0 = uniranges[0], b0 = uniranges[1], a1 = uniranges[2], b1 = uniranges[3]; int sz0 = size[0], sz1 = size[1]; int d0 = deltas[0], step0 = deltas[1], @@ -837,6 +838,7 @@ calcHist_( vector& _ptrs, const vector& _deltas, ((int*)(H + hstep0*idx0))[idx1]++; } } +#endif //HAVE_TBB } else if( dims == 3 ) { From 6b047ca0ebfec53028df72255c0bcedfcaece7d6 Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko Date: Thu, 18 Jul 2013 19:50:51 +0400 Subject: [PATCH 2/2] minor improvement (consistency, readability) --- modules/imgproc/src/histogram.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/src/histogram.cpp b/modules/imgproc/src/histogram.cpp index 2397527ef0..18ff3436c1 100644 --- a/modules/imgproc/src/histogram.cpp +++ b/modules/imgproc/src/histogram.cpp @@ -777,7 +777,6 @@ calcHist_( vector& _ptrs, const vector& _deltas, #ifdef HAVE_TBB calcHist1D_Invoker body(_ptrs, _deltas, hist, _uniranges, size[0], dims, imsize); parallel_for(BlockedRange(0, imsize.height), body); - return; #else double a = uniranges[0], b = uniranges[1]; int sz = size[0], d0 = deltas[0], step0 = deltas[1]; @@ -802,13 +801,13 @@ calcHist_( vector& _ptrs, const vector& _deltas, } } #endif //HAVE_TBB + return; } else if( dims == 2 ) { #ifdef HAVE_TBB calcHist2D_Invoker body(_ptrs, _deltas, hist, _uniranges, size, dims, imsize, hstep); parallel_for(BlockedRange(0, imsize.height), body); - return; #else double a0 = uniranges[0], b0 = uniranges[1], a1 = uniranges[2], b1 = uniranges[3]; int sz0 = size[0], sz1 = size[1]; @@ -839,6 +838,7 @@ calcHist_( vector& _ptrs, const vector& _deltas, } } #endif //HAVE_TBB + return; } else if( dims == 3 ) {