From cb2000b9f311aef69fe1f701c7fbae92011b3663 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Mon, 4 Jun 2012 22:24:46 +0000 Subject: [PATCH] Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang svn path=/trunk/; revision=43087 --- epan/dissectors/packet-memcache.c | 15 ++------------- epan/dissectors/packet-mq.c | 3 --- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/epan/dissectors/packet-memcache.c b/epan/dissectors/packet-memcache.c index 10becaf900..9a11c33d69 100644 --- a/epan/dissectors/packet-memcache.c +++ b/epan/dissectors/packet-memcache.c @@ -595,10 +595,10 @@ dissect_memcache (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += key_len; dissect_value (tvb, pinfo, memcache_tree, offset, value_len, opcode, request); - offset += value_len; + /*offset += value_len;*/ } else if (body_len) { proto_tree_add_item (memcache_tree, hf_value, tvb, offset, body_len, ENC_ASCII|ENC_NA); - offset += body_len; + /*offset += body_len;*/ col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)", val_to_str (status, status_vals, "Unknown status: %d")); @@ -1031,8 +1031,6 @@ incr_dissector (tvbuff_t *tvb, proto_tree *tree, int offset) } proto_tree_add_item (tree, hf_uint64_response, tvb, offset, tokenlen, ENC_BIG_ENDIAN); - offset += (int) (next_token - line); - line = next_token; /* CRLF */ tokenlen = get_token_len (line, lineend, &next_token); @@ -1149,11 +1147,8 @@ stat_dissector (tvbuff_t *tvb, proto_tree *tree, int offset) return -1; /* invalid token */ } proto_tree_add_item (tree, hf_name_value, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); - offset += (int) (next_token - line); - line = next_token; offset = next_offset; - occurrences = 0; } return offset; @@ -1264,9 +1259,6 @@ get_response_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cas = (guint64) strtoul (response_chars, NULL, 10); proto_tree_add_uint64 (tree, hf_cas, tvb, offset, tokenlen, cas); - offset += (int) (next_token - line); - line = next_token; - /* CRLF */ tokenlen = get_token_len (line, lineend, &next_token); if (tokenlen != 0) { @@ -1360,7 +1352,6 @@ memcache_response_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree { proto_tree_add_item (tree, hf_response, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += (int) (next_token - line); - line = next_token; return offset; } @@ -1487,7 +1478,6 @@ memcache_request_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); } offset += (int) (next_token - line); - line = next_token; } offset += 2 ; /* go past /r/n*/ @@ -1655,7 +1645,6 @@ memcache_request_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* noreply */ proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += (int) (next_token - line); - line = next_token; } else { return -1; /* expecting CRLF and if not noreply*/ } diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c index 17f25186e9..4bc4db7ea7 100644 --- a/epan/dissectors/packet-mq.c +++ b/epan/dissectors/packet-mq.c @@ -1999,7 +1999,6 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += iSizeORRR; } } - structId = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL; } if ((opcode == MQ_TST_MQOPEN || opcode == MQ_TST_MQCLOSE || opcode == MQ_TST_MQOPEN_REPLY || opcode == MQ_TST_MQCLOSE_REPLY) @@ -2012,7 +2011,6 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(mq_tree, hf_mq_open_options, tvb, offset, 4, int_rep); } offset += 4; - structId = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL; } if ((iSizeMD_gbl = dissect_mq_md(tvb, mqroot_tree, int_rep, string_rep, offset, &tMsgProps)) != 0) { @@ -2239,7 +2237,6 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } offset += iSizeHeader; iHeadersLength += iSizeHeader; - structId = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL; } } }