From ad4092cf7d59a89b1b2922440eef65be5c0c5ebd Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 9 Jul 2012 19:12:44 -0700 Subject: 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 Reviewed-by: Keith Packard Reviewed-by: Peter Hutterer Tested-by: Daniel Stone --- dix/dispatch.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'dix/dispatch.c') 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; -- cgit v1.2.3