From 4d8dfd66df1c748e77931835444dadb6c779eecc Mon Sep 17 00:00:00 2001 From: lukem Date: Wed, 15 Apr 2009 00:32:23 +0000 Subject: [PATCH] Fix -Wsign-compare issues. (Use %u not %d for unsigned ints.) --- usr.sbin/btattach/btattach.c | 6 +++--- usr.sbin/btattach/btattach.h | 4 ++-- usr.sbin/btattach/init_bcm2035.c | 6 +++--- usr.sbin/btattach/init_digi.c | 6 +++--- usr.sbin/btattach/init_ericsson.c | 6 +++--- usr.sbin/btattach/init_st.c | 6 +++--- usr.sbin/btattach/init_swave.c | 6 +++--- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/usr.sbin/btattach/btattach.c b/usr.sbin/btattach/btattach.c index a33cd8ec3f44..eeeb5fa51725 100644 --- a/usr.sbin/btattach/btattach.c +++ b/usr.sbin/btattach/btattach.c @@ -1,4 +1,4 @@ -/* $NetBSD: btattach.c,v 1.2 2008/07/21 13:36:57 lukem Exp $ */ +/* $NetBSD: btattach.c,v 1.3 2009/04/15 00:32:23 lukem Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -27,7 +27,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008 Iain Hibbert. All rights reserved."); -__RCSID("$NetBSD: btattach.c,v 1.2 2008/07/21 13:36:57 lukem Exp $"); +__RCSID("$NetBSD: btattach.c,v 1.3 2009/04/15 00:32:23 lukem Exp $"); #include #include @@ -265,7 +265,7 @@ main(int argc, char *argv[]) static void usage(void) { - int i; + size_t i; fprintf(stderr, "Usage: %s [-dfop] [-i speed] [type] tty speed\n" diff --git a/usr.sbin/btattach/btattach.h b/usr.sbin/btattach/btattach.h index 9ef50e81abed..e56f2a9c160d 100644 --- a/usr.sbin/btattach/btattach.h +++ b/usr.sbin/btattach/btattach.h @@ -1,4 +1,4 @@ -/* $NetBSD: btattach.h,v 1.1 2008/04/15 11:17:48 plunky Exp $ */ +/* $NetBSD: btattach.h,v 1.2 2009/04/15 00:32:23 lukem Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -36,7 +36,7 @@ struct devtype { const char * descr; /* long description */ devinit_t * init; /* init function */ tcflag_t cflag; /* default cflags */ - int speed; /* default baudrate */ + unsigned int speed; /* default baudrate */ }; devinit_t init_bcm2035; diff --git a/usr.sbin/btattach/init_bcm2035.c b/usr.sbin/btattach/init_bcm2035.c index 225430044996..11bfa1e024a7 100644 --- a/usr.sbin/btattach/init_bcm2035.c +++ b/usr.sbin/btattach/init_bcm2035.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_bcm2035.c,v 1.1 2008/04/15 11:17:48 plunky Exp $ */ +/* $NetBSD: init_bcm2035.c,v 1.2 2009/04/15 00:32:23 lukem Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -31,7 +31,7 @@ */ #include -__RCSID("$NetBSD: init_bcm2035.c,v 1.1 2008/04/15 11:17:48 plunky Exp $"); +__RCSID("$NetBSD: init_bcm2035.c,v 1.2 2009/04/15 00:32:23 lukem Exp $"); #include #include @@ -66,7 +66,7 @@ init_bcm2035(int fd, unsigned int speed) case B460800: rate = 0xfd22; break; case B921600: rate = 0xff55; break; default: - errx(EXIT_FAILURE, "invalid speed for bcm2035: %d\n", speed); + errx(EXIT_FAILURE, "invalid speed for bcm2035: %u\n", speed); }; rate = htole16(rate); diff --git a/usr.sbin/btattach/init_digi.c b/usr.sbin/btattach/init_digi.c index f2f9c64ae430..08892d678376 100644 --- a/usr.sbin/btattach/init_digi.c +++ b/usr.sbin/btattach/init_digi.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_digi.c,v 1.1 2008/04/15 11:17:48 plunky Exp $ */ +/* $NetBSD: init_digi.c,v 1.2 2009/04/15 00:32:23 lukem Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -31,7 +31,7 @@ */ #include -__RCSID("$NetBSD: init_digi.c,v 1.1 2008/04/15 11:17:48 plunky Exp $"); +__RCSID("$NetBSD: init_digi.c,v 1.2 2009/04/15 00:32:23 lukem Exp $"); #include #include @@ -53,7 +53,7 @@ init_digi(int fd, unsigned int speed) case B57600: rate = 0x08; break; case B115200: rate = 0x09; break; default: - errx(EXIT_FAILURE, "invalid speed for digi: %d\n", speed); + errx(EXIT_FAILURE, "invalid speed for digi: %u\n", speed); } uart_send_cmd(fd, HCI_CMD_DIGIANSWER_SET_UART_BAUD_RATE, &rate, sizeof(rate)); diff --git a/usr.sbin/btattach/init_ericsson.c b/usr.sbin/btattach/init_ericsson.c index c2db4b24931d..64fc92523b9c 100644 --- a/usr.sbin/btattach/init_ericsson.c +++ b/usr.sbin/btattach/init_ericsson.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_ericsson.c,v 1.1 2008/04/15 11:17:48 plunky Exp $ */ +/* $NetBSD: init_ericsson.c,v 1.2 2009/04/15 00:32:23 lukem Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -31,7 +31,7 @@ */ #include -__RCSID("$NetBSD: init_ericsson.c,v 1.1 2008/04/15 11:17:48 plunky Exp $"); +__RCSID("$NetBSD: init_ericsson.c,v 1.2 2009/04/15 00:32:23 lukem Exp $"); #include #include @@ -78,7 +78,7 @@ init_ericsson(int fd, unsigned int speed) case 300000: rate = 0x27; break; case 400000: rate = 0x2b; break; default: - errx(EXIT_FAILURE, "invalid speed for ericsson: %d\n", speed); + errx(EXIT_FAILURE, "invalid speed for ericsson: %u\n", speed); } uart_send_cmd(fd, HCI_CMD_ERICSSON_SET_UART_BAUD_RATE, &rate, sizeof(rate)); diff --git a/usr.sbin/btattach/init_st.c b/usr.sbin/btattach/init_st.c index c96ec477e292..f43ba817f327 100644 --- a/usr.sbin/btattach/init_st.c +++ b/usr.sbin/btattach/init_st.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_st.c,v 1.1 2008/04/15 11:17:48 plunky Exp $ */ +/* $NetBSD: init_st.c,v 1.2 2009/04/15 00:32:23 lukem Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -31,7 +31,7 @@ */ #include -__RCSID("$NetBSD: init_st.c,v 1.1 2008/04/15 11:17:48 plunky Exp $"); +__RCSID("$NetBSD: init_st.c,v 1.2 2009/04/15 00:32:23 lukem Exp $"); #include #include @@ -59,7 +59,7 @@ init_st(int fd, unsigned int speed) case B460800: rate = 0x13; break; case B921600: rate = 0x14; break; default: - errx(EXIT_FAILURE, "invalid speed for st: %d\n", speed); + errx(EXIT_FAILURE, "invalid speed for st: %u\n", speed); } uart_send_cmd(fd, HCI_CMD_ST_SET_UART_BAUD_RATE, &rate, sizeof(rate)); diff --git a/usr.sbin/btattach/init_swave.c b/usr.sbin/btattach/init_swave.c index a48ee5d06ca3..1cd0bd92abaf 100644 --- a/usr.sbin/btattach/init_swave.c +++ b/usr.sbin/btattach/init_swave.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_swave.c,v 1.1 2008/04/15 11:17:48 plunky Exp $ */ +/* $NetBSD: init_swave.c,v 1.2 2009/04/15 00:32:23 lukem Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -31,7 +31,7 @@ */ #include -__RCSID("$NetBSD: init_swave.c,v 1.1 2008/04/15 11:17:48 plunky Exp $"); +__RCSID("$NetBSD: init_swave.c,v 1.2 2009/04/15 00:32:23 lukem Exp $"); #include #include @@ -78,7 +78,7 @@ init_swave(int fd, unsigned int speed) case B57600: cp.transport_rate = 0x01; break; case B115200: cp.transport_rate = 0x00; break; default: - errx(EXIT_FAILURE, "invalid speed for swave: %d\n", speed); + errx(EXIT_FAILURE, "invalid speed for swave: %u\n", speed); } uart_send_cmd(fd, HCI_CMD_SWAVE_PARAM_ACCESS_SET, &cp, sizeof(cp));