diff options
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); } |