st/dri: replace Elements() with ARRAY_SIZE()
authorBrian Paul <brianp@vmware.com>
Sat, 28 Feb 2015 16:11:13 +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/gallium/state_trackers/dri/dri_screen.c

index 9cdebf8e26905c270700cf82d635516e4d4bbef4..1b14ab162f14c12b8d7e6a867428d505a85b84ee 100644 (file)
@@ -178,10 +178,10 @@ dri_fill_in_modes(struct dri_screen *screen)
       stencil_bits_array[depth_buffer_factor++] = 0;
    }
 
-   assert(Elements(mesa_formats) == Elements(pipe_formats));
+   assert(ARRAY_SIZE(mesa_formats) == ARRAY_SIZE(pipe_formats));
 
    /* Add configs. */
-   for (format = 0; format < Elements(mesa_formats); format++) {
+   for (format = 0; format < ARRAY_SIZE(mesa_formats); format++) {
       __DRIconfig **new_configs = NULL;
       unsigned num_msaa_modes = 0; /* includes a single-sample mode */
       uint8_t msaa_modes[MSAA_VISUAL_MAX_SAMPLES];
@@ -201,7 +201,7 @@ dri_fill_in_modes(struct dri_screen *screen)
          new_configs = driCreateConfigs(mesa_formats[format],
                                         depth_bits_array, stencil_bits_array,
                                         depth_buffer_factor, back_buffer_modes,
-                                        Elements(back_buffer_modes),
+                                        ARRAY_SIZE(back_buffer_modes),
                                         msaa_modes, 1,
                                         GL_TRUE);
          configs = driConcatConfigs(configs, new_configs);
@@ -211,7 +211,7 @@ dri_fill_in_modes(struct dri_screen *screen)
             new_configs = driCreateConfigs(mesa_formats[format],
                                            depth_bits_array, stencil_bits_array,
                                            depth_buffer_factor, back_buffer_modes,
-                                           Elements(back_buffer_modes),
+                                           ARRAY_SIZE(back_buffer_modes),
                                            msaa_modes+1, num_msaa_modes-1,
                                            GL_FALSE);
             configs = driConcatConfigs(configs, new_configs);