aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11/StBytes.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2016-07-29 00:44:38 +0200
committerUlrich Sibiller <uli42@gmx.de>2016-10-10 22:52:29 +0200
commit687d44b6eaa3c64a12af9bbd557b401419b208eb (patch)
tree55c30ba6b0ae6a2618395fae92922ea4402d52f6 /nx-X11/lib/X11/StBytes.c
parentea24f0b0eb7b82ad879810c8e84292d6bf810bea (diff)
downloadnx-libs-687d44b6eaa3c64a12af9bbd557b401419b208eb.tar.gz
nx-libs-687d44b6eaa3c64a12af9bbd557b401419b208eb.tar.bz2
nx-libs-687d44b6eaa3c64a12af9bbd557b401419b208eb.zip
update src files *[ch] to libX11 1.3.4
Diffstat (limited to 'nx-X11/lib/X11/StBytes.c')
-rw-r--r--nx-X11/lib/X11/StBytes.c35
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);
}