mesa/swrast: replace Elements() with ARRAY_SIZE()
authorBrian Paul <brianp@vmware.com>
Sat, 28 Feb 2015 15:57:20 +0000 (08:57 -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/mesa/swrast/s_points.c
src/mesa/swrast/s_texfetch.c

index 52a7222129f5f9b41f41490dcfee491074e9eb49..8180483ba4b528e97ffdad96cb46ec65f8604c42 100644 (file)
@@ -140,7 +140,7 @@ sprite_point(struct gl_context *ctx, const SWvertex *vert)
          if (attr >= VARYING_SLOT_TEX0 && attr <= VARYING_SLOT_TEX7) {
             /* a texcoord attribute */
             const GLuint u = attr - VARYING_SLOT_TEX0;
-            assert(u < Elements(ctx->Point.CoordReplace));
+            assert(u < ARRAY_SIZE(ctx->Point.CoordReplace));
             if (ctx->Point.CoordReplace[u]) {
                tCoords[numTcoords++] = attr;
 
index 242f8a43fa1e5a6263b410790eab7d29081ae10e..3c4ee15ba8577c3903db9027324758ffee3cff7d 100644 (file)
@@ -573,7 +573,7 @@ set_fetch_functions(const struct gl_sampler_object *samp,
    }
 #endif
 
-   STATIC_ASSERT(Elements(texfetch_funcs) == MESA_FORMAT_COUNT);
+   STATIC_ASSERT(ARRAY_SIZE(texfetch_funcs) == MESA_FORMAT_COUNT);
 
    if (samp->sRGBDecode == GL_SKIP_DECODE_EXT &&
        _mesa_get_format_color_encoding(format) == GL_SRGB) {