mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-07 23:02:23 +00:00
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>
This commit is contained in:
parent
c2fb1a7b2a
commit
5b86c072d1
10 changed files with 77 additions and 48 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue