mapi: replace Elements() with ARRAY_SIZE()
authorBrian Paul <brianp@vmware.com>
Sat, 28 Feb 2015 16:11:29 +0000 (09:11 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 2 Mar 2015 15:55:30 +0000 (08:55 -0700)
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mapi/glapi/gen/gl_enums.py

index 35919d68a415ca07f2ef3398bd232df693bec1b4..d61618f4da0afbf3bea1e8e22565e96526b356b9 100644 (file)
@@ -83,7 +83,7 @@ const char *_mesa_lookup_enum_by_nr( int nr )
    STATIC_ASSERT(sizeof(enum_string_table) < (1 << 16));
 
    elt = bsearch(& nr, enum_string_table_offsets,
-                 Elements(enum_string_table_offsets),
+                 ARRAY_SIZE(enum_string_table_offsets),
                  sizeof(enum_string_table_offsets[0]),
                  (cfunc) compar_nr);
 
@@ -127,7 +127,7 @@ static const char *prim_names[PRIM_MAX+3] = {
 const char *
 _mesa_lookup_prim_by_nr(GLuint nr)
 {
-   if (nr < Elements(prim_names))
+   if (nr < ARRAY_SIZE(prim_names))
       return prim_names[nr];
    else
       return "invalid mode";