Use C99 designated initializers in various extension Replies
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
2f5caeaddb
commit
cc5f09c86f
|
@ -107,14 +107,15 @@ static int
|
||||||
ProcCompositeQueryVersion(ClientPtr client)
|
ProcCompositeQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
CompositeClientPtr pCompositeClient = GetCompositeClient(client);
|
CompositeClientPtr pCompositeClient = GetCompositeClient(client);
|
||||||
xCompositeQueryVersionReply rep;
|
xCompositeQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST(xCompositeQueryVersionReq);
|
REQUEST(xCompositeQueryVersionReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
|
REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
if (stuff->majorVersion < SERVER_COMPOSITE_MAJOR_VERSION) {
|
if (stuff->majorVersion < SERVER_COMPOSITE_MAJOR_VERSION) {
|
||||||
rep.majorVersion = stuff->majorVersion;
|
rep.majorVersion = stuff->majorVersion;
|
||||||
rep.minorVersion = stuff->minorVersion;
|
rep.minorVersion = stuff->minorVersion;
|
||||||
|
@ -311,10 +312,12 @@ ProcCompositeGetOverlayWindow(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xCompositeGetOverlayWindowReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.overlayWin = cs->pOverlayWin->drawable.id;
|
.length = 0,
|
||||||
|
.overlayWin = cs->pOverlayWin->drawable.id
|
||||||
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
|
@ -842,10 +845,12 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
|
||||||
|
|
||||||
cs = GetCompScreen(screenInfo.screens[0]);
|
cs = GetCompScreen(screenInfo.screens[0]);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xCompositeGetOverlayWindowReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.overlayWin = cs->pOverlayWin->drawable.id;
|
.length = 0,
|
||||||
|
.overlayWin = cs->pOverlayWin->drawable.id
|
||||||
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
|
|
|
@ -126,14 +126,16 @@ static int
|
||||||
ProcDamageQueryVersion(ClientPtr client)
|
ProcDamageQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
DamageClientPtr pDamageClient = GetDamageClient(client);
|
DamageClientPtr pDamageClient = GetDamageClient(client);
|
||||||
xDamageQueryVersionReply rep;
|
xDamageQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST(xDamageQueryVersionReq);
|
REQUEST(xDamageQueryVersionReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
|
REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
if (stuff->majorVersion < SERVER_DAMAGE_MAJOR_VERSION) {
|
if (stuff->majorVersion < SERVER_DAMAGE_MAJOR_VERSION) {
|
||||||
rep.majorVersion = stuff->majorVersion;
|
rep.majorVersion = stuff->majorVersion;
|
||||||
rep.minorVersion = stuff->minorVersion;
|
rep.minorVersion = stuff->minorVersion;
|
||||||
|
|
34
dbe/dbe.c
34
dbe/dbe.c
|
@ -118,16 +118,16 @@ static int
|
||||||
ProcDbeGetVersion(ClientPtr client)
|
ProcDbeGetVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xDbeGetVersionReq); */
|
/* REQUEST(xDbeGetVersionReq); */
|
||||||
xDbeGetVersionReply rep;
|
xDbeGetVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.majorVersion = DBE_MAJOR_VERSION,
|
||||||
|
.minorVersion = DBE_MINOR_VERSION
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDbeGetVersionReq);
|
REQUEST_SIZE_MATCH(xDbeGetVersionReq);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.majorVersion = DBE_MAJOR_VERSION;
|
|
||||||
rep.minorVersion = DBE_MINOR_VERSION;
|
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
}
|
}
|
||||||
|
@ -667,10 +667,12 @@ ProcDbeGetVisualInfo(ClientPtr client)
|
||||||
length += pScrVisInfo[i].count * sizeof(xDbeVisInfo);
|
length += pScrVisInfo[i].count * sizeof(xDbeVisInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xDbeGetVisualInfoReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.length = bytes_to_int32(length);
|
.sequenceNumber = client->sequence,
|
||||||
rep.m = count;
|
.length = bytes_to_int32(length),
|
||||||
|
.m = count
|
||||||
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
|
@ -755,7 +757,11 @@ static int
|
||||||
ProcDbeGetBackBufferAttributes(ClientPtr client)
|
ProcDbeGetBackBufferAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDbeGetBackBufferAttributesReq);
|
REQUEST(xDbeGetBackBufferAttributesReq);
|
||||||
xDbeGetBackBufferAttributesReply rep;
|
xDbeGetBackBufferAttributesReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
DbeWindowPrivPtr pDbeWindowPriv;
|
DbeWindowPrivPtr pDbeWindowPriv;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -771,10 +777,6 @@ ProcDbeGetBackBufferAttributes(ClientPtr client)
|
||||||
rep.attributes = None;
|
rep.attributes = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.length = 0;
|
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
|
|
@ -1816,14 +1816,15 @@ static int
|
||||||
ProcRecordQueryVersion(ClientPtr client)
|
ProcRecordQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xRecordQueryVersionReq); */
|
/* REQUEST(xRecordQueryVersionReq); */
|
||||||
xRecordQueryVersionReply rep;
|
xRecordQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.majorVersion = SERVER_RECORD_MAJOR_VERSION,
|
||||||
|
.minorVersion = SERVER_RECORD_MINOR_VERSION
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
|
REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.majorVersion = SERVER_RECORD_MAJOR_VERSION;
|
|
||||||
rep.minorVersion = SERVER_RECORD_MINOR_VERSION;
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swaps(&rep.majorVersion);
|
swaps(&rep.majorVersion);
|
||||||
|
@ -2231,12 +2232,14 @@ ProcRecordGetContext(ClientPtr client)
|
||||||
|
|
||||||
/* write the reply header */
|
/* write the reply header */
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xRecordGetContextReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.length = length;
|
.enabled = pContext->pRecordingClient != NULL,
|
||||||
rep.enabled = pContext->pRecordingClient != NULL;
|
.sequenceNumber = client->sequence,
|
||||||
rep.elementHeader = pContext->elemHeaders;
|
.length = length,
|
||||||
rep.nClients = nClients;
|
.elementHeader = pContext->elemHeaders,
|
||||||
|
.nClients = nClients
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
|
|
@ -267,7 +267,11 @@ static int
|
||||||
ProcRenderQueryVersion(ClientPtr client)
|
ProcRenderQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
RenderClientPtr pRenderClient = GetRenderClient(client);
|
RenderClientPtr pRenderClient = GetRenderClient(client);
|
||||||
xRenderQueryVersionReply rep;
|
xRenderQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST(xRenderQueryVersionReq);
|
REQUEST(xRenderQueryVersionReq);
|
||||||
|
|
||||||
|
@ -275,10 +279,6 @@ ProcRenderQueryVersion(ClientPtr client)
|
||||||
pRenderClient->minor_version = stuff->minorVersion;
|
pRenderClient->minor_version = stuff->minorVersion;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
|
REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
|
||||||
memset(&rep, 0, sizeof(xRenderQueryVersionReply));
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
|
|
||||||
if ((stuff->majorVersion * 1000 + stuff->minorVersion) <
|
if ((stuff->majorVersion * 1000 + stuff->minorVersion) <
|
||||||
(SERVER_RENDER_MAJOR_VERSION * 1000 + SERVER_RENDER_MINOR_VERSION)) {
|
(SERVER_RENDER_MAJOR_VERSION * 1000 + SERVER_RENDER_MINOR_VERSION)) {
|
||||||
|
|
|
@ -474,11 +474,13 @@ ProcXFixesGetCursorName(ClientPtr client)
|
||||||
str = "";
|
str = "";
|
||||||
len = strlen(str);
|
len = strlen(str);
|
||||||
|
|
||||||
reply.type = X_Reply;
|
reply = (xXFixesGetCursorNameReply) {
|
||||||
reply.length = bytes_to_int32(len);
|
.type = X_Reply,
|
||||||
reply.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
reply.atom = pCursor->name;
|
.length = bytes_to_int32(len),
|
||||||
reply.nbytes = len;
|
.atom = pCursor->name,
|
||||||
|
.nbytes = len
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&reply.sequenceNumber);
|
swaps(&reply.sequenceNumber);
|
||||||
swapl(&reply.length);
|
swapl(&reply.length);
|
||||||
|
|
|
@ -61,15 +61,15 @@ static int
|
||||||
ProcXFixesQueryVersion(ClientPtr client)
|
ProcXFixesQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
XFixesClientPtr pXFixesClient = GetXFixesClient(client);
|
XFixesClientPtr pXFixesClient = GetXFixesClient(client);
|
||||||
xXFixesQueryVersionReply rep;
|
xXFixesQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST(xXFixesQueryVersionReq);
|
REQUEST(xXFixesQueryVersionReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXFixesQueryVersionReq);
|
REQUEST_SIZE_MATCH(xXFixesQueryVersionReq);
|
||||||
memset(&rep, 0, sizeof(xXFixesQueryVersionReply));
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
|
|
||||||
if (version_compare(stuff->majorVersion, stuff->minorVersion,
|
if (version_compare(stuff->majorVersion, stuff->minorVersion,
|
||||||
SERVER_XFIXES_MAJOR_VERSION,
|
SERVER_XFIXES_MAJOR_VERSION,
|
||||||
|
|
Loading…
Reference in New Issue