intel: Fix a warning in the release build.
authorEric Anholt <eric@anholt.net>
Thu, 11 Apr 2013 17:16:26 +0000 (10:16 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 12 Apr 2013 23:32:13 +0000 (16:32 -0700)
This was silly -- checking that we didn't overflow the array by dividing
the array size by 2 and then multiplying it back up by 2.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/intel/intel_context.c

index a21bc78b2d4fbe0f976f114327b69f4aa5d40ec3..ba7d4b631f3c050bd152bfe53c93d9641c0e1622 100644 (file)
@@ -1056,7 +1056,6 @@ intel_query_dri2_buffers(struct intel_context *intel,
    struct gl_framebuffer *fb = drawable->driverPrivate;
    int i = 0;
    unsigned attachments[8];
-   const int max_attachments = ARRAY_SIZE(attachments) / 2;
 
    struct intel_renderbuffer *front_rb;
    struct intel_renderbuffer *back_rb;
@@ -1077,7 +1076,7 @@ intel_query_dri2_buffers(struct intel_context *intel,
       attachments[i++] = intel_bits_per_pixel(back_rb);
    }
 
-   assert(i <= 2 * max_attachments);
+   assert(i <= ARRAY_SIZE(attachments));
 
    *buffers = screen->dri2.loader->getBuffersWithFormat(drawable,
                                                        &drawable->w,