Commit 13f25bfb authored by Javier Pello's avatar Javier Pello Committed by Peter Hutterer

Fix const compiler warnings

When invoking Data, Data16 and Data32 from XChangeDeviceProperty,
we must cast the data pointer to the right type, but we do not need
to cast constness away. This change allows to enable -Wcast-qual on
the build and have it complete without warnings.
Signed-off-by: default avatarJavier Pello <javier.pello@urjc.es>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 38086158
......@@ -74,7 +74,7 @@ XChangeDeviceProperty(Display* dpy, XDevice* dev,
len = ((long)nelements + 3) >> 2;
if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) {
SetReqLen(req, len, len);
Data (dpy, (char *)data, nelements);
Data (dpy, (_Xconst char *)data, nelements);
} /* else force BadLength */
break;
......@@ -83,7 +83,7 @@ XChangeDeviceProperty(Display* dpy, XDevice* dev,
if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) {
SetReqLen(req, len, len);
len = (long)nelements << 1;
Data16 (dpy, (short *) data, len);
Data16 (dpy, (_Xconst short *) data, len);
} /* else force BadLength */
break;
......@@ -92,7 +92,7 @@ XChangeDeviceProperty(Display* dpy, XDevice* dev,
if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) {
SetReqLen(req, len, len);
len = (long)nelements << 2;
Data32 (dpy, (long *) data, len);
Data32 (dpy, (_Xconst long *) data, len);
} /* else force BadLength */
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment