summaryrefslogtreecommitdiff
path: root/ewmh
diff options
context:
space:
mode:
authorArnaud Fontaine <arnau@debian.org>2009-12-12 16:39:35 +0100
committerArnaud Fontaine <arnau@debian.org>2010-11-14 20:22:28 +0900
commit84a852f09bc75027175aa60d6d26bb0c0a6773c7 (patch)
treeb8446cabf06d06ec639896f3566aae9f318f72b9 /ewmh
parent7b3479b2cb925082ecbb4abdaee4c783deb4d818 (diff)
Use countof when possible
Diffstat (limited to 'ewmh')
-rw-r--r--ewmh/ewmh.c.m48
1 files changed, 4 insertions, 4 deletions
diff --git a/ewmh/ewmh.c.m4 b/ewmh/ewmh.c.m4
index 7a47c3f..ada2fb1 100644
--- a/ewmh/ewmh.c.m4
+++ b/ewmh/ewmh.c.m4
@@ -748,7 +748,8 @@ xcb_ewmh_set_desktop_layout(xcb_ewmh_connection_t *ewmh,
const uint32_t data[] = { orientation, columns, rows, starting_corner };
return xcb_change_property(ewmh->connection, XCB_PROP_MODE_REPLACE, ewmh->root,
- ewmh->_NET_DESKTOP_LAYOUT, CARDINAL, 32, 2, data);
+ ewmh->_NET_DESKTOP_LAYOUT, CARDINAL, 32,
+ countof(data), data);
}
xcb_void_cookie_t
@@ -761,7 +762,7 @@ xcb_ewmh_set_desktop_layout_checked(xcb_ewmh_connection_t *ewmh,
return xcb_change_property_checked(ewmh->connection, XCB_PROP_MODE_REPLACE,
ewmh->root, ewmh->_NET_DESKTOP_LAYOUT,
- CARDINAL, 32, 2, data);
+ CARDINAL, 32, countof(data), data);
}
/**
@@ -801,8 +802,7 @@ xcb_ewmh_request_moveresize_window(xcb_ewmh_connection_t *ewmh,
uint32_t x, uint32_t y,
uint32_t width, uint32_t height)
{
- const uint32_t data[] = { (gravity | flags |
- GET_LEN_FROM_NB(source_indication, 12)),
+ const uint32_t data[] = { (gravity | flags | source_indication << 12),
x, y, width, height };
return xcb_ewmh_send_client_message(ewmh->connection, moveresize_window,