diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-10-12 08:32:04 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-10-12 08:32:04 +0200 |
commit | 051d521f6e20761ba6831cecd91883da960fa931 (patch) | |
tree | b28abba7818115d2fed80eb360a79a0f9183948e /nx-X11/lib/X11/StBytes.c | |
parent | 6dce607bad8711dd06a5a7b69ad1930386b4123b (diff) | |
parent | b8de7bf654929c823080b211aeac56cd213f5a32 (diff) | |
download | nx-libs-051d521f6e20761ba6831cecd91883da960fa931.tar.gz nx-libs-051d521f6e20761ba6831cecd91883da960fa931.tar.bz2 nx-libs-051d521f6e20761ba6831cecd91883da960fa931.zip |
Merge branch 'uli42-pr/upgrade_libX11' into 3.6.x
Attributes GH PR #214: https://github.com/ArcticaProject/nx-libs/pull/214
Fixes ArcticaProject/nx-libs#157.
Diffstat (limited to 'nx-X11/lib/X11/StBytes.c')
-rw-r--r-- | nx-X11/lib/X11/StBytes.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/nx-X11/lib/X11/StBytes.c b/nx-X11/lib/X11/StBytes.c index b968d2114..0cbbb25f6 100644 --- a/nx-X11/lib/X11/StBytes.c +++ b/nx-X11/lib/X11/StBytes.c @@ -31,7 +31,7 @@ in this Software without prior written authorization from The Open Group. #include <nx-X11/Xatom.h> /* insulate predefined atom numbers from cut routines */ -static Atom n_to_atom[8] = { +static const Atom n_to_atom[8] = { XA_CUT_BUFFER0, XA_CUT_BUFFER1, XA_CUT_BUFFER2, @@ -42,17 +42,20 @@ static Atom n_to_atom[8] = { XA_CUT_BUFFER7}; int -XRotateBuffers (dpy, rotate) - register Display *dpy; - int rotate; +XRotateBuffers ( + register Display *dpy, + int rotate) { - return XRotateWindowProperties(dpy, RootWindow(dpy, 0), n_to_atom, 8, rotate); + /* XRotateWindowProperties wants a non-const Atom*, but it doesn't + * modify it, so this is safe. + */ + return XRotateWindowProperties(dpy, RootWindow(dpy, 0), (Atom *)n_to_atom, 8, rotate); } - -char *XFetchBuffer (dpy, nbytes, buffer) - register Display *dpy; - int *nbytes; - register int buffer; + +char *XFetchBuffer ( + register Display *dpy, + int *nbytes, + register int buffer) { Atom actual_type; int actual_format; @@ -62,8 +65,8 @@ char *XFetchBuffer (dpy, nbytes, buffer) *nbytes = 0; if ((buffer < 0) || (buffer > 7)) return (NULL); /* XXX should be (sizeof (maxint) - 1)/4 */ - if (XGetWindowProperty(dpy, RootWindow(dpy, 0), n_to_atom[buffer], - 0L, 10000000L, False, XA_STRING, + if (XGetWindowProperty(dpy, RootWindow(dpy, 0), n_to_atom[buffer], + 0L, 10000000L, False, XA_STRING, &actual_type, &actual_format, &nitems, &leftover, &data) != Success) { return (NULL); } @@ -75,9 +78,9 @@ char *XFetchBuffer (dpy, nbytes, buffer) return(NULL); } -char *XFetchBytes (dpy, nbytes) - register Display *dpy; - int *nbytes; +char *XFetchBytes ( + register Display *dpy, + int *nbytes) { return (XFetchBuffer (dpy, nbytes, 0)); } @@ -90,7 +93,7 @@ XStoreBuffer ( register int buffer) { if ((buffer < 0) || (buffer > 7)) return 0; - return XChangeProperty(dpy, RootWindow(dpy, 0), n_to_atom[buffer], + return XChangeProperty(dpy, RootWindow(dpy, 0), n_to_atom[buffer], XA_STRING, 8, PropModeReplace, (unsigned char *) bytes, nbytes); } |