diff options
author | Casey Dahlin <cdahlin@redhat.com> | 2010-05-28 01:41:48 -0400 |
---|---|---|
committer | Casey Dahlin <cdahlin@redhat.com> | 2010-05-28 01:41:48 -0400 |
commit | 3bab88b0928ac4b4e109dc0cf304105181c59eb1 (patch) | |
tree | 4edcac36977ef5169a91564d00adead9ad812f39 | |
parent | c9e208899b84895072ba171f9e6013ac28a06747 (diff) | |
download | wayland-3bab88b0928ac4b4e109dc0cf304105181c59eb1.tar.gz wayland-3bab88b0928ac4b4e109dc0cf304105181c59eb1.tar.xz wayland-3bab88b0928ac4b4e109dc0cf304105181c59eb1.zip |
Remove multiple definitions of ARRAY_LENGTH
Seems like this appeared a lot.
-rw-r--r-- | cairo-util.c | 3 | ||||
-rw-r--r-- | connection.c | 2 | ||||
-rw-r--r-- | event-loop.c | 3 | ||||
-rw-r--r-- | wayland-hash.c | 2 | ||||
-rw-r--r-- | wayland-system-compositor.c | 3 | ||||
-rw-r--r-- | window.c | 2 |
6 files changed, 3 insertions, 12 deletions
diff --git a/cairo-util.c b/cairo-util.c index 5e0a2d0..e40e313 100644 --- a/cairo-util.c +++ b/cairo-util.c @@ -27,8 +27,7 @@ #include <math.h> #include <cairo.h> #include "cairo-util.h" - -#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) +#include "wayland-util.h" void blur_surface(cairo_surface_t *surface, int margin) diff --git a/connection.c b/connection.c index 264c6ab..5de4380 100644 --- a/connection.c +++ b/connection.c @@ -32,8 +32,6 @@ #include "wayland-util.h" #include "connection.h" -#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) - struct wl_buffer { char data[4096]; int head, tail; diff --git a/event-loop.c b/event-loop.c index f6252a8..98009f6 100644 --- a/event-loop.c +++ b/event-loop.c @@ -34,6 +34,7 @@ #include <unistd.h> #include <assert.h> #include "wayland.h" +#include "wayland-util.h" struct wl_event_loop { int epoll_fd; @@ -406,8 +407,6 @@ wl_event_loop_destroy(struct wl_event_loop *loop) free(loop); } -#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) - static void dispatch_idles(struct wl_event_loop *loop) { diff --git a/wayland-hash.c b/wayland-hash.c index b299a33..2d36f5c 100644 --- a/wayland-hash.c +++ b/wayland-hash.c @@ -51,8 +51,6 @@ struct wl_hash_table { uint32_t deleted_entries; }; -#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) - /* * From Knuth -- a good choice for hash/rehash values is p, p-2 where * p and p-2 are both prime. These tables are sized to have an extra 10% diff --git a/wayland-system-compositor.c b/wayland-system-compositor.c index e8e46c2..8906b6a 100644 --- a/wayland-system-compositor.c +++ b/wayland-system-compositor.c @@ -46,10 +46,9 @@ #include "wayland.h" #include "wayland-protocol.h" #include "cairo-util.h" +#include "wayland-util.h" #include "wayland-system-compositor.h" -#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) - struct wlsc_matrix { GLdouble d[16]; }; @@ -451,8 +451,6 @@ struct key { /* 59 */ }; -#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) - static void window_update_modifiers(struct window *window, uint32_t key, uint32_t state) { |