]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
some more fixed warnings
authorvp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 12 Mar 2010 17:54:52 +0000 (17:54 +0000)
committervp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 12 Mar 2010 17:54:52 +0000 (17:54 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@2806 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

opencv/3rdparty/lapack/CMakeLists.txt
opencv/3rdparty/libjasper/CMakeLists.txt
opencv/src/cv/cvmotempl.cpp
opencv/src/cv/cvpyramids.cpp
opencv/src/cv/cvstereobm.cpp
opencv/src/cv/cvstereosgbm.cpp
opencv/src/cvaux/cvquadsubpix.cpp
opencv/src/cxcore/cxmathfuncs.cpp
opencv/src/highgui/cvcap_dc1394.cpp
opencv/tests/ml/src/aemknearestkmeans.cpp

index 609265c5a70c362078a8a8f1fcd3db4965f467bf..8e89d69a7ed1e79b5dd1881910e5466dc32c5823 100644 (file)
@@ -48,7 +48,7 @@ if(UNIX)
 endif()
 
 if(CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-parentheses")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-parentheses -Wno-uninitialized -Wno-implicit-function-declaration -Wno-unused")
     set_source_files_properties(dlamch.c slamch.c PROPERTIES COMPILE_FLAGS "-ffloat-store -O0")
 endif()
 
index 48e33c188f1533a6970b09b4f16b81856fd9c83e..30628a183b88998a19aa978462c79c22471a9309 100644 (file)
@@ -36,6 +36,10 @@ if(UNIX)
     endif()
 endif()
 
+if(CMAKE_COMPILER_IS_GNUCXX)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-implicit-function-declaration -Wno-unused")
+endif()
+
 set_target_properties(${the_target}
        PROPERTIES
        OUTPUT_NAME "${the_target}"
index e3d8dd95ec0979924e7e0889100ba29b572e7851..48fd6d11e929337e3091b296dad33539b5765a56 100644 (file)
@@ -74,7 +74,9 @@ cvUpdateMotionHistory( const void* silhouette, void* mhimg,
     float ts = (float)timestamp;\r
     float delbound = (float)(timestamp - mhi_duration);\r
     int x, y;\r
+#if CV_SSE2\r
     volatile bool useSIMD = cv::checkHardwareSupport(CV_CPU_SSE2);\r
+#endif\r
     \r
     for( y = 0; y < size.height; y++ )\r
     {\r
index c6db9812ebd5e2b8161ac3d19d8ca152c8d84a4e..674d8a1077898203aeffa8e465b276032db1655b 100644 (file)
@@ -61,22 +61,21 @@ template<typename T, int shift> struct FltCast
     rtype operator ()(type1 arg) const { return arg*(T)(1./(1 << shift)); }\r
 };\r
 \r
-struct NoVec\r
+template<typename T1, typename T2> struct NoVec\r
 {\r
-    int operator()(const uchar**, uchar*, int, int) const { return 0; }\r
+    int operator()(T1**, T2*, int, int) const { return 0; }\r
 };\r
 \r
 #if CV_SSE2\r
 \r
 struct PyrDownVec_32s8u\r
 {\r
-    int operator()(const uchar** _src, uchar* dst, int, int width) const\r
+    int operator()(int** src, uchar* dst, int, int width) const\r
     {\r
         if( !checkHardwareSupport(CV_CPU_SSE2) )\r
             return 0;\r
         \r
         int x = 0;\r
-        const int** src = (const int**)_src;\r
         const int *row0 = src[0], *row1 = src[1], *row2 = src[2], *row3 = src[3], *row4 = src[4];\r
         __m128i delta = _mm_set1_epi16(128);\r
 \r
@@ -138,14 +137,12 @@ struct PyrDownVec_32s8u
 \r
 struct PyrDownVec_32f\r
 {\r
-    int operator()(const uchar** _src, uchar* _dst, int, int width) const\r
+    int operator()(float** src, float* dst, int, int width) const\r
     {\r
         if( !checkHardwareSupport(CV_CPU_SSE) )\r
             return 0;\r
         \r
         int x = 0;\r
-        const float** src = (const float**)_src;\r
-        float* dst = (float*)_dst;\r
         const float *row0 = src[0], *row1 = src[1], *row2 = src[2], *row3 = src[3], *row4 = src[4];\r
         __m128 _4 = _mm_set1_ps(4.f), _scale = _mm_set1_ps(1.f/256);\r
         for( ; x <= width - 8; x += 8 )\r
@@ -184,8 +181,8 @@ struct PyrDownVec_32f
 \r
 #else\r
 \r
-typedef NoVec PyrDownVec_32s8u;\r
-typedef NoVec PyrDownVec_32f;\r
+typedef NoVec<int, uchar> PyrDownVec_32s8u;\r
+typedef NoVec<float, float> PyrDownVec_32f;\r
 \r
 #endif\r
 \r
@@ -305,7 +302,7 @@ pyrDown_( const Mat& _src, Mat& _dst )
             rows[k] = buf + ((y*2 - PD_SZ/2 + k - sy0) % PD_SZ)*bufstep;\r
         row0 = rows[0]; row1 = rows[1]; row2 = rows[2]; row3 = rows[3]; row4 = rows[4];\r
 \r
-        x = vecOp((const uchar**)rows, (uchar*)dst, (int)_dst.step, dsize.width);\r
+        x = vecOp(rows, dst, (int)_dst.step, dsize.width);\r
         for( ; x < dsize.width; x++ )\r
             dst[x] = castOp(row2[x]*6 + (row1[x] + row3[x])*4 + row0[x] + row4[x]);\r
     }\r
@@ -392,7 +389,7 @@ pyrUp_( const Mat& _src, Mat& _dst )
             rows[k] = buf + ((y - PU_SZ/2 + k - sy0) % PU_SZ)*bufstep;\r
         row0 = rows[0]; row1 = rows[1]; row2 = rows[2];\r
 \r
-        x = vecOp((const uchar**)rows, (uchar*)dst0, (int)_dst.step, dsize.width);\r
+        x = vecOp(rows, dst0, (int)_dst.step, dsize.width);\r
         for( ; x < dsize.width; x++ )\r
         {\r
             T t1 = castOp((row1[x] + row2[x])*4);\r
@@ -413,11 +410,11 @@ void pyrDown( const Mat& _src, Mat& _dst, const Size& _dsz )
     if( depth == CV_8U )\r
         func = pyrDown_<FixPtCast<uchar, 8>, PyrDownVec_32s8u>;\r
     else if( depth == CV_16U )\r
-        func = pyrDown_<FixPtCast<ushort, 8>, NoVec>;\r
+        func = pyrDown_<FixPtCast<ushort, 8>, NoVec<int, ushort> >;\r
     else if( depth == CV_32F )\r
         func = pyrDown_<FltCast<float, 8>, PyrDownVec_32f>;\r
     else if( depth == CV_64F )\r
-        func = pyrDown_<FltCast<double, 8>, NoVec>;\r
+        func = pyrDown_<FltCast<double, 8>, NoVec<double, double> >;\r
     else\r
         CV_Error( CV_StsUnsupportedFormat, "" );\r
 \r
@@ -431,13 +428,13 @@ void pyrUp( const Mat& _src, Mat& _dst, const Size& _dsz )
     int depth = _src.depth();\r
     PyrFunc func = 0;\r
     if( depth == CV_8U )\r
-        func = pyrUp_<FixPtCast<uchar, 6>, NoVec>;\r
+        func = pyrUp_<FixPtCast<uchar, 6>, NoVec<int, uchar> >;\r
     else if( depth == CV_16U )\r
-        func = pyrUp_<FixPtCast<ushort, 6>, NoVec>;\r
+        func = pyrUp_<FixPtCast<ushort, 6>, NoVec<int, ushort> >;\r
     else if( depth == CV_32F )\r
-        func = pyrUp_<FltCast<float, 6>, NoVec>;\r
+        func = pyrUp_<FltCast<float, 6>, NoVec<float, float> >;\r
     else if( depth == CV_64F )\r
-        func = pyrUp_<FltCast<double, 6>, NoVec>;\r
+        func = pyrUp_<FltCast<double, 6>, NoVec<double, double> >;\r
     else\r
         CV_Error( CV_StsUnsupportedFormat, "" );\r
 \r
index aea7b3281232a658c5d4987c06f612080b8e36ae..6d10e0644683b65d265c7a56029317e8b022fa67 100644 (file)
@@ -939,4 +939,4 @@ CV_IMPL void cvFindStereoCorrespondenceBM( const CvArr* leftarr, const CvArr* ri
     cv::findStereoCorrespondenceBM(left, right, disp, state);\r
 }\r
 \r
-/* End of file. */
\ No newline at end of file
+/* End of file. */\r
index 267b75f7f053297a66d1a3a125b3b3c6ab2f3e11..e15db3f7b1a873c87efaae93c82952774b93d7a0 100644 (file)
@@ -159,7 +159,9 @@ static void calcPixelCostBT( const Mat& img1, const Mat& img2, int y,
     buffer -= minX2;
     cost -= minX1*D + minD; // simplify the cost indices inside the loop
     
+#if CV_SSE2    
     volatile bool useSIMD = checkHardwareSupport(CV_CPU_SSE2);
+#endif
     
 #if 1    
     for( c = 0; c < cn; c++, prow1 += width, prow2 += width )
@@ -297,6 +299,8 @@ static void computeDisparitySGBM( const Mat& img1, const Mat& img2,
         6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
         5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
     };
+    
+    volatile bool useSIMD = checkHardwareSupport(CV_CPU_SSE2);
 #endif    
     
     const int ALIGN = 16;
@@ -368,8 +372,6 @@ static void computeDisparitySGBM( const Mat& img1, const Mat& img2,
     DispType* disp2ptr = (DispType*)(disp2cost + width);
     PixType* tempBuf = (PixType*)(disp2ptr + width);
     
-    volatile bool useSIMD = checkHardwareSupport(CV_CPU_SSE2);
-    
     // add P2 to every C(x,y). it saves a few operations in the inner loops
     for( k = 0; k < width1*D; k++ )
         Cbuf[k] = P2;
index af2f68f9c7566692cfbc7463f6d33fda0dabe950..e523ed61b612afa84dcdbd5891b7c46067b1c490 100644 (file)
@@ -176,16 +176,16 @@ void findCorner(const vector<Point2f>& contour, Point2f point, Point2f& corner)
 int segment_hist_max(const MatND& hist, int& low_thresh, int& high_thresh)
 {
     Mat bw;
-    const double max_bell_width = 20; // we expect two bells with width bounded above
-    const double min_bell_width = 5; // and below
+    //const double max_bell_width = 20; // we expect two bells with width bounded above
+    //const double min_bell_width = 5; // and below
     
     double total_sum = sum(hist).val[0];
-    double thresh = total_sum/(2*max_bell_width)*0.25f; // quarter of a bar inside a bell
+    //double thresh = total_sum/(2*max_bell_width)*0.25f; // quarter of a bar inside a bell
     
 //    threshold(hist, bw, thresh, 255.0, CV_THRESH_BINARY);
     
     double quantile_sum = 0.0;
-    double min_quantile = 0.2;
+    //double min_quantile = 0.2;
     double low_sum = 0;
     double max_segment_length = 0;
     int max_start_x = -1;
index 368283ef19af66ae9ce97244b6eadb23fc56a5a0..6996629daaa612bb8ad51d87bdc5cba132288eae 100644 (file)
@@ -91,8 +91,8 @@ static CvStatus CV_STDCALL FastAtan2_32f(const float *Y, const float *X, float *
 #if CV_SSE2
     if( checkHardwareSupport(CV_CPU_SSE) )
     {
-        static const int CV_DECL_ALIGNED(16) iabsmask[] = {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff};
-        __m128 eps = _mm_set1_ps((float)DBL_EPSILON), absmask = _mm_load_ps((const float*)iabsmask);
+        Cv32suf iabsmask; iabsmask.i = 0x7fffffff;
+        __m128 eps = _mm_set1_ps((float)DBL_EPSILON), absmask = _mm_set1_ps(iabsmask.f);
         __m128 _90 = _mm_set1_ps((float)(CV_PI*0.5)), _180 = _mm_set1_ps((float)CV_PI), _360 = _mm_set1_ps((float)(CV_PI*2));
         __m128 zero = _mm_setzero_ps(), _0_28 = _mm_set1_ps(0.28f), scale4 = _mm_set1_ps(scale);
         
index 6efcd313ce7c17f134bf0312fa6a4da37131ea7b..9870f15effab6e8e1bd8be4d39323d4494183625 100644 (file)
@@ -128,7 +128,7 @@ static void y2bgr(const unsigned char *src, unsigned char *dest, unsigned long l
 static void y162bgr(const unsigned char *src, unsigned char *dest, unsigned long long int NumPixels, int bits);
 static void rgb482bgr(const unsigned char *src8, unsigned char *dest, unsigned long long int NumPixels, int bits);
 
-static char * videodev[4]={
+static const char * videodev[4]={
   "/dev/video1394/0",
   "/dev/video1394/1",
   "/dev/video1394/2",
@@ -144,7 +144,7 @@ typedef struct CvCaptureCAM_DC1394
     int mode;
     int color_mode;
     int frame_rate;
-    char * device_name;
+    const char * device_name;
     IplImage frame;
        int convert;
        int buffer_is_writeable;  // indicates whether frame.imageData is allocated by OpenCV or DC1394
@@ -812,7 +812,7 @@ icvSetFeatureCAM_DC1394( CvCaptureCAM_DC1394* capture, int feature_id, int val){
 
                        // now check if the auto is on.
                        if( dc1394_is_feature_auto(capture->handle, capture->camera->node, feature_id, &isAutoOn ) == DC1394_FAILURE ) {
-                               fprintf(stderr, "error determining if feature %d has auto on!\n", index);
+                               fprintf(stderr, "error determining if feature %d has auto on!\n", feature_id);
                                return 0;
                        }
                }
@@ -844,7 +844,7 @@ icvSetFeatureCAM_DC1394( CvCaptureCAM_DC1394* capture, int feature_id, int val){
                // Clamp val to within feature range
                CV_DC1394_CALL( dc1394_get_min_value(capture->handle, capture->camera->node, feature_id, &minval));
                CV_DC1394_CALL( dc1394_get_max_value(capture->handle, capture->camera->node, feature_id, &maxval));
-               val = MIN(maxval, MAX(val, minval));
+               val = (int)MIN(maxval, MAX((unsigned)val, minval));
 
 
                if (dc1394_set_feature_value(capture->handle, capture->camera->node, feature_id, val) ==
index 3b90e5eaca9e182f89449e232ee221d787b0372a..12c782f255d12e0dcb98728effa72e769f07077b 100644 (file)
@@ -62,10 +62,10 @@ void defaultDistribs( vector<Mat>& means, vector<Mat>& covs )
 void generateData( Mat& data, Mat& labels, const vector<int>& sizes, const vector<Mat>& means, const vector<Mat>& covs, int labelType )
 {
     vector<int>::const_iterator sit = sizes.begin();
-    int total = 0, setCount = (int)sizes.size();
+    int total = 0;
     for( ; sit != sizes.end(); ++sit )
         total += *sit;
-    assert( (int)means.size() == setCount && (int)covs.size() == setCount );
+    assert( means.size() == sizes.size() && covs.size() == sizes.size() );
     assert( !data.empty() && data.rows == total );
     assert( data.type() == CV_32FC1 );
     
@@ -83,7 +83,7 @@ void generateData( Mat& data, Mat& labels, const vector<int>& sizes, const vecto
         assert( cit->rows == data.cols && cit->cols == data.cols );
         for( int i = bi; i < ei; i++, p++ )
         {
-            Mat r(1, data.cols, CV_32FC1, data.ptr<float>(i));\r
+            Mat r(1, data.cols, CV_32FC1, data.ptr<float>(i));
             r =  r * (*cit) + *mit; 
             if( labelType == CV_32FC1 )
                 labels.at<float>(p, 0) = (float)l;
@@ -132,12 +132,12 @@ bool getLabelsMap( const Mat& labels, const vector<int>& sizes, vector<int>& lab
         ei = bi + *sit;
         if( isFlt )
         {
-            for( int i = bi; i < ei; i++ )\r
+            for( int i = bi; i < ei; i++ )
                 count[(int)labels.at<float>(i, 0)]++;
         }
         else
         {
-            for( int i = bi; i < ei; i++ )\r
+            for( int i = bi; i < ei; i++ )
                 count[labels.at<int>(i, 0)]++;
         }
   
@@ -221,8 +221,8 @@ void CV_KMeansTest::run( int /*start_from*/ )
     // 3. flag==KMEANS_USE_INITIAL_LABELS
     labels.copyTo( bestLabels );
     RNG rng;
-    for( int i = 0; i < 0.5f * pointsCount; i++ )\r
-        bestLabels.at<int>( rng.next() % pointsCount, 0 ) = rng.next() % 3;\r
+    for( int i = 0; i < 0.5f * pointsCount; i++ )
+        bestLabels.at<int>( rng.next() % pointsCount, 0 ) = rng.next() % 3;
     kmeans( data, 3, bestLabels, TermCriteria( TermCriteria::COUNT, iters, 0.0), 0, KMEANS_USE_INITIAL_LABELS, 0 );
     if( calcErr( bestLabels, labels, sizes, false ) > 0.01f )
     {