summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-12-10 16:35:29 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-12-10 16:35:29 +0000
commitf62320e42891733e9ee8bf661e6fc26a503ccfd6 (patch)
tree6c159927b74f84176e9fea0b4a3c0519f0aeb2fa /sys
parent14e9b6c5251ab3959e0d049d9be8af005b1c7602 (diff)
a few sizeof(array)/sizeof(array[0]) -> nitems(array) conversions found while
looking for something else. sha1(1) tells me there's no binary change.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/wscons/wsemul_vt100_chars.c4
-rw-r--r--sys/dev/wscons/wskbdutil.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/wscons/wsemul_vt100_chars.c b/sys/dev/wscons/wsemul_vt100_chars.c
index a45d9d9e33f..373a34ab4fd 100644
--- a/sys/dev/wscons/wsemul_vt100_chars.c
+++ b/sys/dev/wscons/wsemul_vt100_chars.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsemul_vt100_chars.c,v 1.6 2007/11/27 16:37:27 miod Exp $ */
+/* $OpenBSD: wsemul_vt100_chars.c,v 1.7 2009/12/10 16:35:28 oga Exp $ */
/* $NetBSD: wsemul_vt100_chars.c,v 1.4 1999/02/20 18:20:02 drochner Exp $ */
/*
@@ -150,7 +150,7 @@ vt100_setnrc(struct wsemul_vt100_emuldata *edp, int nrc)
if (edp->nrctab == NULL)
return (0);
- if (nrc < 0 || nrc >= sizeof(nrctable) / sizeof(nrctable[0]))
+ if (nrc < 0 || nrc >= nitems(nrctable))
return (ERANGE);
for (i = 0; i < 128; i++)
diff --git a/sys/dev/wscons/wskbdutil.c b/sys/dev/wscons/wskbdutil.c
index 7fb7a5af572..afeea7ef45e 100644
--- a/sys/dev/wscons/wskbdutil.c
+++ b/sys/dev/wscons/wskbdutil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wskbdutil.c,v 1.7 2008/06/26 05:42:19 ray Exp $ */
+/* $OpenBSD: wskbdutil.c,v 1.8 2009/12/10 16:35:28 oga Exp $ */
/* $NetBSD: wskbdutil.c,v 1.7 1999/12/21 11:59:13 drochner Exp $ */
/*-
@@ -174,7 +174,7 @@ static struct compose_tab_s {
{ { KS_acute, KS_y }, KS_yacute }
};
-#define COMPOSE_SIZE sizeof(compose_tab)/sizeof(compose_tab[0])
+#define COMPOSE_SIZE nitems(compose_tab)
static int compose_tab_inorder = 0;
@@ -428,7 +428,7 @@ wskbd_load_keymap(mapdata, map, maplen)
mp++;
}
- if (stack_ptr == sizeof(stack)/sizeof(stack[0]))
+ if (stack_ptr == nitems(stack))
panic("wskbd_load_keymap: %d: recursion too deep",
mapdata->layout);
if (mp->map_size <= 0)