diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-02-15 23:34:40 -0800 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-19 21:40:26 +0200 |
commit | 5e0584c43d3511a5544246a0f82c759ce860a0c2 (patch) | |
tree | 6aa798f5195680080ade0bfd1e3dd6c5d91a8bf8 /nx-X11/lib/X11/XlibInt.c | |
parent | d91c145a46bcece11623121f5e468d24d5031cab (diff) | |
download | nx-libs-5e0584c43d3511a5544246a0f82c759ce860a0c2.tar.gz nx-libs-5e0584c43d3511a5544246a0f82c759ce860a0c2.tar.bz2 nx-libs-5e0584c43d3511a5544246a0f82c759ce860a0c2.zip |
Preserve constness in casting arguments through the Data*() routines
Casts were annoying gcc by dropping constness when changing types,
when routines simply either copy data into the request buffer or
send it directly to the X server, and never modify the input.
Fixes gcc warnings including:
ChProp.c: In function 'XChangeProperty':
ChProp.c:65:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
ChProp.c:65:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
ChProp.c:74:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
ChProp.c:74:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
ChProp.c:83:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
SetHints.c: In function 'XSetStandardProperties':
SetHints.c:262:20: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
SetPntMap.c: In function 'XSetPointerMapping':
SetPntMap.c:46:5: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
SetPntMap.c:46:5: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
StBytes.c: In function 'XStoreBuffer':
StBytes.c:97:33: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
StName.c: In function 'XStoreName':
StName.c:40:27: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
StName.c: In function 'XSetIconName':
StName.c:51:27: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib/X11/XlibInt.c')
-rw-r--r-- | nx-X11/lib/X11/XlibInt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nx-X11/lib/X11/XlibInt.c b/nx-X11/lib/X11/XlibInt.c index 8dc07ad1b..2d84c626d 100644 --- a/nx-X11/lib/X11/XlibInt.c +++ b/nx-X11/lib/X11/XlibInt.c @@ -3852,7 +3852,7 @@ void _Xbcopy(b1, b2, length) #ifdef DataRoutineIsProcedure void Data( Display *dpy, - char *data, + _Xconst char *data, long len) { if (dpy->bufptr + (len) <= dpy->bufmax) { @@ -3869,7 +3869,7 @@ void Data( int _XData32( Display *dpy, - register long *data, + register _Xconst long *data, unsigned len) { register int *buf; |