diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:12:43 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:58:30 -0700 |
commit | 6a721e3af5e11bae1d59ca551a02470f35d9e844 (patch) | |
tree | b95dd0d69fca66321f010959e69c44f781452c1f /Xext/shm.c | |
parent | d792ac125a0462a04a930af543cbc732f8cdab7d (diff) |
Use C99 designated initializers in Xext Replies
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'Xext/shm.c')
-rw-r--r-- | Xext/shm.c | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/Xext/shm.c b/Xext/shm.c index a7321703a..6c9b16d57 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -285,19 +285,20 @@ ShmRegisterFbFuncs(ScreenPtr pScreen) static int ProcShmQueryVersion(ClientPtr client) { - xShmQueryVersionReply rep; + xShmQueryVersionReply rep = { + .type = X_Reply, + .sharedPixmaps = sharedPixmaps, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_SHM_MAJOR_VERSION, + .minorVersion = SERVER_SHM_MINOR_VERSION, + .uid = geteuid(), + .gid = getegid(), + .pixmapFormat = sharedPixmaps ? ZPixmap : 0 + }; REQUEST_SIZE_MATCH(xShmQueryVersionReq); - memset(&rep, 0, sizeof(xShmQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.sharedPixmaps = sharedPixmaps; - rep.pixmapFormat = sharedPixmaps ? ZPixmap : 0; - rep.majorVersion = SERVER_SHM_MAJOR_VERSION; - rep.minorVersion = SERVER_SHM_MINOR_VERSION; - rep.uid = geteuid(); - rep.gid = getegid(); + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -656,11 +657,13 @@ ProcShmGetImage(ClientPtr client) return BadMatch; visual = None; } - xgi.type = X_Reply; - xgi.length = 0; - xgi.sequenceNumber = client->sequence; - xgi.visual = visual; - xgi.depth = pDraw->depth; + xgi = (xShmGetImageReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .visual = visual, + .depth = pDraw->depth + }; if (stuff->format == ZPixmap) { length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height; } @@ -832,11 +835,13 @@ ProcPanoramiXShmGetImage(ClientPtr client) } } - xgi.visual = wVisual(((WindowPtr) pDraw)); - xgi.type = X_Reply; - xgi.length = 0; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; + xgi = (xShmGetImageReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .visual = wVisual(((WindowPtr) pDraw)), + .depth = pDraw->depth + }; if (format == ZPixmap) { widthBytesLine = PixmapBytePad(w, pDraw->depth); |