Fix a few scan-build warnings.

svn path=/trunk/; revision=42528
This commit is contained in:
Gerald Combs 2012-05-09 23:08:47 +00:00
parent 843f041270
commit 4d30e72575
5 changed files with 12 additions and 17 deletions

View File

@ -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)

View File

@ -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 */

View File

@ -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);

View File

@ -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)

View File

@ -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)