summaryrefslogtreecommitdiffstats
path: root/graphics/djview4/qt4.8.patch
blob: 118238cee480c5d3f45ff9bc35b5d35ec6d0ad6c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 7d4802964b9e74506c63f43505b632f6e7b5db3c Mon Sep 17 00:00:00 2001
From: Leon Bottou <leon@bottou.org>
Date: Mon, 2 Apr 2012 07:11:36 -0700
Subject: [PATCH 1/1] removed swap (use qSwap instead).

Fixes Gentoo bug 401517, compilation problems with qt-4.8.
Unclear why is namespace std in scope at this point when using qt-4.8...
---
 src/qdjvuwidget.cpp |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/src/qdjvuwidget.cpp b/src/qdjvuwidget.cpp
index 52ac366..8136d07 100644
--- a/src/qdjvuwidget.cpp
+++ b/src/qdjvuwidget.cpp
@@ -152,15 +152,6 @@ all_numbers(const char *s)
   return true;
 }
 
-template<class T> static inline void 
-swap(T& x, T& y)
-{
-  T tmp;
-  tmp = x;
-  x = y;
-  y = tmp;
-}
-
 template<class T> static inline int
 ksmallest(T *v, int n, int k)
 {
@@ -173,11 +164,11 @@ ksmallest(T *v, int n, int k)
       /* Sort v[lo], v[m], v[hi] by insertion */
       m = (lo+hi)/2;
       if (v[lo]>v[m])
-        swap(v[lo],v[m]);
+        qSwap(v[lo],v[m]);
       if (v[m]>v[hi]) {
-        swap(v[m],v[hi]);
+        qSwap(v[m],v[hi]);
         if (v[lo]>v[m])
-          swap(v[lo],v[m]);
+          qSwap(v[lo],v[m]);
       }
       /* Extract pivot, place sentinel */
       pivot = v[m];
@@ -191,7 +182,7 @@ ksmallest(T *v, int n, int k)
       do ++l; while (v[l]<pivot);
       do --h; while (v[h]>pivot);
       if (l < h) { 
-        swap(v[l],v[h]); 
+        qSwap(v[l],v[h]); 
         goto loop; 
       }
       /* Finish up */
-- 
1.7.4.1