Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
authoralagoutte <alagoutte@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 21 Apr 2011 15:56:43 +0000 (15:56 +0000)
committeralagoutte <alagoutte@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 21 Apr 2011 15:56:43 +0000 (15:56 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36769 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-agentx.c
epan/dissectors/packet-l2tp.c

index 5deab7580f6c1ef586f38e3d3ef57b0cdeb6bfb6..68b68c533131a57b207be418170b43f278af6218 100644 (file)
@@ -342,7 +342,7 @@ dissect_object_id(tvbuff_t *tvb, proto_tree *tree, int offset, char flags, enum
        proto_tree* subtree;
        guint32 oid[2048];
        char str_oid[2048];
-       int i, slen;
+       int i;
 
        memset(oid, '\0', sizeof(oid));
        memset(str_oid, '\0', sizeof(str_oid));
@@ -357,7 +357,7 @@ dissect_object_id(tvbuff_t *tvb, proto_tree *tree, int offset, char flags, enum
        }
 
        if(!convert_oid_to_str(&oid[0], n_subid, &str_oid[0], 2048, prefix))
-               slen = g_snprintf(&str_oid[0], 2048, "(null)");
+               g_snprintf(&str_oid[0], 2048, "(null)");
 
        if(tree) {
                char *range = "";
@@ -551,7 +551,7 @@ dissect_getbulk_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char f
        }
 }
 
-static void
+static int
 dissect_open_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char flags)
 {
        proto_item* item;
@@ -572,9 +572,10 @@ dissect_open_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char flag
 
        /* Octet string */
        offset += dissect_octet_string(tvb, subtree, offset, flags);
+       return offset;
 }
 
-static void
+static int
 dissect_close_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len)
 {
        proto_item* item;
@@ -589,10 +590,11 @@ dissect_close_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len)
 
        proto_tree_add_uint(subtree, hf_close_reason, tvb, offset, 1, reason);
        offset+=4;
+       return offset;
 }
 
 
-static void
+static int
 dissect_register_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char flags)
 {
 
@@ -623,10 +625,11 @@ dissect_register_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char
                proto_tree_add_item(subtree, hf_reg_ubound, tvb, offset, 4, little_endian);
                offset += 4;
        }
+       return offset;
 }
 
 
-static void
+static int
 dissect_unregister_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char flags)
 {
        proto_item* item;
@@ -655,6 +658,8 @@ dissect_unregister_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, cha
                proto_tree_add_item(subtree, hf_unreg_ubound, tvb, offset, 4, little_endian);
                offset += 4;
        }
+
+       return offset;
 }
 
 static void
@@ -695,7 +700,7 @@ dissect_notify_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char fl
        }
 }
 
-static void
+static int
 dissect_ping_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char flags)
 {
        proto_item* item;
@@ -708,6 +713,7 @@ dissect_ping_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char flag
                /* show context */
                offset += dissect_octet_string(tvb, subtree, offset, flags);
        }
+       return offset;
 }
 
 static void
@@ -749,7 +755,7 @@ dissect_idx_dealloc_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, ch
        }
 }
 
-static void
+static int
 dissect_add_caps_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char flags)
 {
        proto_item* item;
@@ -766,9 +772,11 @@ dissect_add_caps_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char
        offset += dissect_object_id(tvb, subtree, offset, flags, OID_EXACT);
 
        offset += dissect_octet_string(tvb, subtree, offset, flags);
+
+       return offset;
 }
 
-static void
+static int
 dissect_rem_caps_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char flags)
 {
        proto_item* item;
@@ -783,6 +791,8 @@ dissect_rem_caps_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, char
        }
 
        offset += dissect_object_id(tvb, subtree, offset, flags, OID_EXACT);
+
+       return offset;
 }
 
 
index 9d7beccf64d9a5272789fe4019cab8d7b07d6e87..e56d91ef3980cbeee132592252140372de9c8638 100644 (file)
@@ -669,10 +669,7 @@ static void process_control_avps(tvbuff_t *tvb,
                                proto_tree_add_item(l2tp_avp_tree, hf_l2tp_avp_vendor_id,
                                                                        tvb, idx, 4, FALSE);
 
-                               avp_vendor_id  = tvb_get_ntohl(tvb, idx);
-
                                idx += 4;
-                               avp_len -= 4;
                                continue;
                        }
                        else {
@@ -1565,7 +1562,7 @@ process_l2tpv3_data_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                l2tp_tree = proto_item_add_subtree(l2tp_item, ett_l2tp);
                proto_item_append_text(l2tp_item, " version 3");
 
-               ti = proto_tree_add_text(l2tp_tree, tvb, 0, 4,
+               proto_tree_add_text(l2tp_tree, tvb, 0, 4,
                                         "Packet Type: %s Session Id=%u",
                                         data_msg, sid);
        }
@@ -1624,7 +1621,6 @@ process_l2tpv3_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
                        if (avp_type == CONTROL_MESSAGE) {
                                /* We print message type */
                                msg_type = tvb_get_ntohs(tvb, tmp_idx);
-                               tmp_idx += 2;
                                col_add_fstr(pinfo->cinfo, COL_INFO,
                                             "%s - %s (tunnel id=%u)",
                                             control_msg ,