summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Fontaine <arnau@debian.org>2009-12-12 17:34:44 +0100
committerArnaud Fontaine <arnau@debian.org>2010-08-09 16:06:30 -0500
commita0a033c3c68965569153c1517cb10b49ded00890 (patch)
tree6ddd04f4c97a7c17aff5b81ffbff1be5dc7e7664
parent8c8a91a588faa3d46aab4df0a337ab0273ce8ee5 (diff)
Use sizeof() instead of plain integer
-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;