diff options
author | okan | 2011-03-22 10:57:31 +0000 |
---|---|---|
committer | okan | 2011-03-22 10:57:31 +0000 |
commit | c5841193570edf6eca119c583d9e790eef12dcb1 (patch) | |
tree | 82cb7021fa6527f717129aceabeaa68ff00fde3a /xutil.c | |
parent | 6744c6dfbae31f04a8b397d35d144743b5845246 (diff) | |
download | cwm-c5841193570edf6eca119c583d9e790eef12dcb1.tar.gz |
introduce nitems macro, with the appropriate ifndef.
ok oga@
Diffstat (limited to '')
-rw-r--r-- | xutil.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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); } |