summaryrefslogtreecommitdiff
path: root/randr
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-05-13 00:03:35 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-09 19:12:56 -0700
commit789d64e19a3b3d98b88bc80f677e0c37bfb5c631 (patch)
tree40f01917cef8f4b645bda7f95aa2c769225d2a4a /randr
parent329db3292223cccd4887062956622285c45a1523 (diff)
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>
Diffstat (limited to 'randr')
-rw-r--r--randr/rrcrtc.c17
-rw-r--r--randr/rrdispatch.c2
-rw-r--r--randr/rrmode.c2
-rw-r--r--randr/rroutput.c4
-rw-r--r--randr/rrproperty.c4
-rw-r--r--randr/rrscreen.c12
-rw-r--r--randr/rrxinerama.c12
7 files changed, 26 insertions, 27 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 1a6e59350..7616e7c6a 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -975,9 +975,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);
}
@@ -1181,7 +1181,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
swapl(&rep.length);
swapl(&rep.newTimestamp);
}
- WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRSetCrtcConfigReply), &rep);
return Success;
}
@@ -1250,7 +1250,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;
}
@@ -1318,7 +1318,7 @@ ProcRRSetPanning(ClientPtr client)
swapl(&rep.length);
swapl(&rep.newTimestamp);
}
- WriteToClient(client, sizeof(xRRSetPanningReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRSetPanningReply), &rep);
return Success;
}
@@ -1345,7 +1345,7 @@ ProcRRGetCrtcGammaSize(ClientPtr client)
swapl(&reply.length);
swaps(&reply.size);
}
- WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), (char *) &reply);
+ WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), &reply);
return Success;
}
@@ -1382,7 +1382,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;
@@ -1548,8 +1548,7 @@ ProcRRGetCrtcTransform(ClientPtr client)
swaps(&reply->sequenceNumber);
swapl(&reply->length);
}
- WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra,
- (char *) reply);
+ WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra, reply);
free(reply);
return Success;
}
diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c
index 1942d74f8..d071787ca 100644
--- a/randr/rrdispatch.c
+++ b/randr/rrdispatch.c
@@ -63,7 +63,7 @@ ProcRRQueryVersion(ClientPtr client)
swapl(&rep.majorVersion);
swapl(&rep.minorVersion);
}
- WriteToClient(client, sizeof(xRRQueryVersionReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRQueryVersionReply), &rep);
return Success;
}
diff --git a/randr/rrmode.c b/randr/rrmode.c
index 49a45c7f6..7e17d7d84 100644
--- a/randr/rrmode.c
+++ b/randr/rrmode.c
@@ -320,7 +320,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/randr/rroutput.c b/randr/rroutput.c
index fbd0e32b3..fd03aab66 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -489,9 +489,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);
}
diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index 75948fccb..e8f057840 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -407,7 +407,7 @@ ProcRRListOutputProperties(ClientPtr client)
for (prop = output->properties; prop; prop = prop->next)
*temppAtoms++ = prop->propertyName;
- WriteToClient(client, sizeof(xRRListOutputPropertiesReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRListOutputPropertiesReply), &rep);
if (numProps) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
@@ -448,7 +448,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;
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 9bf931603..ec07bb167 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -228,7 +228,7 @@ ProcRRGetScreenSizeRange(ClientPtr client)
swaps(&rep.maxWidth);
swaps(&rep.maxHeight);
}
- WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), &rep);
return Success;
}
@@ -450,9 +450,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;
@@ -860,9 +860,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;
@@ -1092,7 +1092,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/randr/rrxinerama.c b/randr/rrxinerama.c
index aa8a61eee..269a63f78 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -103,7 +103,7 @@ ProcRRXineramaQueryVersion(ClientPtr client)
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
- WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep);
return Success;
}
@@ -140,7 +140,7 @@ ProcRRXineramaGetState(ClientPtr client)
swapl(&rep.length);
swapl(&rep.window);
}
- WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep);
return Success;
}
@@ -194,7 +194,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
swapl(&rep.length);
swapl(&rep.window);
}
- WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep);
return Success;
}
@@ -230,7 +230,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
swapl(&rep.window);
swapl(&rep.screen);
}
- WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep);
return Success;
}
@@ -251,7 +251,7 @@ ProcRRXineramaIsActive(ClientPtr client)
swapl(&rep.length);
swapl(&rep.state);
}
- WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
+ WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep);
return Success;
}
@@ -314,7 +314,7 @@ ProcRRXineramaQueryScreens(ClientPtr client)
swapl(&rep.length);
swapl(&rep.number);
}
- WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep);
+ WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
if (rep.number) {
rrScrPriv(pScreen);