aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/shm.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-09-22 15:42:49 +0200
committermarha <marha@users.sourceforge.net>2011-09-22 15:42:49 +0200
commit46d4f558531910ca1f3297da85b99334d6de2921 (patch)
tree60c37077eb160948fe317a17ec4c19bef679aa35 /xorg-server/Xext/shm.c
parent0bf6df93b9fdbb7902bf1014d605c6876a3ad035 (diff)
parentc1e6c7428a8d2c1b60ffac7df7a3f56c300fa983 (diff)
downloadvcxsrv-46d4f558531910ca1f3297da85b99334d6de2921.tar.gz
vcxsrv-46d4f558531910ca1f3297da85b99334d6de2921.tar.bz2
vcxsrv-46d4f558531910ca1f3297da85b99334d6de2921.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/Xext/dpms.c xorg-server/Xext/saver.c xorg-server/Xext/security.c xorg-server/Xext/shape.c xorg-server/Xext/sync.c xorg-server/Xi/opendev.c xorg-server/fb/wfbrename.h xorg-server/glx/glxserver.h xorg-server/hw/xwin/winwindowswm.c xorg-server/mi/miarc.c xorg-server/mi/miwideline.c xorg-server/os/io.c xorg-server/render/mipict.c
Diffstat (limited to 'xorg-server/Xext/shm.c')
-rw-r--r--xorg-server/Xext/shm.c114
1 files changed, 51 insertions, 63 deletions
diff --git a/xorg-server/Xext/shm.c b/xorg-server/Xext/shm.c
index ac1ab3b56..39916df60 100644
--- a/xorg-server/Xext/shm.c
+++ b/xorg-server/Xext/shm.c
@@ -291,7 +291,6 @@ static int
ProcShmQueryVersion(ClientPtr client)
{
xShmQueryVersionReply rep;
- int n;
REQUEST_SIZE_MATCH(xShmQueryVersionReq);
memset(&rep, 0, sizeof(xShmQueryVersionReply));
@@ -307,12 +306,12 @@ ProcShmQueryVersion(ClientPtr client)
rep.gid = getegid();
#endif
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- swaps(&rep.uid, n);
- swaps(&rep.gid, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
+ swaps(&rep.uid);
+ swaps(&rep.gid);
}
WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep);
return Success;
@@ -652,7 +651,7 @@ ProcShmGetImage(ClientPtr client)
Mask plane = 0;
xShmGetImageReply xgi;
ShmDescPtr shmdesc;
- int n, rc;
+ int rc;
REQUEST(xShmGetImageReq);
@@ -746,10 +745,10 @@ ProcShmGetImage(ClientPtr client)
}
if (client->swapped) {
- swaps(&xgi.sequenceNumber, n);
- swapl(&xgi.length, n);
- swapl(&xgi.visual, n);
- swapl(&xgi.size, n);
+ swaps(&xgi.sequenceNumber);
+ swapl(&xgi.length);
+ swapl(&xgi.visual);
+ swapl(&xgi.size);
}
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
@@ -916,11 +915,10 @@ ProcPanoramiXShmGetImage(ClientPtr client)
free(drawables);
if (client->swapped) {
- int n;
- swaps(&xgi.sequenceNumber, n);
- swapl(&xgi.length, n);
- swapl(&xgi.visual, n);
- swapl(&xgi.size, n);
+ swaps(&xgi.sequenceNumber);
+ swapl(&xgi.length);
+ swapl(&xgi.visual);
+ swapl(&xgi.size);
}
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
@@ -1010,7 +1008,6 @@ CreatePmap:
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pMap->drawable.id = newPix->info[j].id;
if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) {
- (*pScreen->DestroyPixmap)(pMap);
result = BadAlloc;
break;
}
@@ -1021,10 +1018,8 @@ CreatePmap:
}
if(result == BadAlloc) {
- while(j--) {
- (*pScreen->DestroyPixmap)(pMap);
+ while(j--)
FreeResource(newPix->info[j].id, RT_NONE);
- }
free(newPix);
} else
AddResource(stuff->pid, XRT_PIXMAP, newPix);
@@ -1129,7 +1124,6 @@ CreatePmap:
{
return Success;
}
- pDraw->pScreen->DestroyPixmap(pMap);
}
return BadAlloc;
}
@@ -1184,89 +1178,83 @@ SShmCompletionEvent(xShmCompletionEvent *from, xShmCompletionEvent *to)
static int
SProcShmQueryVersion(ClientPtr client)
{
- int n;
REQUEST(xShmQueryVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return ProcShmQueryVersion(client);
}
static int
SProcShmAttach(ClientPtr client)
{
- int n;
REQUEST(xShmAttachReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmAttachReq);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->shmid, n);
+ swapl(&stuff->shmseg);
+ swapl(&stuff->shmid);
return ProcShmAttach(client);
}
static int
SProcShmDetach(ClientPtr client)
{
- int n;
REQUEST(xShmDetachReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmDetachReq);
- swapl(&stuff->shmseg, n);
+ swapl(&stuff->shmseg);
return ProcShmDetach(client);
}
static int
SProcShmPutImage(ClientPtr client)
{
- int n;
REQUEST(xShmPutImageReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmPutImageReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->totalWidth, n);
- swaps(&stuff->totalHeight, n);
- swaps(&stuff->srcX, n);
- swaps(&stuff->srcY, n);
- swaps(&stuff->srcWidth, n);
- swaps(&stuff->srcHeight, n);
- swaps(&stuff->dstX, n);
- swaps(&stuff->dstY, n);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->offset, n);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ swaps(&stuff->totalWidth);
+ swaps(&stuff->totalHeight);
+ swaps(&stuff->srcX);
+ swaps(&stuff->srcY);
+ swaps(&stuff->srcWidth);
+ swaps(&stuff->srcHeight);
+ swaps(&stuff->dstX);
+ swaps(&stuff->dstY);
+ swapl(&stuff->shmseg);
+ swapl(&stuff->offset);
return ProcShmPutImage(client);
}
static int
SProcShmGetImage(ClientPtr client)
{
- int n;
REQUEST(xShmGetImageReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmGetImageReq);
- swapl(&stuff->drawable, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swapl(&stuff->planeMask, n);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->offset, n);
+ swapl(&stuff->drawable);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ swapl(&stuff->planeMask);
+ swapl(&stuff->shmseg);
+ swapl(&stuff->offset);
return ProcShmGetImage(client);
}
static int
SProcShmCreatePixmap(ClientPtr client)
{
- int n;
REQUEST(xShmCreatePixmapReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
- swapl(&stuff->pid, n);
- swapl(&stuff->drawable, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->offset, n);
+ swapl(&stuff->pid);
+ swapl(&stuff->drawable);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ swapl(&stuff->shmseg);
+ swapl(&stuff->offset);
return ProcShmCreatePixmap(client);
}