Use internal temp variable for swap macros
Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
c10bad3d3e
commit
2c7c520cfe
|
@ -47,10 +47,9 @@ ProcBigReqDispatch (ClientPtr client)
|
|||
{
|
||||
REQUEST(xBigReqEnableReq);
|
||||
xBigReqEnableReply rep;
|
||||
int n;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
}
|
||||
if (stuff->brReqType != X_BigReqEnable)
|
||||
return BadRequest;
|
||||
|
@ -62,8 +61,8 @@ ProcBigReqDispatch (ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.max_request_size = maxBigRequestSize;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.max_request_size, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.max_request_size);
|
||||
}
|
||||
WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
|
||||
return Success;
|
||||
|
|
60
Xext/dpms.c
60
Xext/dpms.c
|
@ -46,7 +46,6 @@ ProcDPMSGetVersion(ClientPtr client)
|
|||
{
|
||||
/* REQUEST(xDPMSGetVersionReq); */
|
||||
xDPMSGetVersionReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
|
||||
|
||||
|
@ -56,9 +55,9 @@ ProcDPMSGetVersion(ClientPtr client)
|
|||
rep.majorVersion = DPMSMajorVersion;
|
||||
rep.minorVersion = DPMSMinorVersion;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swaps(&rep.majorVersion, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -69,7 +68,6 @@ ProcDPMSCapable(ClientPtr client)
|
|||
{
|
||||
/* REQUEST(xDPMSCapableReq); */
|
||||
xDPMSCapableReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xDPMSCapableReq);
|
||||
|
||||
|
@ -79,7 +77,7 @@ ProcDPMSCapable(ClientPtr client)
|
|||
rep.capable = DPMSCapableFlag;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -90,7 +88,6 @@ ProcDPMSGetTimeouts(ClientPtr client)
|
|||
{
|
||||
/* REQUEST(xDPMSGetTimeoutsReq); */
|
||||
xDPMSGetTimeoutsReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
|
||||
|
||||
|
@ -102,10 +99,10 @@ ProcDPMSGetTimeouts(ClientPtr client)
|
|||
rep.off = DPMSOffTime / MILLI_PER_SECOND;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swaps(&rep.standby, n);
|
||||
swaps(&rep.suspend, n);
|
||||
swaps(&rep.off, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swaps(&rep.standby);
|
||||
swaps(&rep.suspend);
|
||||
swaps(&rep.off);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -195,7 +192,6 @@ ProcDPMSInfo(ClientPtr client)
|
|||
{
|
||||
/* REQUEST(xDPMSInfoReq); */
|
||||
xDPMSInfoReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xDPMSInfoReq);
|
||||
|
||||
|
@ -206,8 +202,8 @@ ProcDPMSInfo(ClientPtr client)
|
|||
rep.state = DPMSEnabled;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swaps(&rep.power_level, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swaps(&rep.power_level);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -244,13 +240,12 @@ ProcDPMSDispatch (ClientPtr client)
|
|||
static int
|
||||
SProcDPMSGetVersion(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDPMSGetVersionReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
|
||||
swaps(&stuff->majorVersion, n);
|
||||
swaps(&stuff->minorVersion, n);
|
||||
swaps(&stuff->majorVersion);
|
||||
swaps(&stuff->minorVersion);
|
||||
return ProcDPMSGetVersion(client);
|
||||
}
|
||||
|
||||
|
@ -258,9 +253,8 @@ static int
|
|||
SProcDPMSCapable(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSCapableReq);
|
||||
int n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSCapableReq);
|
||||
|
||||
return ProcDPMSCapable(client);
|
||||
|
@ -270,9 +264,8 @@ static int
|
|||
SProcDPMSGetTimeouts(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSGetTimeoutsReq);
|
||||
int n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
|
||||
|
||||
return ProcDPMSGetTimeouts(client);
|
||||
|
@ -282,14 +275,13 @@ static int
|
|||
SProcDPMSSetTimeouts(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSSetTimeoutsReq);
|
||||
int n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
|
||||
|
||||
swaps(&stuff->standby, n);
|
||||
swaps(&stuff->suspend, n);
|
||||
swaps(&stuff->off, n);
|
||||
swaps(&stuff->standby);
|
||||
swaps(&stuff->suspend);
|
||||
swaps(&stuff->off);
|
||||
return ProcDPMSSetTimeouts(client);
|
||||
}
|
||||
|
||||
|
@ -297,9 +289,8 @@ static int
|
|||
SProcDPMSEnable(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSEnableReq);
|
||||
int n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSEnableReq);
|
||||
|
||||
return ProcDPMSEnable(client);
|
||||
|
@ -309,9 +300,8 @@ static int
|
|||
SProcDPMSDisable(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSDisableReq);
|
||||
int n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSDisableReq);
|
||||
|
||||
return ProcDPMSDisable(client);
|
||||
|
@ -321,12 +311,11 @@ static int
|
|||
SProcDPMSForceLevel(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSForceLevelReq);
|
||||
int n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
|
||||
|
||||
swaps(&stuff->level, n);
|
||||
swaps(&stuff->level);
|
||||
|
||||
return ProcDPMSForceLevel(client);
|
||||
}
|
||||
|
@ -335,9 +324,8 @@ static int
|
|||
SProcDPMSInfo(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDPMSInfoReq);
|
||||
int n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDPMSInfoReq);
|
||||
|
||||
return ProcDPMSInfo(client);
|
||||
|
|
16
Xext/geext.c
16
Xext/geext.c
|
@ -58,7 +58,6 @@ static void SGEGenericEvent(xEvent* from, xEvent* to);
|
|||
static int
|
||||
ProcGEQueryVersion(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
GEClientInfoPtr pGEClient = GEGetClient(client);
|
||||
xGEQueryVersionReply rep;
|
||||
REQUEST(xGEQueryVersionReq);
|
||||
|
@ -80,10 +79,10 @@ ProcGEQueryVersion(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.majorVersion, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xGEQueryVersionReply), (char*)&rep);
|
||||
|
@ -101,13 +100,12 @@ int (*ProcGEVector[GENumberRequests])(ClientPtr) = {
|
|||
static int
|
||||
SProcGEQueryVersion(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xGEQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
|
||||
swaps(&stuff->majorVersion, n);
|
||||
swaps(&stuff->minorVersion, n);
|
||||
swaps(&stuff->majorVersion);
|
||||
swaps(&stuff->minorVersion);
|
||||
return(*ProcGEVector[stuff->ReqType])(client);
|
||||
}
|
||||
|
||||
|
|
|
@ -909,7 +909,6 @@ ProcPanoramiXQueryVersion (ClientPtr client)
|
|||
{
|
||||
/* REQUEST(xPanoramiXQueryVersionReq); */
|
||||
xPanoramiXQueryVersionReply rep;
|
||||
register int n;
|
||||
|
||||
REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
|
||||
rep.type = X_Reply;
|
||||
|
@ -918,10 +917,10 @@ ProcPanoramiXQueryVersion (ClientPtr client)
|
|||
rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION;
|
||||
rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.majorVersion, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -933,7 +932,7 @@ ProcPanoramiXGetState(ClientPtr client)
|
|||
REQUEST(xPanoramiXGetStateReq);
|
||||
WindowPtr pWin;
|
||||
xPanoramiXGetStateReply rep;
|
||||
int n, rc;
|
||||
int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
|
@ -946,9 +945,9 @@ ProcPanoramiXGetState(ClientPtr client)
|
|||
rep.state = !noPanoramiXExtension;
|
||||
rep.window = stuff->window;
|
||||
if (client->swapped) {
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.window, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.window);
|
||||
}
|
||||
WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
|
||||
return Success;
|
||||
|
@ -961,7 +960,7 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
|
|||
REQUEST(xPanoramiXGetScreenCountReq);
|
||||
WindowPtr pWin;
|
||||
xPanoramiXGetScreenCountReply rep;
|
||||
int n, rc;
|
||||
int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
|
@ -974,9 +973,9 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
|
|||
rep.ScreenCount = PanoramiXNumScreens;
|
||||
rep.window = stuff->window;
|
||||
if (client->swapped) {
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.window, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.window);
|
||||
}
|
||||
WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep);
|
||||
return Success;
|
||||
|
@ -988,7 +987,7 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
|
|||
REQUEST(xPanoramiXGetScreenSizeReq);
|
||||
WindowPtr pWin;
|
||||
xPanoramiXGetScreenSizeReply rep;
|
||||
int n, rc;
|
||||
int rc;
|
||||
|
||||
if (stuff->screen >= PanoramiXNumScreens)
|
||||
return BadMatch;
|
||||
|
@ -1007,12 +1006,12 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
|
|||
rep.window = stuff->window;
|
||||
rep.screen = stuff->screen;
|
||||
if (client->swapped) {
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.width, n);
|
||||
swapl (&rep.height, n);
|
||||
swapl (&rep.window, n);
|
||||
swapl (&rep.screen, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.width);
|
||||
swapl(&rep.height);
|
||||
swapl(&rep.window);
|
||||
swapl(&rep.screen);
|
||||
}
|
||||
WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep);
|
||||
return Success;
|
||||
|
@ -1040,10 +1039,9 @@ ProcXineramaIsActive(ClientPtr client)
|
|||
rep.state = !noPanoramiXExtension;
|
||||
#endif
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.state, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.state);
|
||||
}
|
||||
WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
|
||||
return Success;
|
||||
|
@ -1063,10 +1061,9 @@ ProcXineramaQueryScreens(ClientPtr client)
|
|||
rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
|
||||
rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.number, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.number);
|
||||
}
|
||||
WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
|
||||
|
||||
|
@ -1081,11 +1078,10 @@ ProcXineramaQueryScreens(ClientPtr client)
|
|||
scratch.height = screenInfo.screens[i]->height;
|
||||
|
||||
if(client->swapped) {
|
||||
int n;
|
||||
swaps (&scratch.x_org, n);
|
||||
swaps (&scratch.y_org, n);
|
||||
swaps (&scratch.width, n);
|
||||
swaps (&scratch.height, n);
|
||||
swaps(&scratch.x_org);
|
||||
swaps(&scratch.y_org);
|
||||
swaps(&scratch.width);
|
||||
swaps(&scratch.height);
|
||||
}
|
||||
WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
|
||||
}
|
||||
|
|
|
@ -51,9 +51,8 @@ static int
|
|||
SProcPanoramiXQueryVersion (ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXQueryVersionReq);
|
||||
int n;
|
||||
|
||||
swaps(&stuff->length,n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
|
||||
return ProcPanoramiXQueryVersion(client);
|
||||
}
|
||||
|
@ -62,11 +61,10 @@ static int
|
|||
SProcPanoramiXGetState(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXGetStateReq);
|
||||
int n;
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return ProcPanoramiXGetState(client);
|
||||
}
|
||||
|
||||
|
@ -74,11 +72,10 @@ static int
|
|||
SProcPanoramiXGetScreenCount(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXGetScreenCountReq);
|
||||
int n;
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return ProcPanoramiXGetScreenCount(client);
|
||||
}
|
||||
|
||||
|
@ -86,12 +83,11 @@ static int
|
|||
SProcPanoramiXGetScreenSize(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXGetScreenSizeReq);
|
||||
int n;
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl (&stuff->screen, n);
|
||||
swapl(&stuff->window);
|
||||
swapl(&stuff->screen);
|
||||
return ProcPanoramiXGetScreenSize(client);
|
||||
}
|
||||
|
||||
|
@ -100,9 +96,8 @@ static int
|
|||
SProcXineramaIsActive(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXineramaIsActiveReq);
|
||||
int n;
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
|
||||
return ProcXineramaIsActive(client);
|
||||
}
|
||||
|
@ -112,9 +107,8 @@ static int
|
|||
SProcXineramaQueryScreens(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXineramaQueryScreensReq);
|
||||
int n;
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
||||
return ProcXineramaQueryScreens(client);
|
||||
}
|
||||
|
|
69
Xext/saver.c
69
Xext/saver.c
|
@ -669,8 +669,6 @@ static int
|
|||
ProcScreenSaverQueryVersion (ClientPtr client)
|
||||
{
|
||||
xScreenSaverQueryVersionReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH (xScreenSaverQueryVersionReq);
|
||||
rep.type = X_Reply;
|
||||
rep.length = 0;
|
||||
|
@ -678,8 +676,8 @@ ProcScreenSaverQueryVersion (ClientPtr client)
|
|||
rep.majorVersion = SERVER_SAVER_MAJOR_VERSION;
|
||||
rep.minorVersion = SERVER_SAVER_MINOR_VERSION;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -690,7 +688,7 @@ ProcScreenSaverQueryInfo (ClientPtr client)
|
|||
{
|
||||
REQUEST(xScreenSaverQueryInfoReq);
|
||||
xScreenSaverQueryInfoReply rep;
|
||||
int n, rc;
|
||||
int rc;
|
||||
ScreenSaverStuffPtr pSaver;
|
||||
DrawablePtr pDraw;
|
||||
CARD32 lastInput;
|
||||
|
@ -750,12 +748,12 @@ ProcScreenSaverQueryInfo (ClientPtr client)
|
|||
rep.kind = ScreenSaverInternal;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.window, n);
|
||||
swapl (&rep.tilOrSince, n);
|
||||
swapl (&rep.idle, n);
|
||||
swapl (&rep.eventMask, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.window);
|
||||
swapl(&rep.tilOrSince);
|
||||
swapl(&rep.idle);
|
||||
swapl(&rep.eventMask);
|
||||
}
|
||||
WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -1384,9 +1382,7 @@ static int
|
|||
SProcScreenSaverQueryVersion (ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverQueryVersionReq);
|
||||
int n;
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
|
||||
return ProcScreenSaverQueryVersion (client);
|
||||
}
|
||||
|
@ -1395,11 +1391,9 @@ static int
|
|||
SProcScreenSaverQueryInfo (ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverQueryInfoReq);
|
||||
int n;
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
|
||||
swapl (&stuff->drawable, n);
|
||||
swapl(&stuff->drawable);
|
||||
return ProcScreenSaverQueryInfo (client);
|
||||
}
|
||||
|
||||
|
@ -1407,12 +1401,10 @@ static int
|
|||
SProcScreenSaverSelectInput (ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverSelectInputReq);
|
||||
int n;
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
|
||||
swapl (&stuff->drawable, n);
|
||||
swapl (&stuff->eventMask, n);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->eventMask);
|
||||
return ProcScreenSaverSelectInput (client);
|
||||
}
|
||||
|
||||
|
@ -1420,18 +1412,16 @@ static int
|
|||
SProcScreenSaverSetAttributes (ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverSetAttributesReq);
|
||||
int n;
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
||||
swapl (&stuff->drawable, n);
|
||||
swaps (&stuff->x, n);
|
||||
swaps (&stuff->y, n);
|
||||
swaps (&stuff->width, n);
|
||||
swaps (&stuff->height, n);
|
||||
swaps (&stuff->borderWidth, n);
|
||||
swapl (&stuff->visualID, n);
|
||||
swapl (&stuff->mask, n);
|
||||
swapl(&stuff->drawable);
|
||||
swaps(&stuff->x);
|
||||
swaps(&stuff->y);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
swaps(&stuff->borderWidth);
|
||||
swapl(&stuff->visualID);
|
||||
swapl(&stuff->mask);
|
||||
SwapRestL(stuff);
|
||||
return ProcScreenSaverSetAttributes (client);
|
||||
}
|
||||
|
@ -1440,23 +1430,20 @@ static int
|
|||
SProcScreenSaverUnsetAttributes (ClientPtr client)
|
||||
{
|
||||
REQUEST(xScreenSaverUnsetAttributesReq);
|
||||
int n;
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
||||
swapl (&stuff->drawable, n);
|
||||
swapl(&stuff->drawable);
|
||||
return ProcScreenSaverUnsetAttributes (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcScreenSaverSuspend (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xScreenSaverSuspendReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
|
||||
swapl(&stuff->suspend, n);
|
||||
swapl(&stuff->suspend);
|
||||
return ProcScreenSaverSuspend (client);
|
||||
}
|
||||
|
||||
|
|
|
@ -368,10 +368,9 @@ ProcSecurityQueryVersion(
|
|||
rep.minorVersion = SERVER_SECURITY_MINOR_VERSION;
|
||||
if(client->swapped)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swaps(&rep.majorVersion, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
}
|
||||
(void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply),
|
||||
(char *)&rep);
|
||||
|
@ -580,11 +579,10 @@ ProcSecurityGenerateAuthorization(
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
char n;
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.authId, n);
|
||||
swaps(&rep.dataLength, n);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.authId);
|
||||
swaps(&rep.dataLength);
|
||||
}
|
||||
|
||||
WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply),
|
||||
|
@ -652,12 +650,11 @@ SProcSecurityQueryVersion(
|
|||
ClientPtr client)
|
||||
{
|
||||
REQUEST(xSecurityQueryVersionReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
|
||||
swaps(&stuff->majorVersion, n);
|
||||
swaps(&stuff->minorVersion,n);
|
||||
swaps(&stuff->majorVersion);
|
||||
swaps(&stuff->minorVersion);
|
||||
return ProcSecurityQueryVersion(client);
|
||||
} /* SProcSecurityQueryVersion */
|
||||
|
||||
|
@ -667,16 +664,15 @@ SProcSecurityGenerateAuthorization(
|
|||
ClientPtr client)
|
||||
{
|
||||
REQUEST(xSecurityGenerateAuthorizationReq);
|
||||
char n;
|
||||
CARD32 *values;
|
||||
unsigned long nvalues;
|
||||
int values_offset;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
|
||||
swaps(&stuff->nbytesAuthProto, n);
|
||||
swaps(&stuff->nbytesAuthData, n);
|
||||
swapl(&stuff->valueMask, n);
|
||||
swaps(&stuff->nbytesAuthProto);
|
||||
swaps(&stuff->nbytesAuthData);
|
||||
swapl(&stuff->valueMask);
|
||||
values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
|
||||
bytes_to_int32(stuff->nbytesAuthData);
|
||||
if (values_offset >
|
||||
|
@ -694,11 +690,10 @@ SProcSecurityRevokeAuthorization(
|
|||
ClientPtr client)
|
||||
{
|
||||
REQUEST(xSecurityRevokeAuthorizationReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
|
||||
swapl(&stuff->authId, n);
|
||||
swapl(&stuff->authId);
|
||||
return ProcSecurityRevokeAuthorization(client);
|
||||
} /* SProcSecurityRevokeAuthorization */
|
||||
|
||||
|
|
110
Xext/shape.c
110
Xext/shape.c
|
@ -214,8 +214,6 @@ static int
|
|||
ProcShapeQueryVersion (ClientPtr client)
|
||||
{
|
||||
xShapeQueryVersionReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH (xShapeQueryVersionReq);
|
||||
memset(&rep, 0, sizeof(xShapeQueryVersionReply));
|
||||
rep.type = X_Reply;
|
||||
|
@ -224,10 +222,10 @@ ProcShapeQueryVersion (ClientPtr client)
|
|||
rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION;
|
||||
rep.minorVersion = SERVER_SHAPE_MINOR_VERSION;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.majorVersion, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof (xShapeQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -637,7 +635,7 @@ ProcShapeQueryExtents (ClientPtr client)
|
|||
WindowPtr pWin;
|
||||
xShapeQueryExtentsReply rep;
|
||||
BoxRec extents, *pExtents;
|
||||
int n, rc;
|
||||
int rc;
|
||||
RegionPtr region;
|
||||
|
||||
REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
|
||||
|
@ -679,16 +677,16 @@ ProcShapeQueryExtents (ClientPtr client)
|
|||
rep.widthClipShape = extents.x2 - extents.x1;
|
||||
rep.heightClipShape = extents.y2 - extents.y1;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.xBoundingShape, n);
|
||||
swaps(&rep.yBoundingShape, n);
|
||||
swaps(&rep.widthBoundingShape, n);
|
||||
swaps(&rep.heightBoundingShape, n);
|
||||
swaps(&rep.xClipShape, n);
|
||||
swaps(&rep.yClipShape, n);
|
||||
swaps(&rep.widthClipShape, n);
|
||||
swaps(&rep.heightClipShape, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.xBoundingShape);
|
||||
swaps(&rep.yBoundingShape);
|
||||
swaps(&rep.widthBoundingShape);
|
||||
swaps(&rep.heightBoundingShape);
|
||||
swaps(&rep.xClipShape);
|
||||
swaps(&rep.yClipShape);
|
||||
swaps(&rep.widthClipShape);
|
||||
swaps(&rep.heightClipShape);
|
||||
}
|
||||
WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -915,8 +913,6 @@ ProcShapeInputSelected (ClientPtr client)
|
|||
ShapeEventPtr pShapeEvent, *pHead;
|
||||
int enabled, rc;
|
||||
xShapeInputSelectedReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
|
@ -942,8 +938,8 @@ ProcShapeInputSelected (ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.enabled = enabled;
|
||||
if (client->swapped) {
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep);
|
||||
return Success;
|
||||
|
@ -958,8 +954,6 @@ ProcShapeGetRectangles (ClientPtr client)
|
|||
xRectangle *rects;
|
||||
int nrects, i, rc;
|
||||
RegionPtr region;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
|
@ -1023,9 +1017,9 @@ ProcShapeGetRectangles (ClientPtr client)
|
|||
rep.ordering = YXBanded;
|
||||
rep.nrects = nrects;
|
||||
if (client->swapped) {
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.nrects, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.nrects);
|
||||
SwapShorts ((short *)rects, (unsigned long)nrects * 4);
|
||||
}
|
||||
WriteToClient (client, sizeof (rep), (char *) &rep);
|
||||
|
@ -1100,24 +1094,22 @@ SShapeNotifyEvent(xShapeNotifyEvent *from, xShapeNotifyEvent *to)
|
|||
static int
|
||||
SProcShapeQueryVersion (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST (xShapeQueryVersionReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return ProcShapeQueryVersion (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcShapeRectangles (ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST (xShapeRectanglesReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
|
||||
swapl (&stuff->dest, n);
|
||||
swaps (&stuff->xOff, n);
|
||||
swaps (&stuff->yOff, n);
|
||||
swapl(&stuff->dest);
|
||||
swaps(&stuff->xOff);
|
||||
swaps(&stuff->yOff);
|
||||
SwapRestS(stuff);
|
||||
return ProcShapeRectangles (client);
|
||||
}
|
||||
|
@ -1125,80 +1117,74 @@ SProcShapeRectangles (ClientPtr client)
|
|||
static int
|
||||
SProcShapeMask (ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST (xShapeMaskReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xShapeMaskReq);
|
||||
swapl (&stuff->dest, n);
|
||||
swaps (&stuff->xOff, n);
|
||||
swaps (&stuff->yOff, n);
|
||||
swapl (&stuff->src, n);
|
||||
swapl(&stuff->dest);
|
||||
swaps(&stuff->xOff);
|
||||
swaps(&stuff->yOff);
|
||||
swapl(&stuff->src);
|
||||
return ProcShapeMask (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcShapeCombine (ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST (xShapeCombineReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xShapeCombineReq);
|
||||
swapl (&stuff->dest, n);
|
||||
swaps (&stuff->xOff, n);
|
||||
swaps (&stuff->yOff, n);
|
||||
swapl (&stuff->src, n);
|
||||
swapl(&stuff->dest);
|
||||
swaps(&stuff->xOff);
|
||||
swaps(&stuff->yOff);
|
||||
swapl(&stuff->src);
|
||||
return ProcShapeCombine (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcShapeOffset (ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST (xShapeOffsetReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xShapeOffsetReq);
|
||||
swapl (&stuff->dest, n);
|
||||
swaps (&stuff->xOff, n);
|
||||
swaps (&stuff->yOff, n);
|
||||
swapl(&stuff->dest);
|
||||
swaps(&stuff->xOff);
|
||||
swaps(&stuff->yOff);
|
||||
return ProcShapeOffset (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcShapeQueryExtents (ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST (xShapeQueryExtentsReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return ProcShapeQueryExtents (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcShapeSelectInput (ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST (xShapeSelectInputReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xShapeSelectInputReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return ProcShapeSelectInput (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcShapeInputSelected (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST (xShapeInputSelectedReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return ProcShapeInputSelected (client);
|
||||
}
|
||||
|
||||
|
@ -1206,11 +1192,9 @@ static int
|
|||
SProcShapeGetRectangles (ClientPtr client)
|
||||
{
|
||||
REQUEST(xShapeGetRectanglesReq);
|
||||
char n;
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return ProcShapeGetRectangles (client);
|
||||
}
|
||||
|
||||
|
|
108
Xext/shm.c
108
Xext/shm.c
|
@ -289,7 +289,6 @@ static int
|
|||
ProcShmQueryVersion(ClientPtr client)
|
||||
{
|
||||
xShmQueryVersionReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xShmQueryVersionReq);
|
||||
memset(&rep, 0, sizeof(xShmQueryVersionReply));
|
||||
|
@ -303,12 +302,12 @@ ProcShmQueryVersion(ClientPtr client)
|
|||
rep.uid = geteuid();
|
||||
rep.gid = getegid();
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.majorVersion, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swaps(&rep.uid, n);
|
||||
swaps(&rep.gid, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
swaps(&rep.uid);
|
||||
swaps(&rep.gid);
|
||||
}
|
||||
WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -633,7 +632,7 @@ ProcShmGetImage(ClientPtr client)
|
|||
Mask plane = 0;
|
||||
xShmGetImageReply xgi;
|
||||
ShmDescPtr shmdesc;
|
||||
int n, rc;
|
||||
int rc;
|
||||
|
||||
REQUEST(xShmGetImageReq);
|
||||
|
||||
|
@ -727,10 +726,10 @@ ProcShmGetImage(ClientPtr client)
|
|||
}
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&xgi.sequenceNumber, n);
|
||||
swapl(&xgi.length, n);
|
||||
swapl(&xgi.visual, n);
|
||||
swapl(&xgi.size, n);
|
||||
swaps(&xgi.sequenceNumber);
|
||||
swapl(&xgi.length);
|
||||
swapl(&xgi.visual);
|
||||
swapl(&xgi.size);
|
||||
}
|
||||
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
|
||||
|
||||
|
@ -897,11 +896,10 @@ ProcPanoramiXShmGetImage(ClientPtr client)
|
|||
free(drawables);
|
||||
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
swaps(&xgi.sequenceNumber, n);
|
||||
swapl(&xgi.length, n);
|
||||
swapl(&xgi.visual, n);
|
||||
swapl(&xgi.size, n);
|
||||
swaps(&xgi.sequenceNumber);
|
||||
swapl(&xgi.length);
|
||||
swapl(&xgi.visual);
|
||||
swapl(&xgi.size);
|
||||
}
|
||||
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
|
||||
|
||||
|
@ -1165,89 +1163,83 @@ SShmCompletionEvent(xShmCompletionEvent *from, xShmCompletionEvent *to)
|
|||
static int
|
||||
SProcShmQueryVersion(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xShmQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return ProcShmQueryVersion(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcShmAttach(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xShmAttachReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShmAttachReq);
|
||||
swapl(&stuff->shmseg, n);
|
||||
swapl(&stuff->shmid, n);
|
||||
swapl(&stuff->shmseg);
|
||||
swapl(&stuff->shmid);
|
||||
return ProcShmAttach(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcShmDetach(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xShmDetachReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShmDetachReq);
|
||||
swapl(&stuff->shmseg, n);
|
||||
swapl(&stuff->shmseg);
|
||||
return ProcShmDetach(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcShmPutImage(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xShmPutImageReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
||||
swapl(&stuff->drawable, n);
|
||||
swapl(&stuff->gc, n);
|
||||
swaps(&stuff->totalWidth, n);
|
||||
swaps(&stuff->totalHeight, n);
|
||||
swaps(&stuff->srcX, n);
|
||||
swaps(&stuff->srcY, n);
|
||||
swaps(&stuff->srcWidth, n);
|
||||
swaps(&stuff->srcHeight, n);
|
||||
swaps(&stuff->dstX, n);
|
||||
swaps(&stuff->dstY, n);
|
||||
swapl(&stuff->shmseg, n);
|
||||
swapl(&stuff->offset, n);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
swaps(&stuff->totalWidth);
|
||||
swaps(&stuff->totalHeight);
|
||||
swaps(&stuff->srcX);
|
||||
swaps(&stuff->srcY);
|
||||
swaps(&stuff->srcWidth);
|
||||
swaps(&stuff->srcHeight);
|
||||
swaps(&stuff->dstX);
|
||||
swaps(&stuff->dstY);
|
||||
swapl(&stuff->shmseg);
|
||||
swapl(&stuff->offset);
|
||||
return ProcShmPutImage(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcShmGetImage(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xShmGetImageReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShmGetImageReq);
|
||||
swapl(&stuff->drawable, n);
|
||||
swaps(&stuff->x, n);
|
||||
swaps(&stuff->y, n);
|
||||
swaps(&stuff->width, n);
|
||||
swaps(&stuff->height, n);
|
||||
swapl(&stuff->planeMask, n);
|
||||
swapl(&stuff->shmseg, n);
|
||||
swapl(&stuff->offset, n);
|
||||
swapl(&stuff->drawable);
|
||||
swaps(&stuff->x);
|
||||
swaps(&stuff->y);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
swapl(&stuff->planeMask);
|
||||
swapl(&stuff->shmseg);
|
||||
swapl(&stuff->offset);
|
||||
return ProcShmGetImage(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcShmCreatePixmap(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xShmCreatePixmapReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
|
||||
swapl(&stuff->pid, n);
|
||||
swapl(&stuff->drawable, n);
|
||||
swaps(&stuff->width, n);
|
||||
swaps(&stuff->height, n);
|
||||
swapl(&stuff->shmseg, n);
|
||||
swapl(&stuff->offset, n);
|
||||
swapl(&stuff->pid);
|
||||
swapl(&stuff->drawable);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
swapl(&stuff->shmseg);
|
||||
swapl(&stuff->offset);
|
||||
return ProcShmCreatePixmap(client);
|
||||
}
|
||||
|
||||
|
|
186
Xext/sync.c
186
Xext/sync.c
|
@ -1273,8 +1273,6 @@ static int
|
|||
ProcSyncInitialize(ClientPtr client)
|
||||
{
|
||||
xSyncInitializeReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xSyncInitializeReq);
|
||||
|
||||
memset(&rep, 0, sizeof(xSyncInitializeReply));
|
||||
|
@ -1286,7 +1284,7 @@ ProcSyncInitialize(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
}
|
||||
WriteToClient(client, sizeof(rep), (char *) &rep);
|
||||
return Success;
|
||||
|
@ -1326,10 +1324,9 @@ ProcSyncListSystemCounters(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.nCounters, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.nCounters);
|
||||
}
|
||||
|
||||
for (i = 0; i < SyncNumSystemCounters; i++)
|
||||
|
@ -1346,11 +1343,10 @@ ProcSyncListSystemCounters(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
char n;
|
||||
swapl(&walklist->counter, n);
|
||||
swapl(&walklist->resolution_hi, n);
|
||||
swapl(&walklist->resolution_lo, n);
|
||||
swaps(&walklist->name_length, n);
|
||||
swapl(&walklist->counter);
|
||||
swapl(&walklist->resolution_hi);
|
||||
swapl(&walklist->resolution_lo);
|
||||
swaps(&walklist->name_length);
|
||||
}
|
||||
|
||||
pname_in_reply = ((char *)walklist) + sz_xSyncSystemCounter;
|
||||
|
@ -1433,9 +1429,8 @@ ProcSyncGetPriority(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.priority, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.priority);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep);
|
||||
|
@ -1732,11 +1727,10 @@ ProcSyncQueryCounter(ClientPtr client)
|
|||
rep.value_lo = XSyncValueLow32(pCounter->value);
|
||||
if (client->swapped)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.value_hi, n);
|
||||
swapl(&rep.value_lo, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.value_hi);
|
||||
swapl(&rep.value_lo);
|
||||
}
|
||||
WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep);
|
||||
return Success;
|
||||
|
@ -1921,15 +1915,14 @@ ProcSyncQueryAlarm(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.counter, n);
|
||||
swapl(&rep.wait_value_hi, n);
|
||||
swapl(&rep.wait_value_lo, n);
|
||||
swapl(&rep.test_type, n);
|
||||
swapl(&rep.delta_hi, n);
|
||||
swapl(&rep.delta_lo, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.counter);
|
||||
swapl(&rep.wait_value_hi);
|
||||
swapl(&rep.wait_value_lo);
|
||||
swapl(&rep.test_type);
|
||||
swapl(&rep.delta_hi);
|
||||
swapl(&rep.delta_lo);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep);
|
||||
|
@ -2087,9 +2080,8 @@ ProcSyncQueryFence(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xSyncQueryFenceReply), (char *) &rep);
|
||||
|
@ -2242,9 +2234,7 @@ static int
|
|||
SProcSyncInitialize(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncInitializeReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncInitializeReq);
|
||||
|
||||
return ProcSyncInitialize(client);
|
||||
|
@ -2254,9 +2244,7 @@ static int
|
|||
SProcSyncListSystemCounters(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncListSystemCountersReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncListSystemCountersReq);
|
||||
|
||||
return ProcSyncListSystemCounters(client);
|
||||
|
@ -2266,13 +2254,11 @@ static int
|
|||
SProcSyncCreateCounter(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncCreateCounterReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncCreateCounterReq);
|
||||
swapl(&stuff->cid, n);
|
||||
swapl(&stuff->initial_value_lo, n);
|
||||
swapl(&stuff->initial_value_hi, n);
|
||||
swapl(&stuff->cid);
|
||||
swapl(&stuff->initial_value_lo);
|
||||
swapl(&stuff->initial_value_hi);
|
||||
|
||||
return ProcSyncCreateCounter(client);
|
||||
}
|
||||
|
@ -2281,13 +2267,11 @@ static int
|
|||
SProcSyncSetCounter(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncSetCounterReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncSetCounterReq);
|
||||
swapl(&stuff->cid, n);
|
||||
swapl(&stuff->value_lo, n);
|
||||
swapl(&stuff->value_hi, n);
|
||||
swapl(&stuff->cid);
|
||||
swapl(&stuff->value_lo);
|
||||
swapl(&stuff->value_hi);
|
||||
|
||||
return ProcSyncSetCounter(client);
|
||||
}
|
||||
|
@ -2296,13 +2280,11 @@ static int
|
|||
SProcSyncChangeCounter(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncChangeCounterReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncChangeCounterReq);
|
||||
swapl(&stuff->cid, n);
|
||||
swapl(&stuff->value_lo, n);
|
||||
swapl(&stuff->value_hi, n);
|
||||
swapl(&stuff->cid);
|
||||
swapl(&stuff->value_lo);
|
||||
swapl(&stuff->value_hi);
|
||||
|
||||
return ProcSyncChangeCounter(client);
|
||||
}
|
||||
|
@ -2311,11 +2293,9 @@ static int
|
|||
SProcSyncQueryCounter(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncQueryCounterReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncQueryCounterReq);
|
||||
swapl(&stuff->counter, n);
|
||||
swapl(&stuff->counter);
|
||||
|
||||
return ProcSyncQueryCounter(client);
|
||||
}
|
||||
|
@ -2324,11 +2304,9 @@ static int
|
|||
SProcSyncDestroyCounter(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncDestroyCounterReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncDestroyCounterReq);
|
||||
swapl(&stuff->counter, n);
|
||||
swapl(&stuff->counter);
|
||||
|
||||
return ProcSyncDestroyCounter(client);
|
||||
}
|
||||
|
@ -2337,9 +2315,7 @@ static int
|
|||
SProcSyncAwait(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncAwaitReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
|
||||
SwapRestL(stuff);
|
||||
|
||||
|
@ -2350,12 +2326,10 @@ static int
|
|||
SProcSyncCreateAlarm(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncCreateAlarmReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
|
||||
swapl(&stuff->id, n);
|
||||
swapl(&stuff->valueMask, n);
|
||||
swapl(&stuff->id);
|
||||
swapl(&stuff->valueMask);
|
||||
SwapRestL(stuff);
|
||||
|
||||
return ProcSyncCreateAlarm(client);
|
||||
|
@ -2365,12 +2339,10 @@ static int
|
|||
SProcSyncChangeAlarm(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncChangeAlarmReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
|
||||
swapl(&stuff->alarm, n);
|
||||
swapl(&stuff->valueMask, n);
|
||||
swapl(&stuff->alarm);
|
||||
swapl(&stuff->valueMask);
|
||||
SwapRestL(stuff);
|
||||
return ProcSyncChangeAlarm(client);
|
||||
}
|
||||
|
@ -2379,11 +2351,9 @@ static int
|
|||
SProcSyncQueryAlarm(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncQueryAlarmReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncQueryAlarmReq);
|
||||
swapl(&stuff->alarm, n);
|
||||
swapl(&stuff->alarm);
|
||||
|
||||
return ProcSyncQueryAlarm(client);
|
||||
}
|
||||
|
@ -2392,11 +2362,9 @@ static int
|
|||
SProcSyncDestroyAlarm(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncDestroyAlarmReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncDestroyAlarmReq);
|
||||
swapl(&stuff->alarm, n);
|
||||
swapl(&stuff->alarm);
|
||||
|
||||
return ProcSyncDestroyAlarm(client);
|
||||
}
|
||||
|
@ -2405,12 +2373,10 @@ static int
|
|||
SProcSyncSetPriority(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncSetPriorityReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncSetPriorityReq);
|
||||
swapl(&stuff->id, n);
|
||||
swapl(&stuff->priority, n);
|
||||
swapl(&stuff->id);
|
||||
swapl(&stuff->priority);
|
||||
|
||||
return ProcSyncSetPriority(client);
|
||||
}
|
||||
|
@ -2419,11 +2385,9 @@ static int
|
|||
SProcSyncGetPriority(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncGetPriorityReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncGetPriorityReq);
|
||||
swapl(&stuff->id, n);
|
||||
swapl(&stuff->id);
|
||||
|
||||
return ProcSyncGetPriority(client);
|
||||
}
|
||||
|
@ -2432,11 +2396,9 @@ static int
|
|||
SProcSyncCreateFence(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncCreateFenceReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncCreateFenceReq);
|
||||
swapl(&stuff->fid, n);
|
||||
swapl(&stuff->fid);
|
||||
|
||||
return ProcSyncCreateFence(client);
|
||||
}
|
||||
|
@ -2445,11 +2407,9 @@ static int
|
|||
SProcSyncTriggerFence(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncTriggerFenceReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncTriggerFenceReq);
|
||||
swapl(&stuff->fid, n);
|
||||
swapl(&stuff->fid);
|
||||
|
||||
return ProcSyncTriggerFence(client);
|
||||
}
|
||||
|
@ -2458,11 +2418,9 @@ static int
|
|||
SProcSyncResetFence(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncResetFenceReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncResetFenceReq);
|
||||
swapl(&stuff->fid, n);
|
||||
swapl(&stuff->fid);
|
||||
|
||||
return ProcSyncResetFence(client);
|
||||
}
|
||||
|
@ -2471,11 +2429,9 @@ static int
|
|||
SProcSyncDestroyFence(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncDestroyFenceReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncDestroyFenceReq);
|
||||
swapl(&stuff->fid, n);
|
||||
swapl(&stuff->fid);
|
||||
|
||||
return ProcSyncDestroyFence(client);
|
||||
}
|
||||
|
@ -2484,11 +2440,9 @@ static int
|
|||
SProcSyncQueryFence(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncQueryFenceReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xSyncQueryFenceReq);
|
||||
swapl(&stuff->fid, n);
|
||||
swapl(&stuff->fid);
|
||||
|
||||
return ProcSyncQueryFence(client);
|
||||
}
|
||||
|
@ -2497,9 +2451,7 @@ static int
|
|||
SProcSyncAwaitFence(ClientPtr client)
|
||||
{
|
||||
REQUEST(xSyncAwaitFenceReq);
|
||||
char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
|
||||
SwapRestL(stuff);
|
||||
|
||||
|
|
|
@ -51,7 +51,6 @@ static int
|
|||
ProcXCMiscGetVersion(ClientPtr client)
|
||||
{
|
||||
xXCMiscGetVersionReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
|
||||
rep.type = X_Reply;
|
||||
|
@ -60,9 +59,9 @@ ProcXCMiscGetVersion(ClientPtr client)
|
|||
rep.majorVersion = XCMiscMajorVersion;
|
||||
rep.minorVersion = XCMiscMinorVersion;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swaps(&rep.majorVersion, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -72,7 +71,6 @@ static int
|
|||
ProcXCMiscGetXIDRange(ClientPtr client)
|
||||
{
|
||||
xXCMiscGetXIDRangeReply rep;
|
||||
int n;
|
||||
XID min_id, max_id;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
|
||||
|
@ -83,9 +81,9 @@ ProcXCMiscGetXIDRange(ClientPtr client)
|
|||
rep.start_id = min_id;
|
||||
rep.count = max_id - min_id + 1;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.start_id, n);
|
||||
swapl(&rep.count, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.start_id);
|
||||
swapl(&rep.count);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -96,7 +94,6 @@ ProcXCMiscGetXIDList(ClientPtr client)
|
|||
{
|
||||
REQUEST(xXCMiscGetXIDListReq);
|
||||
xXCMiscGetXIDListReply rep;
|
||||
int n;
|
||||
XID *pids;
|
||||
unsigned int count;
|
||||
|
||||
|
@ -116,9 +113,9 @@ ProcXCMiscGetXIDList(ClientPtr client)
|
|||
rep.length = count;
|
||||
rep.count = count;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.count, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.count);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *)&rep);
|
||||
if (count)
|
||||
|
@ -150,34 +147,31 @@ ProcXCMiscDispatch (ClientPtr client)
|
|||
static int
|
||||
SProcXCMiscGetVersion(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xXCMiscGetVersionReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
|
||||
swaps(&stuff->majorVersion, n);
|
||||
swaps(&stuff->minorVersion, n);
|
||||
swaps(&stuff->majorVersion);
|
||||
swaps(&stuff->minorVersion);
|
||||
return ProcXCMiscGetVersion(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXCMiscGetXIDRange(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return ProcXCMiscGetXIDRange(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXCMiscGetXIDList(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xXCMiscGetXIDListReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->count, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->count);
|
||||
return ProcXCMiscGetXIDList(client);
|
||||
}
|
||||
|
||||
|
|
|
@ -307,13 +307,13 @@ ProcXF86BigfontQueryVersion(
|
|||
; /* may add more bits here in future versions */
|
||||
if (client->swapped) {
|
||||
char tmp;
|
||||
swaps(&reply.sequenceNumber, tmp);
|
||||
swapl(&reply.length, tmp);
|
||||
swaps(&reply.majorVersion, tmp);
|
||||
swaps(&reply.minorVersion, tmp);
|
||||
swapl(&reply.uid, tmp);
|
||||
swapl(&reply.gid, tmp);
|
||||
swapl(&reply.signature, tmp);
|
||||
swaps(&reply.sequenceNumber);
|
||||
swapl(&reply.length);
|
||||
swaps(&reply.majorVersion);
|
||||
swaps(&reply.minorVersion);
|
||||
swapl(&reply.uid);
|
||||
swapl(&reply.gid);
|
||||
swapl(&reply.signature);
|
||||
}
|
||||
WriteToClient(client,
|
||||
sizeof(xXF86BigfontQueryVersionReply), (char *)&reply);
|
||||
|
@ -326,12 +326,12 @@ swapCharInfo(
|
|||
{
|
||||
char tmp;
|
||||
|
||||
swaps(&pCI->leftSideBearing, tmp);
|
||||
swaps(&pCI->rightSideBearing, tmp);
|
||||
swaps(&pCI->characterWidth, tmp);
|
||||
swaps(&pCI->ascent, tmp);
|
||||
swaps(&pCI->descent, tmp);
|
||||
swaps(&pCI->attributes, tmp);
|
||||
swaps(&pCI->leftSideBearing);
|
||||
swaps(&pCI->rightSideBearing);
|
||||
swaps(&pCI->characterWidth);
|
||||
swaps(&pCI->ascent);
|
||||
swaps(&pCI->descent);
|
||||
swaps(&pCI->attributes);
|
||||
}
|
||||
|
||||
/* static CARD32 hashCI (xCharInfo *p); */
|
||||
|
@ -587,20 +587,20 @@ ProcXF86BigfontQueryFont(
|
|||
reply->shmsegoffset = 0;
|
||||
if (client->swapped) {
|
||||
char tmp;
|
||||
swaps(&reply->sequenceNumber, tmp);
|
||||
swapl(&reply->length, tmp);
|
||||
swaps(&reply->sequenceNumber);
|
||||
swapl(&reply->length);
|
||||
swapCharInfo(&reply->minBounds);
|
||||
swapCharInfo(&reply->maxBounds);
|
||||
swaps(&reply->minCharOrByte2, tmp);
|
||||
swaps(&reply->maxCharOrByte2, tmp);
|
||||
swaps(&reply->defaultChar, tmp);
|
||||
swaps(&reply->nFontProps, tmp);
|
||||
swaps(&reply->fontAscent, tmp);
|
||||
swaps(&reply->fontDescent, tmp);
|
||||
swapl(&reply->nCharInfos, tmp);
|
||||
swapl(&reply->nUniqCharInfos, tmp);
|
||||
swapl(&reply->shmid, tmp);
|
||||
swapl(&reply->shmsegoffset, tmp);
|
||||
swaps(&reply->minCharOrByte2);
|
||||
swaps(&reply->maxCharOrByte2);
|
||||
swaps(&reply->defaultChar);
|
||||
swaps(&reply->nFontProps);
|
||||
swaps(&reply->fontAscent);
|
||||
swaps(&reply->fontDescent);
|
||||
swapl(&reply->nCharInfos);
|
||||
swapl(&reply->nUniqCharInfos);
|
||||
swapl(&reply->shmid);
|
||||
swapl(&reply->shmsegoffset);
|
||||
}
|
||||
p = (char*) &reply[1];
|
||||
{
|
||||
|
@ -614,8 +614,8 @@ ProcXF86BigfontQueryFont(
|
|||
prFP->value = pFP->value;
|
||||
if (client->swapped) {
|
||||
char tmp;
|
||||
swapl(&prFP->name, tmp);
|
||||
swapl(&prFP->value, tmp);
|
||||
swapl(&prFP->name);
|
||||
swapl(&prFP->value);
|
||||
}
|
||||
}
|
||||
p = (char*) prFP;
|
||||
|
@ -635,7 +635,7 @@ ProcXF86BigfontQueryFont(
|
|||
*ps = pIndex2UniqIndex[j];
|
||||
if (client->swapped) {
|
||||
char tmp;
|
||||
swaps(ps, tmp);
|
||||
swaps(ps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -672,7 +672,7 @@ SProcXF86BigfontQueryVersion(
|
|||
REQUEST(xXF86BigfontQueryVersionReq);
|
||||
char tmp;
|
||||
|
||||
swaps(&stuff->length, tmp);
|
||||
swaps(&stuff->length);
|
||||
return ProcXF86BigfontQueryVersion(client);
|
||||
}
|
||||
|
||||
|
@ -683,9 +683,9 @@ SProcXF86BigfontQueryFont(
|
|||
REQUEST(xXF86BigfontQueryFontReq);
|
||||
char tmp;
|
||||
|
||||
swaps(&stuff->length, tmp);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
|
||||
swapl(&stuff->id, tmp);
|
||||
swapl(&stuff->id);
|
||||
return ProcXF86BigfontQueryFont(client);
|
||||
}
|
||||
|
||||
|
|
60
Xext/xres.c
60
Xext/xres.c
|
@ -43,11 +43,10 @@ ProcXResQueryVersion (ClientPtr client)
|
|||
rep.server_major = SERVER_XRES_MAJOR_VERSION;
|
||||
rep.server_minor = SERVER_XRES_MINOR_VERSION;
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.server_major, n);
|
||||
swaps(&rep.server_minor, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.server_major);
|
||||
swaps(&rep.server_minor);
|
||||
}
|
||||
WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -78,10 +77,9 @@ ProcXResQueryClients (ClientPtr client)
|
|||
rep.num_clients = num_clients;
|
||||
rep.length = bytes_to_int32(rep.num_clients * sz_xXResClient);
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.num_clients, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.num_clients);
|
||||
}
|
||||
WriteToClient (client, sizeof (xXResQueryClientsReply), (char *) &rep);
|
||||
|
||||
|
@ -93,9 +91,8 @@ ProcXResQueryClients (ClientPtr client)
|
|||
scratch.resource_mask = RESOURCE_ID_MASK;
|
||||
|
||||
if(client->swapped) {
|
||||
int n;
|
||||
swapl (&scratch.resource_base, n);
|
||||
swapl (&scratch.resource_mask, n);
|
||||
swapl(&scratch.resource_base);
|
||||
swapl(&scratch.resource_mask);
|
||||
}
|
||||
WriteToClient (client, sz_xXResClient, (char *) &scratch);
|
||||
}
|
||||
|
@ -147,10 +144,9 @@ ProcXResQueryClientResources (ClientPtr client)
|
|||
rep.num_types = num_types;
|
||||
rep.length = bytes_to_int32(rep.num_types * sz_xXResType);
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.num_types, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.num_types);
|
||||
}
|
||||
|
||||
WriteToClient (client,sizeof(xXResQueryClientResourcesReply),(char*)&rep);
|
||||
|
@ -174,9 +170,8 @@ ProcXResQueryClientResources (ClientPtr client)
|
|||
scratch.count = counts[i];
|
||||
|
||||
if(client->swapped) {
|
||||
int n;
|
||||
swapl (&scratch.resource_type, n);
|
||||
swapl (&scratch.count, n);
|
||||
swapl(&scratch.resource_type);
|
||||
swapl(&scratch.count);
|
||||
}
|
||||
WriteToClient (client, sz_xXResType, (char *) &scratch);
|
||||
}
|
||||
|
@ -287,11 +282,10 @@ ProcXResQueryClientPixmapBytes (ClientPtr client)
|
|||
rep.bytes_overflow = 0;
|
||||
#endif
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.bytes, n);
|
||||
swapl (&rep.bytes_overflow, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.bytes);
|
||||
swapl(&rep.bytes_overflow);
|
||||
}
|
||||
WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep);
|
||||
|
||||
|
@ -321,11 +315,9 @@ static int
|
|||
SProcXResQueryVersion (ClientPtr client)
|
||||
{
|
||||
REQUEST(xXResQueryVersionReq);
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH (xXResQueryVersionReq);
|
||||
swaps(&stuff->client_major,n);
|
||||
swaps(&stuff->client_minor,n);
|
||||
swaps(&stuff->client_major);
|
||||
swaps(&stuff->client_minor);
|
||||
return ProcXResQueryVersion(client);
|
||||
}
|
||||
|
||||
|
@ -333,10 +325,8 @@ static int
|
|||
SProcXResQueryClientResources (ClientPtr client)
|
||||
{
|
||||
REQUEST(xXResQueryClientResourcesReq);
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq);
|
||||
swaps(&stuff->xid,n);
|
||||
swaps(&stuff->xid);
|
||||
return ProcXResQueryClientResources(client);
|
||||
}
|
||||
|
||||
|
@ -344,10 +334,8 @@ static int
|
|||
SProcXResQueryClientPixmapBytes (ClientPtr client)
|
||||
{
|
||||
REQUEST(xXResQueryClientPixmapBytesReq);
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq);
|
||||
swaps(&stuff->xid,n);
|
||||
swaps(&stuff->xid);
|
||||
return ProcXResQueryClientPixmapBytes(client);
|
||||
}
|
||||
|
||||
|
@ -355,9 +343,7 @@ static int
|
|||
SProcResDispatch (ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
int n;
|
||||
|
||||
swaps(&stuff->length,n);
|
||||
swaps(&stuff->length);
|
||||
|
||||
switch (stuff->data) {
|
||||
case X_XResQueryVersion:
|
||||
|
|
|
@ -71,11 +71,10 @@ ProcSELinuxQueryVersion(ClientPtr client)
|
|||
rep.server_major = SELINUX_MAJOR_VERSION;
|
||||
rep.server_minor = SELINUX_MINOR_VERSION;
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.server_major, n);
|
||||
swaps(&rep.server_minor, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.server_major);
|
||||
swaps(&rep.server_minor);
|
||||
}
|
||||
WriteToClient(client, sizeof(rep), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -100,10 +99,9 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
|
|||
rep.context_len = len;
|
||||
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.context_len, n);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.context_len);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(SELinuxGetContextReply), (char *)&rep);
|
||||
|
@ -353,17 +351,17 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items,
|
|||
for (k = 0; k < count; k++) {
|
||||
buf[pos] = items[k].id;
|
||||
if (client->swapped)
|
||||
swapl(buf + pos, n);
|
||||
swapl(buf + pos);
|
||||
pos++;
|
||||
|
||||
buf[pos] = items[k].octx_len * 4;
|
||||
if (client->swapped)
|
||||
swapl(buf + pos, n);
|
||||
swapl(buf + pos);
|
||||
pos++;
|
||||
|
||||
buf[pos] = items[k].dctx_len * 4;
|
||||
if (client->swapped)
|
||||
swapl(buf + pos, n);
|
||||
swapl(buf + pos);
|
||||
pos++;
|
||||
|
||||
memcpy((char *)(buf + pos), items[k].octx, strlen(items[k].octx) + 1);
|
||||
|
@ -379,9 +377,9 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items,
|
|||
rep.count = count;
|
||||
|
||||
if (client->swapped) {
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.count, n);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.count);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(SELinuxListItemsReply), (char *)&rep);
|
||||
|
@ -529,11 +527,10 @@ static int
|
|||
SProcSELinuxQueryVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(SELinuxQueryVersionReq);
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(SELinuxQueryVersionReq);
|
||||
swaps(&stuff->client_major, n);
|
||||
swaps(&stuff->client_minor, n);
|
||||
swaps(&stuff->client_major);
|
||||
swaps(&stuff->client_minor);
|
||||
return ProcSELinuxQueryVersion(client);
|
||||
}
|
||||
|
||||
|
@ -541,10 +538,9 @@ static int
|
|||
SProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
|
||||
{
|
||||
REQUEST(SELinuxSetCreateContextReq);
|
||||
int n;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(SELinuxSetCreateContextReq);
|
||||
swapl(&stuff->context_len, n);
|
||||
swapl(&stuff->context_len);
|
||||
return ProcSELinuxSetCreateContext(client, offset);
|
||||
}
|
||||
|
||||
|
@ -552,11 +548,10 @@ static int
|
|||
SProcSELinuxSetDeviceContext(ClientPtr client)
|
||||
{
|
||||
REQUEST(SELinuxSetContextReq);
|
||||
int n;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(SELinuxSetContextReq);
|
||||
swapl(&stuff->id, n);
|
||||
swapl(&stuff->context_len, n);
|
||||
swapl(&stuff->id);
|
||||
swapl(&stuff->context_len);
|
||||
return ProcSELinuxSetDeviceContext(client);
|
||||
}
|
||||
|
||||
|
@ -564,10 +559,9 @@ static int
|
|||
SProcSELinuxGetDeviceContext(ClientPtr client)
|
||||
{
|
||||
REQUEST(SELinuxGetContextReq);
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
||||
swapl(&stuff->id, n);
|
||||
swapl(&stuff->id);
|
||||
return ProcSELinuxGetDeviceContext(client);
|
||||
}
|
||||
|
||||
|
@ -575,10 +569,9 @@ static int
|
|||
SProcSELinuxGetDrawableContext(ClientPtr client)
|
||||
{
|
||||
REQUEST(SELinuxGetContextReq);
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
||||
swapl(&stuff->id, n);
|
||||
swapl(&stuff->id);
|
||||
return ProcSELinuxGetDrawableContext(client);
|
||||
}
|
||||
|
||||
|
@ -586,11 +579,10 @@ static int
|
|||
SProcSELinuxGetPropertyContext(ClientPtr client, pointer privKey)
|
||||
{
|
||||
REQUEST(SELinuxGetPropertyContextReq);
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(SELinuxGetPropertyContextReq);
|
||||
swapl(&stuff->window, n);
|
||||
swapl(&stuff->property, n);
|
||||
swapl(&stuff->window);
|
||||
swapl(&stuff->property);
|
||||
return ProcSELinuxGetPropertyContext(client, privKey);
|
||||
}
|
||||
|
||||
|
@ -598,10 +590,9 @@ static int
|
|||
SProcSELinuxGetSelectionContext(ClientPtr client, pointer privKey)
|
||||
{
|
||||
REQUEST(SELinuxGetContextReq);
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
||||
swapl(&stuff->id, n);
|
||||
swapl(&stuff->id);
|
||||
return ProcSELinuxGetSelectionContext(client, privKey);
|
||||
}
|
||||
|
||||
|
@ -609,10 +600,9 @@ static int
|
|||
SProcSELinuxListProperties(ClientPtr client)
|
||||
{
|
||||
REQUEST(SELinuxGetContextReq);
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
||||
swapl(&stuff->id, n);
|
||||
swapl(&stuff->id);
|
||||
return ProcSELinuxListProperties(client);
|
||||
}
|
||||
|
||||
|
@ -620,10 +610,9 @@ static int
|
|||
SProcSELinuxGetClientContext(ClientPtr client)
|
||||
{
|
||||
REQUEST(SELinuxGetContextReq);
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
||||
swapl(&stuff->id, n);
|
||||
swapl(&stuff->id);
|
||||
return ProcSELinuxGetClientContext(client);
|
||||
}
|
||||
|
||||
|
@ -631,9 +620,8 @@ static int
|
|||
SProcSELinuxDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
int n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
|
||||
switch (stuff->data) {
|
||||
case X_SELinuxQueryVersion:
|
||||
|
|
30
Xext/xtest.c
30
Xext/xtest.c
|
@ -91,7 +91,6 @@ static int
|
|||
ProcXTestGetVersion(ClientPtr client)
|
||||
{
|
||||
xXTestGetVersionReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
|
||||
rep.type = X_Reply;
|
||||
|
@ -100,8 +99,8 @@ ProcXTestGetVersion(ClientPtr client)
|
|||
rep.majorVersion = XTestMajorVersion;
|
||||
rep.minorVersion = XTestMinorVersion;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swaps(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXTestGetVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -114,7 +113,7 @@ ProcXTestCompareCursor(ClientPtr client)
|
|||
xXTestCompareCursorReply rep;
|
||||
WindowPtr pWin;
|
||||
CursorPtr pCursor;
|
||||
int n, rc;
|
||||
int rc;
|
||||
DeviceIntPtr ptr = PickPointer(client);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
|
||||
|
@ -139,7 +138,7 @@ ProcXTestCompareCursor(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.same = (wCursor(pWin) == pCursor);
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -348,7 +347,7 @@ ProcXTestFakeInput(ClientPtr client)
|
|||
if (client->swapped)
|
||||
{
|
||||
(void) XTestSwapFakeInput(client, (xReq *)stuff);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
}
|
||||
ResetCurrentRequest (client);
|
||||
client->sequence--;
|
||||
|
@ -476,25 +475,23 @@ ProcXTestDispatch (ClientPtr client)
|
|||
static int
|
||||
SProcXTestGetVersion(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xXTestGetVersionReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
|
||||
swaps(&stuff->minorVersion, n);
|
||||
swaps(&stuff->minorVersion);
|
||||
return ProcXTestGetVersion(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXTestCompareCursor(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xXTestCompareCursorReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
|
||||
swapl(&stuff->window, n);
|
||||
swapl(&stuff->cursor, n);
|
||||
swapl(&stuff->window);
|
||||
swapl(&stuff->cursor);
|
||||
return ProcXTestCompareCursor(client);
|
||||
}
|
||||
|
||||
|
@ -525,10 +522,10 @@ XTestSwapFakeInput(ClientPtr client, xReq *req)
|
|||
static int
|
||||
SProcXTestFakeInput(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
int n;
|
||||
REQUEST(xReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
n = XTestSwapFakeInput(client, stuff);
|
||||
if (n != Success)
|
||||
return n;
|
||||
|
@ -538,10 +535,9 @@ SProcXTestFakeInput(ClientPtr client)
|
|||
static int
|
||||
SProcXTestGrabControl(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xXTestGrabControlReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXTestGrabControlReq);
|
||||
return ProcXTestGrabControl(client);
|
||||
}
|
||||
|
|
407
Xext/xvdisp.c
407
Xext/xvdisp.c
|
@ -59,12 +59,10 @@ SWriteQueryExtensionReply(
|
|||
ClientPtr client,
|
||||
xvQueryExtensionReply *rep
|
||||
){
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->version, n);
|
||||
swaps(&rep->revision, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->version);
|
||||
swaps(&rep->revision);
|
||||
|
||||
(void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)rep);
|
||||
|
||||
|
@ -76,11 +74,9 @@ SWriteQueryAdaptorsReply(
|
|||
ClientPtr client,
|
||||
xvQueryAdaptorsReply *rep
|
||||
){
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_adaptors, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->num_adaptors);
|
||||
|
||||
(void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)rep);
|
||||
|
||||
|
@ -92,11 +88,9 @@ SWriteQueryEncodingsReply(
|
|||
ClientPtr client,
|
||||
xvQueryEncodingsReply *rep
|
||||
){
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_encodings, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->num_encodings);
|
||||
|
||||
(void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)rep);
|
||||
|
||||
|
@ -108,12 +102,10 @@ SWriteAdaptorInfo(
|
|||
ClientPtr client,
|
||||
xvAdaptorInfo *pAdaptor
|
||||
){
|
||||
char n;
|
||||
|
||||
swapl(&pAdaptor->base_id, n);
|
||||
swaps(&pAdaptor->name_size, n);
|
||||
swaps(&pAdaptor->num_ports, n);
|
||||
swaps(&pAdaptor->num_formats, n);
|
||||
swapl(&pAdaptor->base_id);
|
||||
swaps(&pAdaptor->name_size);
|
||||
swaps(&pAdaptor->num_ports);
|
||||
swaps(&pAdaptor->num_formats);
|
||||
|
||||
(void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor);
|
||||
|
||||
|
@ -125,14 +117,13 @@ SWriteEncodingInfo(
|
|||
ClientPtr client,
|
||||
xvEncodingInfo *pEncoding
|
||||
){
|
||||
char n;
|
||||
|
||||
swapl(&pEncoding->encoding, n);
|
||||
swaps(&pEncoding->name_size, n);
|
||||
swaps(&pEncoding->width, n);
|
||||
swaps(&pEncoding->height, n);
|
||||
swapl(&pEncoding->rate.numerator, n);
|
||||
swapl(&pEncoding->rate.denominator, n);
|
||||
swapl(&pEncoding->encoding);
|
||||
swaps(&pEncoding->name_size);
|
||||
swaps(&pEncoding->width);
|
||||
swaps(&pEncoding->height);
|
||||
swapl(&pEncoding->rate.numerator);
|
||||
swapl(&pEncoding->rate.denominator);
|
||||
(void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding);
|
||||
|
||||
return Success;
|
||||
|
@ -143,9 +134,7 @@ SWriteFormat(
|
|||
ClientPtr client,
|
||||
xvFormat *pFormat
|
||||
){
|
||||
char n;
|
||||
|
||||
swapl(&pFormat->visual, n);
|
||||
swapl(&pFormat->visual);
|
||||
(void)WriteToClient(client, sz_xvFormat, (char *)pFormat);
|
||||
|
||||
return Success;
|
||||
|
@ -156,12 +145,10 @@ SWriteAttributeInfo(
|
|||
ClientPtr client,
|
||||
xvAttributeInfo *pAtt
|
||||
){
|
||||
char n;
|
||||
|
||||
swapl(&pAtt->flags, n);
|
||||
swapl(&pAtt->size, n);
|
||||
swapl(&pAtt->min, n);
|
||||
swapl(&pAtt->max, n);
|
||||
swapl(&pAtt->flags);
|
||||
swapl(&pAtt->size);
|
||||
swapl(&pAtt->min);
|
||||
swapl(&pAtt->max);
|
||||
(void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt);
|
||||
|
||||
return Success;
|
||||
|
@ -172,21 +159,19 @@ SWriteImageFormatInfo(
|
|||
ClientPtr client,
|
||||
xvImageFormatInfo *pImage
|
||||
){
|
||||
char n;
|
||||
|
||||
swapl(&pImage->id, n);
|
||||
swapl(&pImage->red_mask, n);
|
||||
swapl(&pImage->green_mask, n);
|
||||
swapl(&pImage->blue_mask, n);
|
||||
swapl(&pImage->y_sample_bits, n);
|
||||
swapl(&pImage->u_sample_bits, n);
|
||||
swapl(&pImage->v_sample_bits, n);
|
||||
swapl(&pImage->horz_y_period, n);
|
||||
swapl(&pImage->horz_u_period, n);
|
||||
swapl(&pImage->horz_v_period, n);
|
||||
swapl(&pImage->vert_y_period, n);
|
||||
swapl(&pImage->vert_u_period, n);
|
||||
swapl(&pImage->vert_v_period, n);
|
||||
swapl(&pImage->id);
|
||||
swapl(&pImage->red_mask);
|
||||
swapl(&pImage->green_mask);
|
||||
swapl(&pImage->blue_mask);
|
||||
swapl(&pImage->y_sample_bits);
|
||||
swapl(&pImage->u_sample_bits);
|
||||
swapl(&pImage->v_sample_bits);
|
||||
swapl(&pImage->horz_y_period);
|
||||
swapl(&pImage->horz_u_period);
|
||||
swapl(&pImage->horz_v_period);
|
||||
swapl(&pImage->vert_y_period);
|
||||
swapl(&pImage->vert_u_period);
|
||||
swapl(&pImage->vert_v_period);
|
||||
|
||||
(void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage);
|
||||
|
||||
|
@ -198,10 +183,8 @@ SWriteGrabPortReply(
|
|||
ClientPtr client,
|
||||
xvGrabPortReply *rep
|
||||
){
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
|
||||
(void)WriteToClient(client, sz_xvGrabPortReply, (char *)rep);
|
||||
|
||||
|
@ -213,11 +196,9 @@ SWriteGetPortAttributeReply(
|
|||
ClientPtr client,
|
||||
xvGetPortAttributeReply *rep
|
||||
){
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swapl(&rep->value, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swapl(&rep->value);
|
||||
|
||||
(void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)rep);
|
||||
|
||||
|
@ -229,12 +210,10 @@ SWriteQueryBestSizeReply(
|
|||
ClientPtr client,
|
||||
xvQueryBestSizeReply *rep
|
||||
){
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->actual_width, n);
|
||||
swaps(&rep->actual_height, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->actual_width);
|
||||
swaps(&rep->actual_height);
|
||||
|
||||
(void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)rep);
|
||||
|
||||
|
@ -246,12 +225,10 @@ SWriteQueryPortAttributesReply(
|
|||
ClientPtr client,
|
||||
xvQueryPortAttributesReply *rep
|
||||
){
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swapl(&rep->num_attributes, n);
|
||||
swapl(&rep->text_size, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swapl(&rep->num_attributes);
|
||||
swapl(&rep->text_size);
|
||||
|
||||
(void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)rep);
|
||||
|
||||
|
@ -263,14 +240,12 @@ SWriteQueryImageAttributesReply(
|
|||
ClientPtr client,
|
||||
xvQueryImageAttributesReply *rep
|
||||
){
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swapl(&rep->num_planes, n);
|
||||
swapl(&rep->data_size, n);
|
||||
swaps(&rep->width, n);
|
||||
swaps(&rep->height, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swapl(&rep->num_planes);
|
||||
swapl(&rep->data_size);
|
||||
swaps(&rep->width);
|
||||
swaps(&rep->height);
|
||||
|
||||
(void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)rep);
|
||||
|
||||
|
@ -282,11 +257,9 @@ SWriteListImageFormatsReply(
|
|||
ClientPtr client,
|
||||
xvListImageFormatsReply *rep
|
||||
){
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swapl(&rep->num_formats, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swapl(&rep->num_formats);
|
||||
|
||||
(void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)rep);
|
||||
|
||||
|
@ -1278,154 +1251,144 @@ ProcXvDispatch(ClientPtr client)
|
|||
static int
|
||||
SProcXvQueryExtension(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvQueryExtensionReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return XvProcVector[xv_QueryExtension](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvQueryAdaptors(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvQueryAdaptorsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->window);
|
||||
return XvProcVector[xv_QueryAdaptors](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvQueryEncodings(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvQueryEncodingsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
return XvProcVector[xv_QueryEncodings](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvGrabPort(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvGrabPortReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->time, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->time);
|
||||
return XvProcVector[xv_GrabPort](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvUngrabPort(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvUngrabPortReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->time, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->time);
|
||||
return XvProcVector[xv_UngrabPort](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvPutVideo(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvPutVideoReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->drawable, n);
|
||||
swapl(&stuff->gc, n);
|
||||
swaps(&stuff->vid_x, n);
|
||||
swaps(&stuff->vid_y, n);
|
||||
swaps(&stuff->vid_w, n);
|
||||
swaps(&stuff->vid_h, n);
|
||||
swaps(&stuff->drw_x, n);
|
||||
swaps(&stuff->drw_y, n);
|
||||
swaps(&stuff->drw_w, n);
|
||||
swaps(&stuff->drw_h, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
swaps(&stuff->vid_x);
|
||||
swaps(&stuff->vid_y);
|
||||
swaps(&stuff->vid_w);
|
||||
swaps(&stuff->vid_h);
|
||||
swaps(&stuff->drw_x);
|
||||
swaps(&stuff->drw_y);
|
||||
swaps(&stuff->drw_w);
|
||||
swaps(&stuff->drw_h);
|
||||
return XvProcVector[xv_PutVideo](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvPutStill(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvPutStillReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->drawable, n);
|
||||
swapl(&stuff->gc, n);
|
||||
swaps(&stuff->vid_x, n);
|
||||
swaps(&stuff->vid_y, n);
|
||||
swaps(&stuff->vid_w, n);
|
||||
swaps(&stuff->vid_h, n);
|
||||
swaps(&stuff->drw_x, n);
|
||||
swaps(&stuff->drw_y, n);
|
||||
swaps(&stuff->drw_w, n);
|
||||
swaps(&stuff->drw_h, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
swaps(&stuff->vid_x);
|
||||
swaps(&stuff->vid_y);
|
||||
swaps(&stuff->vid_w);
|
||||
swaps(&stuff->vid_h);
|
||||
swaps(&stuff->drw_x);
|
||||
swaps(&stuff->drw_y);
|
||||
swaps(&stuff->drw_w);
|
||||
swaps(&stuff->drw_h);
|
||||
return XvProcVector[xv_PutStill](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvGetVideo(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvGetVideoReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->drawable, n);
|
||||
swapl(&stuff->gc, n);
|
||||
swaps(&stuff->vid_x, n);
|
||||
swaps(&stuff->vid_y, n);
|
||||
swaps(&stuff->vid_w, n);
|
||||
swaps(&stuff->vid_h, n);
|
||||
swaps(&stuff->drw_x, n);
|
||||
swaps(&stuff->drw_y, n);
|
||||
swaps(&stuff->drw_w, n);
|
||||
swaps(&stuff->drw_h, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
swaps(&stuff->vid_x);
|
||||
swaps(&stuff->vid_y);
|
||||
swaps(&stuff->vid_w);
|
||||
swaps(&stuff->vid_h);
|
||||
swaps(&stuff->drw_x);
|
||||
swaps(&stuff->drw_y);
|
||||
swaps(&stuff->drw_w);
|
||||
swaps(&stuff->drw_h);
|
||||
return XvProcVector[xv_GetVideo](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvGetStill(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvGetStillReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->drawable, n);
|
||||
swapl(&stuff->gc, n);
|
||||
swaps(&stuff->vid_x, n);
|
||||
swaps(&stuff->vid_y, n);
|
||||
swaps(&stuff->vid_w, n);
|
||||
swaps(&stuff->vid_h, n);
|
||||
swaps(&stuff->drw_x, n);
|
||||
swaps(&stuff->drw_y, n);
|
||||
swaps(&stuff->drw_w, n);
|
||||
swaps(&stuff->drw_h, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
swaps(&stuff->vid_x);
|
||||
swaps(&stuff->vid_y);
|
||||
swaps(&stuff->vid_w);
|
||||
swaps(&stuff->vid_h);
|
||||
swaps(&stuff->drw_x);
|
||||
swaps(&stuff->drw_y);
|
||||
swaps(&stuff->drw_w);
|
||||
swaps(&stuff->drw_h);
|
||||
return XvProcVector[xv_GetStill](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvPutImage(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvPutImageReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->drawable, n);
|
||||
swapl(&stuff->gc, n);
|
||||
swapl(&stuff->id, n);
|
||||
swaps(&stuff->src_x, n);
|
||||
swaps(&stuff->src_y, n);
|
||||
swaps(&stuff->src_w, n);
|
||||
swaps(&stuff->src_h, n);
|
||||
swaps(&stuff->drw_x, n);
|
||||
swaps(&stuff->drw_y, n);
|
||||
swaps(&stuff->drw_w, n);
|
||||
swaps(&stuff->drw_h, n);
|
||||
swaps(&stuff->width, n);
|
||||
swaps(&stuff->height, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
swapl(&stuff->id);
|
||||
swaps(&stuff->src_x);
|
||||
swaps(&stuff->src_y);
|
||||
swaps(&stuff->src_w);
|
||||
swaps(&stuff->src_h);
|
||||
swaps(&stuff->drw_x);
|
||||
swaps(&stuff->drw_y);
|
||||
swaps(&stuff->drw_w);
|
||||
swaps(&stuff->drw_h);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
return XvProcVector[xv_PutImage](client);
|
||||
}
|
||||
|
||||
|
@ -1433,25 +1396,24 @@ SProcXvPutImage(ClientPtr client)
|
|||
static int
|
||||
SProcXvShmPutImage(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvShmPutImageReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->drawable, n);
|
||||
swapl(&stuff->gc, n);
|
||||
swapl(&stuff->shmseg, n);
|
||||
swapl(&stuff->id, n);
|
||||
swapl(&stuff->offset, n);
|
||||
swaps(&stuff->src_x, n);
|
||||
swaps(&stuff->src_y, n);
|
||||
swaps(&stuff->src_w, n);
|
||||
swaps(&stuff->src_h, n);
|
||||
swaps(&stuff->drw_x, n);
|
||||
swaps(&stuff->drw_y, n);
|
||||
swaps(&stuff->drw_w, n);
|
||||
swaps(&stuff->drw_h, n);
|
||||
swaps(&stuff->width, n);
|
||||
swaps(&stuff->height, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->gc);
|
||||
swapl(&stuff->shmseg);
|
||||
swapl(&stuff->id);
|
||||
swapl(&stuff->offset);
|
||||
swaps(&stuff->src_x);
|
||||
swaps(&stuff->src_y);
|
||||
swaps(&stuff->src_w);
|
||||
swaps(&stuff->src_h);
|
||||
swaps(&stuff->drw_x);
|
||||
swaps(&stuff->drw_y);
|
||||
swaps(&stuff->drw_w);
|
||||
swaps(&stuff->drw_h);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
return XvProcVector[xv_ShmPutImage](client);
|
||||
}
|
||||
#else /* MITSHM */
|
||||
|
@ -1461,101 +1423,92 @@ SProcXvShmPutImage(ClientPtr client)
|
|||
static int
|
||||
SProcXvSelectVideoNotify(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvSelectVideoNotifyReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->drawable, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->drawable);
|
||||
return XvProcVector[xv_SelectVideoNotify](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvSelectPortNotify(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvSelectPortNotifyReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
return XvProcVector[xv_SelectPortNotify](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvStopVideo(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvStopVideoReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->drawable, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->drawable);
|
||||
return XvProcVector[xv_StopVideo](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvSetPortAttribute(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvSetPortAttributeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->attribute, n);
|
||||
swapl(&stuff->value, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->attribute);
|
||||
swapl(&stuff->value);
|
||||
return XvProcVector[xv_SetPortAttribute](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvGetPortAttribute(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvGetPortAttributeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->attribute, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->attribute);
|
||||
return XvProcVector[xv_GetPortAttribute](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvQueryBestSize(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvQueryBestSizeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swaps(&stuff->vid_w, n);
|
||||
swaps(&stuff->vid_h, n);
|
||||
swaps(&stuff->drw_w, n);
|
||||
swaps(&stuff->drw_h, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swaps(&stuff->vid_w);
|
||||
swaps(&stuff->vid_h);
|
||||
swaps(&stuff->drw_w);
|
||||
swaps(&stuff->drw_h);
|
||||
return XvProcVector[xv_QueryBestSize](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvQueryPortAttributes(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvQueryPortAttributesReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
return XvProcVector[xv_QueryPortAttributes](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvQueryImageAttributes(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvQueryImageAttributesReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->id, n);
|
||||
swaps(&stuff->width, n);
|
||||
swaps(&stuff->height, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
swapl(&stuff->id);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
return XvProcVector[xv_QueryImageAttributes](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXvListImageFormats(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xvListImageFormatsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->port);
|
||||
return XvProcVector[xv_ListImageFormats](client);
|
||||
}
|
||||
|
||||
|
|
|
@ -72,12 +72,10 @@ SOFTWARE.
|
|||
int
|
||||
SProcXAllowDeviceEvents(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xAllowDeviceEventsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
||||
swapl(&stuff->time, n);
|
||||
swapl(&stuff->time);
|
||||
return (ProcXAllowDeviceEvents(client));
|
||||
}
|
||||
|
||||
|
|
15
Xi/chgdctl.c
15
Xi/chgdctl.c
|
@ -74,16 +74,15 @@ SOFTWARE.
|
|||
int
|
||||
SProcXChangeDeviceControl(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
xDeviceCtl *ctl;
|
||||
|
||||
REQUEST(xChangeDeviceControlReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
||||
swaps(&stuff->control, n);
|
||||
swaps(&stuff->control);
|
||||
ctl = (xDeviceCtl*)&stuff[1];
|
||||
swaps(&ctl->control, n);
|
||||
swaps(&ctl->length, n);
|
||||
swaps(&ctl->control);
|
||||
swaps(&ctl->length);
|
||||
switch(stuff->control) {
|
||||
case DEVICE_ABS_CALIB:
|
||||
case DEVICE_ABS_AREA:
|
||||
|
@ -230,9 +229,7 @@ void
|
|||
SRepXChangeDeviceControl(ClientPtr client, int size,
|
||||
xChangeDeviceControlReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
52
Xi/chgfctl.c
52
Xi/chgfctl.c
|
@ -74,12 +74,10 @@ SOFTWARE.
|
|||
int
|
||||
SProcXChangeFeedbackControl(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xChangeFeedbackControlReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
||||
swapl(&stuff->mask, n);
|
||||
swapl(&stuff->mask);
|
||||
return (ProcXChangeFeedbackControl(client));
|
||||
}
|
||||
|
||||
|
@ -93,17 +91,16 @@ static int
|
|||
ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||
KbdFeedbackPtr k, xKbdFeedbackCtl * f)
|
||||
{
|
||||
char n;
|
||||
KeybdCtrl kctrl;
|
||||
int t;
|
||||
int key = DO_ALL;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n);
|
||||
swaps(&f->pitch, n);
|
||||
swaps(&f->duration, n);
|
||||
swapl(&f->led_mask, n);
|
||||
swapl(&f->led_values, n);
|
||||
swaps(&f->length);
|
||||
swaps(&f->pitch);
|
||||
swaps(&f->duration);
|
||||
swapl(&f->led_mask);
|
||||
swapl(&f->led_values);
|
||||
}
|
||||
|
||||
kctrl = k->ctrl;
|
||||
|
@ -210,14 +207,13 @@ static int
|
|||
ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||
PtrFeedbackPtr p, xPtrFeedbackCtl * f)
|
||||
{
|
||||
char n;
|
||||
PtrCtrl pctrl; /* might get BadValue part way through */
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n);
|
||||
swaps(&f->num, n);
|
||||
swaps(&f->denom, n);
|
||||
swaps(&f->thresh, n);
|
||||
swaps(&f->length);
|
||||
swaps(&f->num);
|
||||
swaps(&f->denom);
|
||||
swaps(&f->thresh);
|
||||
}
|
||||
|
||||
pctrl = p->ctrl;
|
||||
|
@ -276,11 +272,9 @@ ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
|
|||
long unsigned int mask, IntegerFeedbackPtr i,
|
||||
xIntegerFeedbackCtl * f)
|
||||
{
|
||||
char n;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n);
|
||||
swapl(&f->int_to_display, n);
|
||||
swaps(&f->length);
|
||||
swapl(&f->int_to_display);
|
||||
}
|
||||
|
||||
i->ctrl.integer_displayed = f->int_to_display;
|
||||
|
@ -299,13 +293,12 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
|
|||
long unsigned int mask, StringFeedbackPtr s,
|
||||
xStringFeedbackCtl * f)
|
||||
{
|
||||
char n;
|
||||
int i, j;
|
||||
KeySym *syms, *sup_syms;
|
||||
|
||||
syms = (KeySym *) (f + 1);
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n); /* swapped num_keysyms in calling proc */
|
||||
swaps(&f->length); /* swapped num_keysyms in calling proc */
|
||||
SwapLongs((CARD32 *) syms, f->num_keysyms);
|
||||
}
|
||||
|
||||
|
@ -339,14 +332,13 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
|
|||
long unsigned int mask, BellFeedbackPtr b,
|
||||
xBellFeedbackCtl * f)
|
||||
{
|
||||
char n;
|
||||
int t;
|
||||
BellCtrl bctrl; /* might get BadValue part way through */
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n);
|
||||
swaps(&f->pitch, n);
|
||||
swaps(&f->duration, n);
|
||||
swaps(&f->length);
|
||||
swaps(&f->pitch);
|
||||
swaps(&f->duration);
|
||||
}
|
||||
|
||||
bctrl = b->ctrl;
|
||||
|
@ -397,13 +389,12 @@ static int
|
|||
ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||
LedFeedbackPtr l, xLedFeedbackCtl * f)
|
||||
{
|
||||
char n;
|
||||
LedCtrl lctrl; /* might get BadValue part way through */
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n);
|
||||
swapl(&f->led_values, n);
|
||||
swapl(&f->led_mask, n);
|
||||
swaps(&f->length);
|
||||
swapl(&f->led_values);
|
||||
swapl(&f->led_mask);
|
||||
}
|
||||
|
||||
f->led_mask &= l->ctrl.led_mask; /* set only supported leds */
|
||||
|
@ -467,11 +458,10 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
|||
break;
|
||||
case StringFeedbackClass:
|
||||
{
|
||||
char n;
|
||||
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&f->num_keysyms, n);
|
||||
swaps(&f->num_keysyms);
|
||||
}
|
||||
if (len != (bytes_to_int32(sizeof(xStringFeedbackCtl)) + f->num_keysyms))
|
||||
return BadLength;
|
||||
|
|
|
@ -75,10 +75,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXChangeKeyboardDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xChangeKeyboardDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
|
||||
return (ProcXChangeKeyboardDevice(client));
|
||||
}
|
||||
|
|
|
@ -72,11 +72,10 @@ SOFTWARE.
|
|||
int
|
||||
SProcXChangeDeviceKeyMapping(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
unsigned int count;
|
||||
|
||||
REQUEST(xChangeDeviceKeyMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
||||
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
|
||||
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
|
||||
|
|
|
@ -74,13 +74,11 @@ SOFTWARE.
|
|||
int
|
||||
SProcXChangeDeviceDontPropagateList(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xChangeDeviceDontPropagateListReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->count, n);
|
||||
swapl(&stuff->window);
|
||||
swaps(&stuff->count);
|
||||
REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
|
||||
stuff->count * sizeof(CARD32));
|
||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
|
||||
|
|
|
@ -77,10 +77,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXChangePointerDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xChangePointerDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
|
||||
return (ProcXChangePointerDevice(client));
|
||||
}
|
||||
|
|
|
@ -73,10 +73,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXCloseDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xCloseDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xCloseDeviceReq);
|
||||
return (ProcXCloseDevice(client));
|
||||
}
|
||||
|
|
|
@ -71,10 +71,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXDeviceBell(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xDeviceBellReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXDeviceBell(client));
|
||||
}
|
||||
|
||||
|
|
238
Xi/extinit.c
238
Xi/extinit.c
|
@ -533,43 +533,39 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
|||
static void
|
||||
SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
|
||||
{
|
||||
char n;
|
||||
int i;
|
||||
INT32 *ip B32;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swaps(&to->device_state, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swaps(&to->device_state);
|
||||
ip = &to->valuator0;
|
||||
for (i = 0; i < 6; i++) {
|
||||
swapl((ip + i), n); /* macro - braces are required */
|
||||
swapl(ip + i);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
SEventFocus(deviceFocus * from, deviceFocus * to)
|
||||
{
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->time, n);
|
||||
swapl(&to->window, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swapl(&to->time);
|
||||
swapl(&to->window);
|
||||
}
|
||||
|
||||
static void
|
||||
SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
|
||||
{
|
||||
int i;
|
||||
char n;
|
||||
INT32 *ip B32;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->time, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swapl(&to->time);
|
||||
ip = &to->valuator0;
|
||||
for (i = 0; i < 3; i++) {
|
||||
swapl((ip + i), n); /* macro - braces are required */
|
||||
swapl(ip + i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -577,93 +573,78 @@ static void
|
|||
SDeviceKeyStateNotifyEvent(deviceKeyStateNotify * from,
|
||||
deviceKeyStateNotify * to)
|
||||
{
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
}
|
||||
|
||||
static void
|
||||
SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from,
|
||||
deviceButtonStateNotify * to)
|
||||
{
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
}
|
||||
|
||||
static void
|
||||
SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to)
|
||||
{
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->time, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swapl(&to->time);
|
||||
}
|
||||
|
||||
static void
|
||||
SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to)
|
||||
{
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->time, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swapl(&to->time);
|
||||
}
|
||||
|
||||
static void
|
||||
SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to)
|
||||
{
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber,n);
|
||||
swapl(&to->time, n);
|
||||
swaps(&to->control, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swapl(&to->time);
|
||||
swaps(&to->control);
|
||||
}
|
||||
|
||||
static void
|
||||
SDevicePropertyNotifyEvent (devicePropertyNotify *from, devicePropertyNotify *to)
|
||||
{
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber,n);
|
||||
swapl(&to->time, n);
|
||||
swapl(&to->atom, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swapl(&to->time);
|
||||
swapl(&to->atom);
|
||||
}
|
||||
|
||||
static void
|
||||
SDeviceLeaveNotifyEvent (xXILeaveEvent *from, xXILeaveEvent *to)
|
||||
{
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber,n);
|
||||
swapl(&to->length, n);
|
||||
swaps(&to->evtype, n);
|
||||
swaps(&to->deviceid, n);
|
||||
swapl(&to->time, n);
|
||||
swapl(&to->root, n);
|
||||
swapl(&to->event, n);
|
||||
swapl(&to->child, n);
|
||||
swapl(&to->root_x, n);
|
||||
swapl(&to->root_y, n);
|
||||
swapl(&to->event_x, n);
|
||||
swapl(&to->event_y, n);
|
||||
swaps(&to->sourceid, n);
|
||||
swaps(&to->buttons_len, n);
|
||||
swapl(&to->mods.base_mods, n);
|
||||
swapl(&to->mods.latched_mods, n);
|
||||
swapl(&to->mods.locked_mods, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swapl(&to->length);
|
||||
swaps(&to->evtype);
|
||||
swaps(&to->deviceid);
|
||||
swapl(&to->time);
|
||||
swapl(&to->root);
|
||||
swapl(&to->event);
|
||||
swapl(&to->child);
|
||||
swapl(&to->root_x);
|
||||
swapl(&to->root_y);
|
||||
swapl(&to->event_x);
|
||||
swapl(&to->event_y);
|
||||
swaps(&to->sourceid);
|
||||
swaps(&to->buttons_len);
|
||||
swapl(&to->mods.base_mods);
|
||||
swapl(&to->mods.latched_mods);
|
||||
swapl(&to->mods.locked_mods);
|
||||
}
|
||||
|
||||
static void
|
||||
SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to)
|
||||
{
|
||||
char n;
|
||||
int i, j;
|
||||
xXIAnyInfo *any;
|
||||
|
||||
|
@ -682,8 +663,8 @@ SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to)
|
|||
xXIKeyInfo *ki = (xXIKeyInfo*)any;
|
||||
uint32_t *key = (uint32_t*)&ki[1];
|
||||
for (j = 0; j < ki->num_keycodes; j++, key++)
|
||||
swapl(key, n);
|
||||
swaps(&ki->num_keycodes, n);
|
||||
swapl(key);
|
||||
swaps(&ki->num_keycodes);
|
||||
}
|
||||
break;
|
||||
case ButtonClass:
|
||||
|
@ -692,71 +673,70 @@ SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to)
|
|||
Atom *labels = (Atom*)((char*)bi + sizeof(xXIButtonInfo) +
|
||||
pad_to_int32(bits_to_bytes(bi->num_buttons)));
|
||||
for (j = 0; j < bi->num_buttons; j++)
|
||||
swapl(&labels[j], n);
|
||||
swaps(&bi->num_buttons, n);
|
||||
swapl(&labels[j]);
|
||||
swaps(&bi->num_buttons);
|
||||
}
|
||||
break;
|
||||
case ValuatorClass:
|
||||
{
|
||||
xXIValuatorInfo* ai = (xXIValuatorInfo*)any;
|
||||
swapl(&ai->label, n);
|
||||
swapl(&ai->min.integral, n);
|
||||
swapl(&ai->min.frac, n);
|
||||
swapl(&ai->max.integral, n);
|
||||
swapl(&ai->max.frac, n);
|
||||
swapl(&ai->resolution, n);
|
||||
swaps(&ai->number, n);
|
||||
swapl(&ai->label);
|
||||
swapl(&ai->min.integral);
|
||||
swapl(&ai->min.frac);
|
||||
swapl(&ai->max.integral);
|
||||
swapl(&ai->max.frac);
|
||||
swapl(&ai->resolution);
|
||||
swaps(&ai->number);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
swaps(&any->type, n);
|
||||
swaps(&any->length, n);
|
||||
swaps(&any->sourceid, n);
|
||||
swaps(&any->type);
|
||||
swaps(&any->length);
|
||||
swaps(&any->sourceid);
|
||||
|
||||
any = (xXIAnyInfo*)((char*)any + length * 4);
|
||||
}
|
||||
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->length, n);
|
||||
swaps(&to->evtype, n);
|
||||
swaps(&to->deviceid, n);
|
||||
swapl(&to->time, n);
|
||||
swaps(&to->num_classes, n);
|
||||
swaps(&to->sourceid, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swapl(&to->length);
|
||||
swaps(&to->evtype);
|
||||
swaps(&to->deviceid);
|
||||
swapl(&to->time);
|
||||
swaps(&to->num_classes);
|
||||
swaps(&to->sourceid);
|
||||
|
||||
}
|
||||
|
||||
static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to)
|
||||
{
|
||||
int i;
|
||||
char n;
|
||||
char *ptr;
|
||||
char *vmask;
|
||||
|
||||
memcpy(to, from, sizeof(xEvent) + from->length * 4);
|
||||
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->length, n);
|
||||
swaps(&to->evtype, n);
|
||||
swaps(&to->deviceid, n);
|
||||
swapl(&to->time, n);
|
||||
swapl(&to->detail, n);
|
||||
swapl(&to->root, n);
|
||||
swapl(&to->event, n);
|
||||
swapl(&to->child, n);
|
||||
swapl(&to->root_x, n);
|
||||
swapl(&to->root_y, n);
|
||||
swapl(&to->event_x, n);
|
||||
swapl(&to->event_y, n);
|
||||
swaps(&to->buttons_len, n);
|
||||
swaps(&to->valuators_len, n);
|
||||
swaps(&to->sourceid, n);
|
||||
swapl(&to->mods.base_mods, n);
|
||||
swapl(&to->mods.latched_mods, n);
|
||||
swapl(&to->mods.locked_mods, n);
|
||||
swapl(&to->mods.effective_mods, n);
|
||||
swapl(&to->flags, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swapl(&to->length);
|
||||
swaps(&to->evtype);
|
||||
swaps(&to->deviceid);
|
||||
swapl(&to->time);
|
||||
swapl(&to->detail);
|
||||
swapl(&to->root);
|
||||
swapl(&to->event);
|
||||
swapl(&to->child);
|
||||
swapl(&to->root_x);
|
||||
swapl(&to->root_y);
|
||||
swapl(&to->event_x);
|
||||
swapl(&to->event_y);
|
||||
swaps(&to->buttons_len);
|
||||
swaps(&to->valuators_len);
|
||||
swaps(&to->sourceid);
|
||||
swapl(&to->mods.base_mods);
|
||||
swapl(&to->mods.latched_mods);
|
||||
swapl(&to->mods.locked_mods);
|
||||
swapl(&to->mods.effective_mods);
|
||||
swapl(&to->flags);
|
||||
|
||||
ptr = (char*)(&to[1]);
|
||||
ptr += from->buttons_len * 4;
|
||||
|
@ -766,9 +746,9 @@ static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to)
|
|||
{
|
||||
if (BitIsOn(vmask, i))
|
||||
{
|
||||
swapl(((uint32_t*)ptr), n);
|
||||
swapl(((uint32_t *)ptr));
|
||||
ptr += 4;
|
||||
swapl(((uint32_t*)ptr), n);
|
||||
swapl(((uint32_t *)ptr));
|
||||
ptr += 4;
|
||||
}
|
||||
}
|
||||
|
@ -778,55 +758,51 @@ static void SDeviceHierarchyEvent(xXIHierarchyEvent *from,
|
|||
xXIHierarchyEvent *to)
|
||||
{
|
||||
int i;
|
||||
char n;
|
||||
xXIHierarchyInfo *info;
|
||||
|
||||
*to = *from;
|
||||
memcpy(&to[1], &from[1], from->length * 4);
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->length, n);
|
||||
swaps(&to->evtype, n);
|
||||
swaps(&to->deviceid, n);
|
||||
swapl(&to->time, n);
|
||||
swapl(&to->flags, n);
|
||||
swaps(&to->num_info, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swapl(&to->length);
|
||||
swaps(&to->evtype);
|
||||
swaps(&to->deviceid);
|
||||
swapl(&to->time);
|
||||
swapl(&to->flags);
|
||||
swaps(&to->num_info);
|
||||
|
||||
info = (xXIHierarchyInfo*)&to[1];
|
||||
for (i = 0; i< from->num_info; i++)
|
||||
{
|
||||
swaps(&info->deviceid, n);
|
||||
swaps(&info->attachment, n);
|
||||
swaps(&info->deviceid);
|
||||
swaps(&info->attachment);
|
||||
info++;
|
||||
}
|
||||
}
|
||||
|
||||
static void SXIPropertyEvent(xXIPropertyEvent *from, xXIPropertyEvent *to)
|
||||
{
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->length, n);
|
||||
swaps(&to->evtype, n);
|
||||
swaps(&to->deviceid, n);
|
||||
swapl(&to->property, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swapl(&to->length);
|
||||
swaps(&to->evtype);
|
||||
swaps(&to->deviceid);
|
||||
swapl(&to->property);
|
||||
}
|
||||
|
||||
static void SRawEvent(xXIRawEvent *from, xXIRawEvent *to)
|
||||
{
|
||||
char n;
|
||||
int i;
|
||||
FP3232 *values;
|
||||
unsigned char *mask;
|
||||
|
||||
memcpy(to, from, sizeof(xEvent) + from->length * 4);
|
||||
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->length, n);
|
||||
swaps(&to->evtype, n);
|
||||
swaps(&to->deviceid, n);
|
||||
swapl(&to->time, n);
|
||||
swapl(&to->detail, n);
|
||||
swaps(&to->sequenceNumber);
|
||||
swapl(&to->length);
|
||||
swaps(&to->evtype);
|
||||
swaps(&to->deviceid);
|
||||
swapl(&to->time);
|
||||
swapl(&to->detail);
|
||||
|
||||
|
||||
mask = (unsigned char*)&to[1];
|
||||
|
@ -841,16 +817,16 @@ static void SRawEvent(xXIRawEvent *from, xXIRawEvent *to)
|
|||
* they were in aAbBcC order because it's easier and really
|
||||
* doesn't matter.
|
||||
*/
|
||||
swapl(&values->integral, n);
|
||||
swapl(&values->frac, n);
|
||||
swapl(&values->integral);
|
||||
swapl(&values->frac);
|
||||
values++;
|
||||
swapl(&values->integral, n);
|
||||
swapl(&values->frac, n);
|
||||
swapl(&values->integral);
|
||||
swapl(&values->frac);
|
||||
values++;
|
||||
}
|
||||
}
|
||||
|
||||
swaps(&to->valuators_len, n);
|
||||
swaps(&to->valuators_len);
|
||||
}
|
||||
|
||||
|
||||
|
|
10
Xi/getbmap.c
10
Xi/getbmap.c
|
@ -70,10 +70,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXGetDeviceButtonMapping(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceButtonMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXGetDeviceButtonMapping(client));
|
||||
}
|
||||
|
||||
|
@ -126,9 +124,7 @@ void
|
|||
SRepXGetDeviceButtonMapping(ClientPtr client, int size,
|
||||
xGetDeviceButtonMappingReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
35
Xi/getdctl.c
35
Xi/getdctl.c
|
@ -71,12 +71,10 @@ SOFTWARE.
|
|||
int
|
||||
SProcXGetDeviceControl(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceControlReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
||||
swaps(&stuff->control, n);
|
||||
swaps(&stuff->control);
|
||||
return (ProcXGetDeviceControl(client));
|
||||
}
|
||||
|
||||
|
@ -90,7 +88,6 @@ static void
|
|||
CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
|
||||
int length)
|
||||
{
|
||||
char n;
|
||||
AxisInfoPtr a;
|
||||
xDeviceResolutionState *r;
|
||||
int i, *iptr;
|
||||
|
@ -108,19 +105,18 @@ CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
|
|||
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
|
||||
*iptr++ = a->max_resolution;
|
||||
if (client->swapped) {
|
||||
swaps(&r->control, n);
|
||||
swaps(&r->length, n);
|
||||
swapl(&r->num_valuators, n);
|
||||
swaps(&r->control);
|
||||
swaps(&r->length);
|
||||
swapl(&r->num_valuators);
|
||||
iptr = (int *)buf;
|
||||
for (i = 0; i < (3 * v->numAxes); i++, iptr++) {
|
||||
swapl(iptr, n);
|
||||
swapl(iptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
|
||||
{
|
||||
char n;
|
||||
xDeviceCoreState *c = (xDeviceCoreState *) buf;
|
||||
|
||||
c->control = DEVICE_CORE;
|
||||
|
@ -129,15 +125,14 @@ static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
|
|||
c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&c->control, n);
|
||||
swaps(&c->length, n);
|
||||
swaps(&c->status, n);
|
||||
swaps(&c->control);
|
||||
swaps(&c->length);
|
||||
swaps(&c->status);
|
||||
}
|
||||
}
|
||||
|
||||
static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
|
||||
{
|
||||
char n;
|
||||
xDeviceEnableState *e = (xDeviceEnableState *) buf;
|
||||
|
||||
e->control = DEVICE_ENABLE;
|
||||
|
@ -145,9 +140,9 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
|
|||
e->enable = dev->enabled;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&e->control, n);
|
||||
swaps(&e->length, n);
|
||||
swaps(&e->enable, n);
|
||||
swaps(&e->control);
|
||||
swaps(&e->length);
|
||||
swaps(&e->enable);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -161,10 +156,8 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
|
|||
void
|
||||
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
||||
|
|
64
Xi/getfctl.c
64
Xi/getfctl.c
|
@ -71,10 +71,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXGetFeedbackControl(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGetFeedbackControlReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXGetFeedbackControl(client));
|
||||
}
|
||||
|
||||
|
@ -88,7 +86,6 @@ static void
|
|||
CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
|
||||
{
|
||||
int i;
|
||||
char n;
|
||||
xKbdFeedbackState *k2;
|
||||
|
||||
k2 = (xKbdFeedbackState *) * buf;
|
||||
|
@ -104,11 +101,11 @@ CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
|
|||
for (i = 0; i < 32; i++)
|
||||
k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
|
||||
if (client->swapped) {
|
||||
swaps(&k2->length, n);
|
||||
swaps(&k2->pitch, n);
|
||||
swaps(&k2->duration, n);
|
||||
swapl(&k2->led_mask, n);
|
||||
swapl(&k2->led_values, n);
|
||||
swaps(&k2->length);
|
||||
swaps(&k2->pitch);
|
||||
swaps(&k2->duration);
|
||||
swapl(&k2->led_mask);
|
||||
swapl(&k2->led_values);
|
||||
}
|
||||
*buf += sizeof(xKbdFeedbackState);
|
||||
}
|
||||
|
@ -122,7 +119,6 @@ CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
|
|||
static void
|
||||
CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
|
||||
{
|
||||
char n;
|
||||
xPtrFeedbackState *p2;
|
||||
|
||||
p2 = (xPtrFeedbackState *) * buf;
|
||||
|
@ -133,10 +129,10 @@ CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
|
|||
p2->accelDenom = p->ctrl.den;
|
||||
p2->threshold = p->ctrl.threshold;
|
||||
if (client->swapped) {
|
||||
swaps(&p2->length, n);
|
||||
swaps(&p2->accelNum, n);
|
||||
swaps(&p2->accelDenom, n);
|
||||
swaps(&p2->threshold, n);
|
||||
swaps(&p2->length);
|
||||
swaps(&p2->accelNum);
|
||||
swaps(&p2->accelDenom);
|
||||
swaps(&p2->threshold);
|
||||
}
|
||||
*buf += sizeof(xPtrFeedbackState);
|
||||
}
|
||||
|
@ -150,7 +146,6 @@ CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
|
|||
static void
|
||||
CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
|
||||
{
|
||||
char n;
|
||||
xIntegerFeedbackState *i2;
|
||||
|
||||
i2 = (xIntegerFeedbackState *) * buf;
|
||||
|
@ -161,10 +156,10 @@ CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
|
|||
i2->min_value = i->ctrl.min_value;
|
||||
i2->max_value = i->ctrl.max_value;
|
||||
if (client->swapped) {
|
||||
swaps(&i2->length, n);
|
||||
swapl(&i2->resolution, n);
|
||||
swapl(&i2->min_value, n);
|
||||
swapl(&i2->max_value, n);
|
||||
swaps(&i2->length);
|
||||
swapl(&i2->resolution);
|
||||
swapl(&i2->min_value);
|
||||
swapl(&i2->max_value);
|
||||
}
|
||||
*buf += sizeof(xIntegerFeedbackState);
|
||||
}
|
||||
|
@ -179,7 +174,6 @@ static void
|
|||
CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
|
||||
{
|
||||
int i;
|
||||
char n;
|
||||
xStringFeedbackState *s2;
|
||||
KeySym *kptr;
|
||||
|
||||
|
@ -195,12 +189,12 @@ CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
|
|||
for (i = 0; i < s->ctrl.num_symbols_supported; i++)
|
||||
*kptr++ = *(s->ctrl.symbols_supported + i);
|
||||
if (client->swapped) {
|
||||
swaps(&s2->length, n);
|
||||
swaps(&s2->max_symbols, n);
|
||||
swaps(&s2->num_syms_supported, n);
|
||||
swaps(&s2->length);
|
||||
swaps(&s2->max_symbols);
|
||||
swaps(&s2->num_syms_supported);
|
||||
kptr = (KeySym *) (*buf);
|
||||
for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) {
|
||||
swapl(kptr, n);
|
||||
swapl(kptr);
|
||||
}
|
||||
}
|
||||
*buf += (s->ctrl.num_symbols_supported * sizeof(KeySym));
|
||||
|
@ -215,7 +209,6 @@ CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
|
|||
static void
|
||||
CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
|
||||
{
|
||||
char n;
|
||||
xLedFeedbackState *l2;
|
||||
|
||||
l2 = (xLedFeedbackState *) * buf;
|
||||
|
@ -225,9 +218,9 @@ CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
|
|||
l2->led_values = l->ctrl.led_values;
|
||||
l2->led_mask = l->ctrl.led_mask;
|
||||
if (client->swapped) {
|
||||
swaps(&l2->length, n);
|
||||
swapl(&l2->led_values, n);
|
||||
swapl(&l2->led_mask, n);
|
||||
swaps(&l2->length);
|
||||
swapl(&l2->led_values);
|
||||
swapl(&l2->led_mask);
|
||||
}
|
||||
*buf += sizeof(xLedFeedbackState);
|
||||
}
|
||||
|
@ -241,7 +234,6 @@ CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
|
|||
static void
|
||||
CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
|
||||
{
|
||||
char n;
|
||||
xBellFeedbackState *b2;
|
||||
|
||||
b2 = (xBellFeedbackState *) * buf;
|
||||
|
@ -252,9 +244,9 @@ CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
|
|||
b2->pitch = b->ctrl.pitch;
|
||||
b2->duration = b->ctrl.duration;
|
||||
if (client->swapped) {
|
||||
swaps(&b2->length, n);
|
||||
swaps(&b2->pitch, n);
|
||||
swaps(&b2->duration, n);
|
||||
swaps(&b2->length);
|
||||
swaps(&b2->pitch);
|
||||
swaps(&b2->duration);
|
||||
}
|
||||
*buf += sizeof(xBellFeedbackState);
|
||||
}
|
||||
|
@ -270,11 +262,9 @@ void
|
|||
SRepXGetFeedbackControl(ClientPtr client, int size,
|
||||
xGetFeedbackControlReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_feedbacks, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->num_feedbacks);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
||||
|
|
|
@ -71,10 +71,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXGetDeviceFocus(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceFocusReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXGetDeviceFocus(client));
|
||||
}
|
||||
|
||||
|
@ -133,11 +131,9 @@ ProcXGetDeviceFocus(ClientPtr client)
|
|||
void
|
||||
SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swapl(&rep->focus, n);
|
||||
swapl(&rep->time, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swapl(&rep->focus);
|
||||
swapl(&rep->time);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
10
Xi/getkmap.c
10
Xi/getkmap.c
|
@ -74,10 +74,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXGetDeviceKeyMapping(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceKeyMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXGetDeviceKeyMapping(client));
|
||||
}
|
||||
|
||||
|
@ -150,9 +148,7 @@ void
|
|||
SRepXGetDeviceKeyMapping(ClientPtr client, int size,
|
||||
xGetDeviceKeyMappingReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
10
Xi/getmmap.c
10
Xi/getmmap.c
|
@ -71,10 +71,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXGetDeviceModifierMapping(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceModifierMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXGetDeviceModifierMapping(client));
|
||||
}
|
||||
|
||||
|
@ -129,9 +127,7 @@ void
|
|||
SRepXGetDeviceModifierMapping(ClientPtr client, int size,
|
||||
xGetDeviceModifierMappingReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
14
Xi/getprop.c
14
Xi/getprop.c
|
@ -75,12 +75,10 @@ extern int ExtEventIndex;
|
|||
int
|
||||
SProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceDontPropagateListReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
|
||||
swapl(&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return (ProcXGetDeviceDontPropagateList(client));
|
||||
}
|
||||
|
||||
|
@ -178,10 +176,8 @@ void
|
|||
SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
|
||||
xGetDeviceDontPropagateListReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->count, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->count);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
|
@ -73,12 +73,10 @@ SOFTWARE.
|
|||
int
|
||||
SProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGetSelectedExtensionEventsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
|
||||
swapl(&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return (ProcXGetSelectedExtensionEvents(client));
|
||||
}
|
||||
|
||||
|
@ -168,11 +166,9 @@ void
|
|||
SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
|
||||
xGetSelectedExtensionEventsReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->this_client_count, n);
|
||||
swaps(&rep->all_clients_count, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->this_client_count);
|
||||
swaps(&rep->all_clients_count);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
16
Xi/getvers.c
16
Xi/getvers.c
|
@ -73,12 +73,10 @@ XExtensionVersion XIVersion;
|
|||
int
|
||||
SProcXGetExtensionVersion(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGetExtensionVersionReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
|
||||
swaps(&stuff->nbytes, n);
|
||||
swaps(&stuff->nbytes);
|
||||
return (ProcXGetExtensionVersion(client));
|
||||
}
|
||||
|
||||
|
@ -125,11 +123,9 @@ void
|
|||
SRepXGetExtensionVersion(ClientPtr client, int size,
|
||||
xGetExtensionVersionReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->major_version, n);
|
||||
swaps(&rep->minor_version, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->major_version);
|
||||
swaps(&rep->minor_version);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
16
Xi/grabdev.c
16
Xi/grabdev.c
|
@ -75,14 +75,12 @@ extern int ExtEventIndex;
|
|||
int
|
||||
SProcXGrabDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGrabDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
|
||||
swapl(&stuff->grabWindow, n);
|
||||
swapl(&stuff->time, n);
|
||||
swaps(&stuff->event_count, n);
|
||||
swapl(&stuff->grabWindow);
|
||||
swapl(&stuff->time);
|
||||
swaps(&stuff->event_count);
|
||||
|
||||
if (stuff->length != bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
||||
return BadLength;
|
||||
|
@ -210,9 +208,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
|||
void
|
||||
SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
|
@ -74,14 +74,12 @@ SOFTWARE.
|
|||
int
|
||||
SProcXGrabDeviceButton(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGrabDeviceButtonReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
|
||||
swapl(&stuff->grabWindow, n);
|
||||
swaps(&stuff->modifiers, n);
|
||||
swaps(&stuff->event_count, n);
|
||||
swapl(&stuff->grabWindow);
|
||||
swaps(&stuff->modifiers);
|
||||
swaps(&stuff->event_count);
|
||||
REQUEST_FIXED_SIZE(xGrabDeviceButtonReq,
|
||||
stuff->event_count * sizeof(CARD32));
|
||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
|
||||
|
|
|
@ -74,14 +74,12 @@ SOFTWARE.
|
|||
int
|
||||
SProcXGrabDeviceKey(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGrabDeviceKeyReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
||||
swapl(&stuff->grabWindow, n);
|
||||
swaps(&stuff->modifiers, n);
|
||||
swaps(&stuff->event_count, n);
|
||||
swapl(&stuff->grabWindow);
|
||||
swaps(&stuff->modifiers);
|
||||
swaps(&stuff->event_count);
|
||||
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
|
||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
|
||||
return (ProcXGrabDeviceKey(client));
|
||||
|
|
|
@ -71,13 +71,11 @@ SOFTWARE.
|
|||
int
|
||||
SProcXGetDeviceMotionEvents(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceMotionEventsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
||||
swapl(&stuff->start, n);
|
||||
swapl(&stuff->stop, n);
|
||||
swapl(&stuff->start);
|
||||
swapl(&stuff->stop);
|
||||
return (ProcXGetDeviceMotionEvents(client));
|
||||
}
|
||||
|
||||
|
@ -143,11 +141,9 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
|||
WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
|
||||
if (nEvents) {
|
||||
if (client->swapped) {
|
||||
char n;
|
||||
|
||||
bufptr = coords;
|
||||
for (i = 0; i < nEvents * (axes + 1); i++) {
|
||||
swapl(bufptr, n);
|
||||
swapl(bufptr);
|
||||
bufptr++;
|
||||
}
|
||||
}
|
||||
|
@ -168,10 +164,8 @@ void
|
|||
SRepXGetDeviceMotionEvents(ClientPtr client, int size,
|
||||
xGetDeviceMotionEventsReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swapl(&rep->nEvents, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swapl(&rep->nEvents);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
28
Xi/listdev.c
28
Xi/listdev.c
|
@ -78,10 +78,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXListInputDevices(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xListInputDevicesReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXListInputDevices(client));
|
||||
}
|
||||
|
||||
|
@ -145,7 +143,6 @@ CopyDeviceName(char **namebuf, char *name)
|
|||
static void
|
||||
CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
|
||||
{
|
||||
char n;
|
||||
xButtonInfoPtr b2;
|
||||
|
||||
b2 = (xButtonInfoPtr) * buf;
|
||||
|
@ -153,7 +150,7 @@ CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
|
|||
b2->length = sizeof(xButtonInfo);
|
||||
b2->num_buttons = b->numButtons;
|
||||
if (client && client->swapped) {
|
||||
swaps(&b2->num_buttons, n); /* macro - braces are required */
|
||||
swaps(&b2->num_buttons);
|
||||
}
|
||||
*buf += sizeof(xButtonInfo);
|
||||
}
|
||||
|
@ -168,7 +165,6 @@ static void
|
|||
CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
|
||||
char **buf)
|
||||
{
|
||||
char n;
|
||||
xDeviceInfoPtr dev;
|
||||
|
||||
dev = (xDeviceInfoPtr) * buf;
|
||||
|
@ -188,7 +184,7 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
|
|||
dev->use = IsXExtensionDevice;
|
||||
|
||||
if (client->swapped) {
|
||||
swapl(&dev->type, n); /* macro - braces are required */
|
||||
swapl(&dev->type);
|
||||
}
|
||||
*buf += sizeof(xDeviceInfo);
|
||||
}
|
||||
|
@ -202,7 +198,6 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
|
|||
static void
|
||||
CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
|
||||
{
|
||||
char n;
|
||||
xKeyInfoPtr k2;
|
||||
|
||||
k2 = (xKeyInfoPtr) * buf;
|
||||
|
@ -212,7 +207,7 @@ CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
|
|||
k2->max_keycode = k->xkbInfo->desc->max_key_code;
|
||||
k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
|
||||
if (client && client->swapped) {
|
||||
swaps(&k2->num_keys, n);
|
||||
swaps(&k2->num_keys);
|
||||
}
|
||||
*buf += sizeof(xKeyInfo);
|
||||
}
|
||||
|
@ -233,7 +228,6 @@ static int
|
|||
CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
|
||||
{
|
||||
int i, j, axes, t_axes;
|
||||
char n;
|
||||
ValuatorClassPtr v = dev->valuator;
|
||||
xValuatorInfoPtr v2;
|
||||
AxisInfo *a;
|
||||
|
@ -251,7 +245,7 @@ CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
|
|||
v2->mode = valuator_get_mode(dev, 0);
|
||||
v2->motion_buffer_size = v->numMotionEvents;
|
||||
if (client && client->swapped) {
|
||||
swapl(&v2->motion_buffer_size, n);
|
||||
swapl(&v2->motion_buffer_size);
|
||||
}
|
||||
*buf += sizeof(xValuatorInfo);
|
||||
a = v->axes + (VPC * i);
|
||||
|
@ -261,9 +255,9 @@ CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
|
|||
a2->max_value = a->max_value;
|
||||
a2->resolution = a->resolution;
|
||||
if (client && client->swapped) {
|
||||
swapl(&a2->min_value, n);
|
||||
swapl(&a2->max_value, n);
|
||||
swapl(&a2->resolution, n);
|
||||
swapl(&a2->min_value);
|
||||
swapl(&a2->max_value);
|
||||
swapl(&a2->resolution);
|
||||
}
|
||||
a2++;
|
||||
a++;
|
||||
|
@ -424,9 +418,7 @@ ProcXListInputDevices(ClientPtr client)
|
|||
void
|
||||
SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
10
Xi/opendev.c
10
Xi/opendev.c
|
@ -76,10 +76,8 @@ extern CARD8 event_base[];
|
|||
int
|
||||
SProcXOpenDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xOpenDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXOpenDevice(client));
|
||||
}
|
||||
|
||||
|
@ -166,9 +164,7 @@ ProcXOpenDevice(ClientPtr client)
|
|||
void
|
||||
SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
13
Xi/queryst.c
13
Xi/queryst.c
|
@ -56,10 +56,8 @@ from The Open Group.
|
|||
int
|
||||
SProcXQueryDeviceState(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xQueryDeviceStateReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXQueryDeviceState(client));
|
||||
}
|
||||
|
||||
|
@ -72,7 +70,6 @@ SProcXQueryDeviceState(ClientPtr client)
|
|||
int
|
||||
ProcXQueryDeviceState(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
int rc, i;
|
||||
int num_classes = 0;
|
||||
int total_length = 0;
|
||||
|
@ -159,7 +156,7 @@ ProcXQueryDeviceState(ClientPtr client)
|
|||
*((int *)buf) = *values;
|
||||
values++;
|
||||
if (client->swapped) {
|
||||
swapl((int *)buf, n); /* macro - braces needed */
|
||||
swapl((int *)buf);
|
||||
}
|
||||
buf += sizeof(int);
|
||||
}
|
||||
|
@ -184,9 +181,7 @@ ProcXQueryDeviceState(ClientPtr client)
|
|||
void
|
||||
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
|
@ -123,13 +123,11 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
|
|||
int
|
||||
SProcXSelectExtensionEvent(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xSelectExtensionEventReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->count, n);
|
||||
swapl(&stuff->window);
|
||||
swaps(&stuff->count);
|
||||
REQUEST_FIXED_SIZE(xSelectExtensionEventReq,
|
||||
stuff->count * sizeof(CARD32));
|
||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
|
||||
|
|
|
@ -76,7 +76,6 @@ extern int lastEvent; /* Defined in extension.c */
|
|||
int
|
||||
SProcXSendExtensionEvent(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
CARD32 *p;
|
||||
int i;
|
||||
xEvent eventT;
|
||||
|
@ -84,10 +83,10 @@ SProcXSendExtensionEvent(ClientPtr client)
|
|||
EventSwapPtr proc;
|
||||
|
||||
REQUEST(xSendExtensionEventReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
||||
swapl(&stuff->destination, n);
|
||||
swaps(&stuff->count, n);
|
||||
swapl(&stuff->destination);
|
||||
swaps(&stuff->count);
|
||||
|
||||
if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
|
||||
bytes_to_int32(stuff->num_events * sizeof(xEvent)))
|
||||
|
|
10
Xi/setbmap.c
10
Xi/setbmap.c
|
@ -71,10 +71,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXSetDeviceButtonMapping(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xSetDeviceButtonMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXSetDeviceButtonMapping(client));
|
||||
}
|
||||
|
||||
|
@ -132,9 +130,7 @@ void
|
|||
SRepXSetDeviceButtonMapping(ClientPtr client, int size,
|
||||
xSetDeviceButtonMappingReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
10
Xi/setdval.c
10
Xi/setdval.c
|
@ -71,10 +71,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXSetDeviceValuators(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xSetDeviceValuatorsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXSetDeviceValuators(client));
|
||||
}
|
||||
|
||||
|
@ -138,9 +136,7 @@ void
|
|||
SRepXSetDeviceValuators(ClientPtr client, int size,
|
||||
xSetDeviceValuatorsReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
|
@ -74,13 +74,11 @@ SOFTWARE.
|
|||
int
|
||||
SProcXSetDeviceFocus(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xSetDeviceFocusReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
||||
swapl(&stuff->focus, n);
|
||||
swapl(&stuff->time, n);
|
||||
swapl(&stuff->focus);
|
||||
swapl(&stuff->time);
|
||||
return (ProcXSetDeviceFocus(client));
|
||||
}
|
||||
|
||||
|
|
10
Xi/setmmap.c
10
Xi/setmmap.c
|
@ -73,10 +73,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXSetDeviceModifierMapping(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xSetDeviceModifierMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXSetDeviceModifierMapping(client));
|
||||
}
|
||||
|
||||
|
@ -140,9 +138,7 @@ void
|
|||
SRepXSetDeviceModifierMapping(ClientPtr client, int size,
|
||||
xSetDeviceModifierMappingReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
10
Xi/setmode.c
10
Xi/setmode.c
|
@ -71,10 +71,8 @@ SOFTWARE.
|
|||
int
|
||||
SProcXSetDeviceMode(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xSetDeviceModeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXSetDeviceMode(client));
|
||||
}
|
||||
|
||||
|
@ -138,9 +136,7 @@ ProcXSetDeviceMode(ClientPtr client)
|
|||
void
|
||||
SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
|
@ -70,12 +70,10 @@ SOFTWARE.
|
|||
int
|
||||
SProcXUngrabDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xUngrabDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
|
||||
swapl(&stuff->time, n);
|
||||
swapl(&stuff->time);
|
||||
return (ProcXUngrabDevice(client));
|
||||
}
|
||||
|
||||
|
|
|
@ -76,13 +76,11 @@ SOFTWARE.
|
|||
int
|
||||
SProcXUngrabDeviceButton(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xUngrabDeviceButtonReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
|
||||
swapl(&stuff->grabWindow, n);
|
||||
swaps(&stuff->modifiers, n);
|
||||
swapl(&stuff->grabWindow);
|
||||
swaps(&stuff->modifiers);
|
||||
return (ProcXUngrabDeviceButton(client));
|
||||
}
|
||||
|
||||
|
|
|
@ -78,13 +78,11 @@ SOFTWARE.
|
|||
int
|
||||
SProcXUngrabDeviceKey(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xUngrabDeviceKeyReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
|
||||
swapl(&stuff->grabWindow, n);
|
||||
swaps(&stuff->modifiers, n);
|
||||
swapl(&stuff->grabWindow);
|
||||
swaps(&stuff->modifiers);
|
||||
return (ProcXUngrabDeviceKey(client));
|
||||
}
|
||||
|
||||
|
|
|
@ -44,13 +44,11 @@
|
|||
int
|
||||
SProcXIAllowEvents(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXIAllowEventsReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swapl(&stuff->time, n);
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->time);
|
||||
|
||||
return ProcXIAllowEvents(client);
|
||||
}
|
||||
|
|
|
@ -56,13 +56,11 @@
|
|||
int
|
||||
SProcXIChangeCursor(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXIChangeCursorReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->win, n);
|
||||
swapl(&stuff->cursor, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->win);
|
||||
swapl(&stuff->cursor);
|
||||
swaps(&stuff->deviceid);
|
||||
REQUEST_SIZE_MATCH(xXIChangeCursorReq);
|
||||
return (ProcXIChangeCursor(client));
|
||||
}
|
||||
|
|
|
@ -133,10 +133,8 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
|
|||
|
||||
int SProcXIChangeHierarchy(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXIChangeHierarchyReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (ProcXIChangeHierarchy(client));
|
||||
}
|
||||
|
||||
|
@ -424,7 +422,6 @@ ProcXIChangeHierarchy(ClientPtr client)
|
|||
{
|
||||
xXIAnyHierarchyChangeInfo *any;
|
||||
int required_len = sizeof(xXIChangeHierarchyReq);
|
||||
char n;
|
||||
int rc = Success;
|
||||
int flags[MAXDEVICES] = {0};
|
||||
|
||||
|
@ -437,8 +434,8 @@ ProcXIChangeHierarchy(ClientPtr client)
|
|||
any = (xXIAnyHierarchyChangeInfo*)&stuff[1];
|
||||
while(stuff->num_changes--)
|
||||
{
|
||||
SWAPIF(swapl(&any->type, n));
|
||||
SWAPIF(swaps(&any->length, n));
|
||||
SWAPIF(swapl(&any->type));
|
||||
SWAPIF(swaps(&any->length));
|
||||
|
||||
required_len += any->length;
|
||||
if ((stuff->length * 4) < required_len)
|
||||
|
@ -449,7 +446,7 @@ ProcXIChangeHierarchy(ClientPtr client)
|
|||
case XIAddMaster:
|
||||
{
|
||||
xXIAddMasterInfo* c = (xXIAddMasterInfo*)any;
|
||||
SWAPIF(swaps(&c->name_len, n));
|
||||
SWAPIF(swaps(&c->name_len));
|
||||
|
||||
rc = add_master(client, c, flags);
|
||||
if (rc != Success)
|
||||
|
|
|
@ -49,11 +49,10 @@
|
|||
int
|
||||
SProcXIGetClientPointer(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xXIGetClientPointerReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->win, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->win);
|
||||
return ProcXIGetClientPointer(client);
|
||||
}
|
||||
|
||||
|
@ -97,10 +96,9 @@ void
|
|||
SRepXIGetClientPointer(ClientPtr client, int size,
|
||||
xXIGetClientPointerReply* rep)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->deviceid, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->deviceid);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,16 +45,14 @@
|
|||
int
|
||||
SProcXIGrabDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXIGrabDeviceReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swapl(&stuff->grab_window, n);
|
||||
swapl(&stuff->cursor, n);
|
||||
swapl(&stuff->time, n);
|
||||
swaps(&stuff->mask_len, n);
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->grab_window);
|
||||
swapl(&stuff->cursor);
|
||||
swapl(&stuff->time);
|
||||
swaps(&stuff->mask_len);
|
||||
|
||||
return ProcXIGrabDevice(client);
|
||||
}
|
||||
|
@ -115,13 +113,11 @@ ProcXIGrabDevice(ClientPtr client)
|
|||
int
|
||||
SProcXIUngrabDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXIUngrabDeviceReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swapl(&stuff->time, n);
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->time);
|
||||
|
||||
return ProcXIUngrabDevice(client);
|
||||
}
|
||||
|
@ -153,9 +149,7 @@ ProcXIUngrabDevice(ClientPtr client)
|
|||
|
||||
void SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
|
@ -49,27 +49,26 @@ int
|
|||
SProcXIPassiveGrabDevice(ClientPtr client)
|
||||
{
|
||||
int i;
|
||||
char n;
|
||||
xXIModifierInfo *mods;
|
||||
|
||||
REQUEST(xXIPassiveGrabDeviceReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swapl(&stuff->grab_window, n);
|
||||
swapl(&stuff->cursor, n);
|
||||
swapl(&stuff->time, n);
|
||||
swapl(&stuff->detail, n);
|
||||
swaps(&stuff->mask_len, n);
|
||||
swaps(&stuff->num_modifiers, n);
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->grab_window);
|
||||
swapl(&stuff->cursor);
|
||||
swapl(&stuff->time);
|
||||
swapl(&stuff->detail);
|
||||
swaps(&stuff->mask_len);
|
||||
swaps(&stuff->num_modifiers);
|
||||
|
||||
mods = (xXIModifierInfo*)&stuff[1];
|
||||
|
||||
for (i = 0; i < stuff->num_modifiers; i++, mods++)
|
||||
{
|
||||
swapl(&mods->base_mods, n);
|
||||
swapl(&mods->latched_mods, n);
|
||||
swapl(&mods->locked_mods, n);
|
||||
swapl(&mods->base_mods);
|
||||
swapl(&mods->latched_mods);
|
||||
swapl(&mods->locked_mods);
|
||||
}
|
||||
|
||||
return ProcXIPassiveGrabDevice(client);
|
||||
|
@ -88,7 +87,6 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
|||
GrabParameters param;
|
||||
void *tmp;
|
||||
int mask_len;
|
||||
int n;
|
||||
|
||||
REQUEST(xXIPassiveGrabDeviceReq);
|
||||
REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
|
||||
|
@ -198,7 +196,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
|||
info->status = status;
|
||||
info->modifiers = *modifiers;
|
||||
if (client->swapped)
|
||||
swapl(&info->modifiers, n);
|
||||
swapl(&info->modifiers);
|
||||
|
||||
rep.num_modifiers++;
|
||||
rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo));
|
||||
|
@ -217,11 +215,9 @@ void
|
|||
SRepXIPassiveGrabDevice(ClientPtr client, int size,
|
||||
xXIPassiveGrabDeviceReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_modifiers, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->num_modifiers);
|
||||
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
@ -229,22 +225,21 @@ SRepXIPassiveGrabDevice(ClientPtr client, int size,
|
|||
int
|
||||
SProcXIPassiveUngrabDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
int i;
|
||||
uint32_t *modifiers;
|
||||
|
||||
REQUEST(xXIPassiveUngrabDeviceReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->grab_window, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swapl(&stuff->detail, n);
|
||||
swaps(&stuff->num_modifiers, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->grab_window);
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->detail);
|
||||
swaps(&stuff->num_modifiers);
|
||||
|
||||
modifiers = (uint32_t*)&stuff[1];
|
||||
|
||||
for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
|
||||
swapl(modifiers, n);
|
||||
swapl(modifiers);
|
||||
|
||||
return ProcXIPassiveUngrabDevice(client);
|
||||
}
|
||||
|
|
102
Xi/xiproperty.c
102
Xi/xiproperty.c
|
@ -1036,10 +1036,9 @@ ProcXGetDeviceProperty (ClientPtr client)
|
|||
int
|
||||
SProcXListDeviceProperties (ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xListDevicePropertiesReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
|
||||
REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
|
||||
return (ProcXListDeviceProperties(client));
|
||||
|
@ -1048,25 +1047,23 @@ SProcXListDeviceProperties (ClientPtr client)
|
|||
int
|
||||
SProcXChangeDeviceProperty (ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xChangeDevicePropertyReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->property, n);
|
||||
swapl(&stuff->type, n);
|
||||
swapl(&stuff->nUnits, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->property);
|
||||
swapl(&stuff->type);
|
||||
swapl(&stuff->nUnits);
|
||||
return (ProcXChangeDeviceProperty(client));
|
||||
}
|
||||
|
||||
int
|
||||
SProcXDeleteDeviceProperty (ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xDeleteDevicePropertyReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->property, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->property);
|
||||
REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
|
||||
return (ProcXDeleteDeviceProperty(client));
|
||||
}
|
||||
|
@ -1074,14 +1071,13 @@ SProcXDeleteDeviceProperty (ClientPtr client)
|
|||
int
|
||||
SProcXGetDeviceProperty (ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xGetDevicePropertyReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->property, n);
|
||||
swapl(&stuff->type, n);
|
||||
swapl(&stuff->longOffset, n);
|
||||
swapl(&stuff->longLength, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->property);
|
||||
swapl(&stuff->type);
|
||||
swapl(&stuff->longOffset);
|
||||
swapl(&stuff->longLength);
|
||||
REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
|
||||
return (ProcXGetDeviceProperty(client));
|
||||
}
|
||||
|
@ -1093,10 +1089,9 @@ void
|
|||
SRepXListDeviceProperties(ClientPtr client, int size,
|
||||
xListDevicePropertiesReply *rep)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->nAtoms, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->nAtoms);
|
||||
/* properties will be swapped later, see ProcXListDeviceProperties */
|
||||
WriteToClient(client, size, (char*)rep);
|
||||
}
|
||||
|
@ -1105,13 +1100,11 @@ void
|
|||
SRepXGetDeviceProperty(ClientPtr client, int size,
|
||||
xGetDevicePropertyReply *rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swapl(&rep->propertyType, n);
|
||||
swapl(&rep->bytesAfter, n);
|
||||
swapl(&rep->nItems, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swapl(&rep->propertyType);
|
||||
swapl(&rep->bytesAfter);
|
||||
swapl(&rep->nItems);
|
||||
/* data will be swapped, see ProcXGetDeviceProperty */
|
||||
WriteToClient(client, size, (char*)rep);
|
||||
}
|
||||
|
@ -1279,11 +1272,10 @@ ProcXIGetProperty(ClientPtr client)
|
|||
int
|
||||
SProcXIListProperties(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xXIListPropertiesReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXIListPropertiesReq);
|
||||
return (ProcXIListProperties(client));
|
||||
|
@ -1292,27 +1284,25 @@ SProcXIListProperties(ClientPtr client)
|
|||
int
|
||||
SProcXIChangeProperty(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xXIChangePropertyReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swapl(&stuff->property, n);
|
||||
swapl(&stuff->type, n);
|
||||
swapl(&stuff->num_items, n);
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->property);
|
||||
swapl(&stuff->type);
|
||||
swapl(&stuff->num_items);
|
||||
return (ProcXIChangeProperty(client));
|
||||
}
|
||||
|
||||
int
|
||||
SProcXIDeleteProperty(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xXIDeletePropertyReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swapl(&stuff->property, n);
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->property);
|
||||
REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
|
||||
return (ProcXIDeleteProperty(client));
|
||||
}
|
||||
|
@ -1320,15 +1310,14 @@ SProcXIDeleteProperty(ClientPtr client)
|
|||
int
|
||||
SProcXIGetProperty(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xXIGetPropertyReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swapl(&stuff->property, n);
|
||||
swapl(&stuff->type, n);
|
||||
swapl(&stuff->offset, n);
|
||||
swapl(&stuff->len, n);
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->property);
|
||||
swapl(&stuff->type);
|
||||
swapl(&stuff->offset);
|
||||
swapl(&stuff->len);
|
||||
REQUEST_SIZE_MATCH(xXIGetPropertyReq);
|
||||
return (ProcXIGetProperty(client));
|
||||
}
|
||||
|
@ -1338,10 +1327,9 @@ void
|
|||
SRepXIListProperties(ClientPtr client, int size,
|
||||
xXIListPropertiesReply *rep)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_properties, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->num_properties);
|
||||
/* properties will be swapped later, see ProcXIListProperties */
|
||||
WriteToClient(client, size, (char*)rep);
|
||||
}
|
||||
|
@ -1350,13 +1338,11 @@ void
|
|||
SRepXIGetProperty(ClientPtr client, int size,
|
||||
xXIGetPropertyReply *rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swapl(&rep->type, n);
|
||||
swapl(&rep->bytes_after, n);
|
||||
swapl(&rep->num_items, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swapl(&rep->type);
|
||||
swapl(&rep->bytes_after);
|
||||
swapl(&rep->num_items);
|
||||
/* data will be swapped, see ProcXIGetProperty */
|
||||
WriteToClient(client, size, (char*)rep);
|
||||
}
|
||||
|
|
|
@ -52,12 +52,10 @@ static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info);
|
|||
int
|
||||
SProcXIQueryDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXIQueryDeviceReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
|
||||
return ProcXIQueryDevice(client);
|
||||
}
|
||||
|
@ -166,11 +164,9 @@ ProcXIQueryDevice(ClientPtr client)
|
|||
void
|
||||
SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply *rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_devices, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->num_devices);
|
||||
|
||||
/* Device info is already swapped, see ProcXIQueryDevice */
|
||||
|
||||
|
@ -278,17 +274,16 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState)
|
|||
static void
|
||||
SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info)
|
||||
{
|
||||
char n;
|
||||
Atom *btn;
|
||||
int i;
|
||||
swaps(&info->type, n);
|
||||
swaps(&info->length, n);
|
||||
swaps(&info->sourceid, n);
|
||||
swaps(&info->type);
|
||||
swaps(&info->length);
|
||||
swaps(&info->sourceid);
|
||||
|
||||
for (i = 0, btn = (Atom*)&info[1]; i < info->num_buttons; i++, btn++)
|
||||
swaps(btn, n);
|
||||
swaps(btn);
|
||||
|
||||
swaps(&info->num_buttons, n);
|
||||
swaps(&info->num_buttons);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -317,17 +312,16 @@ ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
|
|||
static void
|
||||
SwapKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
|
||||
{
|
||||
char n;
|
||||
uint32_t *key;
|
||||
int i;
|
||||
swaps(&info->type, n);
|
||||
swaps(&info->length, n);
|
||||
swaps(&info->sourceid, n);
|
||||
swaps(&info->type);
|
||||
swaps(&info->length);
|
||||
swaps(&info->sourceid);
|
||||
|
||||
for (i = 0, key = (uint32_t*)&info[1]; i < info->num_keycodes; i++, key++)
|
||||
swapl(key, n);
|
||||
swapl(key);
|
||||
|
||||
swaps(&info->num_keycodes, n);
|
||||
swaps(&info->num_keycodes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -364,16 +358,15 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber,
|
|||
static void
|
||||
SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info)
|
||||
{
|
||||
char n;
|
||||
swaps(&info->type, n);
|
||||
swaps(&info->length, n);
|
||||
swapl(&info->label, n);
|
||||
swapl(&info->min.integral, n);
|
||||
swapl(&info->min.frac, n);
|
||||
swapl(&info->max.integral, n);
|
||||
swapl(&info->max.frac, n);
|
||||
swaps(&info->number, n);
|
||||
swaps(&info->sourceid, n);
|
||||
swaps(&info->type);
|
||||
swaps(&info->length);
|
||||
swapl(&info->label);
|
||||
swapl(&info->min.integral);
|
||||
swapl(&info->min.frac);
|
||||
swapl(&info->max.integral);
|
||||
swapl(&info->max.frac);
|
||||
swaps(&info->number);
|
||||
swaps(&info->sourceid);
|
||||
}
|
||||
|
||||
int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment)
|
||||
|
@ -471,7 +464,6 @@ ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
|
|||
static void
|
||||
SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
|
||||
{
|
||||
char n;
|
||||
char *any = (char*)&info[1];
|
||||
int i;
|
||||
|
||||
|
@ -497,10 +489,10 @@ SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
|
|||
any += len * 4;
|
||||
}
|
||||
|
||||
swaps(&info->deviceid, n);
|
||||
swaps(&info->use, n);
|
||||
swaps(&info->attachment, n);
|
||||
swaps(&info->num_classes, n);
|
||||
swaps(&info->name_len, n);
|
||||
swaps(&info->deviceid);
|
||||
swaps(&info->use);
|
||||
swaps(&info->attachment);
|
||||
swaps(&info->num_classes);
|
||||
swaps(&info->name_len);
|
||||
|
||||
}
|
||||
|
|
|
@ -61,12 +61,10 @@
|
|||
int
|
||||
SProcXIQueryPointer(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXIQueryPointerReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swapl(&stuff->win, n);
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->win);
|
||||
return (ProcXIQueryPointer(client));
|
||||
}
|
||||
|
||||
|
@ -212,17 +210,15 @@ void
|
|||
SRepXIQueryPointer(ClientPtr client, int size,
|
||||
xXIQueryPointerReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swapl(&rep->root, n);
|
||||
swapl(&rep->child, n);
|
||||
swapl(&rep->root_x, n);
|
||||
swapl(&rep->root_y, n);
|
||||
swapl(&rep->win_x, n);
|
||||
swapl(&rep->win_y, n);
|
||||
swaps(&rep->buttons_len, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swapl(&rep->root);
|
||||
swapl(&rep->child);
|
||||
swapl(&rep->root_x);
|
||||
swapl(&rep->root_y);
|
||||
swapl(&rep->win_x);
|
||||
swapl(&rep->win_y);
|
||||
swaps(&rep->buttons_len);
|
||||
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
|
@ -103,23 +103,20 @@ ProcXIQueryVersion(ClientPtr client)
|
|||
int
|
||||
SProcXIQueryVersion(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXIQueryVersionReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq);
|
||||
swaps(&stuff->major_version, n);
|
||||
swaps(&stuff->minor_version, n);
|
||||
swaps(&stuff->major_version);
|
||||
swaps(&stuff->minor_version);
|
||||
return (ProcXIQueryVersion(client));
|
||||
}
|
||||
|
||||
void
|
||||
SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply *rep)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->major_version, n);
|
||||
swaps(&rep->minor_version, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->major_version);
|
||||
swaps(&rep->minor_version);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
|
@ -63,21 +63,20 @@ int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len)
|
|||
int
|
||||
SProcXISelectEvents(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
int i;
|
||||
xXIEventMask* evmask;
|
||||
|
||||
REQUEST(xXISelectEventsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
|
||||
swapl(&stuff->win, n);
|
||||
swaps(&stuff->num_masks, n);
|
||||
swapl(&stuff->win);
|
||||
swaps(&stuff->num_masks);
|
||||
|
||||
evmask = (xXIEventMask*)&stuff[1];
|
||||
for (i = 0; i < stuff->num_masks; i++)
|
||||
{
|
||||
swaps(&evmask->deviceid, n);
|
||||
swaps(&evmask->mask_len, n);
|
||||
swaps(&evmask->deviceid);
|
||||
swaps(&evmask->mask_len);
|
||||
evmask = (xXIEventMask*)(((char*)&evmask[1]) + evmask->mask_len * 4);
|
||||
}
|
||||
|
||||
|
@ -192,12 +191,10 @@ ProcXISelectEvents(ClientPtr client)
|
|||
int
|
||||
SProcXIGetSelectedEvents(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXIGetSelectedEventsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
|
||||
swapl(&stuff->win, n);
|
||||
swapl(&stuff->win);
|
||||
|
||||
return (ProcXIGetSelectedEvents(client));
|
||||
}
|
||||
|
@ -207,7 +204,6 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
|||
{
|
||||
int rc, i;
|
||||
WindowPtr win;
|
||||
char n;
|
||||
char *buffer = NULL;
|
||||
xXIGetSelectedEventsReply reply;
|
||||
OtherInputMasks *masks;
|
||||
|
@ -275,8 +271,8 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&evmask->deviceid, n);
|
||||
swaps(&evmask->mask_len, n);
|
||||
swaps(&evmask->deviceid);
|
||||
swaps(&evmask->mask_len);
|
||||
}
|
||||
|
||||
memcpy(&evmask[1], devmask, j + 1);
|
||||
|
@ -299,11 +295,9 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
|||
void SRepXIGetSelectedEvents(ClientPtr client,
|
||||
int len, xXIGetSelectedEventsReply *rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_masks, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->num_masks);
|
||||
WriteToClient(client, len, (char *)rep);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,12 +51,10 @@
|
|||
int
|
||||
SProcXISetClientPointer(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXISetClientPointerReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->win, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->win);
|
||||
swaps(&stuff->deviceid);
|
||||
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
|
||||
return (ProcXISetClientPointer(client));
|
||||
}
|
||||
|
|
|
@ -43,13 +43,11 @@
|
|||
int
|
||||
SProcXISetFocus(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXISetFocusReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swapl(&stuff->focus, n);
|
||||
swapl(&stuff->time, n);
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->focus);
|
||||
swapl(&stuff->time);
|
||||
|
||||
return ProcXISetFocus(client);
|
||||
}
|
||||
|
@ -57,11 +55,9 @@ SProcXISetFocus(ClientPtr client)
|
|||
int
|
||||
SProcXIGetFocus(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXIGetFocusReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swaps(&stuff->length);
|
||||
swaps(&stuff->deviceid);
|
||||
|
||||
return ProcXIGetFocus(client);
|
||||
}
|
||||
|
@ -122,9 +118,8 @@ ProcXIGetFocus(ClientPtr client)
|
|||
void
|
||||
SRepXIGetFocus(ClientPtr client, int len, xXIGetFocusReply *rep)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swapl(&rep->focus, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swapl(&rep->focus);
|
||||
WriteToClient(client, len, (char *)rep);
|
||||
}
|
||||
|
|
|
@ -56,19 +56,17 @@
|
|||
int
|
||||
SProcXIWarpPointer(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXIWarpPointerReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->src_win, n);
|
||||
swapl(&stuff->dst_win, n);
|
||||
swapl(&stuff->src_x, n);
|
||||
swapl(&stuff->src_y, n);
|
||||
swaps(&stuff->src_width, n);
|
||||
swaps(&stuff->src_height, n);
|
||||
swapl(&stuff->dst_x, n);
|
||||
swapl(&stuff->dst_y, n);
|
||||
swaps(&stuff->deviceid, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->src_win);
|
||||
swapl(&stuff->dst_win);
|
||||
swapl(&stuff->src_x);
|
||||
swapl(&stuff->src_y);
|
||||
swaps(&stuff->src_width);
|
||||
swaps(&stuff->src_height);
|
||||
swapl(&stuff->dst_x);
|
||||
swapl(&stuff->dst_y);
|
||||
swaps(&stuff->deviceid);
|
||||
return (ProcXIWarpPointer(client));
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,6 @@ ProcCompositeQueryVersion (ClientPtr client)
|
|||
{
|
||||
CompositeClientPtr pCompositeClient = GetCompositeClient (client);
|
||||
xCompositeQueryVersionReply rep;
|
||||
register int n;
|
||||
REQUEST(xCompositeQueryVersionReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
|
||||
|
@ -126,10 +125,10 @@ ProcCompositeQueryVersion (ClientPtr client)
|
|||
pCompositeClient->major_version = rep.majorVersion;
|
||||
pCompositeClient->minor_version = rep.minorVersion;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.majorVersion, n);
|
||||
swapl(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.majorVersion);
|
||||
swapl(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -315,10 +314,9 @@ ProcCompositeGetOverlayWindow (ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
int n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.overlayWin, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.overlayWin);
|
||||
}
|
||||
(void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep);
|
||||
|
||||
|
@ -377,111 +375,102 @@ ProcCompositeDispatch (ClientPtr client)
|
|||
static int
|
||||
SProcCompositeQueryVersion (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xCompositeQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
|
||||
swapl(&stuff->majorVersion, n);
|
||||
swapl(&stuff->minorVersion, n);
|
||||
swapl(&stuff->majorVersion);
|
||||
swapl(&stuff->minorVersion);
|
||||
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcCompositeRedirectWindow (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xCompositeRedirectWindowReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcCompositeRedirectSubwindows (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xCompositeRedirectSubwindowsReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcCompositeUnredirectWindow (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xCompositeUnredirectWindowReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcCompositeUnredirectSubwindows (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xCompositeUnredirectSubwindowsReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcCompositeCreateRegionFromBorderClip (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xCompositeCreateRegionFromBorderClipReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xCompositeCreateRegionFromBorderClipReq);
|
||||
swapl (&stuff->region, n);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->region);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcCompositeNameWindowPixmap (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xCompositeNameWindowPixmapReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl (&stuff->pixmap, n);
|
||||
swapl(&stuff->window);
|
||||
swapl(&stuff->pixmap);
|
||||
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcCompositeGetOverlayWindow (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xCompositeGetOverlayWindowReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
|
||||
swapl(&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcCompositeReleaseOverlayWindow (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xCompositeReleaseOverlayWindowReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq);
|
||||
swapl(&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
|
||||
}
|
||||
|
||||
|
@ -839,10 +828,9 @@ PanoramiXCompositeGetOverlayWindow (ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
int n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.overlayWin, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.overlayWin);
|
||||
}
|
||||
(void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep);
|
||||
|
||||
|
|
|
@ -129,7 +129,6 @@ ProcDamageQueryVersion(ClientPtr client)
|
|||
{
|
||||
DamageClientPtr pDamageClient = GetDamageClient (client);
|
||||
xDamageQueryVersionReply rep;
|
||||
register int n;
|
||||
REQUEST(xDamageQueryVersionReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
|
||||
|
@ -150,10 +149,10 @@ ProcDamageQueryVersion(ClientPtr client)
|
|||
pDamageClient->major_version = rep.majorVersion;
|
||||
pDamageClient->minor_version = rep.minorVersion;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.majorVersion, n);
|
||||
swapl(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.majorVersion);
|
||||
swapl(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -334,65 +333,60 @@ ProcDamageDispatch (ClientPtr client)
|
|||
static int
|
||||
SProcDamageQueryVersion(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xDamageQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
|
||||
swapl(&stuff->majorVersion, n);
|
||||
swapl(&stuff->minorVersion, n);
|
||||
swapl(&stuff->majorVersion);
|
||||
swapl(&stuff->minorVersion);
|
||||
return (*ProcDamageVector[stuff->damageReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcDamageCreate (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xDamageCreateReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDamageCreateReq);
|
||||
swapl (&stuff->damage, n);
|
||||
swapl (&stuff->drawable, n);
|
||||
swapl(&stuff->damage);
|
||||
swapl(&stuff->drawable);
|
||||
return (*ProcDamageVector[stuff->damageReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcDamageDestroy (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xDamageDestroyReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDamageDestroyReq);
|
||||
swapl (&stuff->damage, n);
|
||||
swapl(&stuff->damage);
|
||||
return (*ProcDamageVector[stuff->damageReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcDamageSubtract (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xDamageSubtractReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDamageSubtractReq);
|
||||
swapl (&stuff->damage, n);
|
||||
swapl (&stuff->repair, n);
|
||||
swapl (&stuff->parts, n);
|
||||
swapl(&stuff->damage);
|
||||
swapl(&stuff->repair);
|
||||
swapl(&stuff->parts);
|
||||
return (*ProcDamageVector[stuff->damageReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcDamageAdd (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xDamageAddReq);
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDamageSubtractReq);
|
||||
swapl (&stuff->drawable, n);
|
||||
swapl (&stuff->region, n);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->region);
|
||||
return (*ProcDamageVector[stuff->damageReqType]) (client);
|
||||
}
|
||||
|
||||
|
|
63
dbe/dbe.c
63
dbe/dbe.c
|
@ -127,8 +127,6 @@ ProcDbeGetVersion(ClientPtr client)
|
|||
{
|
||||
/* REQUEST(xDbeGetVersionReq); */
|
||||
xDbeGetVersionReply rep;
|
||||
register int n;
|
||||
|
||||
|
||||
REQUEST_SIZE_MATCH(xDbeGetVersionReq);
|
||||
|
||||
|
@ -140,7 +138,7 @@ ProcDbeGetVersion(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xDbeGetVersionReply), (char *)&rep);
|
||||
|
@ -656,7 +654,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
|
|||
xDbeGetVisualInfoReply rep;
|
||||
Drawable *drawables;
|
||||
DrawablePtr *pDrawables = NULL;
|
||||
register int i, j, n, rc;
|
||||
register int i, j, rc;
|
||||
register int count; /* number of visual infos in reply */
|
||||
register int length; /* length of reply */
|
||||
ScreenPtr pScreen;
|
||||
|
@ -732,9 +730,9 @@ ProcDbeGetVisualInfo(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.m, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.m);
|
||||
}
|
||||
|
||||
/* Send off reply. */
|
||||
|
@ -751,7 +749,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
swapl(&data32, n);
|
||||
swapl(&data32);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(CARD32), (char *)&data32);
|
||||
|
@ -772,7 +770,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
swapl(&visInfo.visualID, n);
|
||||
swapl(&visInfo.visualID);
|
||||
|
||||
/* We do not need to swap depth and perfLevel since they are
|
||||
* already 1 byte quantities.
|
||||
|
@ -822,7 +820,7 @@ ProcDbeGetBackBufferAttributes(ClientPtr client)
|
|||
REQUEST(xDbeGetBackBufferAttributesReq);
|
||||
xDbeGetBackBufferAttributesReply rep;
|
||||
DbeWindowPrivPtr pDbeWindowPriv;
|
||||
int rc, n;
|
||||
int rc;
|
||||
|
||||
|
||||
REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
|
||||
|
@ -845,9 +843,9 @@ ProcDbeGetBackBufferAttributes(ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.attributes, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.attributes);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply),
|
||||
|
@ -926,10 +924,8 @@ static int
|
|||
SProcDbeGetVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDbeGetVersionReq);
|
||||
register int n;
|
||||
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return(ProcDbeGetVersion(client));
|
||||
|
||||
} /* SProcDbeGetVersion() */
|
||||
|
@ -962,13 +958,12 @@ static int
|
|||
SProcDbeAllocateBackBufferName(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDbeAllocateBackBufferNameReq);
|
||||
register int n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq);
|
||||
|
||||
swapl(&stuff->window, n);
|
||||
swapl(&stuff->buffer, n);
|
||||
swapl(&stuff->window);
|
||||
swapl(&stuff->buffer);
|
||||
/* stuff->swapAction is a byte. We do not need to swap this field. */
|
||||
|
||||
return(ProcDbeAllocateBackBufferName(client));
|
||||
|
@ -997,13 +992,11 @@ static int
|
|||
SProcDbeDeallocateBackBufferName(ClientPtr client)
|
||||
{
|
||||
REQUEST (xDbeDeallocateBackBufferNameReq);
|
||||
register int n;
|
||||
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq);
|
||||
|
||||
swapl(&stuff->buffer, n);
|
||||
swapl(&stuff->buffer);
|
||||
|
||||
return(ProcDbeDeallocateBackBufferName(client));
|
||||
|
||||
|
@ -1035,14 +1028,14 @@ static int
|
|||
SProcDbeSwapBuffers(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDbeSwapBuffersReq);
|
||||
register int i, n;
|
||||
register int i;
|
||||
xDbeSwapInfo *pSwapInfo;
|
||||
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
|
||||
|
||||
swapl(&stuff->n, n);
|
||||
swapl(&stuff->n);
|
||||
|
||||
if (stuff->n != 0)
|
||||
{
|
||||
|
@ -1054,7 +1047,7 @@ SProcDbeSwapBuffers(ClientPtr client)
|
|||
*/
|
||||
for (i = 0; i < stuff->n; i++)
|
||||
{
|
||||
swapl(&pSwapInfo->window, n);
|
||||
swapl(&pSwapInfo->window);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1083,9 +1076,8 @@ static int
|
|||
SProcDbeBeginIdiom(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDbeBeginIdiomReq);
|
||||
register int n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return(ProcDbeBeginIdiom(client));
|
||||
|
||||
} /* SProcDbeBeginIdiom() */
|
||||
|
@ -1112,13 +1104,11 @@ static int
|
|||
SProcDbeGetVisualInfo(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDbeGetVisualInfoReq);
|
||||
register int n;
|
||||
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xDbeGetVisualInfoReq);
|
||||
|
||||
swapl(&stuff->n, n);
|
||||
swapl(&stuff->n);
|
||||
SwapRestL(stuff);
|
||||
|
||||
return(ProcDbeGetVisualInfo(client));
|
||||
|
@ -1146,12 +1136,11 @@ static int
|
|||
SProcDbeGetBackBufferAttributes(ClientPtr client)
|
||||
{
|
||||
REQUEST (xDbeGetBackBufferAttributesReq);
|
||||
register int n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
|
||||
|
||||
swapl(&stuff->buffer, n);
|
||||
swapl(&stuff->buffer);
|
||||
|
||||
return(ProcDbeGetBackBufferAttributes(client));
|
||||
|
||||
|
|
|
@ -3584,7 +3584,7 @@ ProcInitialConnection(ClientPtr client)
|
|||
bytes_to_int32(prefix->nbytesAuthString);
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&stuff->length, whichbyte);
|
||||
swaps(&stuff->length);
|
||||
}
|
||||
ResetCurrentRequest(client);
|
||||
return Success;
|
||||
|
|
401
dix/swaprep.c
401
dix/swaprep.c
|
@ -74,14 +74,13 @@ void
|
|||
Swap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
|
||||
{
|
||||
int i;
|
||||
char n;
|
||||
|
||||
size >>= 2;
|
||||
for(i = 0; i < size; i++)
|
||||
/* brackets are mandatory here, because "swapl" macro expands
|
||||
to several statements */
|
||||
{
|
||||
swapl(&pbuf[i], n);
|
||||
swapl(&pbuf[i]);
|
||||
}
|
||||
(void)WriteToClient(pClient, size << 2, (char *) pbuf);
|
||||
}
|
||||
|
@ -187,9 +186,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
|
|||
void
|
||||
SGenericReply(ClientPtr pClient, int size, xGenericReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
|
@ -198,67 +195,57 @@ void
|
|||
SGetWindowAttributesReply(ClientPtr pClient, int size,
|
||||
xGetWindowAttributesReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swapl(&pRep->visualID, n);
|
||||
swaps(&pRep->class, n);
|
||||
swapl(&pRep->backingBitPlanes, n);
|
||||
swapl(&pRep->backingPixel, n);
|
||||
swapl(&pRep->colormap, n);
|
||||
swapl(&pRep->allEventMasks, n);
|
||||
swapl(&pRep->yourEventMask, n);
|
||||
swaps(&pRep->doNotPropagateMask, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swapl(&pRep->visualID);
|
||||
swaps(&pRep->class);
|
||||
swapl(&pRep->backingBitPlanes);
|
||||
swapl(&pRep->backingPixel);
|
||||
swapl(&pRep->colormap);
|
||||
swapl(&pRep->allEventMasks);
|
||||
swapl(&pRep->yourEventMask);
|
||||
swaps(&pRep->doNotPropagateMask);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->root, n);
|
||||
swaps(&pRep->x, n);
|
||||
swaps(&pRep->y, n);
|
||||
swaps(&pRep->width, n);
|
||||
swaps(&pRep->height, n);
|
||||
swaps(&pRep->borderWidth, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->root);
|
||||
swaps(&pRep->x);
|
||||
swaps(&pRep->y);
|
||||
swaps(&pRep->width);
|
||||
swaps(&pRep->height);
|
||||
swaps(&pRep->borderWidth);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swapl(&pRep->root, n);
|
||||
swapl(&pRep->parent, n);
|
||||
swaps(&pRep->nChildren, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swapl(&pRep->root);
|
||||
swapl(&pRep->parent);
|
||||
swaps(&pRep->nChildren);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->atom, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->atom);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->nameLength, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swaps(&pRep->nameLength);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
|
@ -266,24 +253,20 @@ SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep)
|
|||
void
|
||||
SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swapl(&pRep->propertyType, n);
|
||||
swapl(&pRep->bytesAfter, n);
|
||||
swapl(&pRep->nItems, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swapl(&pRep->propertyType);
|
||||
swapl(&pRep->bytesAfter);
|
||||
swapl(&pRep->nItems);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->nProperties, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swaps(&pRep->nProperties);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
|
@ -291,10 +274,8 @@ void
|
|||
SGetSelectionOwnerReply(ClientPtr pClient, int size,
|
||||
xGetSelectionOwnerReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->owner, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->owner);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
|
@ -302,27 +283,23 @@ SGetSelectionOwnerReply(ClientPtr pClient, int size,
|
|||
void
|
||||
SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->root, n);
|
||||
swapl(&pRep->child, n);
|
||||
swaps(&pRep->rootX, n);
|
||||
swaps(&pRep->rootY, n);
|
||||
swaps(&pRep->winX, n);
|
||||
swaps(&pRep->winY, n);
|
||||
swaps(&pRep->mask, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->root);
|
||||
swapl(&pRep->child);
|
||||
swaps(&pRep->rootX);
|
||||
swaps(&pRep->rootY);
|
||||
swaps(&pRep->winX);
|
||||
swaps(&pRep->winY);
|
||||
swaps(&pRep->mask);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
static void
|
||||
SwapTimecoord(xTimecoord* pCoord)
|
||||
{
|
||||
char n;
|
||||
|
||||
swapl(&pCoord->time, n);
|
||||
swaps(&pCoord->x, n);
|
||||
swaps(&pCoord->y, n);
|
||||
swapl(&pCoord->time);
|
||||
swaps(&pCoord->x);
|
||||
swaps(&pCoord->y);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -344,33 +321,27 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord *pRep)
|
|||
void
|
||||
SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swapl(&pRep->nEvents, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swapl(&pRep->nEvents);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->child, n);
|
||||
swaps(&pRep->dstX, n);
|
||||
swaps(&pRep->dstY, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->child);
|
||||
swaps(&pRep->dstX);
|
||||
swaps(&pRep->dstY);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->focus, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->focus);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
|
@ -378,40 +349,34 @@ SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep)
|
|||
void
|
||||
SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
static void
|
||||
SwapCharInfo(xCharInfo *pInfo)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pInfo->leftSideBearing, n);
|
||||
swaps(&pInfo->rightSideBearing, n);
|
||||
swaps(&pInfo->characterWidth, n);
|
||||
swaps(&pInfo->ascent, n);
|
||||
swaps(&pInfo->descent, n);
|
||||
swaps(&pInfo->attributes, n);
|
||||
swaps(&pInfo->leftSideBearing);
|
||||
swaps(&pInfo->rightSideBearing);
|
||||
swaps(&pInfo->characterWidth);
|
||||
swaps(&pInfo->ascent);
|
||||
swaps(&pInfo->descent);
|
||||
swaps(&pInfo->attributes);
|
||||
}
|
||||
|
||||
static void
|
||||
SwapFontInfo(xQueryFontReply *pr)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pr->minCharOrByte2, n);
|
||||
swaps(&pr->maxCharOrByte2, n);
|
||||
swaps(&pr->defaultChar, n);
|
||||
swaps(&pr->nFontProps, n);
|
||||
swaps(&pr->fontAscent, n);
|
||||
swaps(&pr->fontDescent, n);
|
||||
swaps(&pr->minCharOrByte2);
|
||||
swaps(&pr->maxCharOrByte2);
|
||||
swaps(&pr->defaultChar);
|
||||
swaps(&pr->nFontProps);
|
||||
swaps(&pr->fontAscent);
|
||||
swaps(&pr->fontDescent);
|
||||
SwapCharInfo( &pr->minBounds);
|
||||
SwapCharInfo( &pr->maxBounds);
|
||||
swapl(&pr->nCharInfos, n);
|
||||
swapl(&pr->nCharInfos);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -421,10 +386,9 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs)
|
|||
xCharInfo * pxci;
|
||||
unsigned nchars, nprops;
|
||||
char *pby;
|
||||
char n;
|
||||
|
||||
swaps(&pr->sequenceNumber, n);
|
||||
swapl(&pr->length, n);
|
||||
swaps(&pr->sequenceNumber);
|
||||
swapl(&pr->length);
|
||||
nchars = pr->nCharInfos;
|
||||
nprops = pr->nFontProps;
|
||||
SwapFontInfo(pr);
|
||||
|
@ -433,9 +397,9 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs)
|
|||
* they are always 2 4 byte values */
|
||||
for(i = 0; i < nprops; i++)
|
||||
{
|
||||
swapl(pby, n);
|
||||
swapl(pby);
|
||||
pby += 4;
|
||||
swapl(pby, n);
|
||||
swapl(pby);
|
||||
pby += 4;
|
||||
}
|
||||
if (hasGlyphs)
|
||||
|
@ -456,27 +420,23 @@ SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply *pRep)
|
|||
void
|
||||
SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swaps(&pRep->fontAscent, n);
|
||||
swaps(&pRep->fontDescent, n);
|
||||
swaps(&pRep->overallAscent, n);
|
||||
swaps(&pRep->overallDescent, n);
|
||||
swapl(&pRep->overallWidth, n);
|
||||
swapl(&pRep->overallLeft, n);
|
||||
swapl(&pRep->overallRight, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swaps(&pRep->fontAscent);
|
||||
swaps(&pRep->fontDescent);
|
||||
swaps(&pRep->overallAscent);
|
||||
swaps(&pRep->overallDescent);
|
||||
swapl(&pRep->overallWidth);
|
||||
swapl(&pRep->overallLeft);
|
||||
swapl(&pRep->overallRight);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SListFontsReply(ClientPtr pClient, int size, xListFontsReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->nFonts, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swaps(&pRep->nFonts);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
|
@ -491,22 +451,18 @@ SListFontsWithInfoReply(ClientPtr pClient, int size,
|
|||
void
|
||||
SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->nPaths, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swaps(&pRep->nPaths);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SGetImageReply(ClientPtr pClient, int size, xGetImageReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swapl(&pRep->visual, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swapl(&pRep->visual);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
/* Fortunately, image doesn't need swapping */
|
||||
}
|
||||
|
@ -515,52 +471,44 @@ void
|
|||
SListInstalledColormapsReply(ClientPtr pClient, int size,
|
||||
xListInstalledColormapsReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->nColormaps, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swaps(&pRep->nColormaps);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swaps(&pRep->red, n);
|
||||
swaps(&pRep->green, n);
|
||||
swaps(&pRep->blue, n);
|
||||
swapl(&pRep->pixel, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swaps(&pRep->red);
|
||||
swaps(&pRep->green);
|
||||
swaps(&pRep->blue);
|
||||
swapl(&pRep->pixel);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->pixel, n);
|
||||
swaps(&pRep->exactRed, n);
|
||||
swaps(&pRep->exactGreen, n);
|
||||
swaps(&pRep->exactBlue, n);
|
||||
swaps(&pRep->screenRed, n);
|
||||
swaps(&pRep->screenGreen, n);
|
||||
swaps(&pRep->screenBlue, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->pixel);
|
||||
swaps(&pRep->exactRed);
|
||||
swaps(&pRep->exactGreen);
|
||||
swaps(&pRep->exactBlue);
|
||||
swaps(&pRep->screenRed);
|
||||
swaps(&pRep->screenGreen);
|
||||
swaps(&pRep->screenBlue);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->nPixels, n);
|
||||
swaps(&pRep->nMasks, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swaps(&pRep->nPixels);
|
||||
swaps(&pRep->nMasks);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
|
@ -568,25 +516,21 @@ SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep)
|
|||
void
|
||||
SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->nPixels, n);
|
||||
swapl(&pRep->redMask, n);
|
||||
swapl(&pRep->greenMask, n);
|
||||
swapl(&pRep->blueMask, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swaps(&pRep->nPixels);
|
||||
swapl(&pRep->redMask);
|
||||
swapl(&pRep->greenMask);
|
||||
swapl(&pRep->blueMask);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
static void
|
||||
SwapRGB(xrgb *prgb)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&prgb->red, n);
|
||||
swaps(&prgb->green, n);
|
||||
swaps(&prgb->blue, n);
|
||||
swaps(&prgb->red);
|
||||
swaps(&prgb->green);
|
||||
swaps(&prgb->blue);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -608,47 +552,39 @@ SQColorsExtend(ClientPtr pClient, int size, xrgb *prgb)
|
|||
void
|
||||
SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply* pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->nColors, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swaps(&pRep->nColors);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swaps(&pRep->exactRed, n);
|
||||
swaps(&pRep->exactGreen, n);
|
||||
swaps(&pRep->exactBlue, n);
|
||||
swaps(&pRep->screenRed, n);
|
||||
swaps(&pRep->screenGreen, n);
|
||||
swaps(&pRep->screenBlue, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swaps(&pRep->exactRed);
|
||||
swaps(&pRep->exactGreen);
|
||||
swaps(&pRep->exactBlue);
|
||||
swaps(&pRep->screenRed);
|
||||
swaps(&pRep->screenGreen);
|
||||
swaps(&pRep->screenBlue);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swaps(&pRep->width, n);
|
||||
swaps(&pRep->height, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swaps(&pRep->width);
|
||||
swaps(&pRep->height);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
|
@ -656,10 +592,8 @@ void
|
|||
SGetKeyboardMappingReply(ClientPtr pClient, int size,
|
||||
xGetKeyboardMappingReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
|
@ -667,10 +601,8 @@ void
|
|||
SGetPointerMappingReply(ClientPtr pClient, int size,
|
||||
xGetPointerMappingReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
|
@ -678,46 +610,38 @@ void
|
|||
SGetModifierMappingReply(ClientPtr pClient, int size,
|
||||
xGetModifierMappingReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swapl(&pRep->ledMask, n);
|
||||
swaps(&pRep->bellPitch, n);
|
||||
swaps(&pRep->bellDuration, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swapl(&pRep->ledMask);
|
||||
swaps(&pRep->bellPitch);
|
||||
swaps(&pRep->bellDuration);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swaps(&pRep->accelNumerator, n);
|
||||
swaps(&pRep->accelDenominator, n);
|
||||
swaps(&pRep->threshold, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swaps(&pRep->accelNumerator);
|
||||
swaps(&pRep->accelDenominator);
|
||||
swaps(&pRep->threshold);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swaps(&pRep->timeout, n);
|
||||
swaps(&pRep->interval, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swaps(&pRep->timeout);
|
||||
swaps(&pRep->interval);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
|
@ -729,8 +653,7 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf)
|
|||
while (bufT < endbuf) {
|
||||
xHostEntry *host = (xHostEntry *) bufT;
|
||||
int len = host->length;
|
||||
char n;
|
||||
swaps (&host->length, n);
|
||||
swaps(&host->length);
|
||||
bufT += sizeof (xHostEntry) + pad_to_int32(len);
|
||||
}
|
||||
(void)WriteToClient (pClient, size, buf);
|
||||
|
@ -739,11 +662,9 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf)
|
|||
void
|
||||
SListHostsReply(ClientPtr pClient, int size, xListHostsReply *pRep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swaps(&pRep->nHosts, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swaps(&pRep->nHosts);
|
||||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
|
|
728
dix/swapreq.c
728
dix/swapreq.c
File diff suppressed because it is too large
Load Diff
241
hw/dmx/dmx.c
241
hw/dmx/dmx.c
|
@ -174,7 +174,6 @@ static int dmxFetchInputAttributes(unsigned int mask,
|
|||
static int ProcDMXQueryVersion(ClientPtr client)
|
||||
{
|
||||
xDMXQueryVersionReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
|
||||
|
||||
|
@ -185,11 +184,11 @@ static int ProcDMXQueryVersion(ClientPtr client)
|
|||
rep.minorVersion = SERVER_DMX_MINOR_VERSION;
|
||||
rep.patchVersion = SERVER_DMX_PATCH_VERSION;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.majorVersion, n);
|
||||
swapl(&rep.minorVersion, n);
|
||||
swapl(&rep.patchVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.majorVersion);
|
||||
swapl(&rep.minorVersion);
|
||||
swapl(&rep.patchVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -198,7 +197,6 @@ static int ProcDMXQueryVersion(ClientPtr client)
|
|||
static int ProcDMXSync(ClientPtr client)
|
||||
{
|
||||
xDMXSyncReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xDMXSyncReq);
|
||||
|
||||
|
@ -209,9 +207,9 @@ static int ProcDMXSync(ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.status = 0;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.status, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.status);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDMXSyncReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -222,7 +220,6 @@ static int ProcDMXForceWindowCreation(ClientPtr client)
|
|||
xDMXForceWindowCreationReply rep;
|
||||
REQUEST(xDMXForceWindowCreationReq);
|
||||
WindowPtr pWin;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
|
||||
|
||||
|
@ -259,9 +256,9 @@ static int ProcDMXForceWindowCreation(ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.status = 0;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.status, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.status);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDMXForceWindowCreationReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -270,7 +267,6 @@ static int ProcDMXForceWindowCreation(ClientPtr client)
|
|||
static int ProcDMXGetScreenCount(ClientPtr client)
|
||||
{
|
||||
xDMXGetScreenCountReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
|
||||
|
||||
|
@ -279,9 +275,9 @@ static int ProcDMXGetScreenCount(ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.screenCount = dmxGetNumScreens();
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.screenCount, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.screenCount);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -291,7 +287,6 @@ static int ProcDMXGetScreenAttributes(ClientPtr client)
|
|||
{
|
||||
REQUEST(xDMXGetScreenAttributesReq);
|
||||
xDMXGetScreenAttributesReply rep;
|
||||
int n;
|
||||
int length;
|
||||
int paddedLength;
|
||||
DMXScreenAttributesRec attr;
|
||||
|
@ -325,20 +320,20 @@ static int ProcDMXGetScreenAttributes(ClientPtr client)
|
|||
rep.displayNameLength = length;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.displayNameLength, n);
|
||||
swapl(&rep.logicalScreen, n);
|
||||
swaps(&rep.screenWindowWidth, n);
|
||||
swaps(&rep.screenWindowHeight, n);
|
||||
swaps(&rep.screenWindowXoffset, n);
|
||||
swaps(&rep.screenWindowYoffset, n);
|
||||
swaps(&rep.rootWindowWidth, n);
|
||||
swaps(&rep.rootWindowHeight, n);
|
||||
swaps(&rep.rootWindowXoffset, n);
|
||||
swaps(&rep.rootWindowYoffset, n);
|
||||
swaps(&rep.rootWindowXorigin, n);
|
||||
swaps(&rep.rootWindowYorigin, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.displayNameLength);
|
||||
swapl(&rep.logicalScreen);
|
||||
swaps(&rep.screenWindowWidth);
|
||||
swaps(&rep.screenWindowHeight);
|
||||
swaps(&rep.screenWindowXoffset);
|
||||
swaps(&rep.screenWindowYoffset);
|
||||
swaps(&rep.rootWindowWidth);
|
||||
swaps(&rep.rootWindowHeight);
|
||||
swaps(&rep.rootWindowXoffset);
|
||||
swaps(&rep.rootWindowYoffset);
|
||||
swaps(&rep.rootWindowXorigin);
|
||||
swaps(&rep.rootWindowYorigin);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *)&rep);
|
||||
if (length) WriteToClient(client, length, (char *)attr.displayName);
|
||||
|
@ -349,7 +344,6 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client)
|
|||
{
|
||||
REQUEST(xDMXChangeScreensAttributesReq);
|
||||
xDMXChangeScreensAttributesReply rep;
|
||||
int n;
|
||||
int status = DMX_BAD_XINERAMA;
|
||||
unsigned int mask = 0;
|
||||
unsigned int i;
|
||||
|
@ -407,10 +401,10 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client)
|
|||
rep.status = status;
|
||||
rep.errorScreen = errorScreen;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.status, n);
|
||||
swapl(&rep.errorScreen, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.status);
|
||||
swapl(&rep.errorScreen);
|
||||
}
|
||||
WriteToClient(client,
|
||||
sizeof(xDMXChangeScreensAttributesReply),
|
||||
|
@ -422,7 +416,6 @@ static int ProcDMXAddScreen(ClientPtr client)
|
|||
{
|
||||
REQUEST(xDMXAddScreenReq);
|
||||
xDMXAddScreenReply rep;
|
||||
int n;
|
||||
int status = 0;
|
||||
CARD32 *value_list;
|
||||
DMXScreenAttributesRec attr;
|
||||
|
@ -458,10 +451,10 @@ static int ProcDMXAddScreen(ClientPtr client)
|
|||
rep.status = status;
|
||||
rep.physicalScreen = stuff->physicalScreen;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.status, n);
|
||||
swapl(&rep.physicalScreen, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.status);
|
||||
swapl(&rep.physicalScreen);
|
||||
}
|
||||
WriteToClient(client,
|
||||
sizeof(xDMXAddScreenReply),
|
||||
|
@ -473,7 +466,6 @@ static int ProcDMXRemoveScreen(ClientPtr client)
|
|||
{
|
||||
REQUEST(xDMXRemoveScreenReq);
|
||||
xDMXRemoveScreenReply rep;
|
||||
int n;
|
||||
int status = 0;
|
||||
|
||||
REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
|
||||
|
@ -485,9 +477,9 @@ static int ProcDMXRemoveScreen(ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.status = status;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.status, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.status);
|
||||
}
|
||||
WriteToClient(client,
|
||||
sizeof(xDMXRemoveScreenReply),
|
||||
|
@ -563,7 +555,7 @@ static int ProcDMXGetWindowAttributes(ClientPtr client)
|
|||
{
|
||||
REQUEST(xDMXGetWindowAttributesReq);
|
||||
xDMXGetWindowAttributesReply rep;
|
||||
int i, n;
|
||||
int i;
|
||||
CARD32 *screens;
|
||||
CARD32 *windows;
|
||||
xRectangle *pos, *vis;
|
||||
|
@ -603,22 +595,22 @@ static int ProcDMXGetWindowAttributes(ClientPtr client)
|
|||
rep.length = count * 6;
|
||||
rep.screenCount = count;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.screenCount, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.screenCount);
|
||||
for (i = 0; i < count; i++) {
|
||||
swapl(&screens[i], n);
|
||||
swapl(&windows[i], n);
|
||||
swapl(&screens[i]);
|
||||
swapl(&windows[i]);
|
||||
|
||||
swaps(&pos[i].x, n);
|
||||
swaps(&pos[i].y, n);
|
||||
swaps(&pos[i].width, n);
|
||||
swaps(&pos[i].height, n);
|
||||
swaps(&pos[i].x);
|
||||
swaps(&pos[i].y);
|
||||
swaps(&pos[i].width);
|
||||
swaps(&pos[i].height);
|
||||
|
||||
swaps(&vis[i].x, n);
|
||||
swaps(&vis[i].y, n);
|
||||
swaps(&vis[i].width, n);
|
||||
swaps(&vis[i].height, n);
|
||||
swaps(&vis[i].x);
|
||||
swaps(&vis[i].y);
|
||||
swaps(&vis[i].width);
|
||||
swaps(&vis[i].height);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -643,7 +635,6 @@ static int ProcDMXGetWindowAttributes(ClientPtr client)
|
|||
static int ProcDMXGetDesktopAttributes(ClientPtr client)
|
||||
{
|
||||
xDMXGetDesktopAttributesReply rep;
|
||||
int n;
|
||||
DMXDesktopAttributesRec attr;
|
||||
|
||||
REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
|
||||
|
@ -660,12 +651,12 @@ static int ProcDMXGetDesktopAttributes(ClientPtr client)
|
|||
rep.length = 0;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.width, n);
|
||||
swapl(&rep.height, n);
|
||||
swapl(&rep.shiftX, n);
|
||||
swapl(&rep.shiftY, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.width);
|
||||
swapl(&rep.height);
|
||||
swapl(&rep.shiftX);
|
||||
swapl(&rep.shiftY);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -675,7 +666,6 @@ static int ProcDMXChangeDesktopAttributes(ClientPtr client)
|
|||
{
|
||||
REQUEST(xDMXChangeDesktopAttributesReq);
|
||||
xDMXChangeDesktopAttributesReply rep;
|
||||
int n;
|
||||
int status = DMX_BAD_XINERAMA;
|
||||
CARD32 *value_list;
|
||||
DMXDesktopAttributesRec attr;
|
||||
|
@ -704,9 +694,9 @@ static int ProcDMXChangeDesktopAttributes(ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.status = status;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.status, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.status);
|
||||
}
|
||||
WriteToClient(client,
|
||||
sizeof(xDMXChangeDesktopAttributesReply),
|
||||
|
@ -717,7 +707,6 @@ static int ProcDMXChangeDesktopAttributes(ClientPtr client)
|
|||
static int ProcDMXGetInputCount(ClientPtr client)
|
||||
{
|
||||
xDMXGetInputCountReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
|
||||
|
||||
|
@ -726,9 +715,9 @@ static int ProcDMXGetInputCount(ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.inputCount = dmxGetInputCount();
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.inputCount, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.inputCount);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -738,7 +727,6 @@ static int ProcDMXGetInputAttributes(ClientPtr client)
|
|||
{
|
||||
REQUEST(xDMXGetInputAttributesReq);
|
||||
xDMXGetInputAttributesReply rep;
|
||||
int n;
|
||||
int length;
|
||||
int paddedLength;
|
||||
DMXInputAttributesRec attr;
|
||||
|
@ -760,12 +748,12 @@ static int ProcDMXGetInputAttributes(ClientPtr client)
|
|||
rep.length = bytes_to_int32(paddedLength);
|
||||
rep.nameLength = length;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.inputType, n);
|
||||
swapl(&rep.physicalScreen, n);
|
||||
swapl(&rep.physicalId, n);
|
||||
swapl(&rep.nameLength, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.inputType);
|
||||
swapl(&rep.physicalScreen);
|
||||
swapl(&rep.physicalId);
|
||||
swapl(&rep.nameLength);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *)&rep);
|
||||
if (length) WriteToClient(client, length, (char *)attr.name);
|
||||
|
@ -776,7 +764,6 @@ static int ProcDMXAddInput(ClientPtr client)
|
|||
{
|
||||
REQUEST(xDMXAddInputReq);
|
||||
xDMXAddInputReply rep;
|
||||
int n;
|
||||
int status = 0;
|
||||
CARD32 *value_list;
|
||||
DMXInputAttributesRec attr;
|
||||
|
@ -814,10 +801,10 @@ static int ProcDMXAddInput(ClientPtr client)
|
|||
rep.status = status;
|
||||
rep.physicalId = id;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.status, n);
|
||||
swapl(&rep.physicalId, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.status);
|
||||
swapl(&rep.physicalId);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDMXAddInputReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -827,7 +814,6 @@ static int ProcDMXRemoveInput(ClientPtr client)
|
|||
{
|
||||
REQUEST(xDMXRemoveInputReq);
|
||||
xDMXRemoveInputReply rep;
|
||||
int n;
|
||||
int status = 0;
|
||||
|
||||
REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
|
||||
|
@ -841,9 +827,9 @@ static int ProcDMXRemoveInput(ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.status = status;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.status, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.status);
|
||||
}
|
||||
WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -883,79 +869,72 @@ static int ProcDMXDispatch(ClientPtr client)
|
|||
|
||||
static int SProcDMXQueryVersion(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
|
||||
return ProcDMXQueryVersion(client);
|
||||
}
|
||||
|
||||
static int SProcDMXSync(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXSyncReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDMXSyncReq);
|
||||
return ProcDMXSync(client);
|
||||
}
|
||||
|
||||
static int SProcDMXForceWindowCreation(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXForceWindowCreationReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
|
||||
swaps(&stuff->window, n);
|
||||
swaps(&stuff->window);
|
||||
return ProcDMXForceWindowCreation(client);
|
||||
}
|
||||
|
||||
static int SProcDMXGetScreenCount(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXGetScreenCountReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
|
||||
return ProcDMXGetScreenCount(client);
|
||||
}
|
||||
|
||||
static int SProcDMXGetScreenAttributes(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXGetScreenAttributesReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq);
|
||||
swapl(&stuff->physicalScreen, n);
|
||||
swapl(&stuff->physicalScreen);
|
||||
return ProcDMXGetScreenAttributes(client);
|
||||
}
|
||||
|
||||
static int SProcDMXChangeScreensAttributes(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXChangeScreensAttributesReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xDMXGetScreenAttributesReq);
|
||||
swapl(&stuff->screenCount, n);
|
||||
swapl(&stuff->maskCount, n);
|
||||
swapl(&stuff->screenCount);
|
||||
swapl(&stuff->maskCount);
|
||||
SwapRestL(stuff);
|
||||
return ProcDMXGetScreenAttributes(client);
|
||||
}
|
||||
|
||||
static int SProcDMXAddScreen(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
int paddedLength;
|
||||
REQUEST(xDMXAddScreenReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
|
||||
swapl(&stuff->displayNameLength, n);
|
||||
swapl(&stuff->valueMask, n);
|
||||
swapl(&stuff->displayNameLength);
|
||||
swapl(&stuff->valueMask);
|
||||
paddedLength = pad_to_int32(stuff->displayNameLength);
|
||||
SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
|
||||
return ProcDMXAddScreen(client);
|
||||
|
@ -963,79 +942,72 @@ static int SProcDMXAddScreen(ClientPtr client)
|
|||
|
||||
static int SProcDMXRemoveScreen(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXRemoveScreenReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
|
||||
swapl(&stuff->physicalScreen, n);
|
||||
swapl(&stuff->physicalScreen);
|
||||
return ProcDMXRemoveScreen(client);
|
||||
}
|
||||
|
||||
static int SProcDMXGetWindowAttributes(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXGetWindowAttributesReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq);
|
||||
swapl(&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return ProcDMXGetWindowAttributes(client);
|
||||
}
|
||||
|
||||
static int SProcDMXGetDesktopAttributes(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXGetDesktopAttributesReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
|
||||
return ProcDMXGetDesktopAttributes(client);
|
||||
}
|
||||
|
||||
static int SProcDMXChangeDesktopAttributes(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXChangeDesktopAttributesReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq);
|
||||
swapl(&stuff->valueMask, n);
|
||||
swapl(&stuff->valueMask);
|
||||
SwapRestL(stuff);
|
||||
return ProcDMXChangeDesktopAttributes(client);
|
||||
}
|
||||
|
||||
static int SProcDMXGetInputCount(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXGetInputCountReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
|
||||
return ProcDMXGetInputCount(client);
|
||||
}
|
||||
|
||||
static int SProcDMXGetInputAttributes(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXGetInputAttributesReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq);
|
||||
swapl(&stuff->deviceId, n);
|
||||
swapl(&stuff->deviceId);
|
||||
return ProcDMXGetInputAttributes(client);
|
||||
}
|
||||
|
||||
static int SProcDMXAddInput(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
int paddedLength;
|
||||
REQUEST(xDMXAddInputReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
|
||||
swapl(&stuff->displayNameLength, n);
|
||||
swapl(&stuff->valueMask, n);
|
||||
swapl(&stuff->displayNameLength);
|
||||
swapl(&stuff->valueMask);
|
||||
paddedLength = pad_to_int32(stuff->displayNameLength);
|
||||
SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
|
||||
return ProcDMXAddInput(client);
|
||||
|
@ -1043,12 +1015,11 @@ static int SProcDMXAddInput(ClientPtr client)
|
|||
|
||||
static int SProcDMXRemoveInput(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xDMXRemoveInputReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
|
||||
swapl(&stuff->physicalId, n);
|
||||
swapl(&stuff->physicalId);
|
||||
return ProcDMXRemoveInput(client);
|
||||
}
|
||||
|
||||
|
|
|
@ -541,7 +541,6 @@ static int
|
|||
ProcXF86DRIQueryVersion (register ClientPtr client)
|
||||
{
|
||||
xXF86DRIQueryVersionReply rep;
|
||||
register int n;
|
||||
REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
|
||||
|
||||
EPHYR_LOG ("enter\n") ;
|
||||
|
@ -553,11 +552,11 @@ ProcXF86DRIQueryVersion (register ClientPtr client)
|
|||
rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION;
|
||||
rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.majorVersion, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swapl(&rep.patchVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
swapl(&rep.patchVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep);
|
||||
EPHYR_LOG ("leave\n") ;
|
||||
|
@ -569,7 +568,6 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
|
|||
{
|
||||
xXF86DRIQueryDirectRenderingCapableReply rep;
|
||||
Bool isCapable;
|
||||
register int n;
|
||||
REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
|
||||
REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq);
|
||||
|
||||
|
@ -592,8 +590,8 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
|
|||
rep.isCapable = 0;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep);
|
||||
|
@ -1311,19 +1309,17 @@ ProcXF86DRIDispatch (register ClientPtr client)
|
|||
static int
|
||||
SProcXF86DRIQueryVersion (register ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86DRIQueryVersionReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return ProcXF86DRIQueryVersion(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->screen, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->screen);
|
||||
return ProcXF86DRIQueryDirectRenderingCapable(client);
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ ephyrHostProxyDoForward (pointer a_request_buffer,
|
|||
EPHYR_LOG ("enter\n") ;
|
||||
|
||||
if (a_do_swap) {
|
||||
swaps (&in_req->length, n) ;
|
||||
swaps(&in_req->length) ;
|
||||
}
|
||||
EPHYR_LOG ("Req {type:%d, data:%d, length:%d}\n",
|
||||
in_req->reqType, in_req->data, in_req->length) ;
|
||||
|
|
|
@ -760,8 +760,7 @@ vfbWriteXWDFileHeader(ScreenPtr pScreen)
|
|||
SwapLongs((CARD32 *)pXWDHeader, SIZEOF(XWDheader)/4);
|
||||
for (i = 0; i < pvfb->ncolors; i++)
|
||||
{
|
||||
register char n;
|
||||
swapl(&pvfb->pXWDCmap[i].pixel, n);
|
||||
swapl(&pvfb->pXWDCmap[i].pixel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -282,7 +282,6 @@ static int
|
|||
ProcXF86VidModeQueryVersion(ClientPtr client)
|
||||
{
|
||||
xXF86VidModeQueryVersionReply rep;
|
||||
register int n;
|
||||
|
||||
DEBUG_P("XF86VidModeQueryVersion");
|
||||
|
||||
|
@ -293,10 +292,10 @@ ProcXF86VidModeQueryVersion(ClientPtr client)
|
|||
rep.majorVersion = SERVER_XF86VIDMODE_MAJOR_VERSION;
|
||||
rep.minorVersion = SERVER_XF86VIDMODE_MINOR_VERSION;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.majorVersion, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -309,7 +308,6 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
|
|||
xXF86VidModeGetModeLineReply rep;
|
||||
xXF86OldVidModeGetModeLineReply oldrep;
|
||||
pointer mode;
|
||||
register int n;
|
||||
int dotClock;
|
||||
int ver;
|
||||
|
||||
|
@ -364,20 +362,20 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
|
|||
rep.privsize = 0;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.dotclock, n);
|
||||
swaps(&rep.hdisplay, n);
|
||||
swaps(&rep.hsyncstart, n);
|
||||
swaps(&rep.hsyncend, n);
|
||||
swaps(&rep.htotal, n);
|
||||
swaps(&rep.hskew, n);
|
||||
swaps(&rep.vdisplay, n);
|
||||
swaps(&rep.vsyncstart, n);
|
||||
swaps(&rep.vsyncend, n);
|
||||
swaps(&rep.vtotal, n);
|
||||
swapl(&rep.flags, n);
|
||||
swapl(&rep.privsize, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.dotclock);
|
||||
swaps(&rep.hdisplay);
|
||||
swaps(&rep.hsyncstart);
|
||||
swaps(&rep.hsyncend);
|
||||
swaps(&rep.htotal);
|
||||
swaps(&rep.hskew);
|
||||
swaps(&rep.vdisplay);
|
||||
swaps(&rep.vsyncstart);
|
||||
swaps(&rep.vsyncend);
|
||||
swaps(&rep.vtotal);
|
||||
swapl(&rep.flags);
|
||||
swapl(&rep.privsize);
|
||||
}
|
||||
if (ver < 2) {
|
||||
oldrep.type = rep.type;
|
||||
|
@ -412,7 +410,6 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
|
|||
xXF86OldVidModeModeInfo oldmdinf;
|
||||
pointer mode;
|
||||
int modecount, dotClock;
|
||||
register int n;
|
||||
int ver;
|
||||
|
||||
DEBUG_P("XF86VidModeGetAllModelines");
|
||||
|
@ -442,9 +439,9 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.modecount = modecount;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.modecount, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.modecount);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply), (char *)&rep);
|
||||
|
||||
|
@ -462,18 +459,18 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
|
|||
mdinf.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
|
||||
mdinf.privsize = 0;
|
||||
if (client->swapped) {
|
||||
swapl(&mdinf.dotclock, n);
|
||||
swaps(&mdinf.hdisplay, n);
|
||||
swaps(&mdinf.hsyncstart, n);
|
||||
swaps(&mdinf.hsyncend, n);
|
||||
swaps(&mdinf.htotal, n);
|
||||
swaps(&mdinf.hskew, n);
|
||||
swaps(&mdinf.vdisplay, n);
|
||||
swaps(&mdinf.vsyncstart, n);
|
||||
swaps(&mdinf.vsyncend, n);
|
||||
swaps(&mdinf.vtotal, n);
|
||||
swapl(&mdinf.flags, n);
|
||||
swapl(&mdinf.privsize, n);
|
||||
swapl(&mdinf.dotclock);
|
||||
swaps(&mdinf.hdisplay);
|
||||
swaps(&mdinf.hsyncstart);
|
||||
swaps(&mdinf.hsyncend);
|
||||
swaps(&mdinf.htotal);
|
||||
swaps(&mdinf.hskew);
|
||||
swaps(&mdinf.vdisplay);
|
||||
swaps(&mdinf.vsyncstart);
|
||||
swaps(&mdinf.vsyncend);
|
||||
swaps(&mdinf.vtotal);
|
||||
swapl(&mdinf.flags);
|
||||
swapl(&mdinf.privsize);
|
||||
}
|
||||
if (ver < 2) {
|
||||
oldmdinf.dotclock = mdinf.dotclock;
|
||||
|
@ -1016,10 +1013,9 @@ status_reply:
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.status = status;
|
||||
if (client->swapped) {
|
||||
register int n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.status, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.status);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), (char *)&rep);
|
||||
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
|
||||
|
@ -1164,7 +1160,6 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
|
|||
{
|
||||
REQUEST(xXF86VidModeGetMonitorReq);
|
||||
xXF86VidModeGetMonitorReply rep;
|
||||
register int n;
|
||||
CARD32 *hsyncdata, *vsyncdata;
|
||||
int i, nHsync, nVrefresh;
|
||||
pointer monitor;
|
||||
|
@ -1226,8 +1221,8 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
|
|||
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), (char *)&rep);
|
||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||
|
@ -1251,7 +1246,7 @@ ProcXF86VidModeGetViewPort(ClientPtr client)
|
|||
{
|
||||
REQUEST(xXF86VidModeGetViewPortReq);
|
||||
xXF86VidModeGetViewPortReply rep;
|
||||
int x, y, n;
|
||||
int x, y;
|
||||
|
||||
DEBUG_P("XF86VidModeGetViewPort");
|
||||
|
||||
|
@ -1269,10 +1264,10 @@ ProcXF86VidModeGetViewPort(ClientPtr client)
|
|||
rep.y = y;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.x, n);
|
||||
swapl(&rep.y, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.x);
|
||||
swapl(&rep.y);
|
||||
}
|
||||
WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -1301,7 +1296,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
|
|||
{
|
||||
REQUEST(xXF86VidModeGetDotClocksReq);
|
||||
xXF86VidModeGetDotClocksReply rep;
|
||||
register int n;
|
||||
int n;
|
||||
int numClocks;
|
||||
CARD32 dotclock;
|
||||
int *Clocks = NULL;
|
||||
|
@ -1338,11 +1333,11 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
|
|||
rep.flags |= CLKFLAG_PROGRAMABLE;
|
||||
}
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.clocks, n);
|
||||
swapl(&rep.maxclocks, n);
|
||||
swapl(&rep.flags, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.clocks);
|
||||
swapl(&rep.maxclocks);
|
||||
swapl(&rep.flags);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), (char *)&rep);
|
||||
if (!ClockProg) {
|
||||
|
@ -1384,7 +1379,6 @@ ProcXF86VidModeGetGamma(ClientPtr client)
|
|||
{
|
||||
REQUEST(xXF86VidModeGetGammaReq);
|
||||
xXF86VidModeGetGammaReply rep;
|
||||
register int n;
|
||||
float red, green, blue;
|
||||
|
||||
DEBUG_P("XF86VidModeGetGamma");
|
||||
|
@ -1403,11 +1397,11 @@ ProcXF86VidModeGetGamma(ClientPtr client)
|
|||
rep.green = (CARD32)(green * 10000.);
|
||||
rep.blue = (CARD32)(blue * 10000.);
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.red, n);
|
||||
swapl(&rep.green, n);
|
||||
swapl(&rep.blue, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.red);
|
||||
swapl(&rep.green);
|
||||
swapl(&rep.blue);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -1444,7 +1438,7 @@ static int
|
|||
ProcXF86VidModeGetGammaRamp(ClientPtr client)
|
||||
{
|
||||
CARD16 *ramp = NULL;
|
||||
int n, length;
|
||||
int length;
|
||||
size_t ramplen = 0;
|
||||
xXF86VidModeGetGammaRampReply rep;
|
||||
REQUEST(xXF86VidModeGetGammaRampReq);
|
||||
|
@ -1476,9 +1470,9 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.size = stuff->size;
|
||||
if(client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.size, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.size);
|
||||
SwapShorts((short*)ramp, length * 3);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *)&rep);
|
||||
|
@ -1496,7 +1490,6 @@ static int
|
|||
ProcXF86VidModeGetGammaRampSize(ClientPtr client)
|
||||
{
|
||||
xXF86VidModeGetGammaRampSizeReply rep;
|
||||
int n;
|
||||
REQUEST(xXF86VidModeGetGammaRampSizeReq);
|
||||
|
||||
if(stuff->screen >= screenInfo.numScreens)
|
||||
|
@ -1509,9 +1502,9 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.size = VidModeGetGammaRampSize(stuff->screen);
|
||||
if(client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.size, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.size);
|
||||
}
|
||||
WriteToClient(client,sizeof(xXF86VidModeGetGammaRampSizeReply),(char*)&rep);
|
||||
|
||||
|
@ -1522,7 +1515,6 @@ static int
|
|||
ProcXF86VidModeGetPermissions(ClientPtr client)
|
||||
{
|
||||
xXF86VidModeGetPermissionsReply rep;
|
||||
int n;
|
||||
REQUEST(xXF86VidModeGetPermissionsReq);
|
||||
|
||||
if(stuff->screen >= screenInfo.numScreens)
|
||||
|
@ -1539,9 +1531,9 @@ ProcXF86VidModeGetPermissions(ClientPtr client)
|
|||
rep.permissions |= XF86VM_WRITE_PERMISSION;
|
||||
}
|
||||
if(client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.permissions, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.permissions);
|
||||
}
|
||||
WriteToClient(client,sizeof(xXF86VidModeGetPermissionsReply),(char*)&rep);
|
||||
|
||||
|
@ -1636,31 +1628,28 @@ ProcXF86VidModeDispatch(ClientPtr client)
|
|||
static int
|
||||
SProcXF86VidModeQueryVersion(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeQueryVersionReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return ProcXF86VidModeQueryVersion(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetModeLine(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeGetModeLineReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetModeLine(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetAllModeLines(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeGetAllModeLinesReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetAllModeLines(client);
|
||||
}
|
||||
|
||||
|
@ -1670,40 +1659,39 @@ SProcXF86VidModeAddModeLine(ClientPtr client)
|
|||
xXF86OldVidModeAddModeLineReq *oldstuff =
|
||||
(xXF86OldVidModeAddModeLineReq *)client->requestBuffer;
|
||||
int ver;
|
||||
register int n;
|
||||
|
||||
REQUEST(xXF86VidModeAddModeLineReq);
|
||||
ver = ClientMajorVersion(client);
|
||||
if (ver < 2) {
|
||||
swaps(&oldstuff->length, n);
|
||||
swaps(&oldstuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
|
||||
swapl(&oldstuff->screen, n);
|
||||
swaps(&oldstuff->hdisplay, n);
|
||||
swaps(&oldstuff->hsyncstart, n);
|
||||
swaps(&oldstuff->hsyncend, n);
|
||||
swaps(&oldstuff->htotal, n);
|
||||
swaps(&oldstuff->vdisplay, n);
|
||||
swaps(&oldstuff->vsyncstart, n);
|
||||
swaps(&oldstuff->vsyncend, n);
|
||||
swaps(&oldstuff->vtotal, n);
|
||||
swapl(&oldstuff->flags, n);
|
||||
swapl(&oldstuff->privsize, n);
|
||||
swapl(&oldstuff->screen);
|
||||
swaps(&oldstuff->hdisplay);
|
||||
swaps(&oldstuff->hsyncstart);
|
||||
swaps(&oldstuff->hsyncend);
|
||||
swaps(&oldstuff->htotal);
|
||||
swaps(&oldstuff->vdisplay);
|
||||
swaps(&oldstuff->vsyncstart);
|
||||
swaps(&oldstuff->vsyncend);
|
||||
swaps(&oldstuff->vtotal);
|
||||
swapl(&oldstuff->flags);
|
||||
swapl(&oldstuff->privsize);
|
||||
SwapRestL(oldstuff);
|
||||
} else {
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq);
|
||||
swapl(&stuff->screen, n);
|
||||
swaps(&stuff->hdisplay, n);
|
||||
swaps(&stuff->hsyncstart, n);
|
||||
swaps(&stuff->hsyncend, n);
|
||||
swaps(&stuff->htotal, n);
|
||||
swaps(&stuff->hskew, n);
|
||||
swaps(&stuff->vdisplay, n);
|
||||
swaps(&stuff->vsyncstart, n);
|
||||
swaps(&stuff->vsyncend, n);
|
||||
swaps(&stuff->vtotal, n);
|
||||
swapl(&stuff->flags, n);
|
||||
swapl(&stuff->privsize, n);
|
||||
swapl(&stuff->screen);
|
||||
swaps(&stuff->hdisplay);
|
||||
swaps(&stuff->hsyncstart);
|
||||
swaps(&stuff->hsyncend);
|
||||
swaps(&stuff->htotal);
|
||||
swaps(&stuff->hskew);
|
||||
swaps(&stuff->vdisplay);
|
||||
swaps(&stuff->vsyncstart);
|
||||
swaps(&stuff->vsyncend);
|
||||
swaps(&stuff->vtotal);
|
||||
swapl(&stuff->flags);
|
||||
swapl(&stuff->privsize);
|
||||
SwapRestL(stuff);
|
||||
}
|
||||
return ProcXF86VidModeAddModeLine(client);
|
||||
|
@ -1715,40 +1703,39 @@ SProcXF86VidModeDeleteModeLine(ClientPtr client)
|
|||
xXF86OldVidModeDeleteModeLineReq *oldstuff =
|
||||
(xXF86OldVidModeDeleteModeLineReq *)client->requestBuffer;
|
||||
int ver;
|
||||
register int n;
|
||||
|
||||
REQUEST(xXF86VidModeDeleteModeLineReq);
|
||||
ver = ClientMajorVersion(client);
|
||||
if (ver < 2) {
|
||||
swaps(&oldstuff->length, n);
|
||||
swaps(&oldstuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
|
||||
swapl(&oldstuff->screen, n);
|
||||
swaps(&oldstuff->hdisplay, n);
|
||||
swaps(&oldstuff->hsyncstart, n);
|
||||
swaps(&oldstuff->hsyncend, n);
|
||||
swaps(&oldstuff->htotal, n);
|
||||
swaps(&oldstuff->vdisplay, n);
|
||||
swaps(&oldstuff->vsyncstart, n);
|
||||
swaps(&oldstuff->vsyncend, n);
|
||||
swaps(&oldstuff->vtotal, n);
|
||||
swapl(&oldstuff->flags, n);
|
||||
swapl(&oldstuff->privsize, n);
|
||||
swapl(&oldstuff->screen);
|
||||
swaps(&oldstuff->hdisplay);
|
||||
swaps(&oldstuff->hsyncstart);
|
||||
swaps(&oldstuff->hsyncend);
|
||||
swaps(&oldstuff->htotal);
|
||||
swaps(&oldstuff->vdisplay);
|
||||
swaps(&oldstuff->vsyncstart);
|
||||
swaps(&oldstuff->vsyncend);
|
||||
swaps(&oldstuff->vtotal);
|
||||
swapl(&oldstuff->flags);
|
||||
swapl(&oldstuff->privsize);
|
||||
SwapRestL(oldstuff);
|
||||
} else {
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq);
|
||||
swapl(&stuff->screen, n);
|
||||
swaps(&stuff->hdisplay, n);
|
||||
swaps(&stuff->hsyncstart, n);
|
||||
swaps(&stuff->hsyncend, n);
|
||||
swaps(&stuff->htotal, n);
|
||||
swaps(&stuff->hskew, n);
|
||||
swaps(&stuff->vdisplay, n);
|
||||
swaps(&stuff->vsyncstart, n);
|
||||
swaps(&stuff->vsyncend, n);
|
||||
swaps(&stuff->vtotal, n);
|
||||
swapl(&stuff->flags, n);
|
||||
swapl(&stuff->privsize, n);
|
||||
swapl(&stuff->screen);
|
||||
swaps(&stuff->hdisplay);
|
||||
swaps(&stuff->hsyncstart);
|
||||
swaps(&stuff->hsyncend);
|
||||
swaps(&stuff->htotal);
|
||||
swaps(&stuff->hskew);
|
||||
swaps(&stuff->vdisplay);
|
||||
swaps(&stuff->vsyncstart);
|
||||
swaps(&stuff->vsyncend);
|
||||
swaps(&stuff->vtotal);
|
||||
swapl(&stuff->flags);
|
||||
swapl(&stuff->privsize);
|
||||
SwapRestL(stuff);
|
||||
}
|
||||
return ProcXF86VidModeDeleteModeLine(client);
|
||||
|
@ -1760,40 +1747,39 @@ SProcXF86VidModeModModeLine(ClientPtr client)
|
|||
xXF86OldVidModeModModeLineReq *oldstuff =
|
||||
(xXF86OldVidModeModModeLineReq *)client->requestBuffer;
|
||||
int ver;
|
||||
register int n;
|
||||
|
||||
REQUEST(xXF86VidModeModModeLineReq);
|
||||
ver = ClientMajorVersion(client);
|
||||
if (ver < 2) {
|
||||
swaps(&oldstuff->length, n);
|
||||
swaps(&oldstuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
|
||||
swapl(&oldstuff->screen, n);
|
||||
swaps(&oldstuff->hdisplay, n);
|
||||
swaps(&oldstuff->hsyncstart, n);
|
||||
swaps(&oldstuff->hsyncend, n);
|
||||
swaps(&oldstuff->htotal, n);
|
||||
swaps(&oldstuff->vdisplay, n);
|
||||
swaps(&oldstuff->vsyncstart, n);
|
||||
swaps(&oldstuff->vsyncend, n);
|
||||
swaps(&oldstuff->vtotal, n);
|
||||
swapl(&oldstuff->flags, n);
|
||||
swapl(&oldstuff->privsize, n);
|
||||
swapl(&oldstuff->screen);
|
||||
swaps(&oldstuff->hdisplay);
|
||||
swaps(&oldstuff->hsyncstart);
|
||||
swaps(&oldstuff->hsyncend);
|
||||
swaps(&oldstuff->htotal);
|
||||
swaps(&oldstuff->vdisplay);
|
||||
swaps(&oldstuff->vsyncstart);
|
||||
swaps(&oldstuff->vsyncend);
|
||||
swaps(&oldstuff->vtotal);
|
||||
swapl(&oldstuff->flags);
|
||||
swapl(&oldstuff->privsize);
|
||||
SwapRestL(oldstuff);
|
||||
} else {
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq);
|
||||
swapl(&stuff->screen, n);
|
||||
swaps(&stuff->hdisplay, n);
|
||||
swaps(&stuff->hsyncstart, n);
|
||||
swaps(&stuff->hsyncend, n);
|
||||
swaps(&stuff->htotal, n);
|
||||
swaps(&stuff->hskew, n);
|
||||
swaps(&stuff->vdisplay, n);
|
||||
swaps(&stuff->vsyncstart, n);
|
||||
swaps(&stuff->vsyncend, n);
|
||||
swaps(&stuff->vtotal, n);
|
||||
swapl(&stuff->flags, n);
|
||||
swapl(&stuff->privsize, n);
|
||||
swapl(&stuff->screen);
|
||||
swaps(&stuff->hdisplay);
|
||||
swaps(&stuff->hsyncstart);
|
||||
swaps(&stuff->hsyncend);
|
||||
swaps(&stuff->htotal);
|
||||
swaps(&stuff->hskew);
|
||||
swaps(&stuff->vdisplay);
|
||||
swaps(&stuff->vsyncstart);
|
||||
swaps(&stuff->vsyncend);
|
||||
swaps(&stuff->vtotal);
|
||||
swapl(&stuff->flags);
|
||||
swapl(&stuff->privsize);
|
||||
SwapRestL(stuff);
|
||||
}
|
||||
return ProcXF86VidModeModModeLine(client);
|
||||
|
@ -1805,40 +1791,39 @@ SProcXF86VidModeValidateModeLine(ClientPtr client)
|
|||
xXF86OldVidModeValidateModeLineReq *oldstuff =
|
||||
(xXF86OldVidModeValidateModeLineReq *)client->requestBuffer;
|
||||
int ver;
|
||||
register int n;
|
||||
|
||||
REQUEST(xXF86VidModeValidateModeLineReq);
|
||||
ver = ClientMajorVersion(client);
|
||||
if (ver < 2) {
|
||||
swaps(&oldstuff->length, n);
|
||||
swaps(&oldstuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
|
||||
swapl(&oldstuff->screen, n);
|
||||
swaps(&oldstuff->hdisplay, n);
|
||||
swaps(&oldstuff->hsyncstart, n);
|
||||
swaps(&oldstuff->hsyncend, n);
|
||||
swaps(&oldstuff->htotal, n);
|
||||
swaps(&oldstuff->vdisplay, n);
|
||||
swaps(&oldstuff->vsyncstart, n);
|
||||
swaps(&oldstuff->vsyncend, n);
|
||||
swaps(&oldstuff->vtotal, n);
|
||||
swapl(&oldstuff->flags, n);
|
||||
swapl(&oldstuff->privsize, n);
|
||||
swapl(&oldstuff->screen);
|
||||
swaps(&oldstuff->hdisplay);
|
||||
swaps(&oldstuff->hsyncstart);
|
||||
swaps(&oldstuff->hsyncend);
|
||||
swaps(&oldstuff->htotal);
|
||||
swaps(&oldstuff->vdisplay);
|
||||
swaps(&oldstuff->vsyncstart);
|
||||
swaps(&oldstuff->vsyncend);
|
||||
swaps(&oldstuff->vtotal);
|
||||
swapl(&oldstuff->flags);
|
||||
swapl(&oldstuff->privsize);
|
||||
SwapRestL(oldstuff);
|
||||
} else {
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq);
|
||||
swapl(&stuff->screen, n);
|
||||
swaps(&stuff->hdisplay, n);
|
||||
swaps(&stuff->hsyncstart, n);
|
||||
swaps(&stuff->hsyncend, n);
|
||||
swaps(&stuff->htotal, n);
|
||||
swaps(&stuff->hskew, n);
|
||||
swaps(&stuff->vdisplay, n);
|
||||
swaps(&stuff->vsyncstart, n);
|
||||
swaps(&stuff->vsyncend, n);
|
||||
swaps(&stuff->vtotal, n);
|
||||
swapl(&stuff->flags, n);
|
||||
swapl(&stuff->privsize, n);
|
||||
swapl(&stuff->screen);
|
||||
swaps(&stuff->hdisplay);
|
||||
swaps(&stuff->hsyncstart);
|
||||
swaps(&stuff->hsyncend);
|
||||
swaps(&stuff->htotal);
|
||||
swaps(&stuff->hskew);
|
||||
swaps(&stuff->vdisplay);
|
||||
swaps(&stuff->vsyncstart);
|
||||
swaps(&stuff->vsyncend);
|
||||
swaps(&stuff->vtotal);
|
||||
swapl(&stuff->flags);
|
||||
swapl(&stuff->privsize);
|
||||
SwapRestL(stuff);
|
||||
}
|
||||
return ProcXF86VidModeValidateModeLine(client);
|
||||
|
@ -1847,130 +1832,120 @@ SProcXF86VidModeValidateModeLine(ClientPtr client)
|
|||
static int
|
||||
SProcXF86VidModeSwitchMode(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeSwitchModeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->zoom, n);
|
||||
swaps(&stuff->screen);
|
||||
swaps(&stuff->zoom);
|
||||
return ProcXF86VidModeSwitchMode(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeSwitchToMode(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeSwitchToModeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeSwitchToMode(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeLockModeSwitch(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeLockModeSwitchReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->lock, n);
|
||||
swaps(&stuff->screen);
|
||||
swaps(&stuff->lock);
|
||||
return ProcXF86VidModeLockModeSwitch(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetMonitor(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeGetMonitorReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetMonitor(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetViewPort(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeGetViewPortReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetViewPort(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeSetViewPort(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeSetViewPortReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swapl(&stuff->x, n);
|
||||
swapl(&stuff->y, n);
|
||||
swaps(&stuff->screen);
|
||||
swapl(&stuff->x);
|
||||
swapl(&stuff->y);
|
||||
return ProcXF86VidModeSetViewPort(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetDotClocks(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeGetDotClocksReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetDotClocks(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeSetClientVersion(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeSetClientVersionReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
|
||||
swaps(&stuff->major, n);
|
||||
swaps(&stuff->minor, n);
|
||||
swaps(&stuff->major);
|
||||
swaps(&stuff->minor);
|
||||
return ProcXF86VidModeSetClientVersion(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeSetGamma(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeSetGammaReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swapl(&stuff->red, n);
|
||||
swapl(&stuff->green, n);
|
||||
swapl(&stuff->blue, n);
|
||||
swaps(&stuff->screen);
|
||||
swapl(&stuff->red);
|
||||
swapl(&stuff->green);
|
||||
swapl(&stuff->blue);
|
||||
return ProcXF86VidModeSetGamma(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetGamma(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86VidModeGetGammaReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetGamma(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeSetGammaRamp(ClientPtr client)
|
||||
{
|
||||
int length, n;
|
||||
int length;
|
||||
REQUEST(xXF86VidModeSetGammaRampReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq);
|
||||
swaps(&stuff->size, n);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->size);
|
||||
swaps(&stuff->screen);
|
||||
length = ((stuff->size + 1) & ~1) * 6;
|
||||
REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length);
|
||||
SwapRestS(stuff);
|
||||
|
@ -1980,34 +1955,31 @@ SProcXF86VidModeSetGammaRamp(ClientPtr client)
|
|||
static int
|
||||
SProcXF86VidModeGetGammaRamp(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xXF86VidModeGetGammaRampReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
|
||||
swaps(&stuff->size, n);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->size);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetGammaRamp(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetGammaRampSize(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xXF86VidModeGetGammaRampSizeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetGammaRampSize(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetPermissions(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xXF86VidModeGetPermissionsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
|
||||
swaps(&stuff->screen, n);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetPermissions(client);
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,6 @@ ProcXF86DRIQueryVersion(
|
|||
)
|
||||
{
|
||||
xXF86DRIQueryVersionReply rep;
|
||||
register int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
|
||||
rep.type = X_Reply;
|
||||
|
@ -96,11 +95,11 @@ ProcXF86DRIQueryVersion(
|
|||
rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION;
|
||||
rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.majorVersion, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swapl(&rep.patchVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
swapl(&rep.patchVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -113,7 +112,6 @@ ProcXF86DRIQueryDirectRenderingCapable(
|
|||
{
|
||||
xXF86DRIQueryDirectRenderingCapableReply rep;
|
||||
Bool isCapable;
|
||||
register int n;
|
||||
|
||||
REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
|
||||
REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq);
|
||||
|
@ -136,8 +134,8 @@ ProcXF86DRIQueryDirectRenderingCapable(
|
|||
rep.isCapable = 0;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
|
||||
WriteToClient(client,
|
||||
|
@ -595,9 +593,8 @@ SProcXF86DRIQueryVersion(
|
|||
register ClientPtr client
|
||||
)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86DRIQueryVersionReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return ProcXF86DRIQueryVersion(client);
|
||||
}
|
||||
|
||||
|
@ -606,10 +603,9 @@ SProcXF86DRIQueryDirectRenderingCapable(
|
|||
register ClientPtr client
|
||||
)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->screen, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->screen);
|
||||
return ProcXF86DRIQueryDirectRenderingCapable(client);
|
||||
}
|
||||
|
||||
|
|
|
@ -71,10 +71,9 @@ ProcDRI2QueryVersion(ClientPtr client)
|
|||
{
|
||||
REQUEST(xDRI2QueryVersionReq);
|
||||
xDRI2QueryVersionReply rep;
|
||||
int n;
|
||||
|
||||
if (client->swapped)
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
|
||||
REQUEST_SIZE_MATCH(xDRI2QueryVersionReq);
|
||||
rep.type = X_Reply;
|
||||
|
@ -84,10 +83,10 @@ ProcDRI2QueryVersion(ClientPtr client)
|
|||
rep.minorVersion = dri2_minor;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.majorVersion, n);
|
||||
swapl(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.majorVersion);
|
||||
swapl(&rep.minorVersion);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xDRI2QueryVersionReply), &rep);
|
||||
|
@ -585,16 +584,15 @@ SProcDRI2Connect(ClientPtr client)
|
|||
{
|
||||
REQUEST(xDRI2ConnectReq);
|
||||
xDRI2ConnectReply rep;
|
||||
int n;
|
||||
|
||||
/* If the client is swapped, it's not local. Talk to the hand. */
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
if (sizeof(*stuff) / 4 != client->req_len)
|
||||
return BadLength;
|
||||
|
||||
rep.sequenceNumber = client->sequence;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
rep.length = 0;
|
||||
rep.driverNameLength = 0;
|
||||
rep.deviceNameLength = 0;
|
||||
|
|
|
@ -147,7 +147,6 @@ ProcAppleWMQueryVersion(
|
|||
)
|
||||
{
|
||||
xAppleWMQueryVersionReply rep;
|
||||
register int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xAppleWMQueryVersionReq);
|
||||
rep.type = X_Reply;
|
||||
|
@ -157,8 +156,8 @@ ProcAppleWMQueryVersion(
|
|||
rep.minorVersion = SERVER_APPLEWM_MINOR_VERSION;
|
||||
rep.patchVersion = SERVER_APPLEWM_PATCH_VERSION;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -681,9 +680,8 @@ SProcAppleWMQueryVersion(
|
|||
register ClientPtr client
|
||||
)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xAppleWMQueryVersionReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return ProcAppleWMQueryVersion(client);
|
||||
}
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ static int ProcPseudoramiXGetState(ClientPtr client)
|
|||
REQUEST(xPanoramiXGetStateReq);
|
||||
WindowPtr pWin;
|
||||
xPanoramiXGetStateReply rep;
|
||||
register int n, rc;
|
||||
register int rc;
|
||||
|
||||
TRACE();
|
||||
|
||||
|
@ -197,9 +197,9 @@ static int ProcPseudoramiXGetState(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.state = !noPseudoramiXExtension;
|
||||
if (client->swapped) {
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swaps (&rep.state, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.state);
|
||||
}
|
||||
WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
|
||||
return Success;
|
||||
|
@ -212,7 +212,7 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client)
|
|||
REQUEST(xPanoramiXGetScreenCountReq);
|
||||
WindowPtr pWin;
|
||||
xPanoramiXGetScreenCountReply rep;
|
||||
register int n, rc;
|
||||
register int rc;
|
||||
|
||||
TRACE();
|
||||
|
||||
|
@ -226,9 +226,9 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.ScreenCount = pseudoramiXNumScreens;
|
||||
if (client->swapped) {
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swaps (&rep.ScreenCount, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.ScreenCount);
|
||||
}
|
||||
WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -259,10 +259,10 @@ static int ProcPseudoramiXGetScreenSize(ClientPtr client)
|
|||
rep.height = pseudoramiXScreens[stuff->screen].h;
|
||||
// was screenInfo.screens[stuff->screen]->height;
|
||||
if (client->swapped) {
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swaps (&rep.width, n);
|
||||
swaps (&rep.height, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.width);
|
||||
swaps(&rep.height);
|
||||
}
|
||||
WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -284,10 +284,9 @@ static int ProcPseudoramiXIsActive(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.state = !noPseudoramiXExtension;
|
||||
if (client->swapped) {
|
||||
register int n;
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.state, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.state);
|
||||
}
|
||||
WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
|
||||
return Success;
|
||||
|
@ -309,10 +308,9 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client)
|
|||
rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens;
|
||||
rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
|
||||
if (client->swapped) {
|
||||
register int n;
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.number, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.number);
|
||||
}
|
||||
WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
|
||||
|
||||
|
@ -327,11 +325,10 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client)
|
|||
scratch.height = pseudoramiXScreens[i].h;
|
||||
|
||||
if(client->swapped) {
|
||||
register int n;
|
||||
swaps (&scratch.x_org, n);
|
||||
swaps (&scratch.y_org, n);
|
||||
swaps (&scratch.width, n);
|
||||
swaps (&scratch.height, n);
|
||||
swaps(&scratch.x_org);
|
||||
swaps(&scratch.y_org);
|
||||
swaps(&scratch.width);
|
||||
swaps(&scratch.height);
|
||||
}
|
||||
WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
|
||||
}
|
||||
|
@ -369,11 +366,10 @@ static int
|
|||
SProcPseudoramiXQueryVersion (ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXQueryVersionReq);
|
||||
register int n;
|
||||
|
||||
TRACE();
|
||||
|
||||
swaps(&stuff->length,n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
|
||||
return ProcPseudoramiXQueryVersion(client);
|
||||
}
|
||||
|
@ -382,11 +378,10 @@ static int
|
|||
SProcPseudoramiXGetState(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXGetStateReq);
|
||||
register int n;
|
||||
|
||||
TRACE();
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
||||
return ProcPseudoramiXGetState(client);
|
||||
}
|
||||
|
@ -395,11 +390,10 @@ static int
|
|||
SProcPseudoramiXGetScreenCount(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXGetScreenCountReq);
|
||||
register int n;
|
||||
|
||||
TRACE();
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
||||
return ProcPseudoramiXGetScreenCount(client);
|
||||
}
|
||||
|
@ -408,11 +402,10 @@ static int
|
|||
SProcPseudoramiXGetScreenSize(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXGetScreenSizeReq);
|
||||
register int n;
|
||||
|
||||
TRACE();
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
||||
return ProcPseudoramiXGetScreenSize(client);
|
||||
}
|
||||
|
@ -422,11 +415,10 @@ static int
|
|||
SProcPseudoramiXIsActive(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXineramaIsActiveReq);
|
||||
register int n;
|
||||
|
||||
TRACE();
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
|
||||
return ProcPseudoramiXIsActive(client);
|
||||
}
|
||||
|
@ -436,11 +428,10 @@ static int
|
|||
SProcPseudoramiXQueryScreens(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXineramaQueryScreensReq);
|
||||
register int n;
|
||||
|
||||
TRACE();
|
||||
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
||||
return ProcPseudoramiXQueryScreens(client);
|
||||
}
|
||||
|
|
|
@ -91,7 +91,6 @@ ProcAppleDRIQueryVersion(
|
|||
)
|
||||
{
|
||||
xAppleDRIQueryVersionReply rep;
|
||||
register int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xAppleDRIQueryVersionReq);
|
||||
rep.type = X_Reply;
|
||||
|
@ -101,8 +100,8 @@ ProcAppleDRIQueryVersion(
|
|||
rep.minorVersion = SERVER_APPLEDRI_MINOR_VERSION;
|
||||
rep.patchVersion = SERVER_APPLEDRI_PATCH_VERSION;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -372,9 +371,8 @@ SProcAppleDRIQueryVersion(
|
|||
register ClientPtr client
|
||||
)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xAppleDRIQueryVersionReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return ProcAppleDRIQueryVersion(client);
|
||||
}
|
||||
|
||||
|
|
|
@ -91,8 +91,8 @@ ProcWindowsWMQueryVersion(ClientPtr client)
|
|||
rep.patchVersion = SERVER_WINDOWSWM_PATCH_VERSION;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -588,7 +588,7 @@ SProcWindowsWMQueryVersion (ClientPtr client)
|
|||
{
|
||||
int n;
|
||||
REQUEST(xWindowsWMQueryVersionReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return ProcWindowsWMQueryVersion(client);
|
||||
}
|
||||
|
||||
|
|
|
@ -256,19 +256,21 @@ version_compare(uint16_t a_major, uint16_t a_minor,
|
|||
SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
|
||||
|
||||
/* byte swap a 32-bit value */
|
||||
#define swapl(x, n) { \
|
||||
n = ((char *) (x))[0];\
|
||||
#define swapl(x) do { \
|
||||
char n = ((char *) (x))[0];\
|
||||
((char *) (x))[0] = ((char *) (x))[3];\
|
||||
((char *) (x))[3] = n;\
|
||||
n = ((char *) (x))[1];\
|
||||
((char *) (x))[1] = ((char *) (x))[2];\
|
||||
((char *) (x))[2] = n; }
|
||||
((char *) (x))[2] = n;\
|
||||
} while (0)
|
||||
|
||||
/* byte swap a short */
|
||||
#define swaps(x, n) { \
|
||||
n = ((char *) (x))[0];\
|
||||
#define swaps(x) do { \
|
||||
char n = ((char *) (x))[0];\
|
||||
((char *) (x))[0] = ((char *) (x))[1];\
|
||||
((char *) (x))[1] = n; }
|
||||
((char *) (x))[1] = n;\
|
||||
} while (0)
|
||||
|
||||
/* copy 32-bit value from src to dst byteswapping on the way */
|
||||
#define cpswapl(src, dst) { \
|
||||
|
|
|
@ -905,9 +905,9 @@ ErrorConnMax(XtransConnInfo trans_conn)
|
|||
if (((*(char *) &whichbyte) && (byteOrder == 'B')) ||
|
||||
(!(*(char *) &whichbyte) && (byteOrder == 'l')))
|
||||
{
|
||||
swaps(&csp.majorVersion, whichbyte);
|
||||
swaps(&csp.minorVersion, whichbyte);
|
||||
swaps(&csp.length, whichbyte);
|
||||
swaps(&csp.majorVersion);
|
||||
swaps(&csp.minorVersion);
|
||||
swaps(&csp.length);
|
||||
}
|
||||
iov[0].iov_len = sz_xConnSetupPrefix;
|
||||
iov[0].iov_base = (char *) &csp;
|
||||
|
|
6
os/io.c
6
os/io.c
|
@ -598,8 +598,7 @@ ResetCurrentRequest(ClientPtr client)
|
|||
((xBigReq *)oci->bufptr)->length = client->req_len;
|
||||
if (client->swapped)
|
||||
{
|
||||
char n;
|
||||
swapl(&((xBigReq *)oci->bufptr)->length, n);
|
||||
swapl(&((xBigReq *)oci->bufptr)->length);
|
||||
}
|
||||
}
|
||||
if (gotnow >= (needed << 2))
|
||||
|
@ -822,11 +821,10 @@ WriteToClient (ClientPtr who, int count, const void *__buf)
|
|||
{ /* start of new reply */
|
||||
CARD32 replylen;
|
||||
unsigned long bytesleft;
|
||||
char n;
|
||||
|
||||
replylen = ((xGenericReply *)buf)->length;
|
||||
if (who->swapped)
|
||||
swapl(&replylen, n);
|
||||
swapl(&replylen);
|
||||
bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes;
|
||||
replyinfo.startOfReply = TRUE;
|
||||
replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft;
|
||||
|
|
100
randr/rrcrtc.c
100
randr/rrcrtc.c
|
@ -751,7 +751,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
|
|||
RRModePtr mode;
|
||||
RROutput *outputs;
|
||||
RROutput *possible;
|
||||
int i, j, k, n;
|
||||
int i, j, k;
|
||||
int width, height;
|
||||
BoxRec panned_area;
|
||||
|
||||
|
@ -818,7 +818,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
|
|||
{
|
||||
outputs[i] = crtc->outputs[i]->id;
|
||||
if (client->swapped)
|
||||
swapl (&outputs[i], n);
|
||||
swapl(&outputs[i]);
|
||||
}
|
||||
k = 0;
|
||||
for (i = 0; i < pScrPriv->numOutputs; i++)
|
||||
|
@ -827,23 +827,23 @@ ProcRRGetCrtcInfo (ClientPtr client)
|
|||
{
|
||||
possible[k] = pScrPriv->outputs[i]->id;
|
||||
if (client->swapped)
|
||||
swapl (&possible[k], n);
|
||||
swapl(&possible[k]);
|
||||
k++;
|
||||
}
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.timestamp, n);
|
||||
swaps(&rep.x, n);
|
||||
swaps(&rep.y, n);
|
||||
swaps(&rep.width, n);
|
||||
swaps(&rep.height, n);
|
||||
swapl(&rep.mode, n);
|
||||
swaps(&rep.rotation, n);
|
||||
swaps(&rep.rotations, n);
|
||||
swaps(&rep.nOutput, n);
|
||||
swaps(&rep.nPossibleOutput, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.timestamp);
|
||||
swaps(&rep.x);
|
||||
swaps(&rep.y);
|
||||
swaps(&rep.width);
|
||||
swaps(&rep.height);
|
||||
swapl(&rep.mode);
|
||||
swaps(&rep.rotation);
|
||||
swaps(&rep.rotations);
|
||||
swaps(&rep.nOutput);
|
||||
swaps(&rep.nPossibleOutput);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *)&rep);
|
||||
if (extraLen)
|
||||
|
@ -1058,10 +1058,9 @@ sendReply:
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
int n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.newTimestamp, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.newTimestamp);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *)&rep);
|
||||
|
||||
|
@ -1079,7 +1078,6 @@ ProcRRGetPanning (ClientPtr client)
|
|||
BoxRec total;
|
||||
BoxRec tracking;
|
||||
INT16 border[4];
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetPanningReq);
|
||||
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
|
||||
|
@ -1117,21 +1115,21 @@ ProcRRGetPanning (ClientPtr client)
|
|||
}
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.timestamp, n);
|
||||
swaps(&rep.left, n);
|
||||
swaps(&rep.top, n);
|
||||
swaps(&rep.width, n);
|
||||
swaps(&rep.height, n);
|
||||
swaps(&rep.track_left, n);
|
||||
swaps(&rep.track_top, n);
|
||||
swaps(&rep.track_width, n);
|
||||
swaps(&rep.track_height, n);
|
||||
swaps(&rep.border_left, n);
|
||||
swaps(&rep.border_top, n);
|
||||
swaps(&rep.border_right, n);
|
||||
swaps(&rep.border_bottom, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.timestamp);
|
||||
swaps(&rep.left);
|
||||
swaps(&rep.top);
|
||||
swaps(&rep.width);
|
||||
swaps(&rep.height);
|
||||
swaps(&rep.track_left);
|
||||
swaps(&rep.track_top);
|
||||
swaps(&rep.track_width);
|
||||
swaps(&rep.track_height);
|
||||
swaps(&rep.border_left);
|
||||
swaps(&rep.border_top);
|
||||
swaps(&rep.border_right);
|
||||
swaps(&rep.border_bottom);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetPanningReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -1149,7 +1147,6 @@ ProcRRSetPanning (ClientPtr client)
|
|||
BoxRec total;
|
||||
BoxRec tracking;
|
||||
INT16 border[4];
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRSetPanningReq);
|
||||
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
|
||||
|
@ -1198,9 +1195,9 @@ sendReply:
|
|||
rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.newTimestamp, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.newTimestamp);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRSetPanningReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -1212,7 +1209,6 @@ ProcRRGetCrtcGammaSize (ClientPtr client)
|
|||
REQUEST(xRRGetCrtcGammaSizeReq);
|
||||
xRRGetCrtcGammaSizeReply reply;
|
||||
RRCrtcPtr crtc;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
|
||||
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
|
||||
|
@ -1226,9 +1222,9 @@ ProcRRGetCrtcGammaSize (ClientPtr client)
|
|||
reply.length = 0;
|
||||
reply.size = crtc->gammaSize;
|
||||
if (client->swapped) {
|
||||
swaps (&reply.sequenceNumber, n);
|
||||
swapl (&reply.length, n);
|
||||
swaps (&reply.size, n);
|
||||
swaps(&reply.sequenceNumber);
|
||||
swapl(&reply.length);
|
||||
swaps(&reply.size);
|
||||
}
|
||||
WriteToClient (client, sizeof (xRRGetCrtcGammaSizeReply), (char *) &reply);
|
||||
return Success;
|
||||
|
@ -1240,7 +1236,6 @@ ProcRRGetCrtcGamma (ClientPtr client)
|
|||
REQUEST(xRRGetCrtcGammaReq);
|
||||
xRRGetCrtcGammaReply reply;
|
||||
RRCrtcPtr crtc;
|
||||
int n;
|
||||
unsigned long len;
|
||||
char *extra = NULL;
|
||||
|
||||
|
@ -1264,9 +1259,9 @@ ProcRRGetCrtcGamma (ClientPtr client)
|
|||
reply.length = bytes_to_int32(len);
|
||||
reply.size = crtc->gammaSize;
|
||||
if (client->swapped) {
|
||||
swaps (&reply.sequenceNumber, n);
|
||||
swapl (&reply.length, n);
|
||||
swaps (&reply.size, n);
|
||||
swaps(&reply.sequenceNumber);
|
||||
swapl(&reply.length);
|
||||
swaps(&reply.size);
|
||||
}
|
||||
WriteToClient (client, sizeof (xRRGetCrtcGammaReply), (char *) &reply);
|
||||
if (crtc->gammaSize)
|
||||
|
@ -1361,7 +1356,6 @@ transform_filter_encode (ClientPtr client, char *output,
|
|||
RRTransformPtr transform)
|
||||
{
|
||||
int nbytes, nparams;
|
||||
int n;
|
||||
|
||||
if (transform->filter == NULL) {
|
||||
*nbytesFilter = 0;
|
||||
|
@ -1377,8 +1371,8 @@ transform_filter_encode (ClientPtr client, char *output,
|
|||
output[nbytes++] = 0;
|
||||
memcpy (output + nbytes, transform->params, nparams * sizeof (xFixed));
|
||||
if (client->swapped) {
|
||||
swaps (nbytesFilter, n);
|
||||
swaps (nparamsFilter, n);
|
||||
swaps(nbytesFilter);
|
||||
swaps(nparamsFilter);
|
||||
SwapLongs ((CARD32 *) (output + nbytes), nparams);
|
||||
}
|
||||
nbytes += nparams * sizeof (xFixed);
|
||||
|
@ -1399,7 +1393,7 @@ ProcRRGetCrtcTransform (ClientPtr client)
|
|||
REQUEST(xRRGetCrtcTransformReq);
|
||||
xRRGetCrtcTransformReply *reply;
|
||||
RRCrtcPtr crtc;
|
||||
int n, nextra;
|
||||
int nextra;
|
||||
RRTransformPtr current, pending;
|
||||
char *extra;
|
||||
|
||||
|
@ -1436,8 +1430,8 @@ ProcRRGetCrtcTransform (ClientPtr client)
|
|||
current);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps (&reply->sequenceNumber, n);
|
||||
swapl (&reply->length, n);
|
||||
swaps(&reply->sequenceNumber);
|
||||
swapl(&reply->length);
|
||||
}
|
||||
WriteToClient (client, sizeof (xRRGetCrtcTransformReply) + nextra, (char *) reply);
|
||||
free(reply);
|
||||
|
|
|
@ -36,7 +36,6 @@ static int
|
|||
ProcRRQueryVersion (ClientPtr client)
|
||||
{
|
||||
xRRQueryVersionReply rep = {0};
|
||||
register int n;
|
||||
REQUEST(xRRQueryVersionReq);
|
||||
rrClientPriv(client);
|
||||
|
||||
|
@ -59,10 +58,10 @@ ProcRRQueryVersion (ClientPtr client)
|
|||
}
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.majorVersion, n);
|
||||
swapl(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.majorVersion);
|
||||
swapl(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
|
|
@ -325,10 +325,9 @@ ProcRRCreateMode (ClientPtr client)
|
|||
rep.mode = mode->mode.id;
|
||||
if (client->swapped)
|
||||
{
|
||||
int n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.mode, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.mode);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep);
|
||||
/* Drop out reference to this mode */
|
||||
|
|
|
@ -447,7 +447,7 @@ ProcRRGetOutputInfo (ClientPtr client)
|
|||
RRMode *modes;
|
||||
RROutput *clones;
|
||||
char *name;
|
||||
int i, n;
|
||||
int i;
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
|
||||
VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
|
||||
|
@ -494,7 +494,7 @@ ProcRRGetOutputInfo (ClientPtr client)
|
|||
{
|
||||
crtcs[i] = output->crtcs[i]->id;
|
||||
if (client->swapped)
|
||||
swapl (&crtcs[i], n);
|
||||
swapl(&crtcs[i]);
|
||||
}
|
||||
for (i = 0; i < output->numModes + output->numUserModes; i++)
|
||||
{
|
||||
|
@ -503,26 +503,26 @@ ProcRRGetOutputInfo (ClientPtr client)
|
|||
else
|
||||
modes[i] = output->userModes[i - output->numModes]->mode.id;
|
||||
if (client->swapped)
|
||||
swapl (&modes[i], n);
|
||||
swapl(&modes[i]);
|
||||
}
|
||||
for (i = 0; i < output->numClones; i++)
|
||||
{
|
||||
clones[i] = output->clones[i]->id;
|
||||
if (client->swapped)
|
||||
swapl (&clones[i], n);
|
||||
swapl(&clones[i]);
|
||||
}
|
||||
memcpy (name, output->name, output->nameLength);
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.timestamp, n);
|
||||
swapl(&rep.crtc, n);
|
||||
swapl(&rep.mmWidth, n);
|
||||
swapl(&rep.mmHeight, n);
|
||||
swaps(&rep.nCrtcs, n);
|
||||
swaps(&rep.nModes, n);
|
||||
swaps(&rep.nClones, n);
|
||||
swaps(&rep.nameLength, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.timestamp);
|
||||
swapl(&rep.crtc);
|
||||
swapl(&rep.mmWidth);
|
||||
swapl(&rep.mmHeight);
|
||||
swaps(&rep.nCrtcs);
|
||||
swaps(&rep.nModes);
|
||||
swaps(&rep.nClones);
|
||||
swaps(&rep.nameLength);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *)&rep);
|
||||
if (extraLen)
|
||||
|
@ -614,9 +614,8 @@ ProcRRGetOutputPrimary(ClientPtr client)
|
|||
rep.output = primary ? primary->id : None;
|
||||
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.output, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.output);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), &rep);
|
||||
|
|
|
@ -409,10 +409,9 @@ ProcRRListOutputProperties (ClientPtr client)
|
|||
rep.nAtoms = numProps;
|
||||
if (client->swapped)
|
||||
{
|
||||
int n;
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swaps (&rep.nAtoms, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.nAtoms);
|
||||
}
|
||||
temppAtoms = pAtoms;
|
||||
for (prop = output->properties; prop; prop = prop->next)
|
||||
|
@ -458,9 +457,8 @@ ProcRRQueryOutputProperty (ClientPtr client)
|
|||
rep.immutable = prop->immutable;
|
||||
if (client->swapped)
|
||||
{
|
||||
int n;
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
WriteToClient (client, sizeof (xRRQueryOutputPropertyReply), (char*)&rep);
|
||||
if (prop->num_valid)
|
||||
|
@ -615,13 +613,11 @@ ProcRRGetOutputProperty (ClientPtr client)
|
|||
reply.propertyType = None;
|
||||
reply.format = 0;
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
|
||||
swaps(&reply.sequenceNumber, n);
|
||||
swapl(&reply.length, n);
|
||||
swapl(&reply.propertyType, n);
|
||||
swapl(&reply.bytesAfter, n);
|
||||
swapl(&reply.nItems, n);
|
||||
swaps(&reply.sequenceNumber);
|
||||
swapl(&reply.length);
|
||||
swapl(&reply.propertyType);
|
||||
swapl(&reply.bytesAfter);
|
||||
swapl(&reply.nItems);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply);
|
||||
return Success;
|
||||
|
@ -647,13 +643,11 @@ ProcRRGetOutputProperty (ClientPtr client)
|
|||
reply.nItems = 0;
|
||||
reply.propertyType = prop_value->type;
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
|
||||
swaps(&reply.sequenceNumber, n);
|
||||
swapl(&reply.length, n);
|
||||
swapl(&reply.propertyType, n);
|
||||
swapl(&reply.bytesAfter, n);
|
||||
swapl(&reply.nItems, n);
|
||||
swaps(&reply.sequenceNumber);
|
||||
swapl(&reply.length);
|
||||
swapl(&reply.propertyType);
|
||||
swapl(&reply.bytesAfter);
|
||||
swapl(&reply.nItems);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply);
|
||||
return Success;
|
||||
|
@ -704,13 +698,11 @@ ProcRRGetOutputProperty (ClientPtr client)
|
|||
}
|
||||
|
||||
if (client->swapped) {
|
||||
int n;
|
||||
|
||||
swaps(&reply.sequenceNumber, n);
|
||||
swapl(&reply.length, n);
|
||||
swapl(&reply.propertyType, n);
|
||||
swapl(&reply.bytesAfter, n);
|
||||
swapl(&reply.nItems, n);
|
||||
swaps(&reply.sequenceNumber);
|
||||
swapl(&reply.length);
|
||||
swapl(&reply.propertyType);
|
||||
swapl(&reply.bytesAfter);
|
||||
swapl(&reply.nItems);
|
||||
}
|
||||
WriteToClient(client, sizeof(xGenericReply), &reply);
|
||||
if (len)
|
||||
|
|
106
randr/rrscreen.c
106
randr/rrscreen.c
|
@ -232,14 +232,12 @@ ProcRRGetScreenSizeRange (ClientPtr client)
|
|||
}
|
||||
if (client->swapped)
|
||||
{
|
||||
int n;
|
||||
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.minWidth, n);
|
||||
swaps(&rep.minHeight, n);
|
||||
swaps(&rep.maxWidth, n);
|
||||
swaps(&rep.maxHeight, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.minWidth);
|
||||
swaps(&rep.minHeight);
|
||||
swaps(&rep.maxWidth);
|
||||
swaps(&rep.maxHeight);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -318,7 +316,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
|
|||
rrScrPrivPtr pScrPriv;
|
||||
CARD8 *extra;
|
||||
unsigned long extraLen;
|
||||
int i, n, rc, has_primary = 0;
|
||||
int i, rc, has_primary = 0;
|
||||
RRCrtc *crtcs;
|
||||
RROutput *outputs;
|
||||
xRRModeInfo *modeinfos;
|
||||
|
@ -401,7 +399,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
|
|||
has_primary = 1;
|
||||
crtcs[0] = pScrPriv->primaryOutput->crtc->id;
|
||||
if (client->swapped)
|
||||
swapl (&crtcs[0], n);
|
||||
swapl(&crtcs[0]);
|
||||
}
|
||||
|
||||
for (i = 0; i < pScrPriv->numCrtcs; i++)
|
||||
|
@ -414,14 +412,14 @@ rrGetScreenResources(ClientPtr client, Bool query)
|
|||
}
|
||||
crtcs[i + has_primary] = pScrPriv->crtcs[i]->id;
|
||||
if (client->swapped)
|
||||
swapl (&crtcs[i + has_primary], n);
|
||||
swapl(&crtcs[i + has_primary]);
|
||||
}
|
||||
|
||||
for (i = 0; i < pScrPriv->numOutputs; i++)
|
||||
{
|
||||
outputs[i] = pScrPriv->outputs[i]->id;
|
||||
if (client->swapped)
|
||||
swapl (&outputs[i], n);
|
||||
swapl(&outputs[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < num_modes; i++)
|
||||
|
@ -430,19 +428,19 @@ rrGetScreenResources(ClientPtr client, Bool query)
|
|||
modeinfos[i] = mode->mode;
|
||||
if (client->swapped)
|
||||
{
|
||||
swapl (&modeinfos[i].id, n);
|
||||
swaps (&modeinfos[i].width, n);
|
||||
swaps (&modeinfos[i].height, n);
|
||||
swapl (&modeinfos[i].dotClock, n);
|
||||
swaps (&modeinfos[i].hSyncStart, n);
|
||||
swaps (&modeinfos[i].hSyncEnd, n);
|
||||
swaps (&modeinfos[i].hTotal, n);
|
||||
swaps (&modeinfos[i].hSkew, n);
|
||||
swaps (&modeinfos[i].vSyncStart, n);
|
||||
swaps (&modeinfos[i].vSyncEnd, n);
|
||||
swaps (&modeinfos[i].vTotal, n);
|
||||
swaps (&modeinfos[i].nameLength, n);
|
||||
swapl (&modeinfos[i].modeFlags, n);
|
||||
swapl(&modeinfos[i].id);
|
||||
swaps(&modeinfos[i].width);
|
||||
swaps(&modeinfos[i].height);
|
||||
swapl(&modeinfos[i].dotClock);
|
||||
swaps(&modeinfos[i].hSyncStart);
|
||||
swaps(&modeinfos[i].hSyncEnd);
|
||||
swaps(&modeinfos[i].hTotal);
|
||||
swaps(&modeinfos[i].hSkew);
|
||||
swaps(&modeinfos[i].vSyncStart);
|
||||
swaps(&modeinfos[i].vSyncEnd);
|
||||
swaps(&modeinfos[i].vTotal);
|
||||
swaps(&modeinfos[i].nameLength);
|
||||
swapl(&modeinfos[i].modeFlags);
|
||||
}
|
||||
memcpy (names, mode->name,
|
||||
mode->mode.nameLength);
|
||||
|
@ -453,14 +451,14 @@ rrGetScreenResources(ClientPtr client, Bool query)
|
|||
}
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.timestamp, n);
|
||||
swapl(&rep.configTimestamp, n);
|
||||
swaps(&rep.nCrtcs, n);
|
||||
swaps(&rep.nOutputs, n);
|
||||
swaps(&rep.nModes, n);
|
||||
swaps(&rep.nbytesNames, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.timestamp);
|
||||
swapl(&rep.configTimestamp);
|
||||
swaps(&rep.nCrtcs);
|
||||
swaps(&rep.nOutputs);
|
||||
swaps(&rep.nModes);
|
||||
swaps(&rep.nbytesNames);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *)&rep);
|
||||
if (extraLen)
|
||||
|
@ -592,7 +590,7 @@ ProcRRGetScreenInfo (ClientPtr client)
|
|||
REQUEST(xRRGetScreenInfoReq);
|
||||
xRRGetScreenInfoReply rep;
|
||||
WindowPtr pWin;
|
||||
int n, rc;
|
||||
int rc;
|
||||
ScreenPtr pScreen;
|
||||
rrScrPrivPtr pScrPriv;
|
||||
CARD8 *extra;
|
||||
|
@ -688,10 +686,10 @@ ProcRRGetScreenInfo (ClientPtr client)
|
|||
size->heightInMillimeters = pSize->mmHeight;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps (&size->widthInPixels, n);
|
||||
swaps (&size->heightInPixels, n);
|
||||
swaps (&size->widthInMillimeters, n);
|
||||
swaps (&size->heightInMillimeters, n);
|
||||
swaps(&size->widthInPixels);
|
||||
swaps(&size->heightInPixels);
|
||||
swaps(&size->widthInMillimeters);
|
||||
swaps(&size->heightInMillimeters);
|
||||
}
|
||||
size++;
|
||||
if (has_rate)
|
||||
|
@ -699,7 +697,7 @@ ProcRRGetScreenInfo (ClientPtr client)
|
|||
*rates = pSize->nRates;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps (rates, n);
|
||||
swaps(rates);
|
||||
}
|
||||
rates++;
|
||||
for (j = 0; j < pSize->nRates; j++)
|
||||
|
@ -707,7 +705,7 @@ ProcRRGetScreenInfo (ClientPtr client)
|
|||
*rates = pSize->pRates[j].rate;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps (rates, n);
|
||||
swaps(rates);
|
||||
}
|
||||
rates++;
|
||||
}
|
||||
|
@ -723,14 +721,14 @@ ProcRRGetScreenInfo (ClientPtr client)
|
|||
rep.length = bytes_to_int32(extraLen);
|
||||
}
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.timestamp, n);
|
||||
swaps(&rep.rotation, n);
|
||||
swaps(&rep.nSizes, n);
|
||||
swaps(&rep.sizeID, n);
|
||||
swaps(&rep.rate, n);
|
||||
swaps(&rep.nrateEnts, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.timestamp);
|
||||
swaps(&rep.rotation);
|
||||
swaps(&rep.nSizes);
|
||||
swaps(&rep.sizeID);
|
||||
swaps(&rep.rate);
|
||||
swaps(&rep.nrateEnts);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep);
|
||||
if (extraLen)
|
||||
|
@ -747,7 +745,7 @@ ProcRRSetScreenConfig (ClientPtr client)
|
|||
REQUEST(xRRSetScreenConfigReq);
|
||||
xRRSetScreenConfigReply rep;
|
||||
DrawablePtr pDraw;
|
||||
int n, rc;
|
||||
int rc;
|
||||
ScreenPtr pScreen;
|
||||
rrScrPrivPtr pScrPriv;
|
||||
TimeStamp time;
|
||||
|
@ -976,11 +974,11 @@ sendReply:
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.newTimestamp, n);
|
||||
swapl(&rep.newConfigTimestamp, n);
|
||||
swapl(&rep.root, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.newTimestamp);
|
||||
swapl(&rep.newConfigTimestamp);
|
||||
swapl(&rep.root);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep);
|
||||
|
||||
|
|
|
@ -25,149 +25,138 @@
|
|||
static int
|
||||
SProcRRQueryVersion (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRRQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->majorVersion, n);
|
||||
swapl(&stuff->minorVersion, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->majorVersion);
|
||||
swapl(&stuff->minorVersion);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRGetScreenInfo (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRRGetScreenInfoReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRSetScreenConfig (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRRSetScreenConfigReq);
|
||||
|
||||
if (RRClientKnowsRates (client))
|
||||
{
|
||||
REQUEST_SIZE_MATCH (xRRSetScreenConfigReq);
|
||||
swaps (&stuff->rate, n);
|
||||
swaps(&stuff->rate);
|
||||
}
|
||||
else
|
||||
{
|
||||
REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq);
|
||||
}
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->drawable, n);
|
||||
swapl(&stuff->timestamp, n);
|
||||
swaps(&stuff->sizeID, n);
|
||||
swaps(&stuff->rotation, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->timestamp);
|
||||
swaps(&stuff->sizeID);
|
||||
swaps(&stuff->rotation);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRSelectInput (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRRSelectInputReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->enable, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->window);
|
||||
swaps(&stuff->enable);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRGetScreenSizeRange (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRGetScreenSizeRangeReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRSetScreenSize (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRSetScreenSizeReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->width, n);
|
||||
swaps(&stuff->height, n);
|
||||
swapl(&stuff->widthInMillimeters, n);
|
||||
swapl(&stuff->heightInMillimeters, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->window);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
swapl(&stuff->widthInMillimeters);
|
||||
swapl(&stuff->heightInMillimeters);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRGetScreenResources (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRGetScreenResourcesReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRGetOutputInfo (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRGetOutputInfoReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->output, n);
|
||||
swapl(&stuff->configTimestamp, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->output);
|
||||
swapl(&stuff->configTimestamp);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRListOutputProperties (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRListOutputPropertiesReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->output, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->output);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRQueryOutputProperty (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRQueryOutputPropertyReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->output, n);
|
||||
swapl(&stuff->property, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->output);
|
||||
swapl(&stuff->property);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRConfigureOutputProperty (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRConfigureOutputPropertyReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->output, n);
|
||||
swapl(&stuff->property, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->output);
|
||||
swapl(&stuff->property);
|
||||
SwapRestL(stuff);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
@ -175,15 +164,14 @@ SProcRRConfigureOutputProperty (ClientPtr client)
|
|||
static int
|
||||
SProcRRChangeOutputProperty (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRChangeOutputPropertyReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE (xRRChangeOutputPropertyReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->output, n);
|
||||
swapl(&stuff->property, n);
|
||||
swapl(&stuff->type, n);
|
||||
swapl(&stuff->nUnits, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->output);
|
||||
swapl(&stuff->property);
|
||||
swapl(&stuff->type);
|
||||
swapl(&stuff->nUnits);
|
||||
switch(stuff->format) {
|
||||
case 8:
|
||||
break;
|
||||
|
@ -203,125 +191,117 @@ SProcRRChangeOutputProperty (ClientPtr client)
|
|||
static int
|
||||
SProcRRDeleteOutputProperty (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRDeleteOutputPropertyReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->output, n);
|
||||
swapl(&stuff->property, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->output);
|
||||
swapl(&stuff->property);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRGetOutputProperty (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRGetOutputPropertyReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->output, n);
|
||||
swapl(&stuff->property, n);
|
||||
swapl(&stuff->type, n);
|
||||
swapl(&stuff->longOffset, n);
|
||||
swapl(&stuff->longLength, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->output);
|
||||
swapl(&stuff->property);
|
||||
swapl(&stuff->type);
|
||||
swapl(&stuff->longOffset);
|
||||
swapl(&stuff->longLength);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRCreateMode (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
xRRModeInfo *modeinfo;
|
||||
REQUEST(xRRCreateModeReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRRCreateModeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->window);
|
||||
|
||||
modeinfo = &stuff->modeInfo;
|
||||
swapl(&modeinfo->id, n);
|
||||
swaps(&modeinfo->width, n);
|
||||
swaps(&modeinfo->height, n);
|
||||
swapl(&modeinfo->dotClock, n);
|
||||
swaps(&modeinfo->hSyncStart, n);
|
||||
swaps(&modeinfo->hSyncEnd, n);
|
||||
swaps(&modeinfo->hTotal, n);
|
||||
swaps(&modeinfo->vSyncStart, n);
|
||||
swaps(&modeinfo->vSyncEnd, n);
|
||||
swaps(&modeinfo->vTotal, n);
|
||||
swaps(&modeinfo->nameLength, n);
|
||||
swapl(&modeinfo->modeFlags, n);
|
||||
swapl(&modeinfo->id);
|
||||
swaps(&modeinfo->width);
|
||||
swaps(&modeinfo->height);
|
||||
swapl(&modeinfo->dotClock);
|
||||
swaps(&modeinfo->hSyncStart);
|
||||
swaps(&modeinfo->hSyncEnd);
|
||||
swaps(&modeinfo->hTotal);
|
||||
swaps(&modeinfo->vSyncStart);
|
||||
swaps(&modeinfo->vSyncEnd);
|
||||
swaps(&modeinfo->vTotal);
|
||||
swaps(&modeinfo->nameLength);
|
||||
swapl(&modeinfo->modeFlags);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRDestroyMode (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRDestroyModeReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRDestroyModeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->mode, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->mode);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRAddOutputMode (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRAddOutputModeReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->output, n);
|
||||
swapl(&stuff->mode, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->output);
|
||||
swapl(&stuff->mode);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRDeleteOutputMode (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRDeleteOutputModeReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->output, n);
|
||||
swapl(&stuff->mode, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->output);
|
||||
swapl(&stuff->mode);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRGetCrtcInfo (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRGetCrtcInfoReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->crtc, n);
|
||||
swapl(&stuff->configTimestamp, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->crtc);
|
||||
swapl(&stuff->configTimestamp);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRSetCrtcConfig (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRSetCrtcConfigReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->crtc, n);
|
||||
swapl(&stuff->timestamp, n);
|
||||
swapl(&stuff->configTimestamp, n);
|
||||
swaps(&stuff->x, n);
|
||||
swaps(&stuff->y, n);
|
||||
swapl(&stuff->mode, n);
|
||||
swaps(&stuff->rotation, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->crtc);
|
||||
swapl(&stuff->timestamp);
|
||||
swapl(&stuff->configTimestamp);
|
||||
swaps(&stuff->x);
|
||||
swaps(&stuff->y);
|
||||
swapl(&stuff->mode);
|
||||
swaps(&stuff->rotation);
|
||||
SwapRestL(stuff);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
@ -329,37 +309,34 @@ SProcRRSetCrtcConfig (ClientPtr client)
|
|||
static int
|
||||
SProcRRGetCrtcGammaSize (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRGetCrtcGammaSizeReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->crtc, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->crtc);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRGetCrtcGamma (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRGetCrtcGammaReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->crtc, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->crtc);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRSetCrtcGamma (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRSetCrtcGammaReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->crtc, n);
|
||||
swaps(&stuff->size, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->crtc);
|
||||
swaps(&stuff->size);
|
||||
SwapRestS(stuff);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
@ -367,16 +344,16 @@ SProcRRSetCrtcGamma (ClientPtr client)
|
|||
static int
|
||||
SProcRRSetCrtcTransform (ClientPtr client)
|
||||
{
|
||||
int n, nparams;
|
||||
int nparams;
|
||||
char *filter;
|
||||
CARD32 *params;
|
||||
REQUEST(xRRSetCrtcTransformReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->crtc, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->crtc);
|
||||
SwapLongs((CARD32 *)&stuff->transform, bytes_to_int32(sizeof(xRenderTransform)));
|
||||
swaps(&stuff->nbytesFilter, n);
|
||||
swaps(&stuff->nbytesFilter);
|
||||
filter = (char *)(stuff + 1);
|
||||
params = (CARD32 *) (filter + pad_to_int32(stuff->nbytesFilter));
|
||||
nparams = ((CARD32 *) stuff + client->req_len) - params;
|
||||
|
@ -390,74 +367,69 @@ SProcRRSetCrtcTransform (ClientPtr client)
|
|||
static int
|
||||
SProcRRGetCrtcTransform (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRGetCrtcTransformReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->crtc, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->crtc);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRGetPanning (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRGetPanningReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetPanningReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->crtc, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->crtc);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRSetPanning (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRSetPanningReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRSetPanningReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->crtc, n);
|
||||
swapl(&stuff->timestamp, n);
|
||||
swaps(&stuff->left, n);
|
||||
swaps(&stuff->top, n);
|
||||
swaps(&stuff->width, n);
|
||||
swaps(&stuff->height, n);
|
||||
swaps(&stuff->track_left, n);
|
||||
swaps(&stuff->track_top, n);
|
||||
swaps(&stuff->track_width, n);
|
||||
swaps(&stuff->track_height, n);
|
||||
swaps(&stuff->border_left, n);
|
||||
swaps(&stuff->border_top, n);
|
||||
swaps(&stuff->border_right, n);
|
||||
swaps(&stuff->border_bottom, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->crtc);
|
||||
swapl(&stuff->timestamp);
|
||||
swaps(&stuff->left);
|
||||
swaps(&stuff->top);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
swaps(&stuff->track_left);
|
||||
swaps(&stuff->track_top);
|
||||
swaps(&stuff->track_width);
|
||||
swaps(&stuff->track_height);
|
||||
swaps(&stuff->border_left);
|
||||
swaps(&stuff->border_top);
|
||||
swaps(&stuff->border_right);
|
||||
swaps(&stuff->border_bottom);
|
||||
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRSetOutputPrimary (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRSetOutputPrimaryReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->window, n);
|
||||
swapl(&stuff->output, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->window);
|
||||
swapl(&stuff->output);
|
||||
return ProcRandrVector[stuff->randrReqType](client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRRGetOutputPrimary (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xRRGetOutputPrimaryReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->window);
|
||||
return ProcRandrVector[stuff->randrReqType](client);
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,6 @@ int
|
|||
ProcRRXineramaQueryVersion(ClientPtr client)
|
||||
{
|
||||
xPanoramiXQueryVersionReply rep;
|
||||
register int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
|
||||
rep.type = X_Reply;
|
||||
|
@ -99,10 +98,10 @@ ProcRRXineramaQueryVersion(ClientPtr client)
|
|||
rep.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION;
|
||||
rep.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION;
|
||||
if(client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swaps(&rep.majorVersion, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -114,7 +113,7 @@ ProcRRXineramaGetState(ClientPtr client)
|
|||
REQUEST(xPanoramiXGetStateReq);
|
||||
WindowPtr pWin;
|
||||
xPanoramiXGetStateReply rep;
|
||||
register int n, rc;
|
||||
register int rc;
|
||||
ScreenPtr pScreen;
|
||||
rrScrPrivPtr pScrPriv;
|
||||
Bool active = FALSE;
|
||||
|
@ -138,9 +137,9 @@ ProcRRXineramaGetState(ClientPtr client)
|
|||
rep.state = active;
|
||||
rep.window = stuff->window;
|
||||
if(client->swapped) {
|
||||
swaps (&rep.sequenceNumber, n);
|
||||
swapl (&rep.length, n);
|
||||
swapl (&rep.window, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.window);
|
||||
}
|
||||
WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -180,7 +179,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
|
|||
REQUEST(xPanoramiXGetScreenCountReq);
|
||||
WindowPtr pWin;
|
||||
xPanoramiXGetScreenCountReply rep;
|
||||
register int n, rc;
|
||||
register int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
|
@ -193,9 +192,9 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
|
|||
rep.ScreenCount = RRXineramaScreenCount (pWin->drawable.pScreen);
|
||||
rep.window = stuff->window;
|
||||
if(client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.window, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.window);
|
||||
}
|
||||
WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -208,7 +207,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
|
|||
WindowPtr pWin, pRoot;
|
||||
ScreenPtr pScreen;
|
||||
xPanoramiXGetScreenSizeReply rep;
|
||||
register int n, rc;
|
||||
register int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
|
@ -226,12 +225,12 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
|
|||
rep.window = stuff->window;
|
||||
rep.screen = stuff->screen;
|
||||
if(client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.width, n);
|
||||
swapl(&rep.height, n);
|
||||
swapl(&rep.window, n);
|
||||
swapl(&rep.screen, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.width);
|
||||
swapl(&rep.height);
|
||||
swapl(&rep.window);
|
||||
swapl(&rep.screen);
|
||||
}
|
||||
WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -250,10 +249,9 @@ ProcRRXineramaIsActive(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.state = RRXineramaScreenActive (screenInfo.screens[RR_XINERAMA_SCREEN]);
|
||||
if(client->swapped) {
|
||||
register int n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.state, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.state);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
|
||||
return Success;
|
||||
|
@ -287,11 +285,10 @@ RRXineramaWriteCrtc(ClientPtr client, RRCrtcPtr crtc)
|
|||
scratch.height = height;
|
||||
}
|
||||
if(client->swapped) {
|
||||
register int n;
|
||||
swaps(&scratch.x_org, n);
|
||||
swaps(&scratch.y_org, n);
|
||||
swaps(&scratch.width, n);
|
||||
swaps(&scratch.height, n);
|
||||
swaps(&scratch.x_org);
|
||||
swaps(&scratch.y_org);
|
||||
swaps(&scratch.width);
|
||||
swaps(&scratch.height);
|
||||
}
|
||||
WriteToClient(client, sz_XineramaScreenInfo, &scratch);
|
||||
}
|
||||
|
@ -313,10 +310,9 @@ ProcRRXineramaQueryScreens(ClientPtr client)
|
|||
rep.number = RRXineramaScreenCount (pScreen);
|
||||
rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
|
||||
if(client->swapped) {
|
||||
register int n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.number, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.number);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *)&rep);
|
||||
|
||||
|
@ -371,8 +367,7 @@ static int
|
|||
SProcRRXineramaQueryVersion (ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXQueryVersionReq);
|
||||
register int n;
|
||||
swaps(&stuff->length,n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
|
||||
return ProcRRXineramaQueryVersion(client);
|
||||
}
|
||||
|
@ -381,10 +376,9 @@ static int
|
|||
SProcRRXineramaGetState(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXGetStateReq);
|
||||
register int n;
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return ProcRRXineramaGetState(client);
|
||||
}
|
||||
|
||||
|
@ -392,10 +386,9 @@ static int
|
|||
SProcRRXineramaGetScreenCount(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXGetScreenCountReq);
|
||||
register int n;
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl(&stuff->window);
|
||||
return ProcRRXineramaGetScreenCount(client);
|
||||
}
|
||||
|
||||
|
@ -403,11 +396,10 @@ static int
|
|||
SProcRRXineramaGetScreenSize(ClientPtr client)
|
||||
{
|
||||
REQUEST(xPanoramiXGetScreenSizeReq);
|
||||
register int n;
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl (&stuff->screen, n);
|
||||
swapl(&stuff->window);
|
||||
swapl(&stuff->screen);
|
||||
return ProcRRXineramaGetScreenSize(client);
|
||||
}
|
||||
|
||||
|
@ -415,8 +407,7 @@ static int
|
|||
SProcRRXineramaIsActive(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXineramaIsActiveReq);
|
||||
register int n;
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
|
||||
return ProcRRXineramaIsActive(client);
|
||||
}
|
||||
|
@ -425,8 +416,7 @@ static int
|
|||
SProcRRXineramaQueryScreens(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXineramaQueryScreensReq);
|
||||
register int n;
|
||||
swaps (&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
||||
return ProcRRXineramaQueryScreens(client);
|
||||
}
|
||||
|
|
|
@ -295,7 +295,6 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
|
|||
CARD32 elemHeaderData[2];
|
||||
int numElemHeaders = 0;
|
||||
Bool recordingClientSwapped = pContext->pRecordingClient->swapped;
|
||||
int n;
|
||||
CARD32 serverTime = 0;
|
||||
Bool gotServerTime = FALSE;
|
||||
int replylen;
|
||||
|
@ -339,11 +338,11 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
|
|||
|
||||
if (recordingClientSwapped)
|
||||
{
|
||||
swaps(&pRep->sequenceNumber, n);
|
||||
swapl(&pRep->length, n);
|
||||
swapl(&pRep->idBase, n);
|
||||
swapl(&pRep->serverTime, n);
|
||||
swapl(&pRep->recordedSequenceNumber, n);
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
swapl(&pRep->idBase);
|
||||
swapl(&pRep->serverTime);
|
||||
swapl(&pRep->recordedSequenceNumber);
|
||||
}
|
||||
pContext->numBufBytes = SIZEOF(xRecordEnableContextReply);
|
||||
}
|
||||
|
@ -361,7 +360,7 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
|
|||
else
|
||||
elemHeaderData[numElemHeaders] = GetTimeInMillis();
|
||||
if (recordingClientSwapped)
|
||||
swapl(&elemHeaderData[numElemHeaders], n);
|
||||
swapl(&elemHeaderData[numElemHeaders]);
|
||||
numElemHeaders++;
|
||||
}
|
||||
|
||||
|
@ -371,17 +370,17 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
|
|||
{
|
||||
elemHeaderData[numElemHeaders] = pClient->sequence;
|
||||
if (recordingClientSwapped)
|
||||
swapl(&elemHeaderData[numElemHeaders], n);
|
||||
swapl(&elemHeaderData[numElemHeaders]);
|
||||
numElemHeaders++;
|
||||
}
|
||||
|
||||
/* adjust reply length */
|
||||
|
||||
replylen = pRep->length;
|
||||
if (recordingClientSwapped) swapl(&replylen, n);
|
||||
if (recordingClientSwapped) swapl(&replylen);
|
||||
replylen += numElemHeaders + bytes_to_int32(datalen) +
|
||||
bytes_to_int32(futurelen);
|
||||
if (recordingClientSwapped) swapl(&replylen, n);
|
||||
if (recordingClientSwapped) swapl(&replylen);
|
||||
pRep->length = replylen;
|
||||
} /* end if not continued reply */
|
||||
|
||||
|
@ -473,7 +472,6 @@ static void
|
|||
RecordABigRequest(RecordContextPtr pContext, ClientPtr client, xReq *stuff)
|
||||
{
|
||||
CARD32 bigLength;
|
||||
char n;
|
||||
int bytesLeft;
|
||||
|
||||
/* note: client->req_len has been frobbed by ReadRequestFromClient
|
||||
|
@ -490,7 +488,7 @@ RecordABigRequest(RecordContextPtr pContext, ClientPtr client, xReq *stuff)
|
|||
/* reinsert the extended length field that was squished out */
|
||||
bigLength = client->req_len + bytes_to_int32(sizeof(bigLength));
|
||||
if (client->swapped)
|
||||
swapl(&bigLength, n);
|
||||
swapl(&bigLength);
|
||||
RecordAProtocolElement(pContext, client, XRecordFromClient,
|
||||
(pointer)&bigLength, sizeof(bigLength), /* continuation */ -1);
|
||||
bytesLeft -= sizeof(bigLength);
|
||||
|
@ -1892,7 +1890,6 @@ ProcRecordQueryVersion(ClientPtr client)
|
|||
{
|
||||
/* REQUEST(xRecordQueryVersionReq); */
|
||||
xRecordQueryVersionReply rep;
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
|
||||
rep.type = X_Reply;
|
||||
|
@ -1902,9 +1899,9 @@ ProcRecordQueryVersion(ClientPtr client)
|
|||
rep.minorVersion = SERVER_RECORD_MINOR_VERSION;
|
||||
if(client->swapped)
|
||||
{
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swaps(&rep.majorVersion, n);
|
||||
swaps(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
}
|
||||
(void)WriteToClient(client, sizeof(xRecordQueryVersionReply),
|
||||
(char *)&rep);
|
||||
|
@ -2207,13 +2204,12 @@ static void
|
|||
RecordSwapRanges(xRecordRange *pRanges, int nRanges)
|
||||
{
|
||||
int i;
|
||||
register char n;
|
||||
for (i = 0; i < nRanges; i++, pRanges++)
|
||||
{
|
||||
swaps(&pRanges->extRequestsMinorFirst, n);
|
||||
swaps(&pRanges->extRequestsMinorLast, n);
|
||||
swaps(&pRanges->extRepliesMinorFirst, n);
|
||||
swaps(&pRanges->extRepliesMinorLast, n);
|
||||
swaps(&pRanges->extRequestsMinorFirst);
|
||||
swaps(&pRanges->extRequestsMinorLast);
|
||||
swaps(&pRanges->extRepliesMinorFirst);
|
||||
swaps(&pRanges->extRepliesMinorLast);
|
||||
}
|
||||
} /* RecordSwapRanges */
|
||||
|
||||
|
@ -2224,7 +2220,6 @@ ProcRecordGetContext(ClientPtr client)
|
|||
RecordContextPtr pContext;
|
||||
REQUEST(xRecordGetContextReq);
|
||||
xRecordGetContextReply rep;
|
||||
int n;
|
||||
RecordClientsAndProtocolPtr pRCAP;
|
||||
int nRCAPs = 0;
|
||||
GetContextRangeInfoPtr pRangeInfo;
|
||||
|
@ -2323,9 +2318,9 @@ ProcRecordGetContext(ClientPtr client)
|
|||
rep.elementHeader = pContext->elemHeaders;
|
||||
if(client->swapped)
|
||||
{
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.nClients, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.nClients);
|
||||
}
|
||||
(void)WriteToClient(client, sizeof(xRecordGetContextReply),
|
||||
(char *)&rep);
|
||||
|
@ -2340,13 +2335,13 @@ ProcRecordGetContext(ClientPtr client)
|
|||
rci.nRanges = pri->nRanges;
|
||||
if (client->swapped)
|
||||
{
|
||||
swapl(&rci.nRanges, n);
|
||||
swapl(&rci.nRanges);
|
||||
RecordSwapRanges(pri->pRanges, pri->nRanges);
|
||||
}
|
||||
for (i = 0; i < pRCAP->numClients; i++)
|
||||
{
|
||||
rci.clientResource = pRCAP->pClientIDs[i];
|
||||
if (client->swapped) swapl(&rci.clientResource, n);
|
||||
if (client->swapped) swapl(&rci.clientResource);
|
||||
WriteToClient(client, sizeof(xRecordClientInfo), (char *)&rci);
|
||||
WriteToClient(client, sizeof(xRecordRange) * pri->nRanges,
|
||||
(char *)pri->pRanges);
|
||||
|
@ -2590,12 +2585,11 @@ static int
|
|||
SProcRecordQueryVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRecordQueryVersionReq);
|
||||
register char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
|
||||
swaps(&stuff->majorVersion, n);
|
||||
swaps(&stuff->minorVersion,n);
|
||||
swaps(&stuff->majorVersion);
|
||||
swaps(&stuff->minorVersion);
|
||||
return ProcRecordQueryVersion(client);
|
||||
} /* SProcRecordQueryVersion */
|
||||
|
||||
|
@ -2603,19 +2597,18 @@ SProcRecordQueryVersion(ClientPtr client)
|
|||
static int
|
||||
SwapCreateRegister(xRecordRegisterClientsReq *stuff)
|
||||
{
|
||||
register char n;
|
||||
int i;
|
||||
XID *pClientID;
|
||||
|
||||
swapl(&stuff->context, n);
|
||||
swapl(&stuff->nClients, n);
|
||||
swapl(&stuff->nRanges, n);
|
||||
swapl(&stuff->context);
|
||||
swapl(&stuff->nClients);
|
||||
swapl(&stuff->nRanges);
|
||||
pClientID = (XID *)&stuff[1];
|
||||
if (stuff->nClients > stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq))
|
||||
return BadLength;
|
||||
for (i = 0; i < stuff->nClients; i++, pClientID++)
|
||||
{
|
||||
swapl(pClientID, n);
|
||||
swapl(pClientID);
|
||||
}
|
||||
if (stuff->nRanges > stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq)
|
||||
- stuff->nClients)
|
||||
|
@ -2630,9 +2623,8 @@ SProcRecordCreateContext(ClientPtr client)
|
|||
{
|
||||
REQUEST(xRecordCreateContextReq);
|
||||
int status;
|
||||
register char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq);
|
||||
if ((status = SwapCreateRegister((pointer)stuff)) != Success)
|
||||
return status;
|
||||
|
@ -2645,9 +2637,8 @@ SProcRecordRegisterClients(ClientPtr client)
|
|||
{
|
||||
REQUEST(xRecordRegisterClientsReq);
|
||||
int status;
|
||||
register char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq);
|
||||
if ((status = SwapCreateRegister((pointer)stuff)) != Success)
|
||||
return status;
|
||||
|
@ -2659,12 +2650,11 @@ static int
|
|||
SProcRecordUnregisterClients(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRecordUnregisterClientsReq);
|
||||
register char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xRecordUnregisterClientsReq);
|
||||
swapl(&stuff->context, n);
|
||||
swapl(&stuff->nClients, n);
|
||||
swapl(&stuff->context);
|
||||
swapl(&stuff->nClients);
|
||||
SwapRestL(stuff);
|
||||
return ProcRecordUnregisterClients(client);
|
||||
} /* SProcRecordUnregisterClients */
|
||||
|
@ -2674,11 +2664,10 @@ static int
|
|||
SProcRecordGetContext(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRecordGetContextReq);
|
||||
register char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xRecordGetContextReq);
|
||||
swapl(&stuff->context, n);
|
||||
swapl(&stuff->context);
|
||||
return ProcRecordGetContext(client);
|
||||
} /* SProcRecordGetContext */
|
||||
|
||||
|
@ -2686,11 +2675,10 @@ static int
|
|||
SProcRecordEnableContext(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRecordEnableContextReq);
|
||||
register char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xRecordEnableContextReq);
|
||||
swapl(&stuff->context, n);
|
||||
swapl(&stuff->context);
|
||||
return ProcRecordEnableContext(client);
|
||||
} /* SProcRecordEnableContext */
|
||||
|
||||
|
@ -2699,11 +2687,10 @@ static int
|
|||
SProcRecordDisableContext(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRecordDisableContextReq);
|
||||
register char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xRecordDisableContextReq);
|
||||
swapl(&stuff->context, n);
|
||||
swapl(&stuff->context);
|
||||
return ProcRecordDisableContext(client);
|
||||
} /* SProcRecordDisableContext */
|
||||
|
||||
|
@ -2712,11 +2699,10 @@ static int
|
|||
SProcRecordFreeContext(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRecordFreeContextReq);
|
||||
register char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xRecordFreeContextReq);
|
||||
swapl(&stuff->context, n);
|
||||
swapl(&stuff->context);
|
||||
return ProcRecordFreeContext(client);
|
||||
} /* SProcRecordFreeContext */
|
||||
|
||||
|
|
442
render/render.c
442
render/render.c
|
@ -276,7 +276,6 @@ ProcRenderQueryVersion (ClientPtr client)
|
|||
{
|
||||
RenderClientPtr pRenderClient = GetRenderClient (client);
|
||||
xRenderQueryVersionReply rep;
|
||||
register int n;
|
||||
REQUEST(xRenderQueryVersionReq);
|
||||
|
||||
pRenderClient->major_version = stuff->majorVersion;
|
||||
|
@ -300,10 +299,10 @@ ProcRenderQueryVersion (ClientPtr client)
|
|||
}
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.majorVersion, n);
|
||||
swapl(&rep.minorVersion, n);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.majorVersion);
|
||||
swapl(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep);
|
||||
return Success;
|
||||
|
@ -345,7 +344,6 @@ ProcRenderQueryPictFormats (ClientPtr client)
|
|||
int nvisual;
|
||||
int rlength;
|
||||
int s;
|
||||
int n;
|
||||
int numScreens;
|
||||
int numSubpixel;
|
||||
/* REQUEST(xRenderQueryPictFormatsReq); */
|
||||
|
@ -432,16 +430,16 @@ ProcRenderQueryPictFormats (ClientPtr client)
|
|||
pictForm->colormap = None;
|
||||
if (client->swapped)
|
||||
{
|
||||
swapl (&pictForm->id, n);
|
||||
swaps (&pictForm->direct.red, n);
|
||||
swaps (&pictForm->direct.redMask, n);
|
||||
swaps (&pictForm->direct.green, n);
|
||||
swaps (&pictForm->direct.greenMask, n);
|
||||
swaps (&pictForm->direct.blue, n);
|
||||
swaps (&pictForm->direct.blueMask, n);
|
||||
swaps (&pictForm->direct.alpha, n);
|
||||
swaps (&pictForm->direct.alphaMask, n);
|
||||
swapl (&pictForm->colormap, n);
|
||||
swapl(&pictForm->id);
|
||||
swaps(&pictForm->direct.red);
|
||||
swaps(&pictForm->direct.redMask);
|
||||
swaps(&pictForm->direct.green);
|
||||
swaps(&pictForm->direct.greenMask);
|
||||
swaps(&pictForm->direct.blue);
|
||||
swaps(&pictForm->direct.blueMask);
|
||||
swaps(&pictForm->direct.alpha);
|
||||
swaps(&pictForm->direct.alphaMask);
|
||||
swapl(&pictForm->colormap);
|
||||
}
|
||||
pictForm++;
|
||||
}
|
||||
|
@ -471,8 +469,8 @@ ProcRenderQueryPictFormats (ClientPtr client)
|
|||
pictVisual->format = pFormat->id;
|
||||
if (client->swapped)
|
||||
{
|
||||
swapl (&pictVisual->visual, n);
|
||||
swapl (&pictVisual->format, n);
|
||||
swapl(&pictVisual->visual);
|
||||
swapl(&pictVisual->format);
|
||||
}
|
||||
pictVisual++;
|
||||
nvisual++;
|
||||
|
@ -482,7 +480,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
|
|||
pictDepth->nPictVisuals = nvisual;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps (&pictDepth->nPictVisuals, n);
|
||||
swaps(&pictDepth->nPictVisuals);
|
||||
}
|
||||
ndepth++;
|
||||
pictDepth = (xPictDepth *) pictVisual;
|
||||
|
@ -495,8 +493,8 @@ ProcRenderQueryPictFormats (ClientPtr client)
|
|||
pictScreen->fallback = 0;
|
||||
if (client->swapped)
|
||||
{
|
||||
swapl (&pictScreen->nDepth, n);
|
||||
swapl (&pictScreen->fallback, n);
|
||||
swapl(&pictScreen->nDepth);
|
||||
swapl(&pictScreen->fallback);
|
||||
}
|
||||
pictScreen = (xPictScreen *) pictDepth;
|
||||
}
|
||||
|
@ -512,20 +510,20 @@ ProcRenderQueryPictFormats (ClientPtr client)
|
|||
*pictSubpixel = SubPixelUnknown;
|
||||
if (client->swapped)
|
||||
{
|
||||
swapl (pictSubpixel, n);
|
||||
swapl(pictSubpixel);
|
||||
}
|
||||
++pictSubpixel;
|
||||
}
|
||||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps (&reply->sequenceNumber, n);
|
||||
swapl (&reply->length, n);
|
||||
swapl (&reply->numFormats, n);
|
||||
swapl (&reply->numScreens, n);
|
||||
swapl (&reply->numDepths, n);
|
||||
swapl (&reply->numVisuals, n);
|
||||
swapl (&reply->numSubpixel, n);
|
||||
swaps(&reply->sequenceNumber);
|
||||
swapl(&reply->length);
|
||||
swapl(&reply->numFormats);
|
||||
swapl(&reply->numScreens);
|
||||
swapl(&reply->numDepths);
|
||||
swapl(&reply->numVisuals);
|
||||
swapl(&reply->numSubpixel);
|
||||
}
|
||||
WriteToClient(client, rlength, (char *) reply);
|
||||
free(reply);
|
||||
|
@ -538,7 +536,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
|
|||
PictFormatPtr pFormat;
|
||||
int rc, num;
|
||||
int rlength;
|
||||
int i, n;
|
||||
int i;
|
||||
REQUEST(xRenderQueryPictIndexValuesReq);
|
||||
xRenderQueryPictIndexValuesReply *reply;
|
||||
xIndexValue *values;
|
||||
|
@ -575,15 +573,15 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
|
|||
{
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
swapl (&values[i].pixel, n);
|
||||
swaps (&values[i].red, n);
|
||||
swaps (&values[i].green, n);
|
||||
swaps (&values[i].blue, n);
|
||||
swaps (&values[i].alpha, n);
|
||||
swapl(&values[i].pixel);
|
||||
swaps(&values[i].red);
|
||||
swaps(&values[i].green);
|
||||
swaps(&values[i].blue);
|
||||
swaps(&values[i].alpha);
|
||||
}
|
||||
swaps (&reply->sequenceNumber, n);
|
||||
swapl (&reply->length, n);
|
||||
swapl (&reply->numIndexValues, n);
|
||||
swaps(&reply->sequenceNumber);
|
||||
swapl(&reply->length);
|
||||
swapl(&reply->numIndexValues);
|
||||
}
|
||||
|
||||
WriteToClient(client, rlength, (char *) reply);
|
||||
|
@ -1822,16 +1820,14 @@ ProcRenderQueryFilters (ClientPtr client)
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
register int n;
|
||||
|
||||
for (i = 0; i < reply->numAliases; i++)
|
||||
{
|
||||
swaps (&aliases[i], n);
|
||||
swaps(&aliases[i]);
|
||||
}
|
||||
swaps(&reply->sequenceNumber, n);
|
||||
swapl(&reply->length, n);
|
||||
swapl(&reply->numAliases, n);
|
||||
swapl(&reply->numFilters, n);
|
||||
swaps(&reply->sequenceNumber);
|
||||
swapl(&reply->length);
|
||||
swapl(&reply->numAliases);
|
||||
swapl(&reply->numFilters);
|
||||
}
|
||||
WriteToClient(client, total_bytes, (char *) reply);
|
||||
free(reply);
|
||||
|
@ -2068,31 +2064,28 @@ ProcRenderDispatch (ClientPtr client)
|
|||
static int
|
||||
SProcRenderQueryVersion (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderQueryVersionReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->majorVersion, n);
|
||||
swapl(&stuff->minorVersion, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->majorVersion);
|
||||
swapl(&stuff->minorVersion);
|
||||
return (*ProcRenderVector[stuff->renderReqType])(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRenderQueryPictFormats (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderQueryPictFormatsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swaps(&stuff->length);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRenderQueryPictIndexValues (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderQueryPictIndexValuesReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->format, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->format);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
|
@ -2105,13 +2098,12 @@ SProcRenderQueryDithers (ClientPtr client)
|
|||
static int
|
||||
SProcRenderCreatePicture (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderCreatePictureReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->pid, n);
|
||||
swapl(&stuff->drawable, n);
|
||||
swapl(&stuff->format, n);
|
||||
swapl(&stuff->mask, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->pid);
|
||||
swapl(&stuff->drawable);
|
||||
swapl(&stuff->format);
|
||||
swapl(&stuff->mask);
|
||||
SwapRestL(stuff);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
@ -2119,11 +2111,10 @@ SProcRenderCreatePicture (ClientPtr client)
|
|||
static int
|
||||
SProcRenderChangePicture (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderChangePictureReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->picture, n);
|
||||
swapl(&stuff->mask, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->picture);
|
||||
swapl(&stuff->mask);
|
||||
SwapRestL(stuff);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
@ -2131,12 +2122,11 @@ SProcRenderChangePicture (ClientPtr client)
|
|||
static int
|
||||
SProcRenderSetPictureClipRectangles (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderSetPictureClipRectanglesReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->picture, n);
|
||||
swaps(&stuff->xOrigin, n);
|
||||
swaps(&stuff->yOrigin, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->picture);
|
||||
swaps(&stuff->xOrigin);
|
||||
swaps(&stuff->yOrigin);
|
||||
SwapRestS(stuff);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
@ -2144,65 +2134,61 @@ SProcRenderSetPictureClipRectangles (ClientPtr client)
|
|||
static int
|
||||
SProcRenderFreePicture (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderFreePictureReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->picture, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->picture);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRenderComposite (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderCompositeReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->src, n);
|
||||
swapl(&stuff->mask, n);
|
||||
swapl(&stuff->dst, n);
|
||||
swaps(&stuff->xSrc, n);
|
||||
swaps(&stuff->ySrc, n);
|
||||
swaps(&stuff->xMask, n);
|
||||
swaps(&stuff->yMask, n);
|
||||
swaps(&stuff->xDst, n);
|
||||
swaps(&stuff->yDst, n);
|
||||
swaps(&stuff->width, n);
|
||||
swaps(&stuff->height, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->src);
|
||||
swapl(&stuff->mask);
|
||||
swapl(&stuff->dst);
|
||||
swaps(&stuff->xSrc);
|
||||
swaps(&stuff->ySrc);
|
||||
swaps(&stuff->xMask);
|
||||
swaps(&stuff->yMask);
|
||||
swaps(&stuff->xDst);
|
||||
swaps(&stuff->yDst);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRenderScale (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderScaleReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->src, n);
|
||||
swapl(&stuff->dst, n);
|
||||
swapl(&stuff->colorScale, n);
|
||||
swapl(&stuff->alphaScale, n);
|
||||
swaps(&stuff->xSrc, n);
|
||||
swaps(&stuff->ySrc, n);
|
||||
swaps(&stuff->xDst, n);
|
||||
swaps(&stuff->yDst, n);
|
||||
swaps(&stuff->width, n);
|
||||
swaps(&stuff->height, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->src);
|
||||
swapl(&stuff->dst);
|
||||
swapl(&stuff->colorScale);
|
||||
swapl(&stuff->alphaScale);
|
||||
swaps(&stuff->xSrc);
|
||||
swaps(&stuff->ySrc);
|
||||
swaps(&stuff->xDst);
|
||||
swaps(&stuff->yDst);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRenderTrapezoids (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderTrapezoidsReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq);
|
||||
swaps (&stuff->length, n);
|
||||
swapl (&stuff->src, n);
|
||||
swapl (&stuff->dst, n);
|
||||
swapl (&stuff->maskFormat, n);
|
||||
swaps (&stuff->xSrc, n);
|
||||
swaps (&stuff->ySrc, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->src);
|
||||
swapl(&stuff->dst);
|
||||
swapl(&stuff->maskFormat);
|
||||
swaps(&stuff->xSrc);
|
||||
swaps(&stuff->ySrc);
|
||||
SwapRestL(stuff);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
@ -2210,16 +2196,15 @@ SProcRenderTrapezoids (ClientPtr client)
|
|||
static int
|
||||
SProcRenderTriangles (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderTrianglesReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
|
||||
swaps (&stuff->length, n);
|
||||
swapl (&stuff->src, n);
|
||||
swapl (&stuff->dst, n);
|
||||
swapl (&stuff->maskFormat, n);
|
||||
swaps (&stuff->xSrc, n);
|
||||
swaps (&stuff->ySrc, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->src);
|
||||
swapl(&stuff->dst);
|
||||
swapl(&stuff->maskFormat);
|
||||
swaps(&stuff->xSrc);
|
||||
swaps(&stuff->ySrc);
|
||||
SwapRestL(stuff);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
@ -2227,16 +2212,15 @@ SProcRenderTriangles (ClientPtr client)
|
|||
static int
|
||||
SProcRenderTriStrip (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderTriStripReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderTriStripReq);
|
||||
swaps (&stuff->length, n);
|
||||
swapl (&stuff->src, n);
|
||||
swapl (&stuff->dst, n);
|
||||
swapl (&stuff->maskFormat, n);
|
||||
swaps (&stuff->xSrc, n);
|
||||
swaps (&stuff->ySrc, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->src);
|
||||
swapl(&stuff->dst);
|
||||
swapl(&stuff->maskFormat);
|
||||
swaps(&stuff->xSrc);
|
||||
swaps(&stuff->ySrc);
|
||||
SwapRestL(stuff);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
@ -2244,16 +2228,15 @@ SProcRenderTriStrip (ClientPtr client)
|
|||
static int
|
||||
SProcRenderTriFan (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderTriFanReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderTriFanReq);
|
||||
swaps (&stuff->length, n);
|
||||
swapl (&stuff->src, n);
|
||||
swapl (&stuff->dst, n);
|
||||
swapl (&stuff->maskFormat, n);
|
||||
swaps (&stuff->xSrc, n);
|
||||
swaps (&stuff->ySrc, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->src);
|
||||
swapl(&stuff->dst);
|
||||
swapl(&stuff->maskFormat);
|
||||
swaps(&stuff->xSrc);
|
||||
swaps(&stuff->ySrc);
|
||||
SwapRestL(stuff);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
@ -2279,47 +2262,43 @@ SProcRenderTransform (ClientPtr client)
|
|||
static int
|
||||
SProcRenderCreateGlyphSet (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderCreateGlyphSetReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->gsid, n);
|
||||
swapl(&stuff->format, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->gsid);
|
||||
swapl(&stuff->format);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRenderReferenceGlyphSet (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderReferenceGlyphSetReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->gsid, n);
|
||||
swapl(&stuff->existing, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->gsid);
|
||||
swapl(&stuff->existing);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRenderFreeGlyphSet (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderFreeGlyphSetReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->glyphset, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->glyphset);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRenderAddGlyphs (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
register int i;
|
||||
CARD32 *gids;
|
||||
void *end;
|
||||
xGlyphInfo *gi;
|
||||
REQUEST(xRenderAddGlyphsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->glyphset, n);
|
||||
swapl(&stuff->nglyphs, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->glyphset);
|
||||
swapl(&stuff->nglyphs);
|
||||
if (stuff->nglyphs & 0xe0000000)
|
||||
return BadLength;
|
||||
end = (CARD8 *) stuff + (client->req_len << 2);
|
||||
|
@ -2331,13 +2310,13 @@ SProcRenderAddGlyphs (ClientPtr client)
|
|||
return BadLength;
|
||||
for (i = 0; i < stuff->nglyphs; i++)
|
||||
{
|
||||
swapl (&gids[i], n);
|
||||
swaps (&gi[i].width, n);
|
||||
swaps (&gi[i].height, n);
|
||||
swaps (&gi[i].x, n);
|
||||
swaps (&gi[i].y, n);
|
||||
swaps (&gi[i].xOff, n);
|
||||
swaps (&gi[i].yOff, n);
|
||||
swapl(&gids[i]);
|
||||
swaps(&gi[i].width);
|
||||
swaps(&gi[i].height);
|
||||
swaps(&gi[i].x);
|
||||
swaps(&gi[i].y);
|
||||
swaps(&gi[i].xOff);
|
||||
swaps(&gi[i].yOff);
|
||||
}
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
@ -2351,10 +2330,9 @@ SProcRenderAddGlyphsFromPicture (ClientPtr client)
|
|||
static int
|
||||
SProcRenderFreeGlyphs (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderFreeGlyphsReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->glyphset, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->glyphset);
|
||||
SwapRestL(stuff);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
@ -2362,7 +2340,6 @@ SProcRenderFreeGlyphs (ClientPtr client)
|
|||
static int
|
||||
SProcRenderCompositeGlyphs (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
xGlyphElt *elt;
|
||||
CARD8 *buffer;
|
||||
CARD8 *end;
|
||||
|
@ -2378,13 +2355,13 @@ SProcRenderCompositeGlyphs (ClientPtr client)
|
|||
case X_RenderCompositeGlyphs32: size = 4; break;
|
||||
}
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->src, n);
|
||||
swapl(&stuff->dst, n);
|
||||
swapl(&stuff->maskFormat, n);
|
||||
swapl(&stuff->glyphset, n);
|
||||
swaps(&stuff->xSrc, n);
|
||||
swaps(&stuff->ySrc, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->src);
|
||||
swapl(&stuff->dst);
|
||||
swapl(&stuff->maskFormat);
|
||||
swapl(&stuff->glyphset);
|
||||
swaps(&stuff->xSrc);
|
||||
swaps(&stuff->ySrc);
|
||||
buffer = (CARD8 *) (stuff + 1);
|
||||
end = (CARD8 *) stuff + (client->req_len << 2);
|
||||
while (buffer + sizeof (xGlyphElt) < end)
|
||||
|
@ -2392,13 +2369,13 @@ SProcRenderCompositeGlyphs (ClientPtr client)
|
|||
elt = (xGlyphElt *) buffer;
|
||||
buffer += sizeof (xGlyphElt);
|
||||
|
||||
swaps (&elt->deltax, n);
|
||||
swaps (&elt->deltay, n);
|
||||
swaps(&elt->deltax);
|
||||
swaps(&elt->deltay);
|
||||
|
||||
i = elt->len;
|
||||
if (i == 0xff)
|
||||
{
|
||||
swapl (buffer, n);
|
||||
swapl(buffer);
|
||||
buffer += 4;
|
||||
}
|
||||
else
|
||||
|
@ -2411,14 +2388,14 @@ SProcRenderCompositeGlyphs (ClientPtr client)
|
|||
case 2:
|
||||
while (i--)
|
||||
{
|
||||
swaps (buffer, n);
|
||||
swaps(buffer);
|
||||
buffer += 2;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
while (i--)
|
||||
{
|
||||
swapl (buffer, n);
|
||||
swapl(buffer);
|
||||
buffer += 4;
|
||||
}
|
||||
break;
|
||||
|
@ -2433,16 +2410,15 @@ SProcRenderCompositeGlyphs (ClientPtr client)
|
|||
static int
|
||||
SProcRenderFillRectangles (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderFillRectanglesReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->dst, n);
|
||||
swaps(&stuff->color.red, n);
|
||||
swaps(&stuff->color.green, n);
|
||||
swaps(&stuff->color.blue, n);
|
||||
swaps(&stuff->color.alpha, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->dst);
|
||||
swaps(&stuff->color.red);
|
||||
swaps(&stuff->color.green);
|
||||
swaps(&stuff->color.blue);
|
||||
swaps(&stuff->color.alpha);
|
||||
SwapRestS(stuff);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
@ -2450,73 +2426,68 @@ SProcRenderFillRectangles (ClientPtr client)
|
|||
static int
|
||||
SProcRenderCreateCursor (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderCreateCursorReq);
|
||||
REQUEST_SIZE_MATCH (xRenderCreateCursorReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->cid, n);
|
||||
swapl(&stuff->src, n);
|
||||
swaps(&stuff->x, n);
|
||||
swaps(&stuff->y, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->cid);
|
||||
swapl(&stuff->src);
|
||||
swaps(&stuff->x);
|
||||
swaps(&stuff->y);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRenderSetPictureTransform (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST(xRenderSetPictureTransformReq);
|
||||
REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->picture, n);
|
||||
swapl(&stuff->transform.matrix11, n);
|
||||
swapl(&stuff->transform.matrix12, n);
|
||||
swapl(&stuff->transform.matrix13, n);
|
||||
swapl(&stuff->transform.matrix21, n);
|
||||
swapl(&stuff->transform.matrix22, n);
|
||||
swapl(&stuff->transform.matrix23, n);
|
||||
swapl(&stuff->transform.matrix31, n);
|
||||
swapl(&stuff->transform.matrix32, n);
|
||||
swapl(&stuff->transform.matrix33, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->picture);
|
||||
swapl(&stuff->transform.matrix11);
|
||||
swapl(&stuff->transform.matrix12);
|
||||
swapl(&stuff->transform.matrix13);
|
||||
swapl(&stuff->transform.matrix21);
|
||||
swapl(&stuff->transform.matrix22);
|
||||
swapl(&stuff->transform.matrix23);
|
||||
swapl(&stuff->transform.matrix31);
|
||||
swapl(&stuff->transform.matrix32);
|
||||
swapl(&stuff->transform.matrix33);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRenderQueryFilters (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST (xRenderQueryFiltersReq);
|
||||
REQUEST_SIZE_MATCH (xRenderQueryFiltersReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->drawable, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->drawable);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRenderSetPictureFilter (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST (xRenderSetPictureFilterReq);
|
||||
REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->picture, n);
|
||||
swaps(&stuff->nbytes, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->picture);
|
||||
swaps(&stuff->nbytes);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcRenderCreateAnimCursor (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST (xRenderCreateAnimCursorReq);
|
||||
REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->cid, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->cid);
|
||||
SwapRestL(stuff);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
@ -2524,14 +2495,13 @@ SProcRenderCreateAnimCursor (ClientPtr client)
|
|||
static int
|
||||
SProcRenderAddTraps (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST (xRenderAddTrapsReq);
|
||||
REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->picture, n);
|
||||
swaps(&stuff->xOff, n);
|
||||
swaps(&stuff->yOff, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->picture);
|
||||
swaps(&stuff->xOff);
|
||||
swaps(&stuff->yOff);
|
||||
SwapRestL(stuff);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
@ -2539,32 +2509,31 @@ SProcRenderAddTraps (ClientPtr client)
|
|||
static int
|
||||
SProcRenderCreateSolidFill(ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
REQUEST (xRenderCreateSolidFillReq);
|
||||
REQUEST_AT_LEAST_SIZE (xRenderCreateSolidFillReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->pid, n);
|
||||
swaps(&stuff->color.alpha, n);
|
||||
swaps(&stuff->color.red, n);
|
||||
swaps(&stuff->color.green, n);
|
||||
swaps(&stuff->color.blue, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->pid);
|
||||
swaps(&stuff->color.alpha);
|
||||
swaps(&stuff->color.red);
|
||||
swaps(&stuff->color.green);
|
||||
swaps(&stuff->color.blue);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static void swapStops(void *stuff, int num)
|
||||
{
|
||||
int i, n;
|
||||
int i;
|
||||
CARD32 *stops;
|
||||
CARD16 *colors;
|
||||
stops = (CARD32 *)(stuff);
|
||||
for (i = 0; i < num; ++i) {
|
||||
swapl(stops, n);
|
||||
swapl(stops);
|
||||
++stops;
|
||||
}
|
||||
colors = (CARD16 *)(stops);
|
||||
for (i = 0; i < 4*num; ++i) {
|
||||
swaps(colors, n);
|
||||
swaps(colors);
|
||||
++colors;
|
||||
}
|
||||
}
|
||||
|
@ -2572,18 +2541,17 @@ static void swapStops(void *stuff, int num)
|
|||
static int
|
||||
SProcRenderCreateLinearGradient (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
int len;
|
||||
REQUEST (xRenderCreateLinearGradientReq);
|
||||
REQUEST_AT_LEAST_SIZE (xRenderCreateLinearGradientReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->pid, n);
|
||||
swapl(&stuff->p1.x, n);
|
||||
swapl(&stuff->p1.y, n);
|
||||
swapl(&stuff->p2.x, n);
|
||||
swapl(&stuff->p2.y, n);
|
||||
swapl(&stuff->nStops, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->pid);
|
||||
swapl(&stuff->p1.x);
|
||||
swapl(&stuff->p1.y);
|
||||
swapl(&stuff->p2.x);
|
||||
swapl(&stuff->p2.y);
|
||||
swapl(&stuff->nStops);
|
||||
|
||||
len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq);
|
||||
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
|
||||
|
@ -2599,20 +2567,19 @@ SProcRenderCreateLinearGradient (ClientPtr client)
|
|||
static int
|
||||
SProcRenderCreateRadialGradient (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
int len;
|
||||
REQUEST (xRenderCreateRadialGradientReq);
|
||||
REQUEST_AT_LEAST_SIZE (xRenderCreateRadialGradientReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->pid, n);
|
||||
swapl(&stuff->inner.x, n);
|
||||
swapl(&stuff->inner.y, n);
|
||||
swapl(&stuff->outer.x, n);
|
||||
swapl(&stuff->outer.y, n);
|
||||
swapl(&stuff->inner_radius, n);
|
||||
swapl(&stuff->outer_radius, n);
|
||||
swapl(&stuff->nStops, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->pid);
|
||||
swapl(&stuff->inner.x);
|
||||
swapl(&stuff->inner.y);
|
||||
swapl(&stuff->outer.x);
|
||||
swapl(&stuff->outer.y);
|
||||
swapl(&stuff->inner_radius);
|
||||
swapl(&stuff->outer_radius);
|
||||
swapl(&stuff->nStops);
|
||||
|
||||
len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq);
|
||||
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
|
||||
|
@ -2628,17 +2595,16 @@ SProcRenderCreateRadialGradient (ClientPtr client)
|
|||
static int
|
||||
SProcRenderCreateConicalGradient (ClientPtr client)
|
||||
{
|
||||
register int n;
|
||||
int len;
|
||||
REQUEST (xRenderCreateConicalGradientReq);
|
||||
REQUEST_AT_LEAST_SIZE (xRenderCreateConicalGradientReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->pid, n);
|
||||
swapl(&stuff->center.x, n);
|
||||
swapl(&stuff->center.y, n);
|
||||
swapl(&stuff->angle, n);
|
||||
swapl(&stuff->nStops, n);
|
||||
swaps(&stuff->length);
|
||||
swapl(&stuff->pid);
|
||||
swapl(&stuff->center.x);
|
||||
swapl(&stuff->center.y);
|
||||
swapl(&stuff->angle);
|
||||
swapl(&stuff->nStops);
|
||||
|
||||
len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq);
|
||||
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
|
||||
|
|
|
@ -44,15 +44,13 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
|
|||
|
||||
if (swap)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&out->sequenceNumber, n);
|
||||
swapl(&out->length, n);
|
||||
swaps(&out->evtype, n);
|
||||
swaps(&out->deviceid, n);
|
||||
swapl(&out->time, n);
|
||||
swapl(&out->detail, n);
|
||||
swaps(&out->valuators_len, n);
|
||||
swaps(&out->sequenceNumber);
|
||||
swapl(&out->length);
|
||||
swaps(&out->evtype);
|
||||
swaps(&out->deviceid);
|
||||
swapl(&out->time);
|
||||
swapl(&out->detail);
|
||||
swaps(&out->valuators_len);
|
||||
}
|
||||
|
||||
|
||||
|
@ -101,9 +99,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
|
|||
vo.frac = value->frac;
|
||||
if (swap)
|
||||
{
|
||||
char n;
|
||||
swapl(&vo.integral, n);
|
||||
swapl(&vo.frac, n);
|
||||
swapl(&vo.integral);
|
||||
swapl(&vo.frac);
|
||||
}
|
||||
|
||||
assert(vi.integral == vo.integral);
|
||||
|
@ -118,9 +115,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
|
|||
vo.frac = raw_value->frac;
|
||||
if (swap)
|
||||
{
|
||||
char n;
|
||||
swapl(&vo.integral, n);
|
||||
swapl(&vo.frac, n);
|
||||
swapl(&vo.integral);
|
||||
swapl(&vo.frac);
|
||||
}
|
||||
|
||||
assert(vi.integral == vo.integral);
|
||||
|
@ -276,29 +272,27 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
|
|||
FP3232 *values;
|
||||
|
||||
if (swap) {
|
||||
char n;
|
||||
|
||||
swaps(&out->sequenceNumber, n);
|
||||
swapl(&out->length, n);
|
||||
swaps(&out->evtype, n);
|
||||
swaps(&out->deviceid, n);
|
||||
swaps(&out->sourceid, n);
|
||||
swapl(&out->time, n);
|
||||
swapl(&out->detail, n);
|
||||
swapl(&out->root, n);
|
||||
swapl(&out->event, n);
|
||||
swapl(&out->child, n);
|
||||
swapl(&out->root_x, n);
|
||||
swapl(&out->root_y, n);
|
||||
swapl(&out->event_x, n);
|
||||
swapl(&out->event_y, n);
|
||||
swaps(&out->buttons_len, n);
|
||||
swaps(&out->valuators_len, n);
|
||||
swapl(&out->mods.base_mods, n);
|
||||
swapl(&out->mods.latched_mods, n);
|
||||
swapl(&out->mods.locked_mods, n);
|
||||
swapl(&out->mods.effective_mods, n);
|
||||
swapl(&out->flags, n);
|
||||
swaps(&out->sequenceNumber);
|
||||
swapl(&out->length);
|
||||
swaps(&out->evtype);
|
||||
swaps(&out->deviceid);
|
||||
swaps(&out->sourceid);
|
||||
swapl(&out->time);
|
||||
swapl(&out->detail);
|
||||
swapl(&out->root);
|
||||
swapl(&out->event);
|
||||
swapl(&out->child);
|
||||
swapl(&out->root_x);
|
||||
swapl(&out->root_y);
|
||||
swapl(&out->event_x);
|
||||
swapl(&out->event_y);
|
||||
swaps(&out->buttons_len);
|
||||
swaps(&out->valuators_len);
|
||||
swapl(&out->mods.base_mods);
|
||||
swapl(&out->mods.latched_mods);
|
||||
swapl(&out->mods.locked_mods);
|
||||
swapl(&out->mods.effective_mods);
|
||||
swapl(&out->flags);
|
||||
}
|
||||
|
||||
assert(out->extension == 0); /* IReqCode defaults to 0 */
|
||||
|
@ -388,9 +382,8 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
|
|||
|
||||
if (swap)
|
||||
{
|
||||
char n;
|
||||
swapl(&vo.integral, n);
|
||||
swapl(&vo.frac, n);
|
||||
swapl(&vo.integral);
|
||||
swapl(&vo.frac);
|
||||
}
|
||||
|
||||
|
||||
|
@ -647,15 +640,13 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
|
|||
|
||||
if (swap)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&out->sequenceNumber, n);
|
||||
swapl(&out->length, n);
|
||||
swaps(&out->evtype, n);
|
||||
swaps(&out->deviceid, n);
|
||||
swaps(&out->sourceid, n);
|
||||
swapl(&out->time, n);
|
||||
swaps(&out->num_classes, n);
|
||||
swaps(&out->sequenceNumber);
|
||||
swapl(&out->length);
|
||||
swaps(&out->evtype);
|
||||
swaps(&out->deviceid);
|
||||
swaps(&out->sourceid);
|
||||
swapl(&out->time);
|
||||
swaps(&out->num_classes);
|
||||
}
|
||||
|
||||
assert(out->type == GenericEvent);
|
||||
|
@ -672,10 +663,9 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
|
|||
|
||||
if (swap)
|
||||
{
|
||||
char n;
|
||||
swaps(&any->length, n);
|
||||
swaps(&any->type, n);
|
||||
swaps(&any->sourceid, n);
|
||||
swaps(&any->length);
|
||||
swaps(&any->type);
|
||||
swaps(&any->sourceid);
|
||||
}
|
||||
|
||||
switch(any->type)
|
||||
|
@ -687,8 +677,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
|
|||
|
||||
if (swap)
|
||||
{
|
||||
char n;
|
||||
swaps(&b->num_buttons, n);
|
||||
swaps(&b->num_buttons);
|
||||
}
|
||||
|
||||
assert(b->length ==
|
||||
|
@ -703,8 +692,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
|
|||
{
|
||||
if (swap)
|
||||
{
|
||||
char n;
|
||||
swapl(&names[j], n);
|
||||
swapl(&names[j]);
|
||||
}
|
||||
assert(names[j] == in->buttons.names[j]);
|
||||
}
|
||||
|
@ -717,8 +705,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
|
|||
|
||||
if (swap)
|
||||
{
|
||||
char n;
|
||||
swaps(&k->num_keycodes, n);
|
||||
swaps(&k->num_keycodes);
|
||||
}
|
||||
|
||||
assert(k->length ==
|
||||
|
@ -732,8 +719,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
|
|||
{
|
||||
if (swap)
|
||||
{
|
||||
char n;
|
||||
swapl(&kc[j], n);
|
||||
swapl(&kc[j]);
|
||||
}
|
||||
assert(kc[j] >= in->keys.min_keycode);
|
||||
assert(kc[j] <= in->keys.max_keycode);
|
||||
|
|
|
@ -70,10 +70,9 @@ static void reply_XIGetClientPointer(ClientPtr client, int len, char *data, void
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
char n;
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swaps(&rep->deviceid, n);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swaps(&rep->deviceid);
|
||||
}
|
||||
|
||||
reply_check_defaults(rep, len, XIGetClientPointer);
|
||||
|
@ -85,7 +84,6 @@ static void reply_XIGetClientPointer(ClientPtr client, int len, char *data, void
|
|||
|
||||
static void request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq* req, int error)
|
||||
{
|
||||
char n;
|
||||
int rc;
|
||||
|
||||
test_data.win = req->win;
|
||||
|
@ -97,8 +95,8 @@ static void request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq*
|
|||
assert(client_request.errorValue == req->win);
|
||||
|
||||
client_request.swapped = TRUE;
|
||||
swapl(&req->win, n);
|
||||
swaps(&req->length, n);
|
||||
swapl(&req->win);
|
||||
swaps(&req->length);
|
||||
rc = SProcXIGetClientPointer(&client_request);
|
||||
assert(rc == error);
|
||||
|
||||
|
|
|
@ -91,10 +91,9 @@ static void reply_XIGetSelectedEvents(ClientPtr client, int len, char *data, voi
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
char n;
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swaps(&rep->num_masks, n);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swaps(&rep->num_masks);
|
||||
}
|
||||
|
||||
reply_check_defaults(rep, len, XIGetSelectedEvents);
|
||||
|
@ -115,9 +114,8 @@ static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data
|
|||
{
|
||||
if (client->swapped)
|
||||
{
|
||||
char n;
|
||||
swaps(&mask->deviceid, n);
|
||||
swaps(&mask->mask_len, n);
|
||||
swaps(&mask->deviceid);
|
||||
swaps(&mask->mask_len);
|
||||
}
|
||||
|
||||
assert(mask->deviceid < 6);
|
||||
|
@ -136,7 +134,6 @@ static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data
|
|||
|
||||
static void request_XIGetSelectedEvents(xXIGetSelectedEventsReq* req, int error)
|
||||
{
|
||||
char n;
|
||||
int rc;
|
||||
ClientRec client;
|
||||
client = init_client(req->length, req);
|
||||
|
@ -148,8 +145,8 @@ static void request_XIGetSelectedEvents(xXIGetSelectedEventsReq* req, int error)
|
|||
|
||||
reply_handler = reply_XIGetSelectedEvents;
|
||||
client.swapped = TRUE;
|
||||
swapl(&req->win, n);
|
||||
swaps(&req->length, n);
|
||||
swapl(&req->win);
|
||||
swaps(&req->length);
|
||||
rc = SProcXIGetSelectedEvents(&client);
|
||||
assert(rc == error);
|
||||
}
|
||||
|
|
|
@ -85,10 +85,9 @@ static void reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, voi
|
|||
|
||||
if (client->swapped)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_modifiers, n);
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->num_modifiers);
|
||||
|
||||
testdata.num_modifiers = rep->num_modifiers;
|
||||
}
|
||||
|
@ -104,14 +103,13 @@ static void reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, voi
|
|||
static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data, void *userdata)
|
||||
{
|
||||
int i;
|
||||
int n;
|
||||
|
||||
xXIGrabModifierInfo *mods = (xXIGrabModifierInfo*)data;
|
||||
|
||||
for (i = 0; i < testdata.num_modifiers; i++, mods++)
|
||||
{
|
||||
if (client->swapped)
|
||||
swapl(&mods->modifiers, n);
|
||||
swapl(&mods->modifiers);
|
||||
|
||||
/* 1 - 7 is the range we use for the global modifiers array
|
||||
* above */
|
||||
|
@ -128,7 +126,6 @@ static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data
|
|||
|
||||
static void request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq* req, int error, int errval)
|
||||
{
|
||||
char n;
|
||||
int rc;
|
||||
int modifiers;
|
||||
|
||||
|
@ -139,20 +136,20 @@ static void request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceRe
|
|||
assert(client_request.errorValue == errval);
|
||||
|
||||
client_request.swapped = TRUE;
|
||||
swaps(&req->length, n);
|
||||
swapl(&req->time, n);
|
||||
swapl(&req->grab_window, n);
|
||||
swapl(&req->cursor, n);
|
||||
swapl(&req->detail, n);
|
||||
swaps(&req->deviceid, n);
|
||||
swaps(&req->length);
|
||||
swapl(&req->time);
|
||||
swapl(&req->grab_window);
|
||||
swapl(&req->cursor);
|
||||
swapl(&req->detail);
|
||||
swaps(&req->deviceid);
|
||||
modifiers = req->num_modifiers;
|
||||
swaps(&req->num_modifiers, n);
|
||||
swaps(&req->mask_len, n);
|
||||
swaps(&req->num_modifiers);
|
||||
swaps(&req->mask_len);
|
||||
|
||||
while(modifiers--)
|
||||
{
|
||||
CARD32 *mod = ((CARD32*)(req + 1)) + modifiers;
|
||||
swapl(mod, n);
|
||||
swapl(mod);
|
||||
}
|
||||
|
||||
rc = SProcXIPassiveGrabDevice(&client_request);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue