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>
This commit is contained in:
committed by
Keith Packard
parent
2b1c1300cc
commit
ad4092cf7d
@@ -22,8 +22,6 @@
|
||||
|
||||
#include "randrstr.h"
|
||||
|
||||
static const int padlength[4] = { 0, 3, 2, 1 };
|
||||
|
||||
static CARD16
|
||||
RR10CurrentSizeID(ScreenPtr pScreen);
|
||||
|
||||
@@ -46,8 +44,7 @@ RREditConnectionInfo(ScreenPtr pScreen)
|
||||
connSetup = (xConnSetup *) ConnectionInfo;
|
||||
vendor = (char *) connSetup + sizeof(xConnSetup);
|
||||
formats = (xPixmapFormat *) ((char *) vendor +
|
||||
connSetup->nbytesVendor +
|
||||
padlength[connSetup->nbytesVendor & 3]);
|
||||
pad_to_int32(connSetup->nbytesVendor));
|
||||
root = (xWindowRoot *) ((char *) formats +
|
||||
sizeof(xPixmapFormat) *
|
||||
screenInfo.numPixmapFormats);
|
||||
|
||||
Reference in New Issue
Block a user