From f489eb9a5d853d7cbd667ffaace73b015a5a47a3 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Wed, 30 Jan 2013 17:25:03 +0400 Subject: [PATCH] Fix build warnings in OpenCL samples --- .../include/opencv2/ocl/matrix_operations.hpp | 28 +++++++++---------- samples/ocl/facedetect.cpp | 2 +- samples/ocl/squares.cpp | 8 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/ocl/include/opencv2/ocl/matrix_operations.hpp b/modules/ocl/include/opencv2/ocl/matrix_operations.hpp index d528aeb02..4b617ce07 100644 --- a/modules/ocl/include/opencv2/ocl/matrix_operations.hpp +++ b/modules/ocl/include/opencv2/ocl/matrix_operations.hpp @@ -141,7 +141,7 @@ namespace cv } - inline oclMat::oclMat(const oclMat &m, const Range &rowRange, const Range &colRange) + inline oclMat::oclMat(const oclMat &m, const Range &rRange, const Range &cRange) { flags = m.flags; step = m.step; @@ -152,22 +152,22 @@ namespace cv wholerows = m.wholerows; wholecols = m.wholecols; offset = m.offset; - if( rowRange == Range::all() ) + if( rRange == Range::all() ) rows = m.rows; else { - CV_Assert( 0 <= rowRange.start && rowRange.start <= rowRange.end && rowRange.end <= m.rows ); - rows = rowRange.size(); - offset += step * rowRange.start; + CV_Assert( 0 <= rRange.start && rRange.start <= rRange.end && rRange.end <= m.rows ); + rows = rRange.size(); + offset += step * rRange.start; } - if( colRange == Range::all() ) + if( cRange == Range::all() ) cols = m.cols; else { - CV_Assert( 0 <= colRange.start && colRange.start <= colRange.end && colRange.end <= m.cols ); - cols = colRange.size(); - offset += colRange.start * elemSize(); + CV_Assert( 0 <= cRange.start && cRange.start <= cRange.end && cRange.end <= m.cols ); + cols = cRange.size(); + offset += cRange.start * elemSize(); flags &= cols < m.cols ? ~Mat::CONTINUOUS_FLAG : -1; } @@ -296,12 +296,12 @@ namespace cv //CPP void oclMat::copyTo( oclMat& m, const oclMat& mask ) const; //CPP void oclMat::convertTo( oclMat& m, int rtype, double alpha=1, double beta=0 ) const; - inline void oclMat::assignTo( oclMat &m, int type ) const + inline void oclMat::assignTo( oclMat &m, int mtype ) const { - if( type < 0 ) + if( mtype < 0 ) m = *this; else - convertTo(m, type); + convertTo(m, mtype); } //CPP oclMat& oclMat::operator = (const Scalar& s); @@ -370,9 +370,9 @@ namespace cv return *this; } - inline oclMat oclMat::operator()( Range rowRange, Range colRange ) const + inline oclMat oclMat::operator()( Range rRange, Range cRange ) const { - return oclMat(*this, rowRange, colRange); + return oclMat(*this, rRange, cRange); } inline oclMat oclMat::operator()( const Rect &roi ) const { diff --git a/samples/ocl/facedetect.cpp b/samples/ocl/facedetect.cpp index 16017b928..ec7933951 100644 --- a/samples/ocl/facedetect.cpp +++ b/samples/ocl/facedetect.cpp @@ -10,7 +10,7 @@ using namespace std; using namespace cv; -void help() +static void help() { cout << "\nThis program demonstrates the cascade recognizer.\n" "This classifier can recognize many ~rigid objects, it's most known use is for faces.\n" diff --git a/samples/ocl/squares.cpp b/samples/ocl/squares.cpp index f70945342..6b184161f 100644 --- a/samples/ocl/squares.cpp +++ b/samples/ocl/squares.cpp @@ -14,7 +14,7 @@ using namespace cv; using namespace std; -void help() +static void help() { cout << "\nA program using OCL module pyramid scaling, Canny, dilate functions, threshold, split; cpu contours, contour simpification and\n" @@ -34,7 +34,7 @@ const char* wndname = "OpenCL Square Detection Demo"; // helper function: // finds a cosine of angle between vectors // from pt0->pt1 and from pt0->pt2 -double angle( Point pt1, Point pt2, Point pt0 ) +static double angle( Point pt1, Point pt2, Point pt0 ) { double dx1 = pt1.x - pt0.x; double dy1 = pt1.y - pt0.y; @@ -45,7 +45,7 @@ double angle( Point pt1, Point pt2, Point pt0 ) // returns sequence of squares detected on the image. // the sequence is stored in the specified memory storage -void findSquares( const Mat& image, vector >& squares ) +static void findSquares( const Mat& image, vector >& squares ) { squares.clear(); @@ -131,7 +131,7 @@ void findSquares( const Mat& image, vector >& squares ) // the function draws all the squares in the image -void drawSquares( Mat& image, const vector >& squares ) +static void drawSquares( Mat& image, const vector >& squares ) { for( size_t i = 0; i < squares.size(); i++ ) {