aboutsummaryrefslogtreecommitdiffstats
path: root/xutil.c
diff options
context:
space:
mode:
authorokan2011-03-22 10:57:31 +0000
committerokan2011-03-22 10:57:31 +0000
commitc5841193570edf6eca119c583d9e790eef12dcb1 (patch)
tree82cb7021fa6527f717129aceabeaa68ff00fde3a /xutil.c
parent6744c6dfbae31f04a8b397d35d144743b5845246 (diff)
downloadcwm-c5841193570edf6eca119c583d9e790eef12dcb1.tar.gz
introduce nitems macro, with the appropriate ifndef.
ok oga@
Diffstat (limited to 'xutil.c')
-rw-r--r--xutil.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xutil.c b/xutil.c
index b50242a..5e5940b 100644
--- a/xutil.c
+++ b/xutil.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: xutil.c,v 1.33 2011/03/22 10:49:46 okan Exp $
+ * $Id: xutil.c,v 1.34 2011/03/22 10:57:31 okan Exp $
*/
#include <sys/param.h>
@@ -57,7 +57,7 @@ void
xu_btn_grab(Window win, int mask, u_int btn)
{
int i;
- for (i = 0; i < sizeof(ign_mods)/sizeof(*ign_mods); i++)
+ for (i = 0; i < nitems(ign_mods); i++)
XGrabButton(X_Dpy, btn, (mask | ign_mods[i]), win,
False, ButtonMask, GrabModeAsync,
GrabModeSync, None, None);
@@ -67,7 +67,7 @@ void
xu_btn_ungrab(Window win, int mask, u_int btn)
{
int i;
- for (i = 0; i < sizeof(ign_mods)/sizeof(*ign_mods); i++)
+ for (i = 0; i < nitems(ign_mods); i++)
XUngrabButton(X_Dpy, btn, (mask | ign_mods[i]), win);
}
@@ -98,7 +98,7 @@ xu_key_grab(Window win, int mask, int keysym)
(XKeycodeToKeysym(X_Dpy, code, 1) == keysym))
mask |= ShiftMask;
- for (i = 0; i < sizeof(ign_mods)/sizeof(*ign_mods); i++)
+ for (i = 0; i < nitems(ign_mods); i++)
XGrabKey(X_Dpy, code, (mask | ign_mods[i]), win,
True, GrabModeAsync, GrabModeAsync);
}
@@ -114,7 +114,7 @@ xu_key_ungrab(Window win, int mask, int keysym)
(XKeycodeToKeysym(X_Dpy, code, 1) == keysym))
mask |= ShiftMask;
- for (i = 0; i < sizeof(ign_mods)/sizeof(*ign_mods); i++)
+ for (i = 0; i < nitems(ign_mods); i++)
XUngrabKey(X_Dpy, code, (mask | ign_mods[i]), win);
}