fixed some GCC 4.4 warnings
authorVadim Pisarevsky <no@email>
Sat, 20 Nov 2010 12:05:28 +0000 (12:05 +0000)
committerVadim Pisarevsky <no@email>
Sat, 20 Nov 2010 12:05:28 +0000 (12:05 +0000)
CMakeLists.txt
modules/core/src/lapack.cpp
modules/core/src/matrix.cpp
modules/imgproc/src/featureselect.cpp
modules/imgproc/src/histogram.cpp
modules/ml/src/knearest.cpp
modules/python/opencv2x.h

index 970d053..d5d7b17 100644 (file)
@@ -562,10 +562,10 @@ if (WITH_TBB)
 \r
         if (TBB_FOUND)\r
             set(HAVE_TBB 1)\r
-            if(NOT "${TBB_INCLUDE_DIRS}" STREQUAL "")\r
-                include_directories("${TBB_INCLUDE_DIRS}")\r
+            if(NOT ${TBB_INCLUDE_DIRS} STREQUAL "")\r
+                include_directories(${TBB_INCLUDE_DIRS})\r
             endif()\r
-            link_directories("${TBB_LIBRARY_DIRS}")\r
+            link_directories(${TBB_LIBRARY_DIRS})\r
             set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${TBB_LIBRARIES})\r
         else()\r
             set(TBB_DEFAULT_INCLUDE_DIRS\r
index 8871e0a..f678085 100644 (file)
@@ -1454,8 +1454,7 @@ void SVD::backSubst( const Mat& w, const Mat& u, const Mat& vt, const Mat& rhs,
     AutoBuffer<double> buffer(nb);
     CV_Assert( u.data && vt.data && w.data );
     
-    if( rhs.data )
-        CV_Assert( rhs.type() == type && rhs.rows == m );
+    CV_Assert( rhs.data == 0 || (rhs.type() == type && rhs.rows == m) );
     
     dst.create( n, nb, type );
     if( type == CV_32F )
index 6ed7d6a..1e61d9a 100644 (file)
@@ -685,8 +685,11 @@ void extractImageCOI(const CvArr* arr, Mat& ch, int coi)
 {
     Mat mat = cvarrToMat(arr, false, true, 1);
     ch.create(mat.dims, mat.size, mat.depth());
-    if(coi < 0) 
-        CV_Assert( CV_IS_IMAGE(arr) && (coi = cvGetImageCOI((const IplImage*)arr)-1) >= 0 );
+    if(coi < 0)
+    { 
+        CV_Assert( CV_IS_IMAGE(arr) );
+        coi = cvGetImageCOI((const IplImage*)arr)-1;
+    }
     CV_Assert(0 <= coi && coi < mat.channels());
     int _pairs[] = { coi, 0 };
     mixChannels( &mat, 1, &ch, 1, _pairs, 1 );
@@ -695,8 +698,11 @@ void extractImageCOI(const CvArr* arr, Mat& ch, int coi)
 void insertImageCOI(const Mat& ch, CvArr* arr, int coi)
 {
     Mat mat = cvarrToMat(arr, false, true, 1);
-    if(coi < 0) 
-        CV_Assert( CV_IS_IMAGE(arr) && (coi = cvGetImageCOI((const IplImage*)arr)-1) >= 0 );
+    if(coi < 0)
+    { 
+        CV_Assert( CV_IS_IMAGE(arr) );
+        coi = cvGetImageCOI((const IplImage*)arr)-1;
+    }
     CV_Assert(ch.size == mat.size && ch.depth() == mat.depth() && 0 <= coi && coi < mat.channels());
     int _pairs[] = { 0, coi };
     mixChannels( &ch, 1, &mat, 1, _pairs, 1 );
index 9c68df7..b469db5 100644 (file)
@@ -57,8 +57,7 @@ void goodFeaturesToTrack( const Mat& image, vector<Point2f>& corners,
 {
     CV_Assert( qualityLevel > 0 && minDistance >= 0 && maxCorners >= 0 );
 
-    if( mask.data )
-        CV_Assert( mask.type() == CV_8UC1 && mask.size() == image.size() );
+    CV_Assert( mask.empty() || (mask.type() == CV_8UC1 && mask.size() == image.size()) );
 
     Mat eig, tmp;
     if( useHarrisDetector )
index a68f301..c68ed94 100644 (file)
@@ -117,8 +117,7 @@ static void histPrepareImages( const Mat* images, int nimages, const int* channe
                                Size& imsize, vector<double>& uniranges )
 {
     int i, j, c;
-    if(!channels)
-        CV_Assert( nimages == dims );
+    CV_Assert( channels != 0 || nimages == dims );
     
     imsize = images[0].size();
     int depth = images[0].depth(), esz1 = (int)images[0].elemSize1();
index e930c3f..c5e4ef4 100644 (file)
@@ -427,7 +427,7 @@ float CvKNearest::find_nearest( const Mat& _samples, int k, Mat* _results,
     {
         if(!(_results->data && (_results->type() == CV_32F ||
             (_results->type() == CV_32S && regression)) &&
-             (_results->cols == 1 || _results->rows == 1) ||
+             (_results->cols == 1 || _results->rows == 1) &&
              _results->cols + _results->rows - 1 == _samples.rows) )
             _results->create(_samples.rows, 1, CV_32F);
         presults = &(results = *_results);
index d971c2e..4f2ec2c 100644 (file)
@@ -76,8 +76,6 @@ public:
     void allocate(int dims, const int* sizes, int type, int*& refcount,
                   uchar*& datastart, uchar*& data, size_t* step)
     {
-        static int ncalls = 0;
-        
         int depth = CV_MAT_DEPTH(type);
         int cn = CV_MAT_CN(type);
         const int f = (int)(sizeof(size_t)/8);
@@ -108,8 +106,6 @@ public:
     
     void deallocate(int* refcount, uchar* datastart, uchar* data)
     {
-        static int ncalls = 0;
-        
         if( !refcount )
             return;
         PyObject* o = pyObjectFromRefcount(refcount);
@@ -124,8 +120,6 @@ enum { ARG_NONE = 0, ARG_MAT = 1, ARG_SCALAR = 2 };
 
 static int pyopencv_to(const PyObject* o, Mat& m, const char* name = "<unknown>", bool allowND=true)
 {
-    static int call_idx = 0;
-    
     if(!o || o == Py_None)
     {
         if( !m.data )