Fix the dead initialization warnings found by clang's static analysis
authorStephen Fisher <steve@stephen-fisher.com>
Thu, 20 Jan 2011 18:56:11 +0000 (18:56 -0000)
committerStephen Fisher <steve@stephen-fisher.com>
Thu, 20 Jan 2011 18:56:11 +0000 (18:56 -0000)
("Value stored to 'xxx' during its initialization is never read")

svn path=/trunk/; revision=35598

epan/dissectors/packet-assa_r3.c
epan/dissectors/packet-bacapp.c
epan/dissectors/packet-gtp.c
epan/dissectors/packet-rtcp.c
epan/tvbuff.c
wiretap/pcap-common.c

index 12797dc7897f76e9ceefaed4051f7f1cabdc6ac1..9b0faac01c2397a8465dbba482f444509c1864a2 100644 (file)
@@ -5497,8 +5497,8 @@ static gint dissect_r3_command (tvbuff_t *tvb, guint32 start_offset, guint32 len
     proto_item *cmd_item = NULL;
     proto_tree *cmd_tree = NULL;
     const gchar *cn = NULL;
-    guint8 cmdLen = tvb_get_guint8 (tvb, start_offset + 0);
-    guint8 cmd = tvb_get_guint8 (tvb, start_offset + 1);
+    guint8 cmdLen;
+    guint8 cmd;
 
     tvb_ensure_bytes_exist (tvb, start_offset, 2);
 
index c2b9f0511907b3dcdbf9a52a89d9f18a5bd3d46a..fdcbfde193cc4b2082fa6c293a727910ad12dddf 100644 (file)
@@ -8905,7 +8905,7 @@ static void
 dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
        guint8 flag, bacapp_type;
-       guint save_fragmented = FALSE, data_offset = 0, bacapp_apdu_size = fGetMaxAPDUSize(0), fragment = FALSE;
+       guint save_fragmented = FALSE, data_offset = 0, bacapp_apdu_size, fragment = FALSE;
        tvbuff_t* new_tvb = NULL;
        guint offset = 0;
        guint8 bacapp_seqno = 0;
index 1c0d2e84d50b59c3e20740466ae2260bfae1b28a..b63a293f9168db8964a32c1e448fbcc728549e64 100644 (file)
@@ -6444,7 +6444,7 @@ static void dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
     guint8 sub_proto, acfield_len = 0, control_field;
     gtp_msg_hash_t *gcrp=NULL;
     conversation_t *conversation=NULL;
-    gtp_conv_info_t *gtp_info=(gtp_conv_info_t *)pinfo->private_data;
+    gtp_conv_info_t *gtp_info;
     void* pd_save;
 
 
index a0815a47158669dc43aacfffd6f4654adda5b72a..757beb88ea4eaa4e3f4ad3f05ad7efc34fca1134 100644 (file)
@@ -2618,7 +2618,7 @@ static void add_roundtrip_delay_info(tvbuff_t *tvb, packet_info *pinfo, proto_tr
 static int
 rtcp_packet_type_to_tree( int rtcp_packet_type)
 {
-    int tree = ett_rtcp;
+    int tree;
 
     switch(rtcp_packet_type) {
     case RTCP_SR: tree = ett_rtcp_sr; break;
index edb095a8d85c23bcd46a9770b508137006ea36f0..8aa1e7b503d2d64f35d6f1fdc8a8ec7b670b60cf 100644 (file)
@@ -3031,7 +3031,7 @@ tvb_find_line_end_unquoted(tvbuff_t *tvb, const gint offset, int len,
 gint tvb_skip_wsp(tvbuff_t* tvb, const gint offset, const gint maxlength)
 {
        gint counter = offset;
-       gint end = offset + maxlength,tvb_len;
+       gint endtvb_len;
        guint8 tempchar;
 
        /* Get the length remaining */
index 278107a1a04f63eb2fcba1642d2a19c51d06a3f0..7867618df63805bf79848f97ca09c65890003501 100644 (file)
@@ -1258,7 +1258,7 @@ pcap_read_erf_exheader(FILE_T fh, union wtap_pseudo_header *pseudo_header,
   guint8 erf_exhdr[8];
   guint64 erf_exhdr_sw;
   int i = 0, max = sizeof(pseudo_header->erf.ehdr_list)/sizeof(struct erf_ehdr);
-  guint8 type = pseudo_header->erf.phdr.type;
+  guint8 type;
   *psize = 0;
   if (pseudo_header->erf.phdr.type & 0x80){
     do{