summaryrefslogtreecommitdiff
path: root/ewmh
diff options
context:
space:
mode:
authorArnaud Fontaine <arnau@debian.org>2009-12-06 18:58:26 +0100
committerArnaud Fontaine <arnau@debian.org>2010-11-14 20:22:28 +0900
commitf053dd0c4fb0260196a334749c716801197f57ba (patch)
treee0db50498b064b63d1a68d5ccea55e9ed7fbd5cd /ewmh
parentcd3da8f36121815ae3e5cbdc62770ff6f9ae67f4 (diff)
Use countof() instead of the length value directly
Diffstat (limited to 'ewmh')
-rw-r--r--ewmh/ewmh.c.m436
1 files changed, 21 insertions, 15 deletions
diff --git a/ewmh/ewmh.c.m4 b/ewmh/ewmh.c.m4
index 9736f6d..1651a49 100644
--- a/ewmh/ewmh.c.m4
+++ b/ewmh/ewmh.c.m4
@@ -646,7 +646,8 @@ xcb_ewmh_request_change_desktop_geometry(xcb_ewmh_connection_t *ewmh,
const uint32_t data[] = { new_width, new_height };
return xcb_ewmh_send_client_message(ewmh->connection, XCB_NONE, ewmh->root,
- ewmh->_NET_DESKTOP_GEOMETRY, 2, data);
+ ewmh->_NET_DESKTOP_GEOMETRY,
+ countof(data), data);
}
uint8_t
@@ -693,7 +694,8 @@ xcb_ewmh_request_change_desktop_viewport(xcb_ewmh_connection_t *ewmh,
const uint32_t data[] = { x, y };
return xcb_ewmh_send_client_message(ewmh->connection, XCB_NONE, ewmh->root,
- ewmh->_NET_DESKTOP_VIEWPORT, 2, data);
+ ewmh->_NET_DESKTOP_VIEWPORT,
+ countof(data), data);
}
/**
@@ -711,7 +713,8 @@ xcb_ewmh_request_change_current_desktop(xcb_ewmh_connection_t *ewmh,
const uint32_t data[] = { new_desktop, timestamp };
return xcb_ewmh_send_client_message(ewmh->connection, XCB_NONE, ewmh->root,
- ewmh->_NET_CURRENT_DESKTOP, 2, data);
+ ewmh->_NET_CURRENT_DESKTOP,
+ countof(data), data);
}
/**
@@ -737,7 +740,7 @@ xcb_ewmh_request_change_active_window(xcb_ewmh_connection_t *ewmh,
return xcb_ewmh_send_client_message(ewmh->connection, window_to_activate,
ewmh->root, ewmh->_NET_ACTIVE_WINDOW,
- 3, data);
+ countof(data), data);
}
/**
@@ -811,8 +814,9 @@ xcb_ewmh_request_close_window(xcb_ewmh_connection_t *ewmh,
{
const uint32_t data[] = { timestamp, source_indication };
- return xcb_ewmh_send_client_message(ewmh->connection, window_to_close, ewmh->root,
- ewmh->_NET_CLOSE_WINDOW, 2, data);
+ return xcb_ewmh_send_client_message(ewmh->connection, window_to_close,
+ ewmh->root, ewmh->_NET_CLOSE_WINDOW,
+ countof(data), data);
}
/**
@@ -835,7 +839,7 @@ xcb_ewmh_request_moveresize_window(xcb_ewmh_connection_t *ewmh,
return xcb_ewmh_send_client_message(ewmh->connection, moveresize_window,
ewmh->root, ewmh->_NET_MOVERESIZE_WINDOW,
- 5, data);
+ countof(data), data);
}
/**
@@ -854,7 +858,7 @@ xcb_ewmh_request_wm_moveresize(xcb_ewmh_connection_t *ewmh,
return xcb_ewmh_send_client_message(ewmh->connection, moveresize_window,
ewmh->root, ewmh->_NET_WM_MOVERESIZE,
- 5, data);
+ countof(data), data);
}
/**
@@ -872,7 +876,7 @@ xcb_ewmh_request_restack_window(xcb_ewmh_connection_t *ewmh,
return xcb_ewmh_send_client_message(ewmh->connection, window_to_restack,
ewmh->root, ewmh->_NET_RESTACK_WINDOW,
- 3, data);
+ countof(data), data);
}
/**
@@ -913,8 +917,9 @@ xcb_ewmh_request_change_wm_desktop(xcb_ewmh_connection_t *ewmh,
{
const uint32_t data[] = { new_desktop, source_indication };
- return xcb_ewmh_send_client_message(ewmh->connection, client_window, ewmh->root,
- ewmh->_NET_WM_DESKTOP, 2, data);
+ return xcb_ewmh_send_client_message(ewmh->connection, client_window,
+ ewmh->root, ewmh->_NET_WM_DESKTOP,
+ countof(data), data);
}
/**
@@ -945,7 +950,7 @@ xcb_ewmh_request_change_wm_state(xcb_ewmh_connection_t *ewmh,
source_indication };
return xcb_ewmh_send_client_message(ewmh->connection, client_window, ewmh->root,
- ewmh->_NET_WM_STATE, 4, data);
+ ewmh->_NET_WM_STATE, countof(data), data);
}
/**
@@ -1167,7 +1172,7 @@ xcb_ewmh_send_wm_ping(xcb_ewmh_connection_t *ewmh,
const uint32_t data[] = { ewmh->_NET_WM_PING, timestamp, window };
return xcb_ewmh_send_client_message(ewmh->connection, window, window,
- ewmh->WM_PROTOCOLS, 3, data);
+ ewmh->WM_PROTOCOLS, countof(data), data);
}
/**
@@ -1241,7 +1246,7 @@ xcb_ewmh_send_wm_sync_request(xcb_ewmh_connection_t *ewmh,
GET_NB_FROM_LEN(counter, 32) };
return xcb_ewmh_send_client_message(ewmh->connection, window, window,
- ewmh->WM_PROTOCOLS, 4, data);
+ ewmh->WM_PROTOCOLS, countof(data), data);
}
/**
@@ -1289,7 +1294,8 @@ xcb_ewmh_request_change_wm_fullscreen_monitors(xcb_ewmh_connection_t *ewmh,
const uint32_t data[] = { top, bottom, left, right, source_indication };
return xcb_ewmh_send_client_message(ewmh->connection, window, ewmh->root,
- ewmh->_NET_WM_FULLSCREEN_MONITORS, 5, data);
+ ewmh->_NET_WM_FULLSCREEN_MONITORS,
+ countof(data), data);
}
/**