aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/wimax/mac_hd_generic_decoder.c
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/wimax/mac_hd_generic_decoder.c
parent843f041270df6ea7601670d847b722a25c891e49 (diff)
Fix a few scan-build warnings.
svn path=/trunk/; revision=42528
Diffstat (limited to 'plugins/wimax/mac_hd_generic_decoder.c')
-rw-r--r--plugins/wimax/mac_hd_generic_decoder.c12
1 files changed, 6 insertions, 6 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)