From a865876c0f5c757ec82a2291aedad3bdd83df48b Mon Sep 17 00:00:00 2001 From: matze Date: Tue, 13 Sep 2016 19:32:37 +0200 Subject: [PATCH] Added CV_UNUSED to not used variable when build without SSE2 support. --- modules/imgproc/src/contours.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/imgproc/src/contours.cpp b/modules/imgproc/src/contours.cpp index 391d2b9262..2bfb7d7893 100644 --- a/modules/imgproc/src/contours.cpp +++ b/modules/imgproc/src/contours.cpp @@ -1390,6 +1390,8 @@ inline int findStartContourPoint(uchar *src_data, CvSize img_size, int j, bool h j += 16; } } +#else + CV_UNUSED(haveSIMD); #endif for (; j < img_size.width && !src_data[j]; ++j) ; @@ -1437,6 +1439,8 @@ inline int findEndContourPoint(uchar *src_data, CvSize img_size, int j, bool hav j += 16; } } +#else + CV_UNUSED(haveSIMD); #endif for (; j < img_size.width && src_data[j]; ++j) ; @@ -1466,6 +1470,7 @@ icvFindContoursInInterval( const CvArr* src, int lower_total; int upper_total; int all_total; + bool haveSIMD = false; CvSeq* runs; CvLinkedRunPoint tmp; @@ -1496,7 +1501,7 @@ icvFindContoursInInterval( const CvArr* src, if( contourHeaderSize < (int)sizeof(CvContour)) CV_Error( CV_StsBadSize, "Contour header size must be >= sizeof(CvContour)" ); #if CV_SSE2 - bool haveSIMD = cv::checkHardwareSupport(CPU_SSE2); + haveSIMD = cv::checkHardwareSupport(CPU_SSE2); #endif storage00.reset(cvCreateChildMemStorage(storage)); storage01.reset(cvCreateChildMemStorage(storage)); @@ -1540,7 +1545,7 @@ icvFindContoursInInterval( const CvArr* src, tmp_prev->next = (CvLinkedRunPoint*)CV_GET_WRITTEN_ELEM( writer ); tmp_prev = tmp_prev->next; - j = findEndContourPoint(src_data, img_size, j+1, haveSIMD); + j = findEndContourPoint(src_data, img_size, j + 1, haveSIMD); tmp.pt.x = j - 1; CV_WRITE_SEQ_ELEM( tmp, writer ); @@ -1573,7 +1578,7 @@ icvFindContoursInInterval( const CvArr* src, tmp_prev->next = (CvLinkedRunPoint*)CV_GET_WRITTEN_ELEM( writer ); tmp_prev = tmp_prev->next; - j = findEndContourPoint(src_data, img_size, j+1, haveSIMD); + j = findEndContourPoint(src_data, img_size, j + 1, haveSIMD); tmp.pt.x = j - 1; CV_WRITE_SEQ_ELEM( tmp, writer );