[Midnightbsd-cvs] src [7112] trunk/usr.sbin/bluetooth/bthidd: fix build with newer lex/yacc

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Jul 19 09:56:49 EDT 2015


Revision: 7112
          http://svnweb.midnightbsd.org/src/?rev=7112
Author:   laffer1
Date:     2015-07-19 09:56:48 -0400 (Sun, 19 Jul 2015)
Log Message:
-----------
fix build with newer lex/yacc

Modified Paths:
--------------
    trunk/usr.sbin/bluetooth/bthidd/Makefile
    trunk/usr.sbin/bluetooth/bthidd/bthid_config.h
    trunk/usr.sbin/bluetooth/bthidd/bthidd.8
    trunk/usr.sbin/bluetooth/bthidd/bthidd.c
    trunk/usr.sbin/bluetooth/bthidd/bthidd.conf.sample
    trunk/usr.sbin/bluetooth/bthidd/bthidd.h
    trunk/usr.sbin/bluetooth/bthidd/client.c
    trunk/usr.sbin/bluetooth/bthidd/hid.c
    trunk/usr.sbin/bluetooth/bthidd/kbd.c
    trunk/usr.sbin/bluetooth/bthidd/kbd.h
    trunk/usr.sbin/bluetooth/bthidd/lexer.l
    trunk/usr.sbin/bluetooth/bthidd/parser.y
    trunk/usr.sbin/bluetooth/bthidd/server.c
    trunk/usr.sbin/bluetooth/bthidd/session.c

Modified: trunk/usr.sbin/bluetooth/bthidd/Makefile
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/Makefile	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/Makefile	2015-07-19 13:56:48 UTC (rev 7112)
@@ -1,4 +1,5 @@
-# $Id: Makefile,v 1.4 2013-01-01 17:41:47 laffer1 Exp $
+# $Id: Makefile,v 1.6 2006/09/07 21:36:55 max Exp $
+# $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/Makefile 249657 2013-04-19 19:45:00Z ed $
 # $MidnightBSD$
 
 PROG=		bthidd
@@ -13,4 +14,6 @@
 DPADD=          ${LIBBLUETOOTH} ${LIBUSBHID}
 LDADD=		-lbluetooth -lusbhid
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 .include <bsd.prog.mk>

Modified: trunk/usr.sbin/bluetooth/bthidd/bthid_config.h
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/bthid_config.h	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/bthid_config.h	2015-07-19 13:56:48 UTC (rev 7112)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * bthid_config.h
  */
@@ -27,8 +28,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: bthid_config.h,v 1.3 2013-01-01 17:41:47 laffer1 Exp $
- * $MidnightBSD$
+ * $Id: bthid_config.h,v 1.4 2006/09/07 21:06:53 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/bthid_config.h 162128 2006-09-07 21:47:49Z emax $
  */
 
 #ifndef _BTHID_CONFIG_H_

Modified: trunk/usr.sbin/bluetooth/bthidd/bthidd.8
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/bthidd.8	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/bthidd.8	2015-07-19 13:56:48 UTC (rev 7112)
@@ -22,7 +22,8 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $Id: bthidd.8,v 1.2 2013-01-01 17:41:47 laffer1 Exp $
+.\" $Id: bthidd.8,v 1.1 2006/09/07 21:36:55 max Exp $
+.\" $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/bthidd.8 208027 2010-05-13 12:07:55Z uqs $
 .\" $MidnightBSD$
 .\"
 .Dd September 7, 2006

Modified: trunk/usr.sbin/bluetooth/bthidd/bthidd.c
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/bthidd.c	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/bthidd.c	2015-07-19 13:56:48 UTC (rev 7112)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * bthidd.c
  */
@@ -27,8 +28,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: bthidd.c,v 1.3 2013-01-01 17:41:47 laffer1 Exp $
- * $MidnightBSD$
+ * $Id: bthidd.c,v 1.8 2006/09/07 21:06:53 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/bthidd.c 162128 2006-09-07 21:47:49Z emax $
  */
 
 #include <sys/time.h>

Modified: trunk/usr.sbin/bluetooth/bthidd/bthidd.conf.sample
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/bthidd.conf.sample	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/bthidd.conf.sample	2015-07-19 13:56:48 UTC (rev 7112)
@@ -1,4 +1,4 @@
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/bthidd.conf.sample 162128 2006-09-07 21:47:49Z emax $
 
 device {
 	bdaddr			00:50:f2:e5:68:84;

Modified: trunk/usr.sbin/bluetooth/bthidd/bthidd.h
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/bthidd.h	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/bthidd.h	2015-07-19 13:56:48 UTC (rev 7112)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * bthidd.h
  */
@@ -27,8 +28,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: bthidd.h,v 1.3 2013-01-01 17:41:47 laffer1 Exp $
- * $MidnightBSD$
+ * $Id: bthidd.h,v 1.7 2006/09/07 21:06:53 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/bthidd.h 162128 2006-09-07 21:47:49Z emax $
  */
 
 #ifndef _BTHIDD_H_

Modified: trunk/usr.sbin/bluetooth/bthidd/client.c
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/client.c	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/client.c	2015-07-19 13:56:48 UTC (rev 7112)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * client.c
  */
@@ -27,8 +28,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: client.c,v 1.3 2013-01-01 17:41:47 laffer1 Exp $
- * $MidnightBSD$
+ * $Id: client.c,v 1.7 2006/09/07 21:06:53 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/client.c 163918 2006-11-02 18:57:09Z emax $
  */
 
 #include <sys/queue.h>

Modified: trunk/usr.sbin/bluetooth/bthidd/hid.c
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/hid.c	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/hid.c	2015-07-19 13:56:48 UTC (rev 7112)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * hid.c
  */
@@ -27,8 +28,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: hid.c,v 1.3 2013-01-01 17:41:47 laffer1 Exp $
- * $MidnightBSD$
+ * $Id: hid.c,v 1.5 2006/09/07 21:06:53 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/hid.c 281567 2015-04-15 22:07:51Z rakuco $
  */
 
 #include <sys/consio.h>
@@ -48,12 +49,6 @@
 #include "bthidd.h"
 #include "kbd.h"
 
-#undef	min
-#define	min(x, y)	(((x) < (y))? (x) : (y))
-
-#undef	ASIZE
-#define	ASIZE(a)	(sizeof(a)/sizeof(a[0]))
-
 /*
  * Process data from control channel
  */
@@ -165,9 +160,21 @@
 			continue;
 
 		page = HID_PAGE(h.usage);
-		usage = HID_USAGE(h.usage);
 		val = hid_get_data(data, &h);
 
+		/*
+		 * When the input field is an array and the usage is specified
+		 * with a range instead of an ID, we have to derive the actual
+		 * usage by using the item value as an index in the usage range
+		 * list.
+		 */
+		if ((h.flags & HIO_VARIABLE)) {
+			usage = HID_USAGE(h.usage);
+		} else {
+			const uint32_t usage_offset = val - h.logical_minimum;
+			usage = HID_USAGE(h.usage_minimum + usage_offset);
+		}
+
 		switch (page) {
 		case HUP_GENERIC_DESKTOP:
 			switch (usage) {

Modified: trunk/usr.sbin/bluetooth/bthidd/kbd.c
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/kbd.c	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/kbd.c	2015-07-19 13:56:48 UTC (rev 7112)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * kbd.c
  */
@@ -27,8 +28,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: kbd.c,v 1.3 2013-01-01 17:41:47 laffer1 Exp $
- * $MidnightBSD$
+ * $Id: kbd.c,v 1.4 2006/09/07 21:06:53 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/kbd.c 276791 2015-01-07 20:01:15Z emax $
  */
 
 #include <sys/consio.h>
@@ -67,7 +68,7 @@
  * The "break" (key released) code is generated as "make" | 0x80
  */
 
-#define E0PREFIX	(1 << 31)
+#define E0PREFIX	(1U << 31)
 #define NOBREAK		(1 << 30)
 #define CODEMASK	(~(E0PREFIX|NOBREAK))
 
@@ -225,8 +226,8 @@
 /* Keyboard Int'l 7             8D */ -1,   /* Unassigned */
 /* Keyboard Int'l 8             8E */ -1,   /* Unassigned */
 /* Keyboard Int'l 9             8F */ -1,   /* Unassigned */
-/* Keyboard Lang 1              90 */ NOBREAK|0xF2, /* None */
-/* Keyboard Lang 2              91 */ NOBREAK|0xF1, /* None */
+/* Keyboard Lang 1              90 */ 0x71, /* eisu */
+/* Keyboard Lang 2              91 */ 0x72, /* kana */
 /* Keyboard Lang 3              92 */ 0x78, /* F8 */
 /* Keyboard Lang 4              93 */ 0x77, /* F7 */
 /* Keyboard Lang 5              94 */ 0x76, /* F6 */

Modified: trunk/usr.sbin/bluetooth/bthidd/kbd.h
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/kbd.h	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/kbd.h	2015-07-19 13:56:48 UTC (rev 7112)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * kbd.h
  */
@@ -27,8 +28,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: kbd.h,v 1.3 2013-01-01 17:41:47 laffer1 Exp $
- * $MidnightBSD$
+ * $Id: kbd.h,v 1.3 2006/09/07 21:06:53 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/kbd.h 162128 2006-09-07 21:47:49Z emax $
  */
 
 #ifndef _KBD_H_

Modified: trunk/usr.sbin/bluetooth/bthidd/lexer.l
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/lexer.l	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/lexer.l	2015-07-19 13:56:48 UTC (rev 7112)
@@ -28,7 +28,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: lexer.l,v 1.3 2013-01-01 17:41:47 laffer1 Exp $
+ * $Id: lexer.l,v 1.3 2006/09/07 21:06:53 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/lexer.l 250926 2013-05-23 05:42:35Z jkim $
  * $MidnightBSD$
  */
 
@@ -37,6 +38,8 @@
 #include "parser.h"
 
 	int	yylex	(void);
+
+#define	YY_DECL	int yylex(void)
 %}
 
 %option yylineno noyywrap nounput noinput

Modified: trunk/usr.sbin/bluetooth/bthidd/parser.y
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/parser.y	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/parser.y	2015-07-19 13:56:48 UTC (rev 7112)
@@ -28,7 +28,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: parser.y,v 1.3 2013-01-01 17:41:47 laffer1 Exp $
+ * $Id: parser.y,v 1.7 2006/09/07 21:06:53 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/parser.y 235789 2012-05-22 16:33:10Z bapt $
  * $MidnightBSD$
  */
 
@@ -39,6 +40,7 @@
 #include <errno.h>
 #include <limits.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <usbhid.h>
@@ -61,7 +63,6 @@
 
 #include "bthid_config.h"
 
-	int	yyparse		(void);
 	int	yylex		(void);
 	void	yyerror		(char const *);
 static	int32_t	check_hid_device(hid_device_p hid_device);

Modified: trunk/usr.sbin/bluetooth/bthidd/server.c
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/server.c	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/server.c	2015-07-19 13:56:48 UTC (rev 7112)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * server.c
  */
@@ -27,8 +28,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: server.c,v 1.3 2013-01-01 17:41:47 laffer1 Exp $
- * $MidnightBSD$
+ * $Id: server.c,v 1.9 2006/09/07 21:06:53 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/server.c 162494 2006-09-21 02:32:28Z emax $
  */
 
 #include <sys/queue.h>

Modified: trunk/usr.sbin/bluetooth/bthidd/session.c
===================================================================
--- trunk/usr.sbin/bluetooth/bthidd/session.c	2015-07-18 22:17:29 UTC (rev 7111)
+++ trunk/usr.sbin/bluetooth/bthidd/session.c	2015-07-19 13:56:48 UTC (rev 7112)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * session.c
  */
@@ -27,8 +28,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: session.c,v 1.3 2013-01-01 17:41:47 laffer1 Exp $
- * $MidnightBSD$
+ * $Id: session.c,v 1.3 2006/09/07 21:06:53 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/session.c 162128 2006-09-07 21:47:49Z emax $
  */
 
 #include <sys/queue.h>



More information about the Midnightbsd-cvs mailing list