diff options
author | Daniel Stone <[email protected]> | 2018-02-21 11:39:09 +0000 |
---|---|---|
committer | Daniel Stone <[email protected]> | 2018-02-21 21:57:38 +0000 |
commit | a6f1952814c96f9d04360337e58cb30df02038f9 (patch) | |
tree | 23c908816c2ccb1d0e384f7d7c2b935cc943f499 /src/loader | |
parent | 52056206e171f8eec0afc16cfd90ee68bf290e7b (diff) |
x11/dri3: Don't open-code ARRAY_SIZE
Signed-off-by: Daniel Stone <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/loader')
-rw-r--r-- | src/loader/loader_dri3_helper.c | 5 | ||||
-rw-r--r-- | 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 <X11/Xlib-xcb.h> #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, ], |