summaryrefslogtreecommitdiff
path: root/app/cwm/search.c
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2011-03-22 10:57:32 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2011-03-22 10:57:32 +0000
commit04a221c8d876285eda7bc13885ed20504801273f (patch)
tree5125356082f3464e4160099b05510fc22b870554 /app/cwm/search.c
parent7166ea9f8813c58c9353d793899c286dd6c2629d (diff)
introduce nitems macro, with the appropriate ifndef.
ok oga@
Diffstat (limited to 'app/cwm/search.c')
-rw-r--r--app/cwm/search.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/cwm/search.c b/app/cwm/search.c
index 940e4cd43..df9ce8076 100644
--- a/app/cwm/search.c
+++ b/app/cwm/search.c
@@ -14,7 +14,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: search.c,v 1.21 2010/09/25 20:01:27 okan Exp $
+ * $Id: search.c,v 1.22 2011/03/22 10:57:31 okan Exp $
*/
#include <sys/param.h>
@@ -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