diff options
| author | martin <martin@NetBSD.org> | 2013-09-12 12:20:01 +0000 |
|---|---|---|
| committer | martin <martin@NetBSD.org> | 2013-09-12 12:20:01 +0000 |
| commit | fc563cad7af18e7197f0cd4e6145c8bb1af76cf8 (patch) | |
| tree | 693d01554f5f4d34484b418ed3a9f2d8d7090fd9 /sys/dev/bluetooth | |
| parent | e9a5d088833929d920afff8f324dc2c6cd78d07d (diff) | |
#ifdef the "npress" variable, so it is only defined (and initialized) when
it is also used.
Diffstat (limited to 'sys/dev/bluetooth')
| -rw-r--r-- | sys/dev/bluetooth/btkbd.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/bluetooth/btkbd.c b/sys/dev/bluetooth/btkbd.c index 98a24bf9773..2fbec5591dd 100644 --- a/sys/dev/bluetooth/btkbd.c +++ b/sys/dev/bluetooth/btkbd.c @@ -1,4 +1,4 @@ -/* $NetBSD: btkbd.c,v 1.15 2012/10/27 17:18:15 chs Exp $ */ +/* $NetBSD: btkbd.c,v 1.16 2013/09/12 12:20:01 martin Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: btkbd.c,v 1.15 2012/10/27 17:18:15 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: btkbd.c,v 1.16 2013/09/12 12:20:01 martin Exp $"); #include <sys/param.h> #include <sys/callout.h> @@ -541,9 +541,11 @@ btkbd_input(struct bthidev *hidev, uint8_t *data, int len) if (sc->sc_rawkbd) { u_char cbuf[MAXKEYS * 2]; int c; - int npress; +#ifdef BTKBD_REPEAT + int npress = 0; +#endif - for (npress = i = j = 0 ; i < nkeys ; i++) { + for (i = j = 0 ; i < nkeys ; i++) { key = ibuf[i]; c = btkbd_trtab[key & CODEMASK]; if (c == NN) |
