From 3f8384d7797cb07f220cad998620aa2b1ee11960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Fri, 15 Sep 2017 20:28:24 +0200 Subject: [PATCH] epan: Fix misuse of comma operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I349dc9896db0bd306bc92f92eb9d4a65d98d309c Reviewed-on: https://code.wireshark.org/review/23558 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann Reviewed-by: Stig Bjørlykke --- epan/dissectors/packet-extreme.c | 2 +- epan/dissectors/packet-gsm_a_bssmap.c | 4 ++-- epan/dissectors/packet-gsm_sms.c | 18 ++++++++-------- epan/dissectors/packet-ipsec.c | 3 ++- epan/dissectors/packet-rpki-rtr.c | 2 +- epan/dissectors/packet-tns.c | 31 +++++++++++++++++++++------ epan/dissectors/packet-xot.c | 2 +- epan/prefs.c | 2 +- plugins/unistim/packet-unistim.c | 2 +- 9 files changed, 42 insertions(+), 24 deletions(-) diff --git a/epan/dissectors/packet-extreme.c b/epan/dissectors/packet-extreme.c index fdf58f1671..8ada7060f0 100644 --- a/epan/dissectors/packet-extreme.c +++ b/epan/dissectors/packet-extreme.c @@ -387,7 +387,7 @@ dissect_tlv_header(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, int length guint8 tlv_type; guint16 tlv_length; - tlv_marker = tvb_get_guint8(tvb, offset), + tlv_marker = tvb_get_guint8(tvb, offset); tlv_type = tvb_get_guint8(tvb, offset + 1); tlv_length = tvb_get_ntohs(tvb, offset + 2); diff --git a/epan/dissectors/packet-gsm_a_bssmap.c b/epan/dissectors/packet-gsm_a_bssmap.c index 1dd9450999..8ab732fc0c 100644 --- a/epan/dissectors/packet-gsm_a_bssmap.c +++ b/epan/dissectors/packet-gsm_a_bssmap.c @@ -8057,8 +8057,8 @@ proto_register_gsm_a_bssmap(void) ett[0] = &ett_bssmap_msg; ett[1] = &ett_cell_list; ett[2] = &ett_dlci; - ett[3] = &ett_codec_lst, - ett[4] = &ett_bss_to_bss_info, + ett[3] = &ett_codec_lst; + ett[4] = &ett_bss_to_bss_info; last_offset = NUM_INDIVIDUAL_ELEMS; diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c index 238bbd7b95..aa11769b49 100644 --- a/epan/dissectors/packet-gsm_sms.c +++ b/epan/dissectors/packet-gsm_sms.c @@ -926,27 +926,27 @@ dis_field_scts_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset) char sign; oct = tvb_get_guint8(tvb, offset); - value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4), + value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4); proto_tree_add_uint(tree, hf_gsm_sms_scts_year, tvb, offset, 1, value); offset++; oct = tvb_get_guint8(tvb, offset); - value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4), + value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4); proto_tree_add_uint(tree, hf_gsm_sms_scts_month, tvb, offset, 1, value); offset++; oct = tvb_get_guint8(tvb, offset); - value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4), + value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4); proto_tree_add_uint(tree, hf_gsm_sms_scts_day, tvb, offset, 1, value); offset++; oct = tvb_get_guint8(tvb, offset); - value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4), + value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4); proto_tree_add_uint(tree, hf_gsm_sms_scts_hour, tvb, offset, 1, value); offset++; oct = tvb_get_guint8(tvb, offset); - value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4), + value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4); proto_tree_add_uint(tree, hf_gsm_sms_scts_minutes, tvb, offset, 1, value); offset++; oct = tvb_get_guint8(tvb, offset); - value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4), + value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4); proto_tree_add_uint(tree, hf_gsm_sms_scts_seconds, tvb, offset, 1, value); offset++; @@ -1081,15 +1081,15 @@ dis_field_vp(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, guint32 *offse case 0x03: offset++; oct = tvb_get_guint8(tvb, offset); - value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4), + value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4); proto_tree_add_uint(subtree, hf_gsm_sms_vp_validity_period_hour, tvb, offset, 1, value); offset++; oct = tvb_get_guint8(tvb, offset); - value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4), + value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4); proto_tree_add_uint(subtree, hf_gsm_sms_vp_validity_period_minutes, tvb, offset, 1, value); offset++; oct = tvb_get_guint8(tvb, offset); - value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4), + value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4); proto_tree_add_uint(subtree, hf_gsm_sms_vp_validity_period_seconds, tvb, offset, 1, value); offset++; done = TRUE; diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c index 13962d2727..35b0523f45 100644 --- a/epan/dissectors/packet-ipsec.c +++ b/epan/dissectors/packet-ipsec.c @@ -1317,7 +1317,8 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) * populate a tree in the second pane with the status of the link layer * (ie none) */ - len = 0, encapsulated_protocol = 0; + len = 0; + encapsulated_protocol = 0; decrypt_dissect_ok = FALSE; ti = proto_tree_add_item(tree, proto_esp, tvb, 0, -1, ENC_NA); diff --git a/epan/dissectors/packet-rpki-rtr.c b/epan/dissectors/packet-rpki-rtr.c index d1622dfcbb..a1c2425c36 100644 --- a/epan/dissectors/packet-rpki-rtr.c +++ b/epan/dissectors/packet-rpki-rtr.c @@ -297,7 +297,7 @@ static int dissect_rpkirtr_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr offset += len_pdu; proto_tree_add_item(rpkirtr_tree, hf_rpkirtr_length_text, tvb, offset, 4, ENC_BIG_ENDIAN); len_text = tvb_get_ntohl(tvb, offset); - offset += 4, + offset += 4; proto_tree_add_item(rpkirtr_tree, hf_rpkirtr_error_text, tvb, offset, len_text, ENC_ASCII|ENC_NA); offset += len_text; } diff --git a/epan/dissectors/packet-tns.c b/epan/dissectors/packet-tns.c index e6da6969b6..63a262857a 100644 --- a/epan/dissectors/packet-tns.c +++ b/epan/dissectors/packet-tns.c @@ -632,10 +632,16 @@ static void dissect_tns_data(tvbuff_t *tvb, int offset, packet_info *pinfo, prot */ /* Orac[le.+] */ if ( tvb_get_ntohl(tvb, offset+2) == 0x4f726163 ) - opi = OPI_VERSION2, skip = 1; + { + opi = OPI_VERSION2; + skip = 1; + } else if ( tvb_get_ntohl(tvb, offset+3) == 0x4f726163 ) - opi = OPI_VERSION2, skip = 2; + { + opi = OPI_VERSION2; + skip = 2; + } /* * OPI_OSESSKEY response has a following pattern: @@ -650,10 +656,16 @@ static void dissect_tns_data(tvbuff_t *tvb, int offset, packet_info *pinfo, prot */ /* ....AUTH (v1) */ else if ( tvb_get_ntoh64(tvb, offset+3) == 0x0000000c41555448 ) - opi = OPI_OSESSKEY, skip = 1; + { + opi = OPI_OSESSKEY; + skip = 1; + } /* ..AUTH_V (v2) */ else if ( tvb_get_ntoh64(tvb, offset+3) == 0x0c0c415554485f53 ) - opi = OPI_OSESSKEY, skip = 2; + { + opi = OPI_OSESSKEY; + skip = 2; + } /* * OPI_OAUTH response has a following pattern: @@ -669,11 +681,16 @@ static void dissect_tns_data(tvbuff_t *tvb, int offset, packet_info *pinfo, prot /* ....AUTH (v1) */ else if ( tvb_get_ntoh64(tvb, offset+3) == 0x0000001341555448 ) - opi = OPI_OAUTH, skip = 1; + { + opi = OPI_OAUTH; + skip = 1; + } /* ..AUTH_V (v2) */ else if ( tvb_get_ntoh64(tvb, offset+3) == 0x1313415554485f56 ) - opi = OPI_OAUTH, skip = 2; - + { + opi = OPI_OAUTH; + skip = 2; + } } if ( opi == OPI_VERSION2 ) diff --git a/epan/dissectors/packet-xot.c b/epan/dissectors/packet-xot.c index 5539a8948b..d8dd8014cc 100644 --- a/epan/dissectors/packet-xot.c +++ b/epan/dissectors/packet-xot.c @@ -127,7 +127,7 @@ static guint get_xot_pdu_len_mult(packet_info *pinfo _U_, tvbuff_t *tvb, int offset_next = offset + XOT_HEADER_LENGTH + X25_MIN_HEADER_LENGTH; int tvb_len; - while (tvb_len = tvb_captured_length_remaining(tvb, offset), tvb_len>0){ + while ((tvb_len = tvb_captured_length_remaining(tvb, offset)) > 0){ guint16 plen = 0; int modulo; guint16 bytes0_1; diff --git a/epan/prefs.c b/epan/prefs.c index ef1db35b88..00af81f1ca 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -662,7 +662,7 @@ prefs_register_protocol_subtree(const char *subtree, int id, void (*apply_cb)(vo * being the name (if it's later registered explicitly * with a description, that will override it). */ - ptr = wmem_strdup(wmem_epan_scope(), ptr), + ptr = wmem_strdup(wmem_epan_scope(), ptr); new_module = prefs_register_subtree(subtree_module, ptr, ptr, NULL); } diff --git a/plugins/unistim/packet-unistim.c b/plugins/unistim/packet-unistim.c index d986d156a2..70d4622d5b 100644 --- a/plugins/unistim/packet-unistim.c +++ b/plugins/unistim/packet-unistim.c @@ -2364,7 +2364,7 @@ dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo, /*Configure Vocoder Parameters*/ proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,ENC_LITTLE_ENDIAN); offset+=1;msg_len-=1; - proto_tree_add_item(msg_tree,hf_audio_vocoder_id,tvb,offset,1,ENC_BIG_ENDIAN), + proto_tree_add_item(msg_tree,hf_audio_vocoder_id,tvb,offset,1,ENC_BIG_ENDIAN); offset+=1;msg_len-=1; while(msg_len>0){ param_tree=proto_tree_add_subtree(msg_tree,tvb,offset,0,ett_unistim,NULL,"Param");