summaryrefslogtreecommitdiff
path: root/src/XlibInt.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-02-15 23:34:40 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-02-16 10:20:53 -0800
commitf0b171c8ea7b055ba520272ea9a2604e18841ac7 (patch)
tree592567b42740d724ee879dd717b8dd3aaab761e3 /src/XlibInt.c
parent6c558ee357292dd9dfc6d9006f4525f625327c52 (diff)
downloadxorg-lib-libX11-f0b171c8ea7b055ba520272ea9a2604e18841ac7.tar.gz
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>
Diffstat (limited to 'src/XlibInt.c')
-rw-r--r--src/XlibInt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/XlibInt.c b/src/XlibInt.c
index 2827c106..e4d35fdc 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -1722,7 +1722,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) {
@@ -1739,7 +1739,7 @@ void Data(
int
_XData32(
Display *dpy,
- register long *data,
+ register _Xconst long *data,
unsigned len)
{
register int *buf;
@@ -1781,7 +1781,7 @@ _XData32(
static doData16(
register Display *dpy,
- short *data,
+ _Xconst short *data,
unsigned len,
char *packbuffer)
{
@@ -1814,7 +1814,7 @@ static doData16(
_XData16 (
Display *dpy,
- short *data,
+ _Xconst short *data,
unsigned len)
{
char packbuffer[PACKBUFFERSIZE];
@@ -1836,7 +1836,7 @@ _XData16 (
static doData32(
register Display *dpy
- long *data,
+ _Xconst long *data,
unsigned len,
char *packbuffer)
{
@@ -1867,7 +1867,7 @@ static doData32(
void _XData32(
Display *dpy,
- long *data,
+ _Xconst long *data,
unsigned len)
{
char packbuffer[PACKBUFFERSIZE];