Fix build warnings in OpenCL samples
authorAndrey Kamaev <andrey.kamaev@itseez.com>
Wed, 30 Jan 2013 13:25:03 +0000 (17:25 +0400)
committerAndrey Kamaev <andrey.kamaev@itseez.com>
Wed, 30 Jan 2013 13:25:03 +0000 (17:25 +0400)
modules/ocl/include/opencv2/ocl/matrix_operations.hpp
samples/ocl/facedetect.cpp
samples/ocl/squares.cpp

index d528aeb..4b617ce 100644 (file)
@@ -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
         {
index 16017b9..ec79339 100644 (file)
@@ -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"
index f709453..6b18416 100644 (file)
@@ -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<vector<Point> >& squares )
+static void findSquares( const Mat& image, vector<vector<Point> >& squares )
 {
     squares.clear();
 
@@ -131,7 +131,7 @@ void findSquares( const Mat& image, vector<vector<Point> >& squares )
 
 
 // the function draws all the squares in the image
-void drawSquares( Mat& image, const vector<vector<Point> >& squares )
+static void drawSquares( Mat& image, const vector<vector<Point> >& squares )
 {
     for( size_t i = 0; i < squares.size(); i++ )
     {