Module Name:    src
Committed By:   lukem
Date:           Sat Apr 18 13:53:59 UTC 2009

Modified Files:
        src/usr.sbin/sdpd: profile.c server.c

Log Message:
Fix -Wcast-qual and -Wsign-compare issues


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sdpd/profile.c \
    src/usr.sbin/sdpd/server.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/profile.c
diff -u src/usr.sbin/sdpd/profile.c:1.5 src/usr.sbin/sdpd/profile.c:1.6
--- src/usr.sbin/sdpd/profile.c:1.5	Wed Mar 19 23:15:19 2008
+++ src/usr.sbin/sdpd/profile.c	Sat Apr 18 13:53:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: profile.c,v 1.5 2008/03/19 23:15:19 plunky Exp $	*/
+/*	$NetBSD: profile.c,v 1.6 2009/04/18 13:53:59 lukem Exp $	*/
 
 /*
  * profile.c
@@ -28,12 +28,12 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: profile.c,v 1.5 2008/03/19 23:15:19 plunky Exp $
+ * $Id: profile.c,v 1.6 2009/04/18 13:53:59 lukem Exp $
  * $FreeBSD: src/usr.sbin/bluetooth/sdpd/profile.c,v 1.2 2004/07/28 07:15:44 kan Exp $
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: profile.c,v 1.5 2008/03/19 23:15:19 plunky Exp $");
+__RCSID("$NetBSD: profile.c,v 1.6 2009/04/18 13:53:59 lukem Exp $");
 
 #include <sys/queue.h>
 #include <sys/utsname.h>
@@ -79,7 +79,7 @@
 		&sp_profile_descriptor,
 	};
 
-	int32_t			i;
+	size_t			i;
 
 	for (i = 0; i < sizeof(profiles)/sizeof(profiles[0]); i++)
 		if (profiles[i]->uuid[0] == uuid)
@@ -415,7 +415,7 @@
 #endif
 	};
 	const int psize = __arraycount(ptype) * 3;
-	int i;
+	size_t i;
 
 	if (datalen != 2 || (18 + psize) > 255 || (buf + 20 + psize) > eob)
 		return (-1);
@@ -428,7 +428,7 @@
 	SDP_PUT8(SDP_DATA_UUID16, buf);
 	SDP_PUT16(SDP_UUID_PROTOCOL_L2CAP, buf);
 	SDP_PUT8(SDP_DATA_UINT16, buf);
-	SDP_PUT16(*(uint16_t *)data, buf);
+	SDP_PUT16(*(const uint16_t *)data, buf);
 
 	SDP_PUT8(SDP_DATA_SEQ8, buf);
 	SDP_PUT8(8 + psize, buf);
Index: src/usr.sbin/sdpd/server.c
diff -u src/usr.sbin/sdpd/server.c:1.5 src/usr.sbin/sdpd/server.c:1.6
--- src/usr.sbin/sdpd/server.c:1.5	Thu Jan 15 23:17:00 2009
+++ src/usr.sbin/sdpd/server.c	Sat Apr 18 13:53:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: server.c,v 1.5 2009/01/15 23:17:00 plunky Exp $	*/
+/*	$NetBSD: server.c,v 1.6 2009/04/18 13:53:59 lukem Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -55,12 +55,12 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: server.c,v 1.5 2009/01/15 23:17:00 plunky Exp $
+ * $Id: server.c,v 1.6 2009/04/18 13:53:59 lukem Exp $
  * $FreeBSD: src/usr.sbin/bluetooth/sdpd/server.c,v 1.2 2005/12/06 17:56:36 emax Exp $
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: server.c,v 1.5 2009/01/15 23:17:00 plunky Exp $");
+__RCSID("$NetBSD: server.c,v 1.6 2009/04/18 13:53:59 lukem Exp $");
 
 #include <sys/param.h>
 #include <sys/select.h>
@@ -476,8 +476,8 @@
 	    	srv->fdidx[fd].priv =
 		    server_auth_check(srv, (struct sockcred *)CMSG_DATA(cmsg));
 
-	if (len >= sizeof(*pdu)
-	    && (sizeof(*pdu) + (pdu->len = ntohs(pdu->len))) == len) {
+	if ((uint32_t)len >= sizeof(*pdu)
+	    && (sizeof(*pdu) + (pdu->len = ntohs(pdu->len))) == (uint32_t)len) {
 		switch (pdu->pid) {
 		case SDP_PDU_SERVICE_SEARCH_REQUEST:
 			error = server_prepare_service_search_response(srv, fd);

Reply via email to