summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-09 19:12:42 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-09 19:14:50 -0700
commit5b86c072d1d586ce040d8831a05cf97ff8b17821 (patch)
tree0652f715c003f9c61044b09a288d235ff92d81f3 /Xext
parentc2fb1a7b2ab58d70b38ee03ab2fdeb4e7183a356 (diff)
Use temporary variables instead of parts of reply structures
When passing variable pointers to functions or otherwise doing long sequences to compute values for replies, create & use some new temporary variables, to allow for simpler initialization of reply structures in the following patches. Move memsets & other initializations to group with the rest of the filling in of the reply structure, now that they're not needed so early in the code path. 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')
-rw-r--r--Xext/shm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Xext/shm.c b/Xext/shm.c
index aa3feaeda..a7321703a 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -616,6 +616,7 @@ ProcShmGetImage(ClientPtr client)
Mask plane = 0;
xShmGetImageReply xgi;
ShmDescPtr shmdesc;
+ VisualID visual = None;
int rc;
REQUEST(xShmGetImageReq);
@@ -646,18 +647,19 @@ ProcShmGetImage(ClientPtr client)
stuff->y + (int) stuff->height >
wBorderWidth((WindowPtr) pDraw) + (int) pDraw->height)
return BadMatch;
- xgi.visual = wVisual(((WindowPtr) pDraw));
+ visual = wVisual(((WindowPtr) pDraw));
}
else {
if (stuff->x < 0 ||
stuff->x + (int) stuff->width > pDraw->width ||
stuff->y < 0 || stuff->y + (int) stuff->height > pDraw->height)
return BadMatch;
- xgi.visual = None;
+ visual = None;
}
xgi.type = X_Reply;
xgi.length = 0;
xgi.sequenceNumber = client->sequence;
+ xgi.visual = visual;
xgi.depth = pDraw->depth;
if (stuff->format == ZPixmap) {
length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;