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>
This commit is contained in:
Alan Coopersmith 2012-05-13 00:03:35 -07:00
commit 789d64e19a
90 changed files with 464 additions and 505 deletions

View file

@ -64,7 +64,7 @@ ProcBigReqDispatch(ClientPtr client)
swaps(&rep.sequenceNumber);
swapl(&rep.max_request_size);
}
WriteToClient(client, sizeof(xBigReqEnableReply), (char *) &rep);
WriteToClient(client, sizeof(xBigReqEnableReply), &rep);
return Success;
}

View file

@ -59,7 +59,7 @@ ProcDPMSGetVersion(ClientPtr client)
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *) &rep);
WriteToClient(client, sizeof(xDPMSGetVersionReply), &rep);
return Success;
}
@ -79,7 +79,7 @@ ProcDPMSCapable(ClientPtr client)
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(xDPMSCapableReply), (char *) &rep);
WriteToClient(client, sizeof(xDPMSCapableReply), &rep);
return Success;
}
@ -104,7 +104,7 @@ ProcDPMSGetTimeouts(ClientPtr client)
swaps(&rep.suspend);
swaps(&rep.off);
}
WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *) &rep);
WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), &rep);
return Success;
}
@ -202,7 +202,7 @@ ProcDPMSInfo(ClientPtr client)
swaps(&rep.sequenceNumber);
swaps(&rep.power_level);
}
WriteToClient(client, sizeof(xDPMSInfoReply), (char *) &rep);
WriteToClient(client, sizeof(xDPMSInfoReply), &rep);
return Success;
}

View file

@ -85,7 +85,7 @@ ProcGEQueryVersion(ClientPtr client)
swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof(xGEQueryVersionReply), (char *) &rep);
WriteToClient(client, sizeof(xGEQueryVersionReply), &rep);
return Success;
}

View file

@ -918,7 +918,7 @@ ProcPanoramiXQueryVersion(ClientPtr client)
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep);
WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep);
return Success;
}
@ -945,7 +945,7 @@ ProcPanoramiXGetState(ClientPtr client)
swapl(&rep.length);
swapl(&rep.window);
}
WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep);
WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep);
return Success;
}
@ -973,7 +973,7 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
swapl(&rep.length);
swapl(&rep.window);
}
WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep);
WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep);
return Success;
}
@ -1009,7 +1009,7 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
swapl(&rep.window);
swapl(&rep.screen);
}
WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep);
WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep);
return Success;
}
@ -1038,7 +1038,7 @@ ProcXineramaIsActive(ClientPtr client)
swapl(&rep.length);
swapl(&rep.state);
}
WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep);
return Success;
}
@ -1059,7 +1059,7 @@ ProcXineramaQueryScreens(ClientPtr client)
swapl(&rep.length);
swapl(&rep.number);
}
WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep);
WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
if (!noPanoramiXExtension) {
xXineramaScreenInfo scratch;
@ -1077,7 +1077,7 @@ ProcXineramaQueryScreens(ClientPtr client)
swaps(&scratch.width);
swaps(&scratch.height);
}
WriteToClient(client, sz_XineramaScreenInfo, (char *) &scratch);
WriteToClient(client, sz_XineramaScreenInfo, &scratch);
}
}

View file

@ -2003,7 +2003,7 @@ PanoramiXGetImage(ClientPtr client)
format, planemask, pBuf, widthBytesLine,
isRoot);
(void) WriteToClient(client, (int) (nlines * widthBytesLine), pBuf);
WriteToClient(client, (int) (nlines * widthBytesLine), pBuf);
linesDone += nlines;
}
}
@ -2020,8 +2020,7 @@ PanoramiXGetImage(ClientPtr client)
nlines, format, plane, pBuf,
widthBytesLine, isRoot);
(void) WriteToClient(client,
(int) (nlines * widthBytesLine), pBuf);
WriteToClient(client, (int)(nlines * widthBytesLine), pBuf);
linesDone += nlines;
}

View file

@ -646,7 +646,7 @@ ProcScreenSaverQueryVersion(ClientPtr client)
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), (char *) &rep);
WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep);
return Success;
}
@ -717,7 +717,7 @@ ProcScreenSaverQueryInfo(ClientPtr client)
swapl(&rep.idle);
swapl(&rep.eventMask);
}
WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), (char *) &rep);
WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), &rep);
return Success;
}

View file

@ -351,8 +351,7 @@ ProcSecurityQueryVersion(ClientPtr client)
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
(void) WriteToClient(client, SIZEOF(xSecurityQueryVersionReply),
(char *) &rep);
WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), &rep);
return Success;
} /* ProcSecurityQueryVersion */
@ -541,8 +540,7 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
swaps(&rep.dataLength);
}
WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply),
(char *) &rep);
WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply), &rep);
WriteToClient(client, authdata_len, pAuthdata);
SecurityAudit

View file

@ -219,7 +219,7 @@ ProcShapeQueryVersion(ClientPtr client)
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof(xShapeQueryVersionReply), (char *) &rep);
WriteToClient(client, sizeof(xShapeQueryVersionReply), &rep);
return Success;
}
@ -679,7 +679,7 @@ ProcShapeQueryExtents(ClientPtr client)
swaps(&rep.widthClipShape);
swaps(&rep.heightClipShape);
}
WriteToClient(client, sizeof(xShapeQueryExtentsReply), (char *) &rep);
WriteToClient(client, sizeof(xShapeQueryExtentsReply), &rep);
return Success;
}
@ -928,7 +928,7 @@ ProcShapeInputSelected(ClientPtr client)
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(xShapeInputSelectedReply), (char *) &rep);
WriteToClient(client, sizeof(xShapeInputSelectedReply), &rep);
return Success;
}
@ -1012,8 +1012,8 @@ ProcShapeGetRectangles(ClientPtr client)
swapl(&rep.nrects);
SwapShorts((short *) rects, (unsigned long) nrects * 4);
}
WriteToClient(client, sizeof(rep), (char *) &rep);
WriteToClient(client, nrects * sizeof(xRectangle), (char *) rects);
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, nrects * sizeof(xRectangle), rects);
free(rects);
return Success;
}

View file

@ -306,7 +306,7 @@ ProcShmQueryVersion(ClientPtr client)
swaps(&rep.uid);
swaps(&rep.gid);
}
WriteToClient(client, sizeof(xShmQueryVersionReply), (char *) &rep);
WriteToClient(client, sizeof(xShmQueryVersionReply), &rep);
return Success;
}
@ -702,7 +702,7 @@ ProcShmGetImage(ClientPtr client)
swapl(&xgi.visual);
swapl(&xgi.size);
}
WriteToClient(client, sizeof(xShmGetImageReply), (char *) &xgi);
WriteToClient(client, sizeof(xShmGetImageReply), &xgi);
return Success;
}
@ -877,7 +877,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
swapl(&xgi.visual);
swapl(&xgi.size);
}
WriteToClient(client, sizeof(xShmGetImageReply), (char *) &xgi);
WriteToClient(client, sizeof(xShmGetImageReply), &xgi);
return Success;
}

View file

@ -1198,7 +1198,7 @@ ProcSyncInitialize(ClientPtr client)
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(rep), (char *) &rep);
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -1263,9 +1263,9 @@ ProcSyncListSystemCounters(ClientPtr client)
namelen));
}
WriteToClient(client, sizeof(rep), (char *) &rep);
WriteToClient(client, sizeof(rep), &rep);
if (len) {
WriteToClient(client, len, (char *) list);
WriteToClient(client, len, list);
free(list);
}
@ -1338,7 +1338,7 @@ ProcSyncGetPriority(ClientPtr client)
swapl(&rep.priority);
}
WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep);
WriteToClient(client, sizeof(xSyncGetPriorityReply), &rep);
return Success;
}
@ -1624,7 +1624,7 @@ ProcSyncQueryCounter(ClientPtr client)
swapl(&rep.value_hi);
swapl(&rep.value_lo);
}
WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep);
WriteToClient(client, sizeof(xSyncQueryCounterReply), &rep);
return Success;
}
@ -1809,7 +1809,7 @@ ProcSyncQueryAlarm(ClientPtr client)
swapl(&rep.delta_lo);
}
WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep);
WriteToClient(client, sizeof(xSyncQueryAlarmReply), &rep);
return Success;
}
@ -1966,7 +1966,7 @@ ProcSyncQueryFence(ClientPtr client)
swapl(&rep.length);
}
WriteToClient(client, sizeof(xSyncQueryFenceReply), (char *) &rep);
WriteToClient(client, sizeof(xSyncQueryFenceReply), &rep);
return client->noClientException;
}

View file

@ -58,7 +58,7 @@ ProcXCMiscGetVersion(ClientPtr client)
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *) &rep);
WriteToClient(client, sizeof(xXCMiscGetVersionReply), &rep);
return Success;
}
@ -80,7 +80,7 @@ ProcXCMiscGetXIDRange(ClientPtr client)
swapl(&rep.start_id);
swapl(&rep.count);
}
WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *) &rep);
WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), &rep);
return Success;
}
@ -111,7 +111,7 @@ ProcXCMiscGetXIDList(ClientPtr client)
swapl(&rep.length);
swapl(&rep.count);
}
WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *) &rep);
WriteToClient(client, sizeof(xXCMiscGetXIDListReply), &rep);
if (count) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, count * sizeof(XID), pids);

View file

@ -307,8 +307,7 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
swapl(&reply.gid);
swapl(&reply.signature);
}
WriteToClient(client,
sizeof(xXF86BigfontQueryVersionReply), (char *) &reply);
WriteToClient(client, sizeof(xXF86BigfontQueryVersionReply), &reply);
return Success;
}
@ -644,7 +643,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
}
}
}
WriteToClient(client, rlength, (char *) reply);
WriteToClient(client, rlength, reply);
free(reply);
if (nCharInfos > 0) {
if (shmid == -1)

View file

@ -209,7 +209,7 @@ ProcXResQueryVersion(ClientPtr client)
swaps(&rep.server_major);
swaps(&rep.server_minor);
}
WriteToClient(client, sizeof(xXResQueryVersionReply), (char *) &rep);
WriteToClient(client, sizeof(xXResQueryVersionReply), &rep);
return Success;
}
@ -242,7 +242,7 @@ ProcXResQueryClients(ClientPtr client)
swapl(&rep.length);
swapl(&rep.num_clients);
}
WriteToClient(client, sizeof(xXResQueryClientsReply), (char *) &rep);
WriteToClient(client, sizeof(xXResQueryClientsReply), &rep);
if (num_clients) {
xXResClient scratch;
@ -255,7 +255,7 @@ ProcXResQueryClients(ClientPtr client)
swapl(&scratch.resource_base);
swapl(&scratch.resource_mask);
}
WriteToClient(client, sz_xXResClient, (char *) &scratch);
WriteToClient(client, sz_xXResClient, &scratch);
}
}
@ -310,8 +310,7 @@ ProcXResQueryClientResources(ClientPtr client)
swapl(&rep.num_types);
}
WriteToClient(client, sizeof(xXResQueryClientResourcesReply),
(char *) &rep);
WriteToClient(client, sizeof(xXResQueryClientResourcesReply), &rep);
if (num_types) {
xXResType scratch;
@ -337,7 +336,7 @@ ProcXResQueryClientResources(ClientPtr client)
swapl(&scratch.resource_type);
swapl(&scratch.count);
}
WriteToClient(client, sz_xXResType, (char *) &scratch);
WriteToClient(client, sz_xXResType, &scratch);
}
}
@ -486,8 +485,7 @@ ProcXResQueryClientPixmapBytes(ClientPtr client)
swapl(&rep.bytes);
swapl(&rep.bytes_overflow);
}
WriteToClient(client, sizeof(xXResQueryClientPixmapBytesReply),
(char *) &rep);
WriteToClient(client, sizeof(xXResQueryClientPixmapBytesReply), &rep);
return Success;
}
@ -679,7 +677,7 @@ ProcXResQueryClientIds (ClientPtr client)
swapl (&rep.numIds);
}
WriteToClient(client,sizeof(rep),(char*)&rep);
WriteToClient(client, sizeof(rep), &rep);
WriteFragmentsToClient(client, &ctx.response);
}
@ -1061,7 +1059,7 @@ ProcXResQueryResourceBytes (ClientPtr client)
SwapXResQueryResourceBytes(&ctx.response);
}
WriteToClient(client,sizeof(rep),(char*)&rep);
WriteToClient(client, sizeof(rep), &rep);
WriteFragmentsToClient(client, &ctx.response);
}

View file

@ -76,7 +76,7 @@ ProcSELinuxQueryVersion(ClientPtr client)
swaps(&rep.server_major);
swaps(&rep.server_minor);
}
WriteToClient(client, sizeof(rep), (char *) &rep);
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -104,7 +104,7 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
swapl(&rep.context_len);
}
WriteToClient(client, sizeof(SELinuxGetContextReply), (char *) &rep);
WriteToClient(client, sizeof(SELinuxGetContextReply), &rep);
WriteToClient(client, len, ctx);
freecon(ctx);
return Success;
@ -383,8 +383,8 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
swapl(&rep.count);
}
WriteToClient(client, sizeof(SELinuxListItemsReply), (char *) &rep);
WriteToClient(client, size * 4, (char *) buf);
WriteToClient(client, sizeof(SELinuxListItemsReply), &rep);
WriteToClient(client, size * 4, buf);
/* Free stuff and return */
rc = Success;

View file

@ -100,7 +100,7 @@ ProcXTestGetVersion(ClientPtr client)
swaps(&rep.sequenceNumber);
swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof(xXTestGetVersionReply), (char *) &rep);
WriteToClient(client, sizeof(xXTestGetVersionReply), &rep);
return Success;
}
@ -141,7 +141,7 @@ ProcXTestCompareCursor(ClientPtr client)
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *) &rep);
WriteToClient(client, sizeof(xXTestCompareCursorReply), &rep);
return Success;
}

View file

@ -62,7 +62,7 @@ SWriteQueryExtensionReply(ClientPtr client, xvQueryExtensionReply * rep)
swaps(&rep->version);
swaps(&rep->revision);
(void) WriteToClient(client, sz_xvQueryExtensionReply, (char *) rep);
WriteToClient(client, sz_xvQueryExtensionReply, rep);
return Success;
}
@ -74,7 +74,7 @@ SWriteQueryAdaptorsReply(ClientPtr client, xvQueryAdaptorsReply * rep)
swapl(&rep->length);
swaps(&rep->num_adaptors);
(void) WriteToClient(client, sz_xvQueryAdaptorsReply, (char *) rep);
WriteToClient(client, sz_xvQueryAdaptorsReply, rep);
return Success;
}
@ -86,7 +86,7 @@ SWriteQueryEncodingsReply(ClientPtr client, xvQueryEncodingsReply * rep)
swapl(&rep->length);
swaps(&rep->num_encodings);
(void) WriteToClient(client, sz_xvQueryEncodingsReply, (char *) rep);
WriteToClient(client, sz_xvQueryEncodingsReply, rep);
return Success;
}
@ -99,7 +99,7 @@ SWriteAdaptorInfo(ClientPtr client, xvAdaptorInfo * pAdaptor)
swaps(&pAdaptor->num_ports);
swaps(&pAdaptor->num_formats);
(void) WriteToClient(client, sz_xvAdaptorInfo, (char *) pAdaptor);
WriteToClient(client, sz_xvAdaptorInfo, pAdaptor);
return Success;
}
@ -114,7 +114,7 @@ SWriteEncodingInfo(ClientPtr client, xvEncodingInfo * pEncoding)
swaps(&pEncoding->height);
swapl(&pEncoding->rate.numerator);
swapl(&pEncoding->rate.denominator);
(void) WriteToClient(client, sz_xvEncodingInfo, (char *) pEncoding);
WriteToClient(client, sz_xvEncodingInfo, pEncoding);
return Success;
}
@ -123,7 +123,7 @@ static int
SWriteFormat(ClientPtr client, xvFormat * pFormat)
{
swapl(&pFormat->visual);
(void) WriteToClient(client, sz_xvFormat, (char *) pFormat);
WriteToClient(client, sz_xvFormat, pFormat);
return Success;
}
@ -135,7 +135,7 @@ SWriteAttributeInfo(ClientPtr client, xvAttributeInfo * pAtt)
swapl(&pAtt->size);
swapl(&pAtt->min);
swapl(&pAtt->max);
(void) WriteToClient(client, sz_xvAttributeInfo, (char *) pAtt);
WriteToClient(client, sz_xvAttributeInfo, pAtt);
return Success;
}
@ -157,7 +157,7 @@ SWriteImageFormatInfo(ClientPtr client, xvImageFormatInfo * pImage)
swapl(&pImage->vert_u_period);
swapl(&pImage->vert_v_period);
(void) WriteToClient(client, sz_xvImageFormatInfo, (char *) pImage);
WriteToClient(client, sz_xvImageFormatInfo, pImage);
return Success;
}
@ -168,7 +168,7 @@ SWriteGrabPortReply(ClientPtr client, xvGrabPortReply * rep)
swaps(&rep->sequenceNumber);
swapl(&rep->length);
(void) WriteToClient(client, sz_xvGrabPortReply, (char *) rep);
WriteToClient(client, sz_xvGrabPortReply, rep);
return Success;
}
@ -180,7 +180,7 @@ SWriteGetPortAttributeReply(ClientPtr client, xvGetPortAttributeReply * rep)
swapl(&rep->length);
swapl(&rep->value);
(void) WriteToClient(client, sz_xvGetPortAttributeReply, (char *) rep);
WriteToClient(client, sz_xvGetPortAttributeReply, rep);
return Success;
}
@ -193,7 +193,7 @@ SWriteQueryBestSizeReply(ClientPtr client, xvQueryBestSizeReply * rep)
swaps(&rep->actual_width);
swaps(&rep->actual_height);
(void) WriteToClient(client, sz_xvQueryBestSizeReply, (char *) rep);
WriteToClient(client, sz_xvQueryBestSizeReply, rep);
return Success;
}
@ -207,7 +207,7 @@ SWriteQueryPortAttributesReply(ClientPtr client,
swapl(&rep->num_attributes);
swapl(&rep->text_size);
(void) WriteToClient(client, sz_xvQueryPortAttributesReply, (char *) rep);
WriteToClient(client, sz_xvQueryPortAttributesReply, rep);
return Success;
}
@ -223,7 +223,7 @@ SWriteQueryImageAttributesReply(ClientPtr client,
swaps(&rep->width);
swaps(&rep->height);
(void) WriteToClient(client, sz_xvQueryImageAttributesReply, (char *) rep);
WriteToClient(client, sz_xvQueryImageAttributesReply, rep);
return Success;
}
@ -235,66 +235,66 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep)
swapl(&rep->length);
swapl(&rep->num_formats);
(void) WriteToClient(client, sz_xvListImageFormatsReply, (char *) rep);
WriteToClient(client, sz_xvListImageFormatsReply, rep);
return Success;
}
#define _WriteQueryAdaptorsReply(_c,_d) \
if ((_c)->swapped) SWriteQueryAdaptorsReply(_c, _d); \
else WriteToClient(_c, sz_xvQueryAdaptorsReply, (char*)_d)
else WriteToClient(_c, sz_xvQueryAdaptorsReply, _d)
#define _WriteQueryExtensionReply(_c,_d) \
if ((_c)->swapped) SWriteQueryExtensionReply(_c, _d); \
else WriteToClient(_c, sz_xvQueryExtensionReply, (char*)_d)
else WriteToClient(_c, sz_xvQueryExtensionReply, _d)
#define _WriteQueryEncodingsReply(_c,_d) \
if ((_c)->swapped) SWriteQueryEncodingsReply(_c, _d); \
else WriteToClient(_c, sz_xvQueryEncodingsReply, (char*)_d)
else WriteToClient(_c, sz_xvQueryEncodingsReply, _d)
#define _WriteAdaptorInfo(_c,_d) \
if ((_c)->swapped) SWriteAdaptorInfo(_c, _d); \
else WriteToClient(_c, sz_xvAdaptorInfo, (char*)_d)
else WriteToClient(_c, sz_xvAdaptorInfo, _d)
#define _WriteAttributeInfo(_c,_d) \
if ((_c)->swapped) SWriteAttributeInfo(_c, _d); \
else WriteToClient(_c, sz_xvAttributeInfo, (char*)_d)
else WriteToClient(_c, sz_xvAttributeInfo, _d)
#define _WriteEncodingInfo(_c,_d) \
if ((_c)->swapped) SWriteEncodingInfo(_c, _d); \
else WriteToClient(_c, sz_xvEncodingInfo, (char*)_d)
else WriteToClient(_c, sz_xvEncodingInfo, _d)
#define _WriteFormat(_c,_d) \
if ((_c)->swapped) SWriteFormat(_c, _d); \
else WriteToClient(_c, sz_xvFormat, (char*)_d)
else WriteToClient(_c, sz_xvFormat, _d)
#define _WriteGrabPortReply(_c,_d) \
if ((_c)->swapped) SWriteGrabPortReply(_c, _d); \
else WriteToClient(_c, sz_xvGrabPortReply, (char*)_d)
else WriteToClient(_c, sz_xvGrabPortReply, _d)
#define _WriteGetPortAttributeReply(_c,_d) \
if ((_c)->swapped) SWriteGetPortAttributeReply(_c, _d); \
else WriteToClient(_c, sz_xvGetPortAttributeReply, (char*)_d)
else WriteToClient(_c, sz_xvGetPortAttributeReply, _d)
#define _WriteQueryBestSizeReply(_c,_d) \
if ((_c)->swapped) SWriteQueryBestSizeReply(_c, _d); \
else WriteToClient(_c, sz_xvQueryBestSizeReply,(char*) _d)
else WriteToClient(_c, sz_xvQueryBestSizeReply, _d)
#define _WriteQueryPortAttributesReply(_c,_d) \
if ((_c)->swapped) SWriteQueryPortAttributesReply(_c, _d); \
else WriteToClient(_c, sz_xvQueryPortAttributesReply,(char*) _d)
else WriteToClient(_c, sz_xvQueryPortAttributesReply, _d)
#define _WriteQueryImageAttributesReply(_c,_d) \
if ((_c)->swapped) SWriteQueryImageAttributesReply(_c, _d); \
else WriteToClient(_c, sz_xvQueryImageAttributesReply,(char*) _d)
else WriteToClient(_c, sz_xvQueryImageAttributesReply, _d)
#define _WriteListImageFormatsReply(_c,_d) \
if ((_c)->swapped) SWriteListImageFormatsReply(_c, _d); \
else WriteToClient(_c, sz_xvListImageFormatsReply,(char*) _d)
else WriteToClient(_c, sz_xvListImageFormatsReply, _d)
#define _WriteImageFormatInfo(_c,_d) \
if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \
else WriteToClient(_c, sz_xvImageFormatInfo, (char*)_d)
else WriteToClient(_c, sz_xvImageFormatInfo, _d)
#define _AllocatePort(_i,_p) \
((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success
@ -1100,7 +1100,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
_WriteQueryImageAttributesReply(client, &rep);
if (client->swapped)
SwapLongs((CARD32 *) offsets, planeLength);
WriteToClient(client, planeLength << 2, (char *) offsets);
WriteToClient(client, planeLength << 2, offsets);
free(offsets);

View file

@ -118,7 +118,7 @@ ProcXvMCQueryVersion(ClientPtr client)
rep.length = 0;
rep.major = SERVER_XVMC_MAJOR_VERSION;
rep.minor = SERVER_XVMC_MINOR_VERSION;
WriteToClient(client, sizeof(xvmcQueryVersionReply), (char *) &rep);
WriteToClient(client, sizeof(xvmcQueryVersionReply), &rep);
return Success;
}
@ -156,7 +156,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
rep.num = (adaptor) ? adaptor->num_surfaces : 0;
rep.length = bytes_to_int32(rep.num * sizeof(xvmcSurfaceInfo));
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), (char *) &rep);
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), &rep);
for (i = 0; i < rep.num; i++) {
surface = adaptor->surfaces[i];
@ -168,7 +168,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
info.subpicture_max_height = surface->subpicture_max_height;
info.mc_type = surface->mc_type;
info.flags = surface->flags;
WriteToClient(client, sizeof(xvmcSurfaceInfo), (char *) &info);
WriteToClient(client, sizeof(xvmcSurfaceInfo), &info);
}
return Success;
@ -254,9 +254,9 @@ ProcXvMCCreateContext(ClientPtr client)
rep.flags_return = pContext->flags;
rep.length = dwords;
WriteToClient(client, sizeof(xvmcCreateContextReply), (char *) &rep);
WriteToClient(client, sizeof(xvmcCreateContextReply), &rep);
if (dwords)
WriteToClient(client, dwords << 2, (char *) data);
WriteToClient(client, dwords << 2, data);
AddResource(pContext->context_id, XvMCRTContext, pContext);
free(data);
@ -325,9 +325,9 @@ ProcXvMCCreateSurface(ClientPtr client)
rep.sequenceNumber = client->sequence;
rep.length = dwords;
WriteToClient(client, sizeof(xvmcCreateSurfaceReply), (char *) &rep);
WriteToClient(client, sizeof(xvmcCreateSurfaceReply), &rep);
if (dwords)
WriteToClient(client, dwords << 2, (char *) data);
WriteToClient(client, dwords << 2, data);
AddResource(pSurface->surface_id, XvMCRTSurface, pSurface);
free(data);
@ -448,9 +448,9 @@ ProcXvMCCreateSubpicture(ClientPtr client)
rep.component_order[3] = pSubpicture->component_order[3];
rep.length = dwords;
WriteToClient(client, sizeof(xvmcCreateSubpictureReply), (char *) &rep);
WriteToClient(client, sizeof(xvmcCreateSubpictureReply), &rep);
if (dwords)
WriteToClient(client, dwords << 2, (char *) data);
WriteToClient(client, dwords << 2, data);
AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture);
free(data);
@ -533,7 +533,7 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
rep.length = bytes_to_int32(rep.num * sizeof(xvImageFormatInfo));
WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), (char *) &rep);
WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), &rep);
for (i = 0; i < rep.num; i++) {
pImage = NULL;
@ -569,7 +569,7 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
info.vert_v_period = pImage->vert_v_period;
memcpy(&info.comp_order, pImage->component_order, 32);
info.scanline_order = pImage->scanline_order;
WriteToClient(client, sizeof(xvImageFormatInfo), (char *) &info);
WriteToClient(client, sizeof(xvImageFormatInfo), &info);
}
return Success;
@ -634,7 +634,7 @@ ProcXvMCGetDRInfo(ClientPtr client)
}
#endif /* HAS_XVMCSHM */
WriteToClient(client, sizeof(xvmcGetDRInfoReply), (char *) &rep);
WriteToClient(client, sizeof(xvmcGetDRInfoReply), &rep);
if (rep.length) {
WriteToClient(client, rep.nameLen, pScreenPriv->clientDriverName);
WriteToClient(client, rep.busIDLen, pScreenPriv->busID);