patches/opencv-01-namespace.diff
author jurikm
Sun, 12 Feb 2012 14:04:10 +0000
changeset 8245 383896da4129
parent 2612 60810d271d9e
permissions -rw-r--r--
SFEsauerbraten.spec: add IPS package name

--- OpenCV-2.1.0.orig/apps/haartraining/haartraining.cpp	2010-04-05 21:24:37.000000000 -0400
+++ OpenCV-2.1.0/apps/haartraining/haartraining.cpp	2010-05-08 19:58:09.745732726 -0400
@@ -49,6 +49,8 @@
 #include <cstring>
 #include <cstdlib>
 
+using namespace std;
+
 #include "cvhaartraining.h"
 
 int main( int argc, char* argv[] )
--- OpenCV-2.1.0.orig/apps/haartraining/createsamples.cpp	2010-04-05 21:24:37.000000000 -0400
+++ OpenCV-2.1.0/apps/haartraining/createsamples.cpp	2010-05-08 19:57:49.338532274 -0400
@@ -50,6 +50,8 @@
 #include <cstdlib>
 #include <cmath>
 
+using namespace std;
+
 #include "cvhaartraining.h"
 
 int main( int argc, char* argv[] )
--- OpenCV-2.1.0.orig/src/cvaux/cvcalonder.cpp	2010-05-08 18:38:19.712059032 -0400
+++ OpenCV-2.1.0/src/cvaux/cvcalonder.cpp	2010-05-08 18:38:31.008683767 -0400
@@ -264,7 +264,7 @@
 		assert(n>0);
 		assert(p>=0 && p<=1);
 		std::vector<float> vec(data, data+n);
-		sort(vec.begin(), vec.end());
+		std::sort(vec.begin(), vec.end());
 		int ix = (int)(p*(n-1));
 		return vec[ix];
 	}
--- OpenCV-2.1.0.orig/src/cv/_cvkdtree.hpp	2010-04-05 21:24:42.000000000 -0400
+++ OpenCV-2.1.0/src/cv/_cvkdtree.hpp	2010-05-08 17:41:49.254954968 -0400
@@ -337,7 +337,7 @@
 
     // add bbf_node for alternate branch in priority queue
     pq.push_back(bbf_node(alt_n, dist));
-    push_heap(pq.begin(), pq.end());
+    std::push_heap(pq.begin(), pq.end());
   }
 
   // called by bbf to walk to leaf;
@@ -374,11 +374,11 @@
     bbf_nn nn(p, distance(d, p));
     if ((int) nn_pq.size() < k) {
       nn_pq.push_back(nn);
-      push_heap(nn_pq.begin(), nn_pq.end());
+      std::push_heap(nn_pq.begin(), nn_pq.end());
     } else if (nn_pq[0].dist > nn.dist) {
-      pop_heap(nn_pq.begin(), nn_pq.end());
+      std::pop_heap(nn_pq.begin(), nn_pq.end());
       nn_pq.end()[-1] = nn;
-      push_heap(nn_pq.begin(), nn_pq.end());
+      std::push_heap(nn_pq.begin(), nn_pq.end());
     }
     assert(nn_pq.size() < 2 || nn_pq[0].dist >= nn_pq[1].dist);
   }
@@ -405,7 +405,7 @@
     while (tmp_pq.size() && emax > 0) {
 
       // from node nearest query point d, run to leaf
-      pop_heap(tmp_pq.begin(), tmp_pq.end());
+      std::pop_heap(tmp_pq.begin(), tmp_pq.end());
       bbf_node bbf(tmp_pq.end()[-1]);
       tmp_pq.erase(tmp_pq.end() - 1);
 
--- OpenCV-2.1.0.orig/tests/cxts/cxts.cpp	2010-04-05 21:24:46.000000000 -0400
+++ OpenCV-2.1.0/tests/cxts/cxts.cpp	2010-05-08 20:05:57.629712690 -0400
@@ -886,8 +886,8 @@
                     break;
             }
 
-			sort(v_cpe.begin(), v_cpe.end());
-			sort(v_time.begin(), v_time.end());
+			std::sort(v_cpe.begin(), v_cpe.end());
+			std::sort(v_time.begin(), v_time.end());
 			
             t_cpu_acc = v_cpe[i/2];
             t_acc = v_time[i/2];
--- OpenCV-2.1.0.orig/tests/cv/src/acameracalibration.cpp	2010-04-05 21:24:45.000000000 -0400
+++ OpenCV-2.1.0/tests/cv/src/acameracalibration.cpp	2010-05-08 20:11:29.151324867 -0400
@@ -1610,9 +1610,9 @@
 	{
 		ni = objectPoints[i].size();
 		((int*)npoints.data)[i] = ni;
-		copy(objectPoints[i].begin(), objectPoints[i].end(), objPtData + j);
-		copy(imagePoints1[i].begin(), imagePoints1[i].end(), imgPtData + j);
-		copy(imagePoints2[i].begin(), imagePoints2[i].end(), imgPtData2 + j);
+		std::copy(objectPoints[i].begin(), objectPoints[i].end(), objPtData + j);
+		std::copy(imagePoints1[i].begin(), imagePoints1[i].end(), imgPtData + j);
+		std::copy(imagePoints2[i].begin(), imagePoints2[i].end(), imgPtData2 + j);
 	}
 	CvMat _objPt = objPt, _imgPt = imgPt, _imgPt2 = imgPt2, _npoints = npoints;
 	CvMat _cameraMatrix1 = cameraMatrix1, _distCoeffs1 = distCoeffs1;
--- OpenCV-2.1.0.orig/tests/cxcore/src/asolvepoly.cpp	2010-04-05 21:24:46.000000000 -0400
+++ OpenCV-2.1.0/tests/cxcore/src/asolvepoly.cpp	2010-05-09 00:01:40.991381047 -0400
@@ -98,8 +98,8 @@
             for (int j = 0; j < n; ++j)
 	            ar[j] = complex_type(u[j * 2], u[j * 2 + 1]);
 
-            sort(r.begin(), r.end(), pred_complex());
-            sort(ar.begin(), ar.end(), pred_complex());
+            std::sort(r.begin(), r.end(), pred_complex());
+            std::sort(ar.begin(), ar.end(), pred_complex());
 
             pass = true;
             if( n == 3 )
@@ -114,7 +114,7 @@
                     nr2 = cv::solveCubic(cv::Mat_<float>(cv::Mat(&amat)), umat2);
                 cvFlip(&amat, &amat, 0);
                 if(nr2 > 0)
-                    sort(ar2.begin(), ar2.begin()+nr2, pred_double());
+                    std::sort(ar2.begin(), ar2.begin()+nr2, pred_double());
                 ar2.resize(nr2);
 
                 int nr1 = 0;