summaryrefslogtreecommitdiff
path: root/ewmh
diff options
context:
space:
mode:
authorArnaud Fontaine <arnau@debian.org>2009-12-12 17:34:44 +0100
committerArnaud Fontaine <arnau@debian.org>2010-11-14 20:22:29 +0900
commite4de47c1b53e727474d0e6d63db32ddb9f97e67b (patch)
tree9eded7a45a98bdae90b92346511045833f97f43c /ewmh
parent31550a9c294d20a4bce37017429dd62041e97be3 (diff)
Use sizeof() instead of plain integer
Diffstat (limited to 'ewmh')
-rw-r--r--ewmh/ewmh.c.m412
1 files changed, 3 insertions, 9 deletions
diff --git a/ewmh/ewmh.c.m4 b/ewmh/ewmh.c.m4
index eb3399a..ed205f1 100644
--- a/ewmh/ewmh.c.m4
+++ b/ewmh/ewmh.c.m4
@@ -63,12 +63,6 @@ static ewmh_atom_t ewmh_atoms[] = {dnl
#define NB_EWMH_ATOMS countof(ewmh_atoms)
-/** Get the number of elements from the reply length */
-#define GET_NB_FROM_LEN(len, shift_value) ((len) >> (shift_value))
-
-/** Get the length of elements from the number of elements of a reply */
-#define GET_LEN_FROM_NB(nb, shift_value) ((nb) << (shift_value))
-
/**
* Common functions and macro
*/
@@ -132,7 +126,7 @@ static ewmh_atom_t ewmh_atoms[] = {dnl
xcb_get_property_reply_t *r) \
{ \
if(!r || r->type != atype || r->format != 32 || \
- xcb_get_property_value_length(r) != 4) \
+ xcb_get_property_value_length(r) != sizeof(ctype)) \
return 0; \
\
*atom_value = *((ctype *) xcb_get_property_value(r)); \
@@ -626,7 +620,7 @@ xcb_ewmh_get_desktop_geometry_from_reply(uint32_t *width, uint32_t *height,
xcb_get_property_reply_t *r)
{
if(!r || r->type != CARDINAL || r->format != 32 ||
- xcb_get_property_value_length(r) != 8)
+ xcb_get_property_value_length(r) != (sizeof(uint32_t) * 2))
return 0;
uint32_t *value = (uint32_t *) xcb_get_property_value(r);
@@ -1074,7 +1068,7 @@ xcb_ewmh_get_wm_icon_from_reply(xcb_ewmh_get_wm_icon_reply_t *wm_icon,
xcb_get_property_reply_t *r)
{
if(!r || r->type != CARDINAL || r->format != 32 ||
- GET_NB_FROM_LEN(xcb_get_property_value_length(r), 2) <= 2)
+ xcb_get_property_value_length(r) <= (sizeof(uint32_t) * 2))
return 0;
wm_icon->_reply = r;