Add a common ARRAY_SIZE macro to dix.h

Does what it says on the box, replacing those from Xi/ and glx/.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Daniel Stone 2012-07-10 02:02:50 +01:00 committed by Keith Packard
parent 67953d6975
commit 854c1fa4a1
3 changed files with 2 additions and 4 deletions

View File

@ -49,8 +49,6 @@ SOFTWARE.
* Dispatch routines and initialization routines for the X input extension.
*
*/
#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0]))
#define NUMTYPES 15
#ifdef HAVE_DIX_CONFIG_H

View File

@ -107,8 +107,6 @@ __ATTRIB(__DRI_ATTRIB_BUFFER_SIZE, rgbBits),
__ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture),
__ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),};
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
static void
setScalar(__GLXconfig * config, unsigned int attrib, unsigned int value)
{

View File

@ -64,6 +64,8 @@ SOFTWARE.
#define REQUEST(type) \
type *stuff = (type *)client->requestBuffer
#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
#define REQUEST_SIZE_MATCH(req)\
if ((sizeof(req) >> 2) != client->req_len)\
return(BadLength)