summaryrefslogtreecommitdiff
path: root/dix/dispatch.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-09 19:12:44 -0700
committerKeith Packard <keithp@keithp.com>2012-07-09 22:52:30 -0700
commitad4092cf7d59a89b1b2922440eef65be5c0c5ebd (patch)
treeec5d4d32e3b05d70e000771492638eb3e8ff2914 /dix/dispatch.c
parent2b1c1300cc23912ee1c59f8dde938dd4d7287f4a (diff)
Replace padlength tables with inline functions from misc.h
Adds new function padding_for_int32() and uses existing pad_to_int32() depending on required results. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'dix/dispatch.c')
-rw-r--r--dix/dispatch.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c
index d916f345e..3c6a591db 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -466,8 +466,6 @@ Dispatch(void)
static int VendorRelease = VENDOR_RELEASE;
static char *VendorString = VENDOR_NAME;
-static const int padlength[4] = { 0, 3, 2, 1 };
-
void
SetVendorRelease(int release)
{
@@ -528,7 +526,7 @@ CreateConnectionBlock(void)
memmove(pBuf, VendorString, (int) setup.nbytesVendor);
sizesofar += setup.nbytesVendor;
pBuf += setup.nbytesVendor;
- i = padlength[setup.nbytesVendor & 3];
+ i = padding_for_int32(setup.nbytesVendor);
sizesofar += i;
while (--i >= 0)
*pBuf++ = 0;