From f30bce9530cc4c851b8be4625276d26e4fd752a8 Mon Sep 17 00:00:00 2001 From: stig Date: Mon, 18 Apr 2011 15:29:25 +0000 Subject: Removed some unneeded assignments. Found by clang. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36698 f5534014-38df-0310-8fa8-9805f1628bb7 --- epan/dissectors/packet-btamp.c | 4 ++-- epan/dissectors/packet-btobex.c | 2 +- epan/dissectors/packet-cisco-wids.c | 3 +-- epan/dissectors/packet-dplay.c | 2 +- epan/dissectors/packet-dtls.c | 3 +-- epan/dissectors/packet-isup.c | 3 +-- epan/dissectors/packet-memcache.c | 14 ++++++-------- epan/dissectors/packet-mgcp.c | 2 +- epan/dissectors/packet-nfs.c | 4 ++-- epan/dissectors/packet-rpc.c | 5 +---- epan/dissectors/packet-scsi.c | 5 ++--- epan/dissectors/packet-smb-common.c | 2 +- epan/dissectors/packet-ssh.c | 2 +- epan/dissectors/packet-ucp.c | 4 ++-- epan/dissectors/packet-windows-common.c | 2 +- 15 files changed, 24 insertions(+), 33 deletions(-) (limited to 'epan/dissectors') diff --git a/epan/dissectors/packet-btamp.c b/epan/dissectors/packet-btamp.c index f997632c6c..06cc59e56a 100644 --- a/epan/dissectors/packet-btamp.c +++ b/epan/dissectors/packet-btamp.c @@ -208,7 +208,7 @@ dissect_discoverresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr "Controller list"); btamp_controller_list_tree=proto_item_add_subtree(ti_controller_list, ett_btamp_controller_list); - while ((length = tvb_length_remaining(tvb, offset)) >= 3) { + while (tvb_length_remaining(tvb, offset) >= 3) { offset = dissect_controller_entry(tvb, offset, pinfo, btamp_controller_list_tree, idx); ++idx; } @@ -231,7 +231,7 @@ dissect_changenotify(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree * "Controller list"); btamp_controller_list_tree=proto_item_add_subtree(ti_controller_list, ett_btamp_controller_list); - while ((length = tvb_length_remaining(tvb, offset)) >= 3) { + while (tvb_length_remaining(tvb, offset) >= 3) { offset = dissect_controller_entry(tvb, offset, pinfo, btamp_controller_list_tree, idx); ++idx; } diff --git a/epan/dissectors/packet-btobex.c b/epan/dissectors/packet-btobex.c index 07ad3c231d..e30a265a89 100644 --- a/epan/dissectors/packet-btobex.c +++ b/epan/dissectors/packet-btobex.c @@ -271,7 +271,7 @@ display_unicode_string(tvbuff_t *tvb, proto_tree *tree, int offset, char **data) * Get the length of the string. */ len = 0; - while ((character = tvb_get_ntohs(tvb, offset + len)) != '\0') + while (tvb_get_ntohs(tvb, offset + len) != '\0') len += 2; len += 2; /* count the '\0' too */ diff --git a/epan/dissectors/packet-cisco-wids.c b/epan/dissectors/packet-cisco-wids.c index a1d07150dd..c04222fe1c 100644 --- a/epan/dissectors/packet-cisco-wids.c +++ b/epan/dissectors/packet-cisco-wids.c @@ -77,7 +77,6 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *ti, *cwids_tree; volatile int offset = 0; guint16 capturelen; - guint remain; void *pd_save; col_set_str(pinfo->cinfo, COL_PROTOCOL, "CWIDS"); @@ -86,7 +85,7 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cwids_tree = NULL; - while((remain = tvb_length_remaining(tvb, offset)) > 0) { + while(tvb_length_remaining(tvb, offset) > 0) { ti = proto_tree_add_item(tree, proto_cwids, tvb, offset, 28, FALSE); cwids_tree = proto_item_add_subtree(ti, ett_cwids); diff --git a/epan/dissectors/packet-dplay.c b/epan/dissectors/packet-dplay.c index cc0d6f030c..08f402c3b3 100644 --- a/epan/dissectors/packet-dplay.c +++ b/epan/dissectors/packet-dplay.c @@ -420,7 +420,7 @@ static gint display_unicode_string(proto_tree *tree, gint hf_index, tvbuff_t *tv * if we don't find the '\0'? I think it's a feature. */ len = 0; - while ((character = tvb_get_letohs(tvb, offset + len)) != '\0') + while (tvb_get_letohs(tvb, offset + len) != '\0') len += 2; len += 2; /* count the '\0' too */ diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c index eea7341b95..2ee81ca2a0 100644 --- a/epan/dissectors/packet-dtls.c +++ b/epan/dissectors/packet-dtls.c @@ -465,7 +465,6 @@ decrypt_dtls_record(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, gboolean save_plaintext) { gint ret; - gint direction; SslDecoder* decoder; ret = 0; @@ -479,7 +478,7 @@ decrypt_dtls_record(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, } /* retrive decoder for this packet direction */ - if ((direction = ssl_packet_from_server(ssl, dtls_associations, pinfo)) != 0) { + if (ssl_packet_from_server(ssl, dtls_associations, pinfo) != 0) { ssl_debug_printf("decrypt_dtls_record: using server decoder\n"); decoder = ssl->server; } diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c index e9b1147441..ad08f5c586 100644 --- a/epan/dissectors/packet-isup.c +++ b/epan/dissectors/packet-isup.c @@ -2621,9 +2621,8 @@ dissect_isup_circuit_state_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *pa guint8 circuit_state; gint offset=0; gint i=0; - gint length; - while((length = tvb_reported_length_remaining(parameter_tvb, offset)) > 0){ + while(tvb_reported_length_remaining(parameter_tvb, offset) > 0){ circuit_state_item = proto_tree_add_text(parameter_tree, parameter_tvb, offset, -1, "Circuit# CIC+%u state", i); diff --git a/epan/dissectors/packet-memcache.c b/epan/dissectors/packet-memcache.c index 57a638b5b0..83b09440e1 100644 --- a/epan/dissectors/packet-memcache.c +++ b/epan/dissectors/packet-memcache.c @@ -921,7 +921,6 @@ content_data_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int int content_length, guint8 opcode) { gint datalen; - int len; gboolean short_pkt = FALSE; /* @@ -929,7 +928,7 @@ content_data_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int * the buffer. It is not necessary that we have all the * content_length bytes available to read. */ - if ((len = tvb_reported_length_remaining (tvb, offset) != 0)) { + if (tvb_reported_length_remaining (tvb, offset) != 0) { /* bytes actually remaining in this tvbuff. */ datalen = tvb_length_remaining (tvb, offset); if (content_length >= 0) { @@ -1000,14 +999,14 @@ static int incr_dissector (tvbuff_t *tvb, proto_tree *tree, int offset) { gint next_offset; - int linelen, len; + int linelen; const guchar *line, *lineend; const guchar *next_token; int tokenlen; /* expecting to read 'bytes' number of bytes from the buffer. */ - if ((len = tvb_reported_length_remaining (tvb, offset)) != 0) { + if (tvb_reported_length_remaining (tvb, offset) != 0) { /* Find the end of the line. */ linelen = tvb_find_line_end (tvb, offset, tvb_ensure_length_remaining (tvb, offset), &next_offset, @@ -1057,11 +1056,10 @@ stat_dissector (tvbuff_t *tvb, proto_tree *tree, int offset) gint next_offset; const guchar *next_token; const guchar *line, *lineend; - int reported_datalen = -1; guint32 slabclass; guchar response_chars[21]; - while ((reported_datalen = tvb_reported_length_remaining (tvb, offset)) != 0) { + while (tvb_reported_length_remaining (tvb, offset) != 0) { /* Find the end of the line. */ linelen = tvb_find_line_end (tvb, offset, tvb_ensure_length_remaining (tvb, offset), &next_offset, @@ -1167,7 +1165,7 @@ static int get_response_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { gint next_offset; - int linelen, len; + int linelen; const guchar *line, *lineend; const guchar *next_token; int tokenlen; @@ -1178,7 +1176,7 @@ get_response_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int gchar response_chars[21]; /* cover uint64 (20 + 1) bytes*/ /* expecting to read 'bytes' number of bytes from the buffer. */ - while ((len = tvb_reported_length_remaining (tvb, offset)) != 0) { + while (tvb_reported_length_remaining (tvb, offset) != 0) { /* Find the end of the line. */ linelen = tvb_find_line_end (tvb, offset, tvb_ensure_length_remaining (tvb, offset), &next_offset, diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c index 34e5b44fcd..c243873463 100644 --- a/epan/dissectors/packet-mgcp.c +++ b/epan/dissectors/packet-mgcp.c @@ -1338,7 +1338,7 @@ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf) /* Add a recognised parameter type if we have one */ if (*hf != NULL && len > (tvb_current_offset - offset) && - (tempchar = tvb_get_guint8(tvb,tvb_current_offset)) == ':') + tvb_get_guint8(tvb,tvb_current_offset) == ':') { tvb_current_offset++; tvb_current_offset = tvb_skip_wsp(tvb,tvb_current_offset, (len - tvb_current_offset + offset)); diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index d58d4fb1fe..4a605d07ff 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -4923,7 +4923,7 @@ dissect_access_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* acc_req = civ->private_data; /* Should never happen because ONC-RPC requires the call in order to dissect the reply. */ if (acc_req==NULL) { - return offset+=4; + return offset+4; } if(nfsv4) { acc_supp = tvb_get_ntohl(tvb, offset+0); @@ -4967,7 +4967,7 @@ dissect_access_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* offset, 4, (mask_denied > 0 ? TRUE : FALSE )); PROTO_ITEM_SET_GENERATED(ditem); - return offset+=4; + return offset+4; } /* RFC 1813, Page 40..43 */ diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c index a674997862..40c272e4b1 100644 --- a/epan/dissectors/packet-rpc.c +++ b/epan/dissectors/packet-rpc.c @@ -1646,15 +1646,12 @@ dissect_rpc_continuation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void make_fake_rpc_prog_if_needed (rpc_prog_info_key *prpc_prog_key, guint prog_ver) { - - rpc_prog_info_value *rpc_prog = NULL; - /* sanity check: no one uses versions > 10 */ if(prog_ver>10){ return; } - if( (rpc_prog = g_hash_table_lookup(rpc_progs, prpc_prog_key)) == NULL) { + if(g_hash_table_lookup(rpc_progs, prpc_prog_key) == NULL) { /* ok this is not a known rpc program so we * will have to fake it. */ diff --git a/epan/dissectors/packet-scsi.c b/epan/dissectors/packet-scsi.c index c13e49d262..026fb035be 100644 --- a/epan/dissectors/packet-scsi.c +++ b/epan/dissectors/packet-scsi.c @@ -3645,7 +3645,6 @@ dissect_scsi_pagecode (tvbuff_t *tvb, packet_info *pinfo _U_, scsi_task_data_t *cdata) { guint8 pcode; - const gchar *valstr; int hf_pagecode; /* unless we have cdata there is not much point in continuing */ @@ -3653,8 +3652,8 @@ dissect_scsi_pagecode (tvbuff_t *tvb, packet_info *pinfo _U_, return; pcode = tvb_get_guint8 (tvb, offset); - if ((valstr = match_strval (pcode & SCSI_MS_PCODE_BITS, - scsi_spc_modepage_val)) == NULL) { + if (match_strval (pcode & SCSI_MS_PCODE_BITS, + scsi_spc_modepage_val) == NULL) { /* * This isn't a generic mode page that applies to all SCSI * device types; try to interpret it based on what we deduced, diff --git a/epan/dissectors/packet-smb-common.c b/epan/dissectors/packet-smb-common.c index dba733a81a..0f76486d6c 100644 --- a/epan/dissectors/packet-smb-common.c +++ b/epan/dissectors/packet-smb-common.c @@ -94,7 +94,7 @@ int display_unicode_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_i * if we don't find the '\0'? I think it's a feature. */ len = 0; - while ((character = tvb_get_letohs(tvb, offset + len)) != '\0') + while (tvb_get_letohs(tvb, offset + len) != '\0') len += 2; len += 2; /* count the '\0' too */ diff --git a/epan/dissectors/packet-ssh.c b/epan/dissectors/packet-ssh.c index 93d7701a32..d58e6f3137 100644 --- a/epan/dissectors/packet-ssh.c +++ b/epan/dissectors/packet-ssh.c @@ -363,7 +363,7 @@ dissect_ssh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return; } - while((remain_length = tvb_reported_length_remaining(tvb,offset))> 0 ) { + while(tvb_reported_length_remaining(tvb,offset)> 0 ) { need_desegmentation = FALSE; last_offset = offset; this_number = this_data->counter+number; diff --git a/epan/dissectors/packet-ucp.c b/epan/dissectors/packet-ucp.c index 1e876fed15..ece530bad4 100644 --- a/epan/dissectors/packet-ucp.c +++ b/epan/dissectors/packet-ucp.c @@ -1631,12 +1631,12 @@ add_5xO(proto_tree *tree, tvbuff_t *tvb) UcpHandleByte(hf_ucp_parm_DCs); UcpHandleByte(hf_ucp_parm_MCLs); UcpHandleByte(hf_ucp_parm_RPI); - if ((intval = tvb_get_guint8(tvb, offset++)) != '/') { + if (tvb_get_guint8(tvb, offset++) != '/') { proto_tree_add_string(tree, hf_ucp_parm_CPg, tvb, offset - 1,1, "(reserved for Code Page)"); offset++; } - if ((intval = tvb_get_guint8(tvb, offset++)) != '/') { + if (tvb_get_guint8(tvb, offset++) != '/') { proto_tree_add_string(tree, hf_ucp_parm_RPLy, tvb, offset - 1,1, "(reserved for Reply type)"); offset++; diff --git a/epan/dissectors/packet-windows-common.c b/epan/dissectors/packet-windows-common.c index 4b738cac1e..0a4b48ab79 100644 --- a/epan/dissectors/packet-windows-common.c +++ b/epan/dissectors/packet-windows-common.c @@ -1515,7 +1515,7 @@ dissect_nt_sid(tvbuff_t *tvb, int offset, proto_tree *parent_tree, if(hf_sid==-1){ /* if no tree, just return the offset of the end_of_SID+1 */ if (!parent_tree) - return(offset+=(6+(num_auth*4))); + return(offset+(6+(num_auth*4))); hf_sid=hf_nt_sid; } -- cgit v1.2.3