From 0c393c8f3969ab10ba6ea026e6c6fd4175a8a924 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 16 Jun 2010 18:13:23 +0200 Subject: [PATCH] xwindow_set_state(): Use uint32_t instead of long This function calls xcb_change_property() with format==32 which means that it is called with a 32-bit integer. However, on 64-bit machines, sizeof(long) == 64 which means that this code did the wrong thing. This wasn't noticed before because it only causes a real difference on big-endian machines. Signed-off-by: Uli Schlachter --- xwindow.c | 4 ++-- xwindow.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xwindow.c b/xwindow.c index 2b12eb7e0..d6bba4a34 100644 --- a/xwindow.c +++ b/xwindow.c @@ -34,9 +34,9 @@ * \param state The state to set. */ void -xwindow_set_state(xcb_window_t win, long state) +xwindow_set_state(xcb_window_t win, uint32_t state) { - long data[] = { state, XCB_NONE }; + uint32_t data[] = { state, XCB_NONE }; xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, win, WM_STATE, WM_STATE, 32, 2, data); } diff --git a/xwindow.h b/xwindow.h index 475465ad8..4151d5d82 100644 --- a/xwindow.h +++ b/xwindow.h @@ -25,7 +25,7 @@ #include "globalconf.h" #include "draw.h" -void xwindow_set_state(xcb_window_t, long); +void xwindow_set_state(xcb_window_t, uint32_t); xcb_get_property_cookie_t xwindow_get_state_unchecked(xcb_window_t); uint32_t xwindow_get_state_reply(xcb_get_property_cookie_t); void xwindow_configure(xcb_window_t, area_t, int);