summaryrefslogtreecommitdiff
path: root/wm/blackbox70/patches/patch-ab
blob: a5ead2ed83776dc579dc4cc98d776aa8a766b689 (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
$NetBSD: patch-ab,v 1.2 2013/04/29 21:27:15 joerg Exp $

Sunpro has problems with a non-const const_reverse_iterator.

--- lib/Menu.cc.orig	2005-01-27 17:08:22.000000000 +0000
+++ lib/Menu.cc
@@ -33,9 +33,9 @@
 #include <X11/Xlib.h>
 #include <X11/keysym.h>
 
-#include <stdio.h>
 #include <assert.h>
-
+#include <stdio.h>
+#include <stdlib.h>
 
 bt::MenuStyle **bt::MenuStyle::styles = 0;
 
@@ -363,7 +363,7 @@ unsigned int bt::Menu::insertItem(const 
   } else {
     index = std::min(static_cast<size_t>(index), _items.size());
     it = _items.begin();
-    std::advance<ItemList::iterator, signed>(it, index);
+    std::advance(it, index);
   }
 
   it = _items.insert(it, item);
@@ -514,7 +514,7 @@ void bt::Menu::removeItem(unsigned int i
 
 void bt::Menu::removeIndex(unsigned int index) {
   ItemList::iterator it = _items.begin();
-  std::advance<ItemList::iterator, signed>(it, index);
+  std::advance(it, index);
   if (it == _items.end())
     return; // item not found
   removeItemByIterator(it);
@@ -1035,7 +1035,7 @@ void bt::Menu::keyPressEvent(const XKeyE
     const ItemList::const_iterator &end = _items.end();
     ItemList::const_iterator anchor = _items.begin();
     if (_active_index != ~0u) {
-      std::advance<ItemList::const_iterator, signed>(anchor, _active_index);
+      std::advance(anchor, _active_index);
 
       // go one paste the current active index
       if (anchor != end && !anchor->separator)
@@ -1052,11 +1052,10 @@ void bt::Menu::keyPressEvent(const XKeyE
   }
 
   case XK_Up: {
-    ItemList::const_reverse_iterator anchor = _items.rbegin();
-    const ItemList::const_reverse_iterator &end = _items.rend();
+    ItemList::reverse_iterator anchor = _items.rbegin();
+    const ItemList::reverse_iterator &end = _items.rend();
     if (_active_index != ~0u) {
-      std::advance<ItemList::const_reverse_iterator, signed>
-        (anchor, _items.size() - _active_index - 1);
+      std::advance(anchor, _items.size() - _active_index - 1);
 
       // go one item past the current active index
       if (anchor != end && !anchor->separator)
@@ -1065,7 +1064,7 @@ void bt::Menu::keyPressEvent(const XKeyE
 
     if (anchor == end) anchor = _items.rbegin();
 
-    ItemList::const_reverse_iterator it =
+    ItemList::reverse_iterator it =
       std::find_if(anchor, end, InteractMatch());
     if (it != end)
       activateIndex(it->indx);
@@ -1073,8 +1072,8 @@ void bt::Menu::keyPressEvent(const XKeyE
   }
 
   case XK_Home: {
-    const ItemList::const_iterator &end = _items.end();
-    ItemList::const_iterator it = _items.begin();
+    const ItemList::iterator &end = _items.end();
+    ItemList::iterator it = _items.begin();
     it = std::find_if(it, end, InteractMatch());
     if (it != end)
       activateIndex(it->indx);
@@ -1082,8 +1081,8 @@ void bt::Menu::keyPressEvent(const XKeyE
   }
 
   case XK_End: {
-    const ItemList::const_reverse_iterator &end = _items.rend();
-    ItemList::const_reverse_iterator it = _items.rbegin();
+    const ItemList::reverse_iterator &end = _items.rend();
+    ItemList::reverse_iterator it = _items.rbegin();
     it = std::find_if(it, end, InteractMatch());
     if (it != end)
       activateIndex(it->indx);