aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/dmx/dmx.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
committermarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
commit81f91c615982e50bb62708201569c33a3cd3d973 (patch)
tree4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/hw/dmx/dmx.c
parentb571a562410f565af2bdde52d9f7f9a23ffae04f (diff)
parenta915739887477b28d924ecc8417ee107d125bd6c (diff)
downloadvcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/hw/dmx/dmx.c')
-rw-r--r--xorg-server/hw/dmx/dmx.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/xorg-server/hw/dmx/dmx.c b/xorg-server/hw/dmx/dmx.c
index 10d9e2206..87d408d7e 100644
--- a/xorg-server/hw/dmx/dmx.c
+++ b/xorg-server/hw/dmx/dmx.c
@@ -51,7 +51,6 @@
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
-#define EXTENSION_PROC_ARGS void *
#include "extnsionst.h"
#include "opaque.h"
@@ -361,10 +360,10 @@ static int ProcDMXGetScreenAttributes(ClientPtr client)
rep.rootWindowYorigin = attr.rootWindowYorigin;
length = attr.displayName ? strlen(attr.displayName) : 0;
- paddedLength = (length + 3) & ~3;
+ paddedLength = pad_to_int32(length);
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = paddedLength >> 2;
+ rep.length = bytes_to_int32(paddedLength);
rep.displayNameLength = length;
if (client->swapped) {
@@ -406,7 +405,7 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xDMXChangeScreensAttributesReq);
- len = client->req_len - (sizeof(xDMXChangeScreensAttributesReq) >> 2);
+ len = client->req_len - bytes_to_int32(sizeof(xDMXChangeScreensAttributesReq));
if (len < stuff->screenCount + stuff->maskCount)
return BadLength;
@@ -475,8 +474,8 @@ static int ProcDMXAddScreen(ClientPtr client)
int paddedLength;
REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
- paddedLength = (stuff->displayNameLength + 3) & ~3;
- len = client->req_len - (sizeof(xDMXAddScreenReq) >> 2);
+ paddedLength = pad_to_int32(stuff->displayNameLength);
+ len = client->req_len - bytes_to_int32(sizeof(xDMXAddScreenReq));
if (len != Ones(stuff->valueMask) + paddedLength/4)
return BadLength;
@@ -796,10 +795,10 @@ static int ProcDMXGetInputAttributes(ClientPtr client)
rep.detached = attr.detached;
length = attr.name ? strlen(attr.name) : 0;
- paddedLength = (length + 3) & ~3;
+ paddedLength = pad_to_int32(length);
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = paddedLength >> 2;
+ rep.length = bytes_to_int32(paddedLength);
rep.nameLength = length;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
@@ -829,7 +828,7 @@ static int ProcDMXAddInput(ClientPtr client)
int id = -1;
REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
- paddedLength = (stuff->displayNameLength + 3) & ~3;
+ paddedLength = pad_to_int32(stuff->displayNameLength);
len = client->req_len - (sizeof(xDMXAddInputReq) >> 2);
if (len != Ones(stuff->valueMask) + paddedLength/4)
return BadLength;
@@ -998,7 +997,7 @@ static int SProcDMXAddScreen(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
swapl(&stuff->displayNameLength, n);
swapl(&stuff->valueMask, n);
- paddedLength = (stuff->displayNameLength + 3) & ~3;
+ paddedLength = pad_to_int32(stuff->displayNameLength);
SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
return ProcDMXAddScreen(client);
}
@@ -1078,7 +1077,7 @@ static int SProcDMXAddInput(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
swapl(&stuff->displayNameLength, n);
swapl(&stuff->valueMask, n);
- paddedLength = (stuff->displayNameLength + 3) & ~3;
+ paddedLength = pad_to_int32(stuff->displayNameLength);
SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
return ProcDMXAddInput(client);
}