summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Fontaine <arnau@debian.org>2009-12-12 16:39:35 +0100
committerArnaud Fontaine <arfontaine@ITEM-58736.dhcp.oxfd.uk.sopra>2010-02-11 14:47:30 +0000
commitf440da927452ccb067c74127195190d9b3d9b16d (patch)
tree374bf7940b091d26f532e22958c0e99bc25182dd
parent4732425b399f2d98b5456af54ebc1b18db547dd1 (diff)
Use countof when possible
-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,