From 09e2692403680b5c9c39c6723788f87e2dcdd4ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 23 Dec 2011 13:33:45 -0500 Subject: [PATCH] compositor-x11: Use ARRAY_LENGTH macro from wayland-util.h --- compositor/compositor-x11.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/compositor/compositor-x11.c b/compositor/compositor-x11.c index a18d5378..5aa1ebfc 100644 --- a/compositor/compositor-x11.c +++ b/compositor/compositor-x11.c @@ -44,8 +44,6 @@ #include "compositor.h" -#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) - struct x11_compositor { struct wlsc_compositor base; @@ -244,7 +242,7 @@ x11_output_set_wm_protocols(struct x11_output *output) c->atom.wm_protocols, XCB_ATOM_ATOM, 32, - ARRAY_SIZE(list), + ARRAY_LENGTH(list), list); } @@ -700,19 +698,19 @@ x11_compositor_get_resources(struct x11_compositor *c) { "CARDINAL", F(atom.cardinal) }, }; - xcb_intern_atom_cookie_t cookies[ARRAY_SIZE(atoms)]; + xcb_intern_atom_cookie_t cookies[ARRAY_LENGTH(atoms)]; xcb_intern_atom_reply_t *reply; xcb_pixmap_t pixmap; xcb_gc_t gc; int i; uint8_t data[] = { 0, 0, 0, 0 }; - for (i = 0; i < ARRAY_SIZE(atoms); i++) + for (i = 0; i < ARRAY_LENGTH(atoms); i++) cookies[i] = xcb_intern_atom (c->conn, 0, strlen(atoms[i].name), atoms[i].name); - for (i = 0; i < ARRAY_SIZE(atoms); i++) { + for (i = 0; i < ARRAY_LENGTH(atoms); i++) { reply = xcb_intern_atom_reply (c->conn, cookies[i], NULL); *(xcb_atom_t *) ((char *) c + atoms[i].offset) = reply->atom; free(reply);