summary refs log tree commit diff
path: root/search.c
diff options
context:
space:
mode:
authorokan <okan>2011-03-22 10:57:31 +0000
committerokan <okan>2011-03-22 10:57:31 +0000
commit2c706e60c7b9c7da4198fac2ca9bc01e7d26895a (patch)
tree975648c5b4aab6ae45e322d60f73506d8e4d6c2d /search.c
parent8f88cd474a20772e72a7db5abe3013e2be223108 (diff)
downloadcwm-2c706e60c7b9c7da4198fac2ca9bc01e7d26895a.tar.gz
cwm-2c706e60c7b9c7da4198fac2ca9bc01e7d26895a.tar.xz
cwm-2c706e60c7b9c7da4198fac2ca9bc01e7d26895a.zip
introduce nitems macro, with the appropriate ifndef.
ok oga@
Diffstat (limited to 'search.c')
-rw-r--r--search.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/search.c b/search.c
index 8cd6523..7d39884 100644
--- a/search.c
+++ b/search.c
@@ -42,9 +42,6 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search)
 {
 	struct winname	*wn;
 	struct menu	*mi, *tierp[4], *before = NULL;
-	int		 ntiers;
-
-	ntiers = sizeof(tierp) / sizeof(tierp[0]);
 
 	TAILQ_INIT(resultq);
 
@@ -92,14 +89,14 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search)
 		 * window.  Furthermore, this is denoted by a "!" when
 		 * printing the window name in the search menu.
 		 */
-		if (cc == client_current() && tier < ntiers - 1)
+		if (cc == client_current() && tier < nitems(tierp) - 1)
 			tier++;
 
 		/* Clients that are hidden get ranked one up. */
 		if (cc->flags & CLIENT_HIDDEN && tier > 0)
 			tier--;
 
-		assert(tier < ntiers);
+		assert(tier < nitems(tierp));
 
 		/*
 		 * If you have a tierp, insert after it, and make it