Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
authorAlexis La Goutte <alexis.lagoutte@gmail.com>
Tue, 8 May 2012 17:42:36 +0000 (17:42 -0000)
committerAlexis La Goutte <alexis.lagoutte@gmail.com>
Tue, 8 May 2012 17:42:36 +0000 (17:42 -0000)
svn path=/trunk/; revision=42513

epan/dissectors/packet-erldp.c
epan/dissectors/packet-etch.c
epan/dissectors/packet-fcgi.c
epan/dissectors/packet-hdfs.c
epan/dissectors/packet-icep.c
epan/dissectors/packet-ifcp.c

index 62c916a71123bd2446c91f27f6d385d27e5677ed..c8da6c4d2939fa108e2108b835fab52c31b09ece 100644 (file)
@@ -422,13 +422,13 @@ static void dissect_erldp_handshake(tvbuff_t *tvb, packet_info *pinfo, proto_tre
       proto_tree_add_item(tree, hf_erldp_challenge, tvb, offset, 4, ENC_BIG_ENDIAN);
       offset += 4;
       proto_tree_add_item(tree, hf_erldp_digest, tvb, offset, 16, ENC_NA);
-      offset += 16;
+      /*offset += 16;*/
       col_add_str(pinfo->cinfo, COL_INFO, "SEND_CHALLENGE_REPLY");
       break;
 
     case 'a' :
       proto_tree_add_item(tree, hf_erldp_digest, tvb, offset, 16, ENC_NA);
-      offset += 16;
+      /*offset += 16;*/
       col_add_str(pinfo->cinfo, COL_INFO, "SEND_CHALLENGE_ACK");
       break;
 
@@ -487,7 +487,7 @@ static void dissect_erldp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
       }
       offset = dissect_etf_type("ControlMessage", pinfo, tvb, offset, erldp_tree);
       if (tvb_length_remaining(tvb, offset) > 0)
-        offset = dissect_etf_type("Message", pinfo, tvb, offset, erldp_tree);
+        dissect_etf_type("Message", pinfo, tvb, offset, erldp_tree);
       break;
 
     default:
index b6fbf1d017be1f773d90a3508bea150272cb779a..b1b679a59e89006bdebd4b2fcb0046aca85361d5 100644 (file)
@@ -397,7 +397,7 @@ read_array_type(unsigned int *offset, tvbuff_t *tvb, proto_tree *etch_tree)
 
   read_type(offset, tvb, etch_tree);
   if (type_code == ETCH_TC_CUSTOM) {
-    type_code = read_type(offset, tvb, etch_tree);
+    read_type(offset, tvb, etch_tree);
     proto_tree_add_item(etch_tree, hf_etch_value, tvb, *offset, 4,
                         ENC_BIG_ENDIAN);
     (*offset) += 4;
index 3be25b63dc2ffc84dd27d1d69a3c4183e95b9e2e..81415d35f3af5fd460e4901b8eb9c9e050fe3ca6 100644 (file)
@@ -141,7 +141,7 @@ dissect_nv_pairs(tvbuff_t *tvb, proto_tree *fcgi_tree, gint offset, guint16 len)
    }
 }
 
-static void
+static int
 dissect_begin_request(tvbuff_t *tvb, proto_tree *fcgi_tree, gint offset, guint16 len)
 {
    proto_item *br;
@@ -159,7 +159,7 @@ dissect_begin_request(tvbuff_t *tvb, proto_tree *fcgi_tree, gint offset, guint16
 
    offset += 5;
 
-   return;
+   return offset;
 }
 
 static void
@@ -170,7 +170,7 @@ dissect_abort_request(tvbuff_t *tvb, proto_tree *fcgi_tree, gint offset, guint16
    return;
 }
 
-static void
+static int
 dissect_end_request(tvbuff_t *tvb, proto_tree *fcgi_tree, gint offset, guint16 len)
 {
    proto_item *er;
@@ -187,7 +187,7 @@ dissect_end_request(tvbuff_t *tvb, proto_tree *fcgi_tree, gint offset, guint16 l
 
    offset += 3;
 
-   return;
+   return offset;
 }
 
 static void
@@ -318,7 +318,7 @@ dissect_fcgi_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
       if (plen > 0) {
          proto_tree_add_item(fcgi_tree, hf_fcgi_padding_data, tvb, offset, plen, ENC_NA);
-         offset += plen;
+         /*offset += plen;*/
       }
    }
 }
index 39a963510248fbbb401d9b64c6878180a67a21c3..3a7de7aade1a2abb52c386eae7e94247c868368b 100644 (file)
@@ -232,7 +232,7 @@ dissect_data (tvbuff_t *tvb, proto_tree *hdfs_tree, guint offset) {
 response to a get protocol version message
 contains a type length, type name and the value
 */
-static void
+static int
 dissect_resp_long (tvbuff_t *tvb, proto_tree *hdfs_tree, int offset) {
     /* get length that we just dissected */
     int length = tvb_get_ntohs(tvb, offset);
@@ -247,13 +247,15 @@ dissect_resp_long (tvbuff_t *tvb, proto_tree *hdfs_tree, int offset) {
 
     /* the value */
     proto_tree_add_item(hdfs_tree, hf_hdfs_prover, tvb, offset, 8, ENC_BIG_ENDIAN);
-        offset += 8;
+    offset += 8;
+
+    return offset;
 }
 
 /*
 Response to a file status message
 */
-static void
+static int
 dissect_resp_filestatus (tvbuff_t *tvb, proto_tree *hdfs_tree, int offset) {
 
     int length;
@@ -324,6 +326,8 @@ dissect_resp_filestatus (tvbuff_t *tvb, proto_tree *hdfs_tree, int offset) {
     /* group name */
     proto_tree_add_item(hdfs_tree, hf_hdfs_groupname, tvb, offset, length, ENC_ASCII|ENC_NA);
     offset += length;
+
+    return offset;
 }
 
 
@@ -598,7 +602,7 @@ dissect_hdfs_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
                     /* the value of the parameter */
                     proto_tree_add_item(hdfs_tree, hf_hdfs_paramval, tvb, offset, length, ENC_ASCII|ENC_NA);
-                    offset += length;
+                    /*offset += length;*/
                 }
             }
 
@@ -618,7 +622,7 @@ dissect_hdfs_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                 offset += 1;
 
                 proto_tree_add_item(hdfs_tree, hf_hdfs_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
-                offset += 1;
+                /*offset += 1;*/
 
             } else {
                 /* second authentication packet */
index 8a8b484190e53234cf69ea090c4008bdbb78182b..09ad262800ff6e234a2d42e1ecc79ab00412bb13 100644 (file)
@@ -331,7 +331,7 @@ static void dissect_ice_facet(proto_tree *tree, int hf_icep,
                        return;
                }
 
-               offset += consumed_facet;
+               /*offset += consumed_facet;*/
                (*consumed) += consumed_facet;
                return;
        }
index dcdc14d07b4b2e004ef0e572478d300edf4afb5a..91c9e7a73edafbae85cbf0083d07d56d3e1fd61f 100644 (file)
@@ -276,7 +276,6 @@ dissect_ifcpflags(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
        if(flags&IFCP_FLAGS_SPC){
                proto_item_append_text(item, "  SPC");
        }
-       flags&=(~IFCP_FLAGS_SPC);
 
 
        offset++;
@@ -310,7 +309,6 @@ dissect_commonflags(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
        if(flags&IFCP_COMMON_FLAGS_CRCV){
                proto_item_append_text(item, "  CRCV");
        }
-       flags&=(~IFCP_COMMON_FLAGS_CRCV);
 }
 
 static void