aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/randr
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2016-07-04 00:28:47 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-07-05 13:32:05 +0200
commitf6a1bda2dff0c70aa13f3cb763a9b08c4c037c53 (patch)
tree13abc7de22c00d7ab9080c47df749afbe94d8f85 /nx-X11/programs/Xserver/randr
parentff81a52695821704a3eb33e8de8bb7fe55bccfe1 (diff)
downloadnx-libs-f6a1bda2dff0c70aa13f3cb763a9b08c4c037c53.tar.gz
nx-libs-f6a1bda2dff0c70aa13f3cb763a9b08c4c037c53.tar.bz2
nx-libs-f6a1bda2dff0c70aa13f3cb763a9b08c4c037c53.zip
Remove unneccesary casts from WriteToClient calls
Casting return to (void) was used to tell lint that you intended to ignore the return value, so it didn't warn you about it. Casting the third argument to (char *) was used as the most generic pointer type in the days before compilers supported C89 (void *) (except for a couple places it's used for byte-sized pointer math). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org> Backport to nx-libs: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Diffstat (limited to 'nx-X11/programs/Xserver/randr')
-rw-r--r--nx-X11/programs/Xserver/randr/rrcrtc.c16
-rw-r--r--nx-X11/programs/Xserver/randr/rrdispatch.c2
-rw-r--r--nx-X11/programs/Xserver/randr/rrmode.c2
-rw-r--r--nx-X11/programs/Xserver/randr/rrmonitor.c4
-rw-r--r--nx-X11/programs/Xserver/randr/rroutput.c6
-rw-r--r--nx-X11/programs/Xserver/randr/rrproperty.c10
-rw-r--r--nx-X11/programs/Xserver/randr/rrprovider.c8
-rw-r--r--nx-X11/programs/Xserver/randr/rrproviderproperty.c10
-rw-r--r--nx-X11/programs/Xserver/randr/rrscreen.c16
-rw-r--r--nx-X11/programs/Xserver/randr/rrxinerama.c14
10 files changed, 44 insertions, 44 deletions
diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c b/nx-X11/programs/Xserver/randr/rrcrtc.c
index f1cc8c5e9..9bc504e66 100644
--- a/nx-X11/programs/Xserver/randr/rrcrtc.c
+++ b/nx-X11/programs/Xserver/randr/rrcrtc.c
@@ -1082,9 +1082,9 @@ ProcRRGetCrtcInfo(ClientPtr client)
swaps(&rep.nOutput);
swaps(&rep.nPossibleOutput);
}
- WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRGetCrtcInfoReply), &rep);
if (extraLen) {
- WriteToClient(client, extraLen, (char *) extra);
+ WriteToClient(client, extraLen, extra);
free(extra);
}
@@ -1313,7 +1313,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
swapl(&rep.length);
swapl(&rep.newTimestamp);
}
- WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRSetCrtcConfigReply), &rep);
return Success;
}
@@ -1382,7 +1382,7 @@ ProcRRGetPanning(ClientPtr client)
swaps(&rep.border_right);
swaps(&rep.border_bottom);
}
- WriteToClient(client, sizeof(xRRGetPanningReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRGetPanningReply), &rep);
return Success;
}
@@ -1453,7 +1453,7 @@ ProcRRSetPanning(ClientPtr client)
swapl(&rep.length);
swapl(&rep.newTimestamp);
}
- WriteToClient(client, sizeof(xRRSetPanningReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRSetPanningReply), &rep);
return Success;
}
@@ -1482,7 +1482,7 @@ ProcRRGetCrtcGammaSize(ClientPtr client)
swapl(&reply.length);
swaps(&reply.size);
}
- WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), (char *) &reply);
+ WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), &reply);
return Success;
}
@@ -1521,7 +1521,7 @@ ProcRRGetCrtcGamma(ClientPtr client)
swapl(&reply.length);
swaps(&reply.size);
}
- WriteToClient(client, sizeof(xRRGetCrtcGammaReply), (char *) &reply);
+ WriteToClient(client, sizeof(xRRGetCrtcGammaReply), &reply);
if (crtc->gammaSize) {
memcpy(extra, crtc->gammaRed, len);
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write;
@@ -1688,7 +1688,7 @@ ProcRRGetCrtcTransform(ClientPtr client)
swapl(&reply->length);
}
WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra,
- (char *) reply);
+ reply);
free(reply);
return Success;
}
diff --git a/nx-X11/programs/Xserver/randr/rrdispatch.c b/nx-X11/programs/Xserver/randr/rrdispatch.c
index eae774636..14f74d771 100644
--- a/nx-X11/programs/Xserver/randr/rrdispatch.c
+++ b/nx-X11/programs/Xserver/randr/rrdispatch.c
@@ -67,7 +67,7 @@ ProcRRQueryVersion(ClientPtr client)
#ifndef NXAGENT_SERVER
WriteToClient(client, sizeof(xRRQueryVersionReply), &rep);
#else
- WriteToClient(client, sizeof(xRRQueryVersionReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRQueryVersionReply), &rep);
#endif
return Success;
}
diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c
index c3e60c0bd..db832d8f5 100644
--- a/nx-X11/programs/Xserver/randr/rrmode.c
+++ b/nx-X11/programs/Xserver/randr/rrmode.c
@@ -380,7 +380,7 @@ ProcRRCreateMode(ClientPtr client)
swapl(&rep.length);
swapl(&rep.mode);
}
- WriteToClient(client, sizeof(xRRCreateModeReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRCreateModeReply), &rep);
/* Drop out reference to this mode */
RRModeDestroy(mode);
return Success;
diff --git a/nx-X11/programs/Xserver/randr/rrmonitor.c b/nx-X11/programs/Xserver/randr/rrmonitor.c
index d648625c1..8829caf2f 100644
--- a/nx-X11/programs/Xserver/randr/rrmonitor.c
+++ b/nx-X11/programs/Xserver/randr/rrmonitor.c
@@ -667,7 +667,7 @@ ProcRRGetMonitors(ClientPtr client)
swapl(&rep.nmonitors);
swapl(&rep.noutputs);
}
- WriteToClient(client, sizeof(xRRGetMonitorsReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRGetMonitorsReply), &rep);
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
@@ -696,7 +696,7 @@ ProcRRGetMonitors(ClientPtr client)
swapl(&info.heightInMillimeters);
}
- WriteToClient(client, sizeof(xRRMonitorInfo), (char *) &info);
+ WriteToClient(client, sizeof(xRRMonitorInfo), &info);
WriteSwappedDataToClient(client, monitor->numOutputs * sizeof(RROutput),
monitor->outputs);
}
diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c
index 3a276e34a..07fda36b5 100644
--- a/nx-X11/programs/Xserver/randr/rroutput.c
+++ b/nx-X11/programs/Xserver/randr/rroutput.c
@@ -534,9 +534,9 @@ ProcRRGetOutputInfo(ClientPtr client)
swaps(&rep.nClones);
swaps(&rep.nameLength);
}
- WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRGetOutputInfoReply), &rep);
if (extraLen) {
- WriteToClient(client, extraLen, (char *) extra);
+ WriteToClient(client, extraLen, extra);
free(extra);
}
@@ -662,7 +662,7 @@ ProcRRGetOutputPrimary(ClientPtr client)
swapl(&rep.output);
}
- WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), &rep);
return Success;
}
diff --git a/nx-X11/programs/Xserver/randr/rrproperty.c b/nx-X11/programs/Xserver/randr/rrproperty.c
index b97f85b38..dab9e10cc 100644
--- a/nx-X11/programs/Xserver/randr/rrproperty.c
+++ b/nx-X11/programs/Xserver/randr/rrproperty.c
@@ -428,7 +428,7 @@ ProcRRListOutputProperties(ClientPtr client)
swapl(&rep.length);
swaps(&rep.nAtoms);
}
- WriteToClient(client, sizeof(xRRListOutputPropertiesReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRListOutputPropertiesReply), &rep);
if (numProps) {
/* Copy property name atoms to reply buffer */
@@ -482,7 +482,7 @@ ProcRRQueryOutputProperty(ClientPtr client)
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
- WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), &rep);
if (prop->num_valid) {
memcpy(extra, prop->valid_values, prop->num_valid * sizeof(INT32));
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
@@ -646,7 +646,7 @@ ProcRRGetOutputProperty(ClientPtr client)
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetOutputPropertyReply),
- (char *) &reply);
+ &reply);
return Success;
}
@@ -675,7 +675,7 @@ ProcRRGetOutputProperty(ClientPtr client)
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetOutputPropertyReply),
- (char *) &reply);
+ &reply);
return Success;
}
@@ -728,7 +728,7 @@ ProcRRGetOutputProperty(ClientPtr client)
swapl(&reply.bytesAfter);
swapl(&reply.nItems);
}
- WriteToClient(client, sizeof(xGenericReply), (char *) &reply);
+ WriteToClient(client, sizeof(xGenericReply), &reply);
if (len) {
memcpy(extra, (char *) prop_value->data + ind, len);
switch (reply.format) {
diff --git a/nx-X11/programs/Xserver/randr/rrprovider.c b/nx-X11/programs/Xserver/randr/rrprovider.c
index 9ffb404c5..fe99fa04d 100644
--- a/nx-X11/programs/Xserver/randr/rrprovider.c
+++ b/nx-X11/programs/Xserver/randr/rrprovider.c
@@ -147,10 +147,10 @@ ProcRRGetProviders(ClientPtr client)
swapl(&rep.timestamp);
swaps(&rep.nProviders);
}
- WriteToClient(client, sizeof(xRRGetProvidersReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRGetProvidersReply), &rep);
if (extraLen)
{
- WriteToClient(client, extraLen, (char *) extra);
+ WriteToClient(client, extraLen, extra);
free(extra);
}
return Success;
@@ -289,10 +289,10 @@ ProcRRGetProviderInfo(ClientPtr client)
swaps(&rep.nOutputs);
swaps(&rep.nameLength);
}
- WriteToClient(client, sizeof(xRRGetProviderInfoReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRGetProviderInfoReply), &rep);
if (extraLen)
{
- WriteToClient(client, extraLen, (char *) extra);
+ WriteToClient(client, extraLen, extra);
free(extra);
}
return Success;
diff --git a/nx-X11/programs/Xserver/randr/rrproviderproperty.c b/nx-X11/programs/Xserver/randr/rrproviderproperty.c
index 303719909..9ac4eb09d 100644
--- a/nx-X11/programs/Xserver/randr/rrproviderproperty.c
+++ b/nx-X11/programs/Xserver/randr/rrproviderproperty.c
@@ -432,7 +432,7 @@ ProcRRListProviderProperties(ClientPtr client)
*temppAtoms++ = prop->propertyName;
WriteToClient(client, sizeof(xRRListProviderPropertiesReply),
- (char *) &rep);
+ &rep);
if (numProps) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
@@ -479,7 +479,7 @@ ProcRRQueryProviderProperty(ClientPtr client)
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
- WriteToClient(client, sizeof(xRRQueryProviderPropertyReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRQueryProviderPropertyReply), &rep);
if (prop->num_valid) {
memcpy(extra, prop->valid_values, prop->num_valid * sizeof(INT32));
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
@@ -642,7 +642,7 @@ ProcRRGetProviderProperty(ClientPtr client)
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetProviderPropertyReply),
- (char *) &reply);
+ &reply);
return Success;
}
@@ -671,7 +671,7 @@ ProcRRGetProviderProperty(ClientPtr client)
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetProviderPropertyReply),
- (char *) &reply);
+ &reply);
return Success;
}
@@ -724,7 +724,7 @@ ProcRRGetProviderProperty(ClientPtr client)
swapl(&reply.bytesAfter);
swapl(&reply.nItems);
}
- WriteToClient(client, sizeof(xGenericReply), (char *) &reply);
+ WriteToClient(client, sizeof(xGenericReply), &reply);
if (len) {
memcpy(extra, (char *) prop_value->data + ind, len);
switch (reply.format) {
diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c b/nx-X11/programs/Xserver/randr/rrscreen.c
index 9a6af7f39..9f0476815 100644
--- a/nx-X11/programs/Xserver/randr/rrscreen.c
+++ b/nx-X11/programs/Xserver/randr/rrscreen.c
@@ -251,7 +251,7 @@ ProcRRGetScreenSizeRange(ClientPtr client)
swaps(&rep.maxWidth);
swaps(&rep.maxHeight);
}
- WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), &rep);
return Success;
}
@@ -494,9 +494,9 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
swaps(&rep.nModes);
swaps(&rep.nbytesNames);
}
- WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRGetScreenResourcesReply), &rep);
if (extraLen) {
- WriteToClient(client, extraLen, (char *) extra);
+ WriteToClient(client, extraLen, extra);
free(extra);
}
return Success;
@@ -662,9 +662,9 @@ rrGetScreenResources(ClientPtr client, Bool query)
swaps(&rep.nbytesNames);
}
WriteToClient(client, sizeof(xRRGetScreenResourcesReply),
- (char *) (char *) &rep);
+ (char *) &rep);
if (extraLen) {
- WriteToClient(client, extraLen, (char *) (char *) extra);
+ WriteToClient(client, extraLen, extra);
free(extra);
}
return Success;
@@ -927,9 +927,9 @@ ProcRRGetScreenInfo(ClientPtr client)
swaps(&rep.rate);
swaps(&rep.nrateEnts);
}
- WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRGetScreenInfoReply), &rep);
if (extraLen) {
- WriteToClient(client, extraLen, (char *) extra);
+ WriteToClient(client, extraLen, extra);
free(extra);
}
return Success;
@@ -1169,7 +1169,7 @@ ProcRRSetScreenConfig(ClientPtr client)
swapl(&rep.newConfigTimestamp);
swapl(&rep.root);
}
- WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRSetScreenConfigReply), &rep);
return Success;
}
diff --git a/nx-X11/programs/Xserver/randr/rrxinerama.c b/nx-X11/programs/Xserver/randr/rrxinerama.c
index bd6340296..be1c0abce 100644
--- a/nx-X11/programs/Xserver/randr/rrxinerama.c
+++ b/nx-X11/programs/Xserver/randr/rrxinerama.c
@@ -123,7 +123,7 @@ ProcRRXineramaQueryVersion(ClientPtr client)
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
- WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep);
return Success;
}
@@ -168,7 +168,7 @@ ProcRRXineramaGetState(ClientPtr client)
swapl(&rep.length);
swapl(&rep.window);
}
- WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep);
return Success;
}
@@ -215,7 +215,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
swapl(&rep.length);
swapl(&rep.window);
}
- WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep);
return Success;
}
@@ -259,7 +259,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
swapl(&rep.window);
swapl(&rep.screen);
}
- WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep);
return Success;
}
@@ -281,7 +281,7 @@ ProcRRXineramaIsActive(ClientPtr client)
swapl(&rep.length);
swapl(&rep.state);
}
- WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
+ WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep);
return Success;
}
@@ -295,7 +295,7 @@ RRXineramaWriteMonitor(ClientPtr client, RRMonitorPtr monitor)
scratch.width = monitor->geometry.box.x2 - monitor->geometry.box.x1;
scratch.height = monitor->geometry.box.y2 - monitor->geometry.box.y1;
- WriteToClient(client, sz_XineramaScreenInfo, (char *) &scratch);
+ WriteToClient(client, sz_XineramaScreenInfo, &scratch);
}
int
@@ -326,7 +326,7 @@ ProcRRXineramaQueryScreens(ClientPtr client)
swapl(&rep.length);
swapl(&rep.number);
}
- WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep);
+ WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
for (m = 0; m < nmonitors; m++)
RRXineramaWriteMonitor(client, &monitors[m]);