aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-05-09 23:08:47 +0000
committerGerald Combs <gerald@wireshark.org>2012-05-09 23:08:47 +0000
commit4d30e72575cbf63b84918309985513f71dff224c (patch)
tree89b52a82a0db49c120dbd94d1fcb4f9bc0f800ff /plugins
parent843f041270df6ea7601670d847b722a25c891e49 (diff)
Fix a few scan-build warnings.
svn path=/trunk/; revision=42528
Diffstat (limited to 'plugins')
-rw-r--r--plugins/wimax/mac_hd_generic_decoder.c12
-rw-r--r--plugins/wimax/msg_dlmap.c13
-rw-r--r--plugins/wimax/msg_ulmap.c2
-rw-r--r--plugins/wimax/wimax_compact_dlmap_ie_decoder.c1
-rw-r--r--plugins/wimax/wimax_compact_ulmap_ie_decoder.c1
5 files changed, 12 insertions, 17 deletions
diff --git a/plugins/wimax/mac_hd_generic_decoder.c b/plugins/wimax/mac_hd_generic_decoder.c
index eb04e85689..478d2e28b2 100644
--- a/plugins/wimax/mac_hd_generic_decoder.c
+++ b/plugins/wimax/mac_hd_generic_decoder.c
@@ -86,7 +86,9 @@ guint cid_broadcast = 0xFFFF;
/* forward reference */
static gint extended_subheader_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+#ifdef DEBUG /* for debug only */
static gint arq_feedback_payload_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *parent_item);
+#endif
/* Static variables */
static GHashTable *payload_frag_table = NULL;
@@ -631,7 +633,7 @@ void wimax_defragment_init(void)
init_wimax_globals();
}
-static guint decode_packing_subheader(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree *tree, guint payload_length, guint payload_offset, proto_item *parent_item)
+static guint decode_packing_subheader(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree *tree, guint payload_length _U_, guint payload_offset, proto_item *parent_item)
{
proto_item *generic_item = NULL;
proto_tree *generic_tree = NULL;
@@ -658,7 +660,6 @@ static guint decode_packing_subheader(tvbuff_t *payload_tvb, packet_info *pinfo,
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_bsn, payload_tvb, payload_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_len_ext, payload_tvb, payload_offset, 3, ENC_BIG_ENDIAN);
/* update the length and offset */
- payload_length -= 3;
payload_offset += 3;
frag_len -= 3;
}
@@ -673,7 +674,6 @@ static guint decode_packing_subheader(tvbuff_t *payload_tvb, packet_info *pinfo,
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_fsn_ext, payload_tvb, payload_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_len_ext, payload_tvb, payload_offset, 3, ENC_BIG_ENDIAN);
/* update the length and offset */
- payload_length -= 3;
payload_offset += 3;
frag_len -= 3;
}
@@ -686,7 +686,6 @@ static guint decode_packing_subheader(tvbuff_t *payload_tvb, packet_info *pinfo,
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_fsn, payload_tvb, payload_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_len, payload_tvb, payload_offset, 2, ENC_BIG_ENDIAN);
/* update the length and offset */
- payload_length -= 2;
payload_offset += 2;
frag_len -= 2;
}
@@ -1133,8 +1132,8 @@ void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto
if (first_arq_fb_payload && arq_fb_payload)
{ /* decode and display the ARQ feedback payload */
first_arq_fb_payload = FALSE;
- ret_length = arq_feedback_payload_decoder(tvb_new_subset(payload_tvb, payload_offset, new_payload_len, new_payload_len), pinfo, generic_tree, parent_item);
#ifdef DEBUG /* for debug only */
+ ret_length = arq_feedback_payload_decoder(tvb_new_subset(payload_tvb, payload_offset, new_payload_len, new_payload_len), pinfo, generic_tree, parent_item);
if (ret_length != new_payload_len)
{ /* error */
/* update the info column */
@@ -1209,7 +1208,6 @@ void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto
}
}
payload_length -= new_payload_len;
- payload_offset += new_payload_len;
} /* end of while loop */
} /* end of payload processing */
length -= frag_len;
@@ -1377,6 +1375,7 @@ static gint extended_subheader_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_
return ext_length;
}
+#ifdef DEBUG /* for debug only */
static gint arq_feedback_payload_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *parent_item)
{
gint length, i;
@@ -1479,6 +1478,7 @@ static gint arq_feedback_payload_decoder(tvbuff_t *tvb, packet_info *pinfo, prot
/* return the offset */
return offset;
}
+#endif /* DEBUG */
/* Register Wimax Generic Mac Header Protocol and Dissector */
void proto_register_mac_header_generic(void)
diff --git a/plugins/wimax/msg_dlmap.c b/plugins/wimax/msg_dlmap.c
index 5ab46c6c75..f33ae6c432 100644
--- a/plugins/wimax/msg_dlmap.c
+++ b/plugins/wimax/msg_dlmap.c
@@ -430,7 +430,6 @@ gint Dedicated_MIMO_DL_Control_IE(proto_tree *diuc_tree, const guint8 *bufptr, g
/* CQICH Control Info */
if (cqi == 1) {
- CQICH_num = 0;
XBIT(data, 3, "Period");
XBIT(data, 3, "Frame Offset");
XBIT(data, 4, "Duration");
@@ -1194,7 +1193,7 @@ gint HARQ_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gi
proto_tree_add_text(tree, tvb, BITHI(bit,pad), "Padding: %d bits",pad);
bit += pad;
}
-
+
return BIT_TO_NIB(bit);
}
@@ -1994,7 +1993,6 @@ gint dissect_dlmap_ie(proto_tree *ie_tree, const guint8 *bufptr, gint offset, gi
{
/* Downlink IE */
alt_format = 0;
- data = 0;
/*papr = 0; XX: not used ? */
ie_len = 9;
@@ -2106,7 +2104,7 @@ void dissect_mac_mgmt_msg_dlmap_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, p
ti = proto_tree_add_text(dlmap_tree, tvb, offset, length, "DL-MAP IEs (%d bytes)", length);
ie_tree = proto_item_add_subtree(ti, ett_dlmap_ie);
- length = BYTE_TO_NIB(length); /* convert length to nibbles */
+ /* length = BYTE_TO_NIB(length); */ /* convert length to nibbles */
nib = BYTE_TO_NIB(offset);
while (nib < ((tvb_len*2)-1)) {
@@ -2184,7 +2182,7 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre
ti_dlmap_ies = proto_tree_add_text(tree, tvb, offset, length, "DL-MAP IEs (%d bytes)", length);
ie_tree = proto_item_add_subtree(ti_dlmap_ies, ett_dlmap_ie);
- length = BYTE_TO_NIB(mac_len - sizeof(mac_crc) - 1); /* convert length to nibbles */
+ /* length = BYTE_TO_NIB(mac_len - sizeof(mac_crc) - 1); */ /* convert length to nibbles */
while (dl_ie_count--) {
nib += dissect_dlmap_ie(ie_tree, bufptr, nib, tvb_len * 2, tvb);
@@ -2209,7 +2207,7 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compressed UL-MAP");
/* subtract 8 from lennib (CRC) */
- nib += wimax_decode_ulmapc(base_tree, bufptr, nib, lennib - 8, tvb);
+ /* nib += wimax_decode_ulmapc(base_tree, bufptr, nib, lennib - 8, tvb); */
}
/* CRC is always appended */
@@ -2321,8 +2319,7 @@ gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
{
proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
}
- nib += 4;
-
+ /* nib += 4; */
sub_dl_ul_map = 0; /* clear flag */
/* return length */
diff --git a/plugins/wimax/msg_ulmap.c b/plugins/wimax/msg_ulmap.c
index 1bf6e40df5..40850c4fef 100644
--- a/plugins/wimax/msg_ulmap.c
+++ b/plugins/wimax/msg_ulmap.c
@@ -1934,7 +1934,7 @@ void dissect_mac_mgmt_msg_ulmap_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, p
ti = proto_tree_add_text(ulmap_tree, tvb, offset, length, "UL-MAP IEs (%u bytes)", length);
ie_tree = proto_item_add_subtree(ti, ett_ulmap_ie);
- length = BYTE_TO_NIB(length); /* convert length to nibbles */
+ /* length = BYTE_TO_NIB(length); */ /* convert length to nibbles */
nib = BYTE_TO_NIB(offset);
while (nib < ((tvb_len*2)-1)) {
nib += dissect_ulmap_ie(ie_tree, bufptr, nib, tvb_len*2, tvb);
diff --git a/plugins/wimax/wimax_compact_dlmap_ie_decoder.c b/plugins/wimax/wimax_compact_dlmap_ie_decoder.c
index fbf1fa66dc..f3e74897e6 100644
--- a/plugins/wimax/wimax_compact_dlmap_ie_decoder.c
+++ b/plugins/wimax/wimax_compact_dlmap_ie_decoder.c
@@ -630,7 +630,6 @@ guint wimax_compact_dlmap_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuf
}
else
{
- nband = 0;
band_count = 1;
/* display the Nb-BITMAP */
if(nibble_offset & 1)
diff --git a/plugins/wimax/wimax_compact_ulmap_ie_decoder.c b/plugins/wimax/wimax_compact_ulmap_ie_decoder.c
index d03c55d668..7dc35dbed9 100644
--- a/plugins/wimax/wimax_compact_ulmap_ie_decoder.c
+++ b/plugins/wimax/wimax_compact_ulmap_ie_decoder.c
@@ -584,7 +584,6 @@ guint wimax_compact_ulmap_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuf
}
else
{
- nband = 0;
band_count = 1;
/* display the Nb-BITMAP */
if(nibble_offset & 1)