diff options
-rw-r--r-- | x11-wm/blackbox/files/patch-lib_Display.cc | 36 | ||||
-rw-r--r-- | x11-wm/blackbox/files/patch-lib_Menu.cc | 71 | ||||
-rw-r--r-- | x11-wm/blackbox/files/patch-lib_Texture.cc | 19 | ||||
-rw-r--r-- | x11-wm/blackbox/files/patch-src_Window.cc | 74 | ||||
-rw-r--r-- | x11-wm/blackbox/files/patch-src_blackbox.cc | 28 | ||||
-rw-r--r-- | x11-wm/blackbox/files/patch-src_main.cc | 45 | ||||
-rw-r--r-- | x11-wm/blackbox/files/patch-util_bsetroot.cc | 42 |
7 files changed, 315 insertions, 0 deletions
diff --git a/x11-wm/blackbox/files/patch-lib_Display.cc b/x11-wm/blackbox/files/patch-lib_Display.cc new file mode 100644 index 000000000000..1fc8032f1aa4 --- /dev/null +++ b/x11-wm/blackbox/files/patch-lib_Display.cc @@ -0,0 +1,36 @@ +--- lib/Display.cc.orig 2005-01-03 10:42:38.000000000 +0100 ++++ lib/Display.cc 2013-08-31 15:42:48.395906537 +0200 +@@ -25,6 +25,7 @@ + #include "Display.hh" + + #include <algorithm> ++#include <cstdlib> + + #include <X11/Xutil.h> + +@@ -32,7 +33,6 @@ + #include <fcntl.h> + #include <stdio.h> + +- + namespace bt { + + void createBitmapLoader(const Display &display); +@@ -68,7 +68,7 @@ + if (!(xdisplay = XOpenDisplay(dpy_name))) { + fprintf(stderr, "bt::Display: failed to open display '%s'\n", + dpy_name ? dpy_name : ""); +- ::exit(2); ++ std::exit(2); + } + + #ifdef DEBUG +@@ -77,7 +77,7 @@ + + if (fcntl(XConnectionNumber(xdisplay), F_SETFD, 1) == -1) { + fprintf(stderr, "bt::Display: failed to mark connection close-on-exec\n"); +- ::exit(2); ++ std::exit(2); + } + + if (!multi_head || ScreenCount(xdisplay) == 1) { diff --git a/x11-wm/blackbox/files/patch-lib_Menu.cc b/x11-wm/blackbox/files/patch-lib_Menu.cc new file mode 100644 index 000000000000..b9a833e70064 --- /dev/null +++ b/x11-wm/blackbox/files/patch-lib_Menu.cc @@ -0,0 +1,71 @@ +--- lib/Menu.cc.orig 2013-08-31 15:45:50.982895002 +0200 ++++ lib/Menu.cc 2013-08-31 15:53:36.911861215 +0200 +@@ -30,6 +30,8 @@ + #include "PixmapCache.hh" + #include "Resource.hh" + ++#include <cstdlib> ++ + #include <X11/Xlib.h> + #include <X11/keysym.h> + +@@ -135,11 +137,11 @@ + + str = resource.read("menu.title.marginWidth", "Menu.Title.MarginWidth", "1"); + title_margin = +- static_cast<unsigned int>(std::max(strtol(str.c_str(), 0, 0), 0l)); ++ static_cast<unsigned int>(std::max(std::strtol(str.c_str(), 0, 0), 0l)); + + str = resource.read("menu.frame.marginWidth", "Menu.Frame.MarginWidth", "1"); + frame_margin = +- static_cast<unsigned int>(std::max(strtol(str.c_str(), 0, 0), 0l)); ++ static_cast<unsigned int>(std::max(std::strtol(str.c_str(), 0, 0), 0l)); + } + + +@@ -363,7 +365,7 @@ + } 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 +516,7 @@ + + 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 +1037,7 @@ + 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) +@@ -1055,8 +1057,7 @@ + ItemList::const_reverse_iterator anchor = _items.rbegin(); + const ItemList::const_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) +@@ -1174,7 +1175,7 @@ + } + + fprintf(stderr, "Error: bt::Menu::verifyId: id %u already used\n", id); +- abort(); ++ std::abort(); + } + + std::vector<bool>::iterator it = diff --git a/x11-wm/blackbox/files/patch-lib_Texture.cc b/x11-wm/blackbox/files/patch-lib_Texture.cc new file mode 100644 index 000000000000..68be348af457 --- /dev/null +++ b/x11-wm/blackbox/files/patch-lib_Texture.cc @@ -0,0 +1,19 @@ +--- lib/Texture.cc.orig 2013-08-31 15:55:19.995853042 +0200 ++++ lib/Texture.cc 2013-08-31 15:55:47.288909835 +0200 +@@ -28,6 +28,7 @@ + #include "Resource.hh" + + #include <algorithm> ++#include <cstdlib> + + #include <X11/Xlib.h> + #include <ctype.h> +@@ -184,7 +185,7 @@ + + const std::string bstr = + resource.read(name + ".borderWidth", className + ".BorderWidth", "1"); +- unsigned int bw = static_cast<unsigned int>(strtoul(bstr.c_str(), 0, 0)); ++ unsigned int bw = static_cast<unsigned int>(std::strtoul(bstr.c_str(), 0, 0)); + texture.setBorderWidth(bw); + } + diff --git a/x11-wm/blackbox/files/patch-src_Window.cc b/x11-wm/blackbox/files/patch-src_Window.cc new file mode 100644 index 000000000000..8e308077df30 --- /dev/null +++ b/x11-wm/blackbox/files/patch-src_Window.cc @@ -0,0 +1,74 @@ +--- src/Window.cc.orig 2013-08-31 15:58:41.720845042 +0200 ++++ src/Window.cc 2013-08-31 16:00:13.671837757 +0200 +@@ -33,6 +33,8 @@ + #include "Workspace.hh" + #include "blackbox.hh" + ++#include <cstdlib> ++ + #include <Pen.hh> + #include <PixmapCache.hh> + #include <Unicode.hh> +@@ -3699,14 +3701,14 @@ + wtop = y, + wbottom = y + height - 1, + // left, right, top + bottom are for rect, douterleft = left border of rect +- dinnerleft = abs(wleft - rect.left()), +- dinnerright = abs(wright - rect.right()), +- dinnertop = abs(wtop - rect.top()), +- dinnerbottom = abs(wbottom - rect.bottom()), +- douterleft = abs(wright - rect.left()), +- douterright = abs(wleft - rect.right()), +- doutertop = abs(wbottom - rect.top()), +- douterbottom = abs(wtop - rect.bottom()); ++ dinnerleft = std::abs(wleft - rect.left()), ++ dinnerright = std::abs(wright - rect.right()), ++ dinnertop = std::abs(wtop - rect.top()), ++ dinnerbottom = std::abs(wbottom - rect.bottom()), ++ douterleft = std::abs(wright - rect.left()), ++ douterright = std::abs(wleft - rect.right()), ++ doutertop = std::abs(wbottom - rect.top()), ++ douterbottom = std::abs(wtop - rect.bottom()); + + if ((wtop <= rect.bottom() && wbottom >= rect.top()) + || doutertop <= snap_distance +@@ -3749,8 +3751,8 @@ + const int cwy = y + height / 2; + const int crx = rect.x() + rect.width() / 2; + const int cry = rect.y() + rect.height() / 2; +- const int cdx = abs(cwx - crx); +- const int cdy = abs(cwy - cry); ++ const int cdx = std::abs(cwx - crx); ++ const int cdy = std::abs(cwy - cry); + if (cdx <= snap_distance) + // snap to horizontal center + *dx = x - (rect.x() + ((rect.width() - width) / 2)); +@@ -3773,13 +3775,13 @@ + if (edge_distance) { + collisionAdjust(&dx, &dy, *x, *y, frame.rect.width(), frame.rect.height(), + _screen->availableArea(), edge_distance, true); +- nx = (dx != init_dx && abs(dx) < abs(nx)) ? dx : nx; dx = init_dx; +- ny = (dy != init_dy && abs(dy) < abs(ny)) ? dy : ny; dy = init_dy; ++ nx = (dx != init_dx && std::abs(dx) < std::abs(nx)) ? dx : nx; dx = init_dx; ++ ny = (dy != init_dy && std::abs(dy) < std::abs(ny)) ? dy : ny; dy = init_dy; + if (!blackbox->resource().fullMaximization()) { + collisionAdjust(&dx, &dy, *x, *y, frame.rect.width(), frame.rect.height(), + _screen->screenInfo().rect(), edge_distance); +- nx = (dx != init_dx && abs(dx) < abs(nx)) ? dx : nx; dx = init_dx; +- ny = (dy != init_dy && abs(dy) < abs(ny)) ? dy : ny; dy = init_dy; ++ nx = (dx != init_dx && std::abs(dx) < std::abs(nx)) ? dx : nx; dx = init_dx; ++ ny = (dy != init_dy && std::abs(dy) < std::abs(ny)) ? dy : ny; dy = init_dy; + } + } + if (win_distance) { +@@ -3791,8 +3793,8 @@ + win->workspace() == _screen->currentWorkspace()) { + collisionAdjust(&dx, &dy, *x, *y, frame.rect.width(), + frame.rect.height(), win->frame.rect, win_distance); +- nx = (dx != init_dx && abs(dx) < abs(nx)) ? dx : nx; dx = init_dx; +- ny = (dy != init_dy && abs(dy) < abs(ny)) ? dy : ny; dy = init_dy; ++ nx = (dx != init_dx && std::abs(dx) < std::abs(nx)) ? dx : nx; dx = init_dx; ++ ny = (dy != init_dy && std::abs(dy) < std::abs(ny)) ? dy : ny; dy = init_dy; + } + } + } diff --git a/x11-wm/blackbox/files/patch-src_blackbox.cc b/x11-wm/blackbox/files/patch-src_blackbox.cc new file mode 100644 index 000000000000..866a1d8cf4eb --- /dev/null +++ b/x11-wm/blackbox/files/patch-src_blackbox.cc @@ -0,0 +1,28 @@ +--- src/blackbox.cc.orig 2013-08-31 16:03:04.354825567 +0200 ++++ src/blackbox.cc 2013-08-31 16:12:46.759944855 +0200 +@@ -27,6 +27,8 @@ + #include "Slit.hh" + #include "Window.hh" + ++#include <cstdlib> ++ + #include <Pen.hh> + #include <PixmapCache.hh> + #include <Util.hh> +@@ -36,6 +38,7 @@ + #include <sys/stat.h> + #include <assert.h> + #include <signal.h> ++#include <stdlib.h> + #include <unistd.h> + + // #define FOCUS_DEBUG +@@ -422,7 +425,7 @@ + if (managed == 0) { + fprintf(stderr, "%s: no managable screens found, exiting...\n", + applicationName().c_str()); +- ::exit(3); ++ std::exit(3); + } + + screen_list_count = managed; diff --git a/x11-wm/blackbox/files/patch-src_main.cc b/x11-wm/blackbox/files/patch-src_main.cc new file mode 100644 index 000000000000..e00f37bfc8e0 --- /dev/null +++ b/x11-wm/blackbox/files/patch-src_main.cc @@ -0,0 +1,45 @@ +--- src/main.cc.orig 2013-08-31 16:15:04.709773262 +0200 ++++ src/main.cc 2013-08-31 16:15:45.604774045 +0200 +@@ -24,6 +24,8 @@ + + // #define PRINT_SIZES + ++#include <cstdlib> ++ + #if defined(PRINT_SIZES) + # include "Screen.hh" + # include "Slit.hh" +@@ -69,7 +71,7 @@ + #endif // SHAPE + ); + +- ::exit(exitval); ++ std::exit(exitval); + } + + int main(int argc, char **argv) { +@@ -87,13 +89,13 @@ + "Copyright (c) 1997 - 2000, 2002 - 2005 Bradley T Hughes\n", + __blackbox_version); + +- ::exit(0); ++ std::exit(0); + } else if (! strcmp(argv[i], "-rc")) { + // look for alternative rc file to use + + if ((++i) >= argc) { + fprintf(stderr, "error: '-rc' requires and argument\n"); +- ::exit(1); ++ std::exit(1); + } + + rc_file = argv[i]; +@@ -103,7 +105,7 @@ + + if ((++i) >= argc) { + fprintf(stderr, "error: '-display' requires an argument\n"); +- ::exit(1); ++ std::exit(1); + } + + dpy_name = argv[i]; diff --git a/x11-wm/blackbox/files/patch-util_bsetroot.cc b/x11-wm/blackbox/files/patch-util_bsetroot.cc new file mode 100644 index 000000000000..fc10d491203c --- /dev/null +++ b/x11-wm/blackbox/files/patch-util_bsetroot.cc @@ -0,0 +1,42 @@ +--- util/bsetroot.cc.orig 2013-08-31 16:18:50.697762748 +0200 ++++ util/bsetroot.cc 2013-08-31 16:19:53.695753444 +0200 +@@ -28,6 +28,7 @@ + #include <Texture.hh> + + #include <cctype> ++#include <cstdlib> + + #include <X11/Xatom.h> + #include <stdio.h> +@@ -68,11 +69,11 @@ + } else if (! strcmp("-mod", argv[i])) { + if ((++i) >= argc) usage(); + +- mod_x = atoi(argv[i]); ++ mod_x = std::atoi(argv[i]); + + if ((++i) >= argc) usage(); + +- mod_y = atoi(argv[i]); ++ mod_y = std::atoi(argv[i]); + + if (mod_x < 1) mod_x = 1; + if (mod_y < 1) mod_y = 1; +@@ -336,7 +337,7 @@ + " -to <color> gradient end color\n\n" + " -solid <color> solid color\n\n" + " -help print this help text and exit\n"); +- exit(exit_code); ++ std::exit(exit_code); + } + + int main(int argc, char **argv) { +@@ -350,7 +351,7 @@ + if ((++i) >= argc) { + fprintf(stderr, "error: '-display' requires an argument\n"); + +- ::exit(1); ++ std::exit(1); + } + + display_name = argv[i]; |