more warning fixes for GCC
authormarina.kolpakova <marina.kolpakova@itseez.com>
Sun, 19 Aug 2012 23:26:53 +0000 (03:26 +0400)
committermarina.kolpakova <marina.kolpakova@itseez.com>
Sun, 19 Aug 2012 23:26:53 +0000 (03:26 +0400)
modules/gpu/src/brute_force_matcher.cpp
modules/gpu/src/hog.cpp
modules/gpu/src/video_decoder.cpp

index d709260..a1fe066 100644 (file)
@@ -420,16 +420,16 @@ void cv::gpu::BFMatcher_GPU::matchConvert(const Mat& trainIdx, const Mat& imgIdx
     const float* distance_ptr =  distance.ptr<float>();\r
     for (int queryIdx = 0; queryIdx < nQuery; ++queryIdx, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)\r
     {\r
-        int trainIdx = *trainIdx_ptr;\r
+        int _trainIdx = *trainIdx_ptr;\r
 \r
-        if (trainIdx == -1)\r
+        if (_trainIdx == -1)\r
             continue;\r
 \r
-        int imgIdx = *imgIdx_ptr;\r
+        int _imgIdx = *imgIdx_ptr;\r
 \r
-        float distance = *distance_ptr;\r
+        float _distance = *distance_ptr;\r
 \r
-        DMatch m(queryIdx, trainIdx, imgIdx, distance);\r
+        DMatch m(queryIdx, _trainIdx, _imgIdx, _distance);\r
 \r
         matches.push_back(m);\r
     }\r
@@ -558,13 +558,13 @@ void cv::gpu::BFMatcher_GPU::knnMatchConvert(const Mat& trainIdx, const Mat& dis
 \r
         for (int i = 0; i < k; ++i, ++trainIdx_ptr, ++distance_ptr)\r
         {\r
-            int trainIdx = *trainIdx_ptr;\r
+            int _trainIdx = *trainIdx_ptr;\r
 \r
-            if (trainIdx != -1)\r
+            if (_trainIdx != -1)\r
             {\r
-                float distance = *distance_ptr;\r
+                float _distance = *distance_ptr;\r
 \r
-                DMatch m(queryIdx, trainIdx, 0, distance);\r
+                DMatch m(queryIdx, _trainIdx, 0, _distance);\r
 \r
                 curMatches.push_back(m);\r
             }\r
@@ -680,15 +680,15 @@ void cv::gpu::BFMatcher_GPU::knnMatch2Convert(const Mat& trainIdx, const Mat& im
 \r
         for (int i = 0; i < 2; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)\r
         {\r
-            int trainIdx = *trainIdx_ptr;\r
+            int _trainIdx = *trainIdx_ptr;\r
 \r
-            if (trainIdx != -1)\r
+            if (_trainIdx != -1)\r
             {\r
-                int imgIdx = *imgIdx_ptr;\r
+                int _imgIdx = *imgIdx_ptr;\r
 \r
-                float distance = *distance_ptr;\r
+                float _distance = *distance_ptr;\r
 \r
-                DMatch m(queryIdx, trainIdx, imgIdx, distance);\r
+                DMatch m(queryIdx, _trainIdx, _imgIdx, _distance);\r
 \r
                 curMatches.push_back(m);\r
             }\r
@@ -868,25 +868,25 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
         const int* trainIdx_ptr = trainIdx.ptr<int>(queryIdx);\r
         const float* distance_ptr = distance.ptr<float>(queryIdx);\r
 \r
-        const int nMatches = std::min(nMatches_ptr[queryIdx], trainIdx.cols);\r
+        const int nMatched = std::min(nMatches_ptr[queryIdx], trainIdx.cols);\r
 \r
-        if (nMatches == 0)\r
+        if (nMatched == 0)\r
         {\r
             if (!compactResult)\r
                 matches.push_back(vector<DMatch>());\r
             continue;\r
         }\r
 \r
-        matches.push_back(vector<DMatch>(nMatches));\r
+        matches.push_back(vector<DMatch>(nMatched));\r
         vector<DMatch>& curMatches = matches.back();\r
 \r
-        for (int i = 0; i < nMatches; ++i, ++trainIdx_ptr, ++distance_ptr)\r
+        for (int i = 0; i < nMatched; ++i, ++trainIdx_ptr, ++distance_ptr)\r
         {\r
-            int trainIdx = *trainIdx_ptr;\r
+            int _trainIdx = *trainIdx_ptr;\r
 \r
-            float distance = *distance_ptr;\r
+            float _distance = *distance_ptr;\r
 \r
-            DMatch m(queryIdx, trainIdx, 0, distance);\r
+            DMatch m(queryIdx, _trainIdx, 0, _distance);\r
 \r
             curMatches[i] = m;\r
         }\r
@@ -1009,9 +1009,9 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
         const int* imgIdx_ptr = imgIdx.ptr<int>(queryIdx);\r
         const float* distance_ptr = distance.ptr<float>(queryIdx);\r
 \r
-        const int nMatches = std::min(nMatches_ptr[queryIdx], trainIdx.cols);\r
+        const int nMatched = std::min(nMatches_ptr[queryIdx], trainIdx.cols);\r
 \r
-        if (nMatches == 0)\r
+        if (nMatched == 0)\r
         {\r
             if (!compactResult)\r
                 matches.push_back(vector<DMatch>());\r
@@ -1020,9 +1020,9 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
 \r
         matches.push_back(vector<DMatch>());\r
         vector<DMatch>& curMatches = matches.back();\r
-        curMatches.reserve(nMatches);\r
+        curMatches.reserve(nMatched);\r
 \r
-        for (int i = 0; i < nMatches; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)\r
+        for (int i = 0; i < nMatched; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)\r
         {\r
             int _trainIdx = *trainIdx_ptr;\r
             int _imgIdx = *imgIdx_ptr;\r
index fafcce7..5db3be9 100644 (file)
@@ -315,7 +315,7 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
   double scale = 1.;\r
   int levels = 0;\r
 \r
-  for (levels = 0; levels < conf_out.size(); levels++)\r
+  for (levels = 0; levels < (int)conf_out.size(); levels++)\r
     {\r
       scale = conf_out[levels].scale;\r
       level_scale.push_back(scale);\r
@@ -332,8 +332,8 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
 \r
   for (size_t i = 0; i < level_scale.size(); i++)\r
     {\r
-      double scale = level_scale[i];\r
-      Size sz(cvRound(img.cols / scale), cvRound(img.rows / scale));\r
+      double _scale = level_scale[i];\r
+      Size sz(cvRound(img.cols / _scale), cvRound(img.rows / _scale));\r
       GpuMat smaller_img;\r
 \r
       if (sz == img.size())\r
index 9f06adc..bee5002 100644 (file)
@@ -49,36 +49,36 @@ void cv::gpu::detail::VideoDecoder::create(const VideoReader_GPU::FormatInfo& vi
 {\r
     release();\r
 \r
-    cudaVideoCodec codec = static_cast<cudaVideoCodec>(videoFormat.codec);\r
-    cudaVideoChromaFormat chromaFormat = static_cast<cudaVideoChromaFormat>(videoFormat.chromaFormat);\r
+    cudaVideoCodec _codec = static_cast<cudaVideoCodec>(videoFormat.codec);\r
+    cudaVideoChromaFormat _chromaFormat = static_cast<cudaVideoChromaFormat>(videoFormat.chromaFormat);\r
 \r
-    cudaVideoCreateFlags videoCreateFlags = (codec == cudaVideoCodec_JPEG || codec == cudaVideoCodec_MPEG2) ?\r
+    cudaVideoCreateFlags videoCreateFlags = (_codec == cudaVideoCodec_JPEG || _codec == cudaVideoCodec_MPEG2) ?\r
                                             cudaVideoCreate_PreferCUDA :\r
                                             cudaVideoCreate_PreferCUVID;\r
 \r
     // Validate video format.  These are the currently supported formats via NVCUVID\r
-    CV_Assert(cudaVideoCodec_MPEG1 == codec ||\r
-              cudaVideoCodec_MPEG2 == codec ||\r
-              cudaVideoCodec_MPEG4 == codec ||\r
-              cudaVideoCodec_VC1   == codec ||\r
-              cudaVideoCodec_H264  == codec ||\r
-              cudaVideoCodec_JPEG  == codec ||\r
-              cudaVideoCodec_YUV420== codec ||\r
-              cudaVideoCodec_YV12  == codec ||\r
-              cudaVideoCodec_NV12  == codec ||\r
-              cudaVideoCodec_YUYV  == codec ||\r
-              cudaVideoCodec_UYVY  == codec );\r
-\r
-    CV_Assert(cudaVideoChromaFormat_Monochrome == chromaFormat ||\r
-              cudaVideoChromaFormat_420        == chromaFormat ||\r
-              cudaVideoChromaFormat_422        == chromaFormat ||\r
-              cudaVideoChromaFormat_444        == chromaFormat);\r
+    CV_Assert(cudaVideoCodec_MPEG1 == _codec ||\r
+              cudaVideoCodec_MPEG2 == _codec ||\r
+              cudaVideoCodec_MPEG4 == _codec ||\r
+              cudaVideoCodec_VC1   == _codec ||\r
+              cudaVideoCodec_H264  == _codec ||\r
+              cudaVideoCodec_JPEG  == _codec ||\r
+              cudaVideoCodec_YUV420== _codec ||\r
+              cudaVideoCodec_YV12  == _codec ||\r
+              cudaVideoCodec_NV12  == _codec ||\r
+              cudaVideoCodec_YUYV  == _codec ||\r
+              cudaVideoCodec_UYVY  == _codec );\r
+\r
+    CV_Assert(cudaVideoChromaFormat_Monochrome == _chromaFormat ||\r
+              cudaVideoChromaFormat_420        == _chromaFormat ||\r
+              cudaVideoChromaFormat_422        == _chromaFormat ||\r
+              cudaVideoChromaFormat_444        == _chromaFormat);\r
 \r
     // Fill the decoder-create-info struct from the given video-format struct.\r
     std::memset(&createInfo_, 0, sizeof(CUVIDDECODECREATEINFO));\r
 \r
     // Create video decoder\r
-    createInfo_.CodecType           = codec;\r
+    createInfo_.CodecType           = _codec;\r
     createInfo_.ulWidth             = videoFormat.width;\r
     createInfo_.ulHeight            = videoFormat.height;\r
     createInfo_.ulNumDecodeSurfaces = FrameQueue::MaximumSize;\r
@@ -87,7 +87,7 @@ void cv::gpu::detail::VideoDecoder::create(const VideoReader_GPU::FormatInfo& vi
     while (createInfo_.ulNumDecodeSurfaces * videoFormat.width * videoFormat.height > 16 * 1024 * 1024)\r
         createInfo_.ulNumDecodeSurfaces--;\r
 \r
-    createInfo_.ChromaFormat    = chromaFormat;\r
+    createInfo_.ChromaFormat    = _chromaFormat;\r
     createInfo_.OutputFormat    = cudaVideoSurfaceFormat_NV12;\r
     createInfo_.DeinterlaceMode = cudaVideoDeinterlaceMode_Adaptive;\r
 \r