From fc563cad7af18e7197f0cd4e6145c8bb1af76cf8 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 12 Sep 2013 12:20:01 +0000 Subject: #ifdef the "npress" variable, so it is only defined (and initialized) when it is also used. --- sys/dev/bluetooth/btkbd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/dev') 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 -__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 #include @@ -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) -- cgit