aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rohc.c
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2011-12-13 19:46:24 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2011-12-13 19:46:24 +0000
commit70e2a50ad10f3c82cfb94578a58681e1445f5117 (patch)
tree5190d2172502e35ac9b0f68978330844546fabac /epan/dissectors/packet-rohc.c
parent9924dd3acf5dd983c86ad174e4fff157c61f6479 (diff)
Initialise 'sub_tree' to NULL, to avoid warnings about possibly using
uninitialised. The warnings are bogus, but could have been avoided, as the test to see if we're using a compression profile is redundant/will always be TRUE in those functions... Also removed some unnecessary braces from switch cases (no local variables were defined). svn path=/trunk/; revision=40181
Diffstat (limited to 'epan/dissectors/packet-rohc.c')
-rw-r--r--epan/dissectors/packet-rohc.c58
1 files changed, 28 insertions, 30 deletions
diff --git a/epan/dissectors/packet-rohc.c b/epan/dissectors/packet-rohc.c
index d919587059..23db012d52 100644
--- a/epan/dissectors/packet-rohc.c
+++ b/epan/dissectors/packet-rohc.c
@@ -352,7 +352,7 @@ static int
dissect_rohc_ir_rtp_profile_dynamic(tvbuff_t *tvb, proto_tree *tree, int offset, rohc_info *p_rohc_info){
proto_item *item, *root_ti;
- proto_tree *sub_tree, *dynamic_ipv4_tree, *dynamic_udp_tree, *dynamic_rtp_tree;
+ proto_tree *sub_tree=NULL, *dynamic_ipv4_tree, *dynamic_udp_tree, *dynamic_rtp_tree;
guint8 oct, rx, cc, val_len = 0;
int i, start_offset, tree_start_offset;
guint8 tos, ttl, rnd, nbo;
@@ -365,24 +365,23 @@ dissect_rohc_ir_rtp_profile_dynamic(tvbuff_t *tvb, proto_tree *tree, int offset,
guint64 ts_stride=0;
#endif
start_offset = offset;
- switch(p_rohc_info->profile){
-
- case ROHC_PROFILE_UNCOMPRESSED: {
+ switch(p_rohc_info->profile){
+
+ case ROHC_PROFILE_UNCOMPRESSED:
item = proto_tree_add_text(tree, tvb, offset, 0, "Profile 0x0000 Uncompressed");
- } break;
-
- case ROHC_PROFILE_RTP: {
+ break;
+
+ case ROHC_PROFILE_RTP:
item = proto_tree_add_text(tree, tvb, offset, 0, "Profile 0x0001 RTP Dynamic Chain");
- } break;
-
- case ROHC_PROFILE_UDP: {
+ break;
+
+ case ROHC_PROFILE_UDP:
item = proto_tree_add_text(tree, tvb, offset, 0, "Profile 0x0002 UDP Dynamic Chain");
- } break;
-
- default: {
+ break;
+
+ default:
item = proto_tree_add_text(tree, tvb, offset, 0, "Profile not supported");
- } return -1;
-
+ return -1;
}
/* IP dynamic*/
@@ -575,29 +574,28 @@ static int
dissect_rohc_ir_rtp_udp_profile_static(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset, gboolean d, rohc_info *p_rohc_info){
proto_item *item, *ipv4_item, *udp_item, *rtp_item;
- proto_tree *sub_tree, *static_ipv4_tree, *static_udp_tree, *static_rtp_tree;
+ proto_tree *sub_tree=NULL, *static_ipv4_tree, *static_udp_tree, *static_rtp_tree;
guint8 version;
int start_offset, tree_start_offset;
start_offset = offset;
- switch(p_rohc_info->profile){
-
- case ROHC_PROFILE_UNCOMPRESSED: {
+ switch(p_rohc_info->profile){
+
+ case ROHC_PROFILE_UNCOMPRESSED:
item = proto_tree_add_text(tree, tvb, offset, 0, "Profile 0x0000 Uncompressed");
- } break;
-
- case ROHC_PROFILE_RTP: {
+ break;
+
+ case ROHC_PROFILE_RTP:
item = proto_tree_add_text(tree, tvb, offset, 0, "Profile 0x0001 RTP Static Chain");
- } break;
-
- case ROHC_PROFILE_UDP: {
+ break;
+
+ case ROHC_PROFILE_UDP:
item = proto_tree_add_text(tree, tvb, offset, 0, "Profile 0x0002 UDP Static Chain");
- } break;
-
- default: {
+ break;
+
+ default:
item = proto_tree_add_text(tree, tvb, offset, 0, "Profile not supported");
- } return -1;
-
+ return -1;
}
/* IP static*/