From a6f1952814c96f9d04360337e58cb30df02038f9 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 21 Feb 2018 11:39:09 +0000 Subject: [PATCH] x11/dri3: Don't open-code ARRAY_SIZE Signed-off-by: Daniel Stone Reviewed-by: Eric Engestrom Reviewed-by: Emil Velikov --- src/loader/loader_dri3_helper.c | 5 +++-- src/loader/meson.build | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c index 30ea133f7e5..cb947c58728 100644 --- a/src/loader/loader_dri3_helper.c +++ b/src/loader/loader_dri3_helper.c @@ -33,6 +33,7 @@ #include #include "loader_dri3_helper.h" +#include "util/macros.h" /* From xmlpool/options.h, user exposed so should be stable */ #define DRI_CONF_VBLANK_NEVER 0 @@ -233,7 +234,7 @@ loader_dri3_drawable_fini(struct loader_dri3_drawable *draw) draw->ext->core->destroyDrawable(draw->dri_drawable); - for (i = 0; i < LOADER_DRI3_NUM_BUFFERS; i++) { + for (i = 0; i < ARRAY_SIZE(draw->buffers); i++) { if (draw->buffers[i]) dri3_free_render_buffer(draw, draw->buffers[i]); } @@ -392,7 +393,7 @@ dri3_handle_present_event(struct loader_dri3_drawable *draw, xcb_present_idle_notify_event_t *ie = (void *) ge; int b; - for (b = 0; b < sizeof(draw->buffers) / sizeof(draw->buffers[0]); b++) { + for (b = 0; b < ARRAY_SIZE(draw->buffers); b++) { struct loader_dri3_buffer *buf = draw->buffers[b]; if (buf && buf->pixmap == ie->pixmap) diff --git a/src/loader/meson.build b/src/loader/meson.build index e4455e9a72b..2693970182f 100644 --- a/src/loader/meson.build +++ b/src/loader/meson.build @@ -25,7 +25,7 @@ if with_platform_x11 and with_dri3 'loader_dri3_helper', ['loader_dri3_helper.c', 'loader_dri3_helper.h'], c_args : c_vis_args, - include_directories : inc_include, + include_directories : [inc_include, inc_src], dependencies : [ dep_libdrm, dep_xcb_dri3, dep_xcb_present, dep_xcb_sync, dep_xshmfence, ], -- 2.30.2