From owner-freebsd-bugs@FreeBSD.ORG Sun May 19 01:40:01 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1134A310 for ; Sun, 19 May 2013 01:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id EB386D5C for ; Sun, 19 May 2013 01:40:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r4J1e0vH065643 for ; Sun, 19 May 2013 01:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r4J1e0Vw065642; Sun, 19 May 2013 01:40:00 GMT (envelope-from gnats) Resent-Date: Sun, 19 May 2013 01:40:00 GMT Resent-Message-Id: <201305190140.r4J1e0Vw065642@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3BF6CFD9 for ; Sun, 19 May 2013 01:33:17 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.FreeBSD.org (oldred.freebsd.org [8.8.178.121]) by mx1.freebsd.org (Postfix) with ESMTP id 13932D28 for ; Sun, 19 May 2013 01:33:17 +0000 (UTC) Received: from oldred.FreeBSD.org ([127.0.1.6]) by oldred.FreeBSD.org (8.14.5/8.14.5) with ESMTP id r4J1XGLA050325 for ; Sun, 19 May 2013 01:33:16 GMT (envelope-from nobody@oldred.FreeBSD.org) Received: (from nobody@localhost) by oldred.FreeBSD.org (8.14.5/8.14.5/Submit) id r4J1XGxe050324; Sun, 19 May 2013 01:33:16 GMT (envelope-from nobody) Message-Id: <201305190133.r4J1XGxe050324@oldred.FreeBSD.org> Date: Sun, 19 May 2013 01:33:16 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/178764: [PATCH] [bluetooth] synch __arraycount definition fix a -Wsign-compare warning X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 01:40:01 -0000 >Number: 178764 >Category: bin >Synopsis: [PATCH] [bluetooth] synch __arraycount definition fix a -Wsign-compare warning >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun May 19 01:40:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 10-CURRENT >Organization: EMC Isilon >Environment: FreeBSD fuji-current.local 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r250326: Thu May 16 13:51:42 PDT 2013 root@fuji-current.local:/usr/obj/usr/src.svn/sys/FUJI-NOCOMPAT i386 >Description: The attached patch updates the __arraycount definition to match upstream's (NetBSD's) definition and fixes the -Wsign-compare error. >How-To-Repeat: >Fix: Patch attached with submission follows: >From 9637e70133b6edfba4a37bde22909ee6e9d21ede Mon Sep 17 00:00:00 2001 From: Garrett Cooper Date: Sat, 18 May 2013 17:47:21 -0700 Subject: [PATCH] Synch __arraycount with upstream's definition Subsequently, fix a -Wsign-compare error with clang due to synching __arraycount's definition. Signed-off-by: Garrett Cooper --- usr.sbin/bluetooth/btpand/btpand.c | 4 ++-- usr.sbin/bluetooth/btpand/btpand.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bluetooth/btpand/btpand.c b/usr.sbin/bluetooth/btpand/btpand.c index 9387444..8895db2 100644 --- a/usr.sbin/bluetooth/btpand/btpand.c +++ b/usr.sbin/bluetooth/btpand/btpand.c @@ -146,7 +146,7 @@ main(int argc, char *argv[]) case 's': /* service */ case 'S': /* service (no SDP) */ for (ul = 0; strcasecmp(optarg, services[ul].name); ul++) { - if (ul == __arraycount(services)) + if (ul == (unsigned long)__arraycount(services)) errx(EXIT_FAILURE, "%s: unknown service", optarg); } @@ -264,7 +264,7 @@ static void usage(void) { const char *p = getprogname(); - int n = strlen(p); + size_t n = strlen(p); fprintf(stderr, "usage: %s [-i ifname] [-m mode] -a address -d device\n" diff --git a/usr.sbin/bluetooth/btpand/btpand.h b/usr.sbin/bluetooth/btpand/btpand.h index c5f7204..440cca1 100644 --- a/usr.sbin/bluetooth/btpand/btpand.h +++ b/usr.sbin/bluetooth/btpand/btpand.h @@ -44,7 +44,7 @@ #include "event.h" #ifndef __arraycount -#define __arraycount(__x) (int)(sizeof((__x)) / sizeof((__x)[0])) +#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) #endif #ifndef L2CAP_PSM_INVALID -- 1.8.2.3 >Release-Note: >Audit-Trail: >Unformatted: