diff --git a/tools/hcidump.c b/tools/hcidump.c
index a14a784..8e5f663 100644
--- a/tools/hcidump.c
+++ b/tools/hcidump.c
struct addrinfo *ai, *runp;
struct addrinfo hints;
struct pollfd fds[3];
- int err, opt, datagram, nfds = 0;
+ unsigned int nfds = 0;
+ int err, opt, datagram;
memset(&hints, 0, sizeof (hints));
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
freeaddrinfo(ai);
while (1) {
- int i, n = poll(fds, nfds, -1);
+ unsigned int i;
+ int n = poll(fds, nfds, -1);
if (n <= 0)
continue;
printf("client: %s:%s snap_len: %d filter: 0x%lx\n",
hname, hport, snap_len, parser.filter);
- for (n = 0; n < nfds; n++)
+ for (n = 0; n < (int) nfds; n++)
close(fds[n].fd);
return sk;
diff --git a/tools/parser/csr.c b/tools/parser/csr.c
index 6cce85b..89ea882 100644
--- a/tools/parser/csr.c
+++ b/tools/parser/csr.c
static inline void commands_dump(int level, char *str, struct frame *frm)
{
unsigned char commands[64];
- int i;
+ unsigned int i;
memcpy(commands, frm->ptr, frm->len);
diff --git a/tools/parser/l2cap.c b/tools/parser/l2cap.c
index a906f42..2153719 100644
--- a/tools/parser/l2cap.c
+++ b/tools/parser/l2cap.c
hdr = frm->ptr;
dlen = btohs(hdr->len);
- if (frm->len == (dlen + L2CAP_HDR_SIZE)) {
+ if ((int) frm->len == (dlen + L2CAP_HDR_SIZE)) {
/* Complete frame */
l2cap_parse(level, frm);
return;
diff --git a/tools/parser/obex.c b/tools/parser/obex.c
index 0f68443..97ce2af 100644
--- a/tools/parser/obex.c
+++ b/tools/parser/obex.c
length = get_u16(frm);
status = opcode & 0x7f;
- if (frm->len < length - 3) {
+ if ((int) frm->len < length - 3) {
frm->ptr -= 3;
frm->len += 3;
return;
diff --git a/tools/parser/parser.c b/tools/parser/parser.c
index e50590e..2df2bf9 100644
--- a/tools/parser/parser.c
+++ b/tools/parser/parser.c
unsigned char *buf = frm->ptr;
register int i, n;
- if ((num < 0) || (num > frm->len))
+ if ((num < 0) || (num > (int) frm->len))
num = frm->len;
for (i = 0, n = 1; i < num; i++, n++) {
unsigned char *buf = frm->ptr;
register int i, n;
- if ((num < 0) || (num > frm->len))
+ if ((num < 0) || (num > (int) frm->len))
num = frm->len;
for (i = 0, n = 1; i < num; i++, n++) {
unsigned char *buf = frm->ptr;
register int i, n = 0, size;
- if ((num < 0) || (num > frm->len))
+ if ((num < 0) || (num > (int) frm->len))
num = frm->len;
while (num > 0) {
diff --git a/tools/parser/ppp.c b/tools/parser/ppp.c
index 6ef24e9..530a4b9 100644
--- a/tools/parser/ppp.c
+++ b/tools/parser/ppp.c
static inline int check_for_ppp_traffic(unsigned char *data, int size)
{
- int i;
+ unsigned int i;
for (i = 0; i < size - sizeof(ppp_magic1); i++)
if (!memcmp(data + i, ppp_magic1, sizeof(ppp_magic1))) {
diff --git a/tools/parser/rfcomm.c b/tools/parser/rfcomm.c
index b85df91..7c66049 100644
--- a/tools/parser/rfcomm.c
+++ b/tools/parser/rfcomm.c
print_mcc(mcc_head);
}
-static inline void mcc_msc(int level, uint8_t *ptr, int len,
+static inline void mcc_msc(int level, uint8_t *ptr, unsigned int len,
long_frame_head *head, mcc_long_frame_head *mcc_head)
{
msc_msg *msc = (void*) (ptr - STRUCT_END(msc_msg, mcc_s_head));
printf("\n");
}
-static inline void mcc_rpn(int level, uint8_t *ptr, int len,
+static inline void mcc_rpn(int level, uint8_t *ptr, unsigned int len,
long_frame_head *head, mcc_long_frame_head *mcc_head)
{
rpn_msg *rpn = (void *) (ptr - STRUCT_END(rpn_msg, mcc_s_head));
diff --git a/tools/parser/sdp.c b/tools/parser/sdp.c
index f0ffea3..7ccf07b 100644
--- a/tools/parser/sdp.c
+++ b/tools/parser/sdp.c
char* get_uuid_name(int uuid)
{
- int i;
+ unsigned int i;
for (i = 0; i < SDP_UUID_NAM_LOOKUP_TABLE_SIZE; i++) {
if (sdp_uuid_nam_lookup_table[i].uuid == uuid)
static inline char* get_attr_id_name(int attr_id)
{
- int i;
+ unsigned int i;
for (i = 0; i < SDP_ATTR_ID_NAM_LOOKUP_TABLE_SIZE; i++)
if (sdp_attr_id_nam_lookup_table[i].attr_id == attr_id)
static inline void print_des(uint8_t de_type, int level, int n, struct frame *frm, int *split, uint16_t *psm, uint8_t *channel)
{
int len = frm->len;
- while (len - frm->len < n && frm->len > 0)
+ while (len - (int) frm->len < n && (int) frm->len > 0)
print_de(level, frm, split, psm, channel);
}
if (parse_de_hdr(frm, &n1) == SDP_DE_SEQ) {
len = frm->len;
- while (len - frm->len < n1 && frm->len > 0) {
+ while (len - (int) frm->len < n1 && (int) frm->len > 0) {
if (parse_de_hdr(frm, &n2) == SDP_DE_UUID) {
print_uuid(n2, frm, NULL, NULL);
} else {
if (parse_de_hdr(frm, &n1) == SDP_DE_SEQ) {
len = frm->len;
- while (len - frm->len < n1 && frm->len > 0) {
+ while (len - (int) frm->len < n1 && (int) frm->len > 0) {
/* Print AttributeID */
if (parse_de_hdr(frm, &n2) == SDP_DE_UINT) {
char *name;
if (parse_de_hdr(frm, &n1) == SDP_DE_SEQ) {
len = frm->len;
- while (len - frm->len < n1 && frm->len > 0) {
+ while (len - (int) frm->len < n1 && (int) frm->len > 0) {
/* Print AttributeID */
if (parse_de_hdr(frm, &n2) == SDP_DE_UINT && n2 == sizeof(attr_id)) {
char *name;
int count = frm->len;
if (parse_de_hdr(frm, &n) == SDP_DE_SEQ) {
- while (count - frm->len < n && frm->len > 0) {
+ while (count - (int) frm->len < n && (int) frm->len > 0) {
p_indent(level, 0);
printf("record #%d\n", cnt++);
print_attr_list(level + 2, frm);