aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-02-28 23:13:49 +0100
committerUlrich Sibiller <uli42@gmx.de>2019-02-28 23:13:49 +0100
commitc6b6a8fcb75023b89ec1d4b9f3ce3c9eb44764e1 (patch)
tree4d10c1e4fa88ac7a4e97044cfd697ff75a4085a0
parentc81a45785970aa198736d8dc578beb2d7bbd1b2f (diff)
downloadnx-libs-c6b6a8fcb75023b89ec1d4b9f3ce3c9eb44764e1.tar.gz
nx-libs-c6b6a8fcb75023b89ec1d4b9f3ce3c9eb44764e1.tar.bz2
nx-libs-c6b6a8fcb75023b89ec1d4b9f3ce3c9eb44764e1.zip
Use C99 designated initializers in various extension Replies
commit cc5f09c86f7bea23b7546c3491b2c52ce8100a71 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon Jul 9 19:12:43 2012 -0700 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> Attributes ArcticaProject/nx-libs#382
-rw-r--r--nx-X11/programs/Xserver/damageext/damageext.c10
-rw-r--r--nx-X11/programs/Xserver/dbe/dbe.c34
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXrender.c15
-rw-r--r--nx-X11/programs/Xserver/record/record.c35
-rw-r--r--nx-X11/programs/Xserver/render/render.c14
-rw-r--r--nx-X11/programs/Xserver/xfixes/cursor.c12
-rw-r--r--nx-X11/programs/Xserver/xfixes/xfixes.c11
7 files changed, 72 insertions, 59 deletions
diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c
index b9d99a53c..56677e320 100644
--- a/nx-X11/programs/Xserver/damageext/damageext.c
+++ b/nx-X11/programs/Xserver/damageext/damageext.c
@@ -132,15 +132,15 @@ static int
ProcDamageQueryVersion(ClientPtr client)
{
DamageClientPtr pDamageClient = GetDamageClient (client);
- xDamageQueryVersionReply rep;
+ xDamageQueryVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0
+ };
REQUEST(xDamageQueryVersionReq);
REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
- memset(&rep, 0, sizeof(xDamageQueryVersionReply));
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
if (stuff->majorVersion < SERVER_DAMAGE_MAJOR_VERSION) {
rep.majorVersion = stuff->majorVersion;
rep.minorVersion = stuff->minorVersion;
diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c
index 588dd0582..446571311 100644
--- a/nx-X11/programs/Xserver/dbe/dbe.c
+++ b/nx-X11/programs/Xserver/dbe/dbe.c
@@ -312,16 +312,16 @@ static int
ProcDbeGetVersion(ClientPtr client)
{
/* 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);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = DBE_MAJOR_VERSION;
- rep.minorVersion = DBE_MINOR_VERSION;
-
if (client->swapped)
{
swaps(&rep.sequenceNumber);
@@ -946,10 +946,12 @@ ProcDbeGetVisualInfo(ClientPtr client)
length += pScrVisInfo[i].count * sizeof(xDbeVisInfo);
}
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = length >> 2;
- rep.m = count;
+ rep = (xDbeGetVisualInfoReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = length >> 2,
+ .m = count
+ };
if (client->swapped)
{
@@ -1041,7 +1043,11 @@ static int
ProcDbeGetBackBufferAttributes(ClientPtr client)
{
REQUEST(xDbeGetBackBufferAttributesReq);
- xDbeGetBackBufferAttributesReply rep;
+ xDbeGetBackBufferAttributesReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0
+ };
DbeWindowPrivPtr pDbeWindowPriv;
REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
@@ -1056,10 +1062,6 @@ ProcDbeGetBackBufferAttributes(ClientPtr client)
rep.attributes = pDbeWindowPriv->pWindow->drawable.id;
}
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
-
if (client->swapped)
{
swaps(&rep.sequenceNumber);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
index ce4ea9d5f..fd9c0be82 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
@@ -135,7 +135,14 @@ static int
ProcRenderQueryVersion (ClientPtr client)
{
RenderClientPtr pRenderClient = GetRenderClient (client);
- xRenderQueryVersionReply rep;
+ xRenderQueryVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .majorVersion = nxagentRenderVersionMajor,
+ .minorVersion = nxagentRenderVersionMinor
+ };
+
REQUEST(xRenderQueryVersionReq);
REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
@@ -143,12 +150,6 @@ ProcRenderQueryVersion (ClientPtr client)
pRenderClient->major_version = stuff->majorVersion;
pRenderClient->minor_version = stuff->minorVersion;
- memset(&rep, 0, sizeof(xRenderQueryVersionReply));
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = nxagentRenderVersionMajor;
- rep.minorVersion = nxagentRenderVersionMinor;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c
index c18b96e46..31803a289 100644
--- a/nx-X11/programs/Xserver/record/record.c
+++ b/nx-X11/programs/Xserver/record/record.c
@@ -1949,14 +1949,16 @@ static int
ProcRecordQueryVersion(ClientPtr client)
{
/* 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);
- 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)
{
swaps(&rep.sequenceNumber);
@@ -2287,6 +2289,7 @@ ProcRecordGetContext(ClientPtr client)
GetContextRangeInfoPtr pri;
int i;
int err;
+ CARD32 nClients, length;
REQUEST_SIZE_MATCH(xRecordGetContextReq);
VERIFY_CONTEXT(pContext, stuff->context, client);
@@ -2359,24 +2362,28 @@ ProcRecordGetContext(ClientPtr client)
/* calculate number of clients and reply length */
- rep.nClients = 0;
- rep.length = 0;
+ nClients = 0;
+ length = 0;
for (pRCAP = pContext->pListOfRCAP, pri = pRangeInfo;
pRCAP;
pRCAP = pRCAP->pNextRCAP, pri++)
{
- rep.nClients += pRCAP->numClients;
- rep.length += pRCAP->numClients *
+ nClients += pRCAP->numClients;
+ length += pRCAP->numClients *
( (sizeof(xRecordClientInfo) >> 2) +
pri->nRanges * (sizeof(xRecordRange) >> 2));
}
/* write the reply header */
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.enabled = pContext->pRecordingClient != NULL;
- rep.elementHeader = pContext->elemHeaders;
+ rep = (xRecordGetContextReply) {
+ .type = X_Reply,
+ .enabled = pContext->pRecordingClient != NULL,
+ .sequenceNumber = client->sequence,
+ .length = length,
+ .elementHeader = pContext->elemHeaders,
+ .nClients = nClients
+ };
if(client->swapped)
{
swaps(&rep.sequenceNumber);
diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c
index 78677b752..e4d8a3f76 100644
--- a/nx-X11/programs/Xserver/render/render.c
+++ b/nx-X11/programs/Xserver/render/render.c
@@ -274,7 +274,13 @@ static int
ProcRenderQueryVersion (ClientPtr client)
{
RenderClientPtr pRenderClient = GetRenderClient (client);
- xRenderQueryVersionReply rep;
+ xRenderQueryVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .majorVersion = SERVER_RENDER_MAJOR_VERSION,
+ .minorVersion = SERVER_RENDER_MINOR_VERSION
+ };
REQUEST(xRenderQueryVersionReq);
@@ -283,12 +289,6 @@ ProcRenderQueryVersion (ClientPtr client)
pRenderClient->major_version = stuff->majorVersion;
pRenderClient->minor_version = stuff->minorVersion;
- memset(&rep, 0, sizeof(xRenderQueryVersionReply));
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SERVER_RENDER_MAJOR_VERSION;
- rep.minorVersion = SERVER_RENDER_MINOR_VERSION;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c
index b80bd90d6..8f258e32f 100644
--- a/nx-X11/programs/Xserver/xfixes/cursor.c
+++ b/nx-X11/programs/Xserver/xfixes/cursor.c
@@ -456,11 +456,13 @@ ProcXFixesGetCursorName (ClientPtr client)
str = "";
len = strlen (str);
- reply.type = X_Reply;
- reply.length = (len + 3) >> 2;
- reply.sequenceNumber = client->sequence;
- reply.atom = pCursor->name;
- reply.nbytes = len;
+ reply = (xXFixesGetCursorNameReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = (len + 3) >> 2,
+ .atom = pCursor->name,
+ .nbytes = len
+ };
if (client->swapped) {
swaps(&reply.sequenceNumber);
swapl(&reply.length);
diff --git a/nx-X11/programs/Xserver/xfixes/xfixes.c b/nx-X11/programs/Xserver/xfixes/xfixes.c
index fadaf73b2..7fe94a99c 100644
--- a/nx-X11/programs/Xserver/xfixes/xfixes.c
+++ b/nx-X11/programs/Xserver/xfixes/xfixes.c
@@ -56,14 +56,15 @@ static int
ProcXFixesQueryVersion(ClientPtr client)
{
XFixesClientPtr pXFixesClient = GetXFixesClient (client);
- xXFixesQueryVersionReply rep;
+ xXFixesQueryVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0
+ };
REQUEST(xXFixesQueryVersionReq);
REQUEST_SIZE_MATCH(xXFixesQueryVersionReq);
- memset(&rep, 0, sizeof(xXFixesQueryVersionReply));
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
+
if (stuff->majorVersion < SERVER_XFIXES_MAJOR_VERSION) {
rep.majorVersion = stuff->majorVersion;
rep.minorVersion = stuff->minorVersion;