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:
parent
67953d6975
commit
854c1fa4a1
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue