From 9c0b5859e6cc4b7a0e925fde8665990281b265d3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 29 Jan 2009 17:58:28 +0100 Subject: Fix mostly every warning caused by -Wsign-compare --- compat/bnep.c | 12 ++++++------ compat/hidd.c | 4 ++-- compat/msdun.c | 3 ++- compat/sdp.c | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) (limited to 'compat') diff --git a/compat/bnep.c b/compat/bnep.c index f8d2b291..e9742c7a 100644 --- a/compat/bnep.c +++ b/compat/bnep.c @@ -128,7 +128,7 @@ int bnep_show_connections(void) { struct bnep_connlist_req req; struct bnep_conninfo ci[48]; - int i; + unsigned int i; req.cnum = 48; req.ci = ci; @@ -137,7 +137,7 @@ int bnep_show_connections(void) return -1; } - for (i=0; i < req.cnum; i++) { + for (i = 0; i < req.cnum; i++) { printf("%s %s %s\n", ci[i].device, batostr((bdaddr_t *) ci[i].dst), bnep_svc2str(ci[i].role)); @@ -162,7 +162,7 @@ int bnep_kill_all_connections(void) { struct bnep_connlist_req req; struct bnep_conninfo ci[48]; - int i; + unsigned int i; req.cnum = 48; req.ci = ci; @@ -171,7 +171,7 @@ int bnep_kill_all_connections(void) return -1; } - for (i=0; i < req.cnum; i++) { + for (i = 0; i < req.cnum; i++) { struct bnep_conndel_req req; memcpy(req.dst, ci[i].dst, ETH_ALEN); req.flags = 0; @@ -227,7 +227,7 @@ int bnep_accept_connection(int sk, uint16_t role, char *dev) errno = EPROTO; - if (r < sizeof(*req)) + if (r < (int) sizeof(*req)) return -1; req = (void *) pkt; @@ -292,7 +292,7 @@ receive: errno = EPROTO; - if (r < sizeof(*rsp)) + if (r < (int) sizeof(*rsp)) return -1; rsp = (void *) pkt; diff --git a/compat/hidd.c b/compat/hidd.c index a6f67410..212c0926 100644 --- a/compat/hidd.c +++ b/compat/hidd.c @@ -425,7 +425,7 @@ static void do_show(int ctl) struct hidp_connlist_req req; struct hidp_conninfo ci[16]; char addr[18]; - int i; + unsigned int i; req.cnum = 16; req.ci = ci; @@ -598,7 +598,7 @@ static void do_kill(int ctl, bdaddr_t *bdaddr, uint32_t flags) struct hidp_conndel_req req; struct hidp_connlist_req cl; struct hidp_conninfo ci[16]; - int i; + unsigned int i; if (!bacmp(bdaddr, BDADDR_ALL)) { cl.cnum = 16; diff --git a/compat/msdun.c b/compat/msdun.c index fab4c586..1759ef66 100644 --- a/compat/msdun.c +++ b/compat/msdun.c @@ -56,7 +56,8 @@ static void sig_alarm(int sig) static int w4_str(int fd, char *str) { char buf[40]; - int r, len = 0; + unsigned len = 0; + int r; while (1) { r = read(fd, buf + len, sizeof(buf) - len - 1); diff --git a/compat/sdp.c b/compat/sdp.c index 941895d4..bb188f6a 100644 --- a/compat/sdp.c +++ b/compat/sdp.c @@ -71,7 +71,7 @@ static void epox_endian_quirk(unsigned char *data, int size) */ unsigned char pattern[] = { 0x05, 0x07, 0x19, 0x00, 0x2a, 0x00, 0xff, 0x15, 0x00, 0x26, 0x00, 0xff }; - int i; + unsigned int i; if (!data) return; -- cgit