aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2011-06-08 17:47:39 +0900
committerJohan Hedberg <johan.hedberg@intel.com>2011-06-08 17:47:39 +0900
commitf0a2c8e576fc7720a20d200155ca46ba1b8246c5 (patch)
treebf412c862310dd5798471eb3fd4d7e774cb20e6f
parent0afa37a9926bd0f383bbec23b5932a3621df2932 (diff)
downloadbluez-hcidump-f0a2c8e576fc7720a20d200155ca46ba1b8246c5.tar.gz
bluez-hcidump-f0a2c8e576fc7720a20d200155ca46ba1b8246c5.tar.xz
bluez-hcidump-f0a2c8e576fc7720a20d200155ca46ba1b8246c5.zip
Fix gcc 4.6 compiler warnings
-rw-r--r--parser/avdtp.c5
-rw-r--r--parser/bpa.c4
-rw-r--r--parser/capi.c3
-rw-r--r--parser/hci.c5
-rw-r--r--parser/ppp.c11
-rw-r--r--parser/rfcomm.c3
6 files changed, 22 insertions, 9 deletions
diff --git a/parser/avdtp.c b/parser/avdtp.c
index 2dd2477..6836058 100644
--- a/parser/avdtp.c
+++ b/parser/avdtp.c
@@ -459,8 +459,9 @@ void avdtp_dump(int level, struct frame *frm)
nsp = (hdr & 0x0c) == 0x04 ? get_u8(frm) : 0;
sid = hdr & 0x08 ? 0x00 : get_u8(frm);
- printf("AVDTP(s): %s %s: transaction %d\n",
- hdr & 0x08 ? pt2str(hdr) : si2str(sid), mt2str(hdr), hdr >> 4);
+ printf("AVDTP(s): %s %s: transaction %d nsp 0x%02x\n",
+ hdr & 0x08 ? pt2str(hdr) : si2str(sid),
+ mt2str(hdr), hdr >> 4, nsp);
switch (sid & 0x7f) {
case 0x01:
diff --git a/parser/bpa.c b/parser/bpa.c
index 291d4ca..016f1bd 100644
--- a/parser/bpa.c
+++ b/parser/bpa.c
@@ -58,8 +58,8 @@ void bpa_dump(int level, struct frame *frm)
channel = get_u8(frm);
p_indent(level, frm);
- printf("BPA: id %d num %d status 0x%02x time %d channel %d\n",
- id, num, status, time, channel);
+ printf("BPA: id %d num %d len %u status 0x%02x time %d channel %d\n",
+ id, num, len, status, time, channel);
raw_dump(level, frm);
}
diff --git a/parser/capi.c b/parser/capi.c
index 788f4bd..f8cba3e 100644
--- a/parser/capi.c
+++ b/parser/capi.c
@@ -693,7 +693,6 @@ static void cmd_disconnect_b3(int level, uint8_t subcmd, struct frame *frm)
static void cmd_data_b3(int level, uint8_t subcmd, struct frame *frm)
{
uint32_t data;
- uint64_t data64;
uint16_t length, handle, flags, info;
cmd_common(level, 0x00, frm);
@@ -724,7 +723,7 @@ static void cmd_data_b3(int level, uint8_t subcmd, struct frame *frm)
printf("Flags: 0x%04x\n", flags);
if (data == 0)
- data64 = get_u64(frm);
+ (void) get_u64(frm);
raw_dump(level, frm);
}
diff --git a/parser/hci.c b/parser/hci.c
index e4a3633..b85cc14 100644
--- a/parser/hci.c
+++ b/parser/hci.c
@@ -3958,8 +3958,11 @@ static inline void sco_dump(int level, struct frame *frm)
uint8_t flags = acl_flags(handle);
int len;
- if (frm->audio_fd > fileno(stderr))
+ if (frm->audio_fd > fileno(stderr)) {
len = write(frm->audio_fd, frm->ptr + HCI_SCO_HDR_SIZE, hdr->dlen);
+ if (len < 0)
+ return;
+ }
if (!p_filter(FILT_SCO)) {
p_indent(level, frm);
diff --git a/parser/ppp.c b/parser/ppp.c
index 875e5df..99165c4 100644
--- a/parser/ppp.c
+++ b/parser/ppp.c
@@ -176,12 +176,23 @@ void ppp_dump(int level, struct frame *frm)
id = 0x07;
err = write(frm->pppdump_fd, &id, 1);
+ if (err < 0)
+ return;
+
err = write(frm->pppdump_fd, &ts, 4);
+ if (err < 0)
+ return;
id = frm->in ? 0x02 : 0x01;
err = write(frm->pppdump_fd, &id, 1);
+ if (err < 0)
+ return;
err = write(frm->pppdump_fd, &len, 2);
+ if (err < 0)
+ return;
err = write(frm->pppdump_fd, frm->ptr, frm->len);
+ if (err < 0)
+ return;
}
if (!ppp_traffic) {
diff --git a/parser/rfcomm.c b/parser/rfcomm.c
index c2a278d..25e7ae1 100644
--- a/parser/rfcomm.c
+++ b/parser/rfcomm.c
@@ -55,11 +55,10 @@ static void print_rfcomm_hdr(long_frame_head* head, uint8_t *ptr, int len)
address_field addr = head->addr;
uint8_t ctr = head->control;
uint16_t ilen = head->length.bits.len;
- uint8_t ctr_type,pf,dlci,fcs;
+ uint8_t pf, dlci, fcs;
dlci = GET_DLCI(addr);
pf = GET_PF(ctr);
- ctr_type = CLR_PF(ctr);
fcs = *(ptr + len - 1);
printf("cr %d dlci %d pf %d ilen %d fcs 0x%x ", addr.cr, dlci, pf, ilen, fcs);