mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
randr: use X_SEND_REPLY_SIMPLE() for sending simple replies
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
4aff0544ea
commit
331510cc8f
@@ -1436,20 +1436,15 @@ ProcRRSetCrtcConfig(ClientPtr client)
|
||||
free(outputs);
|
||||
|
||||
xRRSetCrtcConfigReply rep = {
|
||||
.type = X_Reply,
|
||||
.status = status,
|
||||
.sequenceNumber = client->sequence,
|
||||
.newTimestamp = pScrPriv->lastSetTime.milliseconds
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.newTimestamp);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRSetCrtcConfigReply), &rep);
|
||||
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1476,10 +1471,7 @@ ProcRRGetPanning(ClientPtr client)
|
||||
return RRErrorBase + BadRRCrtc;
|
||||
|
||||
xRRGetPanningReply rep = {
|
||||
.type = X_Reply,
|
||||
.status = RRSetConfigSuccess,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = 1,
|
||||
.timestamp = pScrPriv->lastSetTime.milliseconds
|
||||
};
|
||||
|
||||
@@ -1500,8 +1492,6 @@ ProcRRGetPanning(ClientPtr client)
|
||||
}
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.timestamp);
|
||||
swaps(&rep.left);
|
||||
swaps(&rep.top);
|
||||
@@ -1516,8 +1506,7 @@ ProcRRGetPanning(ClientPtr client)
|
||||
swaps(&rep.border_right);
|
||||
swaps(&rep.border_bottom);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetPanningReply), &rep);
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1578,18 +1567,14 @@ ProcRRSetPanning(ClientPtr client)
|
||||
|
||||
sendReply: ;
|
||||
xRRSetPanningReply rep = {
|
||||
.type = X_Reply,
|
||||
.status = status,
|
||||
.sequenceNumber = client->sequence,
|
||||
.newTimestamp = pScrPriv->lastSetTime.milliseconds
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.newTimestamp);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRSetPanningReply), &rep);
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1606,17 +1591,12 @@ ProcRRGetCrtcGammaSize(ClientPtr client)
|
||||
return RRErrorBase + BadRRCrtc;
|
||||
|
||||
xRRGetCrtcGammaSizeReply reply = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.size = crtc->gammaSize
|
||||
};
|
||||
if (client->swapped) {
|
||||
swaps(&reply.sequenceNumber);
|
||||
swapl(&reply.length);
|
||||
swaps(&reply.size);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), &reply);
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, reply);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -40,10 +40,6 @@ RRClientKnowsRates(ClientPtr pClient)
|
||||
int
|
||||
ProcRRQueryVersion(ClientPtr client)
|
||||
{
|
||||
xRRQueryVersionReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
};
|
||||
REQUEST(xRRQueryVersionReq);
|
||||
rrClientPriv(client);
|
||||
|
||||
@@ -51,25 +47,24 @@ ProcRRQueryVersion(ClientPtr client)
|
||||
pRRClient->major_version = stuff->majorVersion;
|
||||
pRRClient->minor_version = stuff->minorVersion;
|
||||
|
||||
xRRQueryVersionReply rep = {
|
||||
.majorVersion = SERVER_RANDR_MAJOR_VERSION,
|
||||
.minorVersion = SERVER_RANDR_MINOR_VERSION
|
||||
};
|
||||
|
||||
if (version_compare(stuff->majorVersion, stuff->minorVersion,
|
||||
SERVER_RANDR_MAJOR_VERSION,
|
||||
SERVER_RANDR_MINOR_VERSION) < 0) {
|
||||
rep.majorVersion = stuff->majorVersion;
|
||||
rep.minorVersion = stuff->minorVersion;
|
||||
}
|
||||
else {
|
||||
rep.majorVersion = SERVER_RANDR_MAJOR_VERSION;
|
||||
rep.minorVersion = SERVER_RANDR_MINOR_VERSION;
|
||||
}
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.majorVersion);
|
||||
swapl(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRQueryVersionReply), &rep);
|
||||
return Success;
|
||||
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -335,19 +335,10 @@ leaseReturned:
|
||||
RRLeaseChangeState(lease, RRLeaseCreating, RRLeaseRunning);
|
||||
|
||||
xRRCreateLeaseReply rep = {
|
||||
.type = X_Reply,
|
||||
.nfd = 1,
|
||||
.sequenceNumber = client->sequence,
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof (rep), &rep);
|
||||
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
|
||||
bail_lease:
|
||||
free(lease);
|
||||
|
||||
@@ -315,20 +315,17 @@ ProcRRCreateMode(ClientPtr client)
|
||||
return error;
|
||||
|
||||
xRRCreateModeReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.mode = mode->mode.id
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.mode);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRCreateModeReply), &rep);
|
||||
/* Drop out reference to this mode */
|
||||
RRModeDestroy(mode);
|
||||
return Success;
|
||||
|
||||
if (client->swapped) {
|
||||
swapl(&rep.mode);
|
||||
}
|
||||
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -604,17 +604,12 @@ ProcRRGetOutputPrimary(ClientPtr client)
|
||||
primary = pScrPriv->primaryOutput;
|
||||
|
||||
xRRGetOutputPrimaryReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.output = primary ? primary->id : None
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.output);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), &rep);
|
||||
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
@@ -87,13 +87,12 @@ ProcRRGetProviders (ClientPtr client)
|
||||
|
||||
if (!pScrPriv)
|
||||
{
|
||||
xRRGetProvidersReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
xRRGetProvidersReply reply = {
|
||||
.timestamp = currentTime.milliseconds,
|
||||
};
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
return Success;
|
||||
if (client->swapped)
|
||||
swapl(&reply.timestamp);
|
||||
return X_SEND_REPLY_SIMPLE(client, reply);
|
||||
}
|
||||
|
||||
extraLen = total_providers * sizeof(CARD32);
|
||||
|
||||
@@ -204,10 +204,7 @@ ProcRRGetScreenSizeRange(ClientPtr client)
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
pScrPriv = rrGetScrPriv(pScreen);
|
||||
|
||||
xRRGetScreenSizeRangeReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
};
|
||||
xRRGetScreenSizeRangeReply rep = { 0 };
|
||||
|
||||
if (pScrPriv) {
|
||||
if (!RRGetInfo(pScreen, FALSE))
|
||||
@@ -222,15 +219,12 @@ ProcRRGetScreenSizeRange(ClientPtr client)
|
||||
rep.maxHeight = rep.minHeight = pScreen->height;
|
||||
}
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.minWidth);
|
||||
swaps(&rep.minHeight);
|
||||
swaps(&rep.maxWidth);
|
||||
swaps(&rep.maxHeight);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), &rep);
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1081,9 +1075,7 @@ ProcRRSetScreenConfig(ClientPtr client)
|
||||
free(pData);
|
||||
|
||||
xRRSetScreenConfigReply rep = {
|
||||
.type = X_Reply,
|
||||
.status = status,
|
||||
.sequenceNumber = client->sequence,
|
||||
.newTimestamp = pScrPriv->lastSetTime.milliseconds,
|
||||
.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds,
|
||||
.root = pDraw->pScreen->root->drawable.id,
|
||||
@@ -1091,15 +1083,11 @@ ProcRRSetScreenConfig(ClientPtr client)
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.newTimestamp);
|
||||
swapl(&rep.newConfigTimestamp);
|
||||
swapl(&rep.root);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRSetScreenConfigReply), &rep);
|
||||
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
static CARD16
|
||||
|
||||
@@ -97,21 +97,16 @@ int
|
||||
ProcRRXineramaQueryVersion(ClientPtr client)
|
||||
{
|
||||
xPanoramiXQueryVersionReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION,
|
||||
.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION
|
||||
};
|
||||
|
||||
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
}
|
||||
WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep);
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -137,18 +132,13 @@ ProcRRXineramaGetState(ClientPtr client)
|
||||
}
|
||||
|
||||
xPanoramiXGetStateReply rep = {
|
||||
.type = X_Reply,
|
||||
.state = active,
|
||||
.sequenceNumber = client->sequence,
|
||||
.window = stuff->window
|
||||
};
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.window);
|
||||
}
|
||||
WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep);
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -176,18 +166,13 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
|
||||
return rc;
|
||||
|
||||
xPanoramiXGetScreenCountReply rep = {
|
||||
.type = X_Reply,
|
||||
.ScreenCount = RRXineramaScreenCount(pWin->drawable.pScreen),
|
||||
.sequenceNumber = client->sequence,
|
||||
.window = stuff->window
|
||||
};
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.window);
|
||||
}
|
||||
WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep);
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -207,43 +192,32 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
|
||||
pRoot = pScreen->root;
|
||||
|
||||
xPanoramiXGetScreenSizeReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.width = pRoot->drawable.width,
|
||||
.height = pRoot->drawable.height,
|
||||
.window = stuff->window,
|
||||
.screen = stuff->screen
|
||||
};
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.width);
|
||||
swapl(&rep.height);
|
||||
swapl(&rep.window);
|
||||
swapl(&rep.screen);
|
||||
}
|
||||
WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep);
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
int
|
||||
ProcRRXineramaIsActive(ClientPtr client)
|
||||
{
|
||||
|
||||
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
|
||||
|
||||
xXineramaIsActiveReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN])
|
||||
};
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.state);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep);
|
||||
return Success;
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user