diff options
author | Bill Meier <wmeier@newsguy.com> | 2008-06-26 00:16:58 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2008-06-26 00:16:58 +0000 |
commit | ceebccced4f27f63ac441a18da5937bb48177f41 (patch) | |
tree | 7d1f7f36fe44f2900f58d229445ea0102a23d0e3 /epan/dissectors | |
parent | e7831309611d38c0eda2a3edf8ef3d7e2647bdeb (diff) |
Fix some warnings reported by gcc -Wshadow ...
svn path=/trunk/; revision=25607
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-afs.c | 66 | ||||
-rw-r--r-- | epan/dissectors/packet-aim-generic.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-aim.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-nt.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-sccp.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-sctp.c | 22 | ||||
-rw-r--r-- | epan/dissectors/packet-user_encap.c | 8 |
7 files changed, 62 insertions, 62 deletions
diff --git a/epan/dissectors/packet-afs.c b/epan/dissectors/packet-afs.c index 4c61d7be4b..2fc3cdc080 100644 --- a/epan/dissectors/packet-afs.c +++ b/epan/dissectors/packet-afs.c @@ -414,33 +414,33 @@ static gint ett_afs_vldb_flags = -1; /* Output a rx style string, up to a maximum length first 4 bytes - length, then char data */ #define OUT_RXString(field) \ - { guint32 i,len; \ - char *tmp; \ - const guint8 *p; \ - i = tvb_get_ntohl(tvb, offset); \ + { guint32 i_orxs,len_orxs; \ + char *tmp_orxs; \ + const guint8 *p_orxs; \ + i_orxs = tvb_get_ntohl(tvb, offset); \ offset += 4; \ - p = tvb_get_ptr(tvb,offset,i); \ - len = ((i+4-1)/4)*4; \ - tmp = ep_alloc(i+1); \ - memcpy(tmp, p, i); \ - tmp[i] = '\0'; \ - proto_tree_add_string(tree, field, tvb, offset-4, len+4, \ - (void *)tmp); \ - offset += len; \ + p_orxs = tvb_get_ptr(tvb,offset,i_orxs); \ + len_orxs = ((i_orxs+4-1)/4)*4; \ + tmp_orxs = ep_alloc(i_orxs+1); \ + memcpy(tmp_orxs, p_orxs, i_orxs); \ + tmp_orxs[i_orxs] = '\0'; \ + proto_tree_add_string(tree, field, tvb, offset-4, len_orxs+4, \ + (void *)tmp_orxs); \ + offset += len_orxs; \ } /* Output a fixed length vectorized string (each char is a 32 bit int) */ #define OUT_RXStringV(field, length) \ - { char tmp[length+1]; \ - int i,soff; \ - soff = offset;\ - for (i=0; i<length; i++)\ + { char tmp_orxsv[length+1]; \ + int i_orxsv,soff_orxsv; \ + soff_orxsv = offset;\ + for (i_orxsv=0; i_orxsv<length; i_orxsv++)\ {\ - tmp[i] = (char) tvb_get_ntohl(tvb, offset);\ + tmp_orxsv[i_orxsv] = (char) tvb_get_ntohl(tvb, offset);\ offset += sizeof(guint32);\ }\ - tmp[length] = '\0';\ - proto_tree_add_string(tree, field, tvb, soff, length*sizeof(guint32), tmp);\ + tmp_orxsv[length] = '\0';\ + proto_tree_add_string(tree, field, tvb, soff_orxsv, length*sizeof(guint32), tmp_orxsv);\ } @@ -483,27 +483,27 @@ static gint ett_afs_vldb_flags = -1; /* Output a Status mask */ #define OUT_FS_STATUSMASK() \ - { proto_tree *save, *ti; \ - guint32 mask; \ - mask = tvb_get_ntohl(tvb, offset); \ - ti = proto_tree_add_uint(tree, hf_afs_fs_status_mask, tvb, offset, \ - sizeof(guint32), mask); \ - save = tree; \ - tree = proto_item_add_subtree(ti, ett_afs_status_mask); \ + { proto_tree *save_ofsm, *ti_ofsm; \ + guint32 mask_ofsm; \ + mask_ofsm = tvb_get_ntohl(tvb, offset); \ + ti_ofsm = proto_tree_add_uint(tree, hf_afs_fs_status_mask, tvb, offset, \ + sizeof(guint32), mask_ofsm); \ + save_ofsm = tree; \ + tree = proto_item_add_subtree(ti_ofsm, ett_afs_status_mask); \ proto_tree_add_boolean(tree, hf_afs_fs_status_mask_setmodtime, \ - tvb,offset,sizeof(guint32), mask); \ + tvb,offset,sizeof(guint32), mask_ofsm); \ proto_tree_add_boolean(tree, hf_afs_fs_status_mask_setowner, \ - tvb,offset,sizeof(guint32), mask); \ + tvb,offset,sizeof(guint32), mask_ofsm); \ proto_tree_add_boolean(tree, hf_afs_fs_status_mask_setgroup, \ - tvb,offset,sizeof(guint32), mask); \ + tvb,offset,sizeof(guint32), mask_ofsm); \ proto_tree_add_boolean(tree, hf_afs_fs_status_mask_setmode, \ - tvb,offset,sizeof(guint32), mask); \ + tvb,offset,sizeof(guint32), mask_ofsm); \ proto_tree_add_boolean(tree, hf_afs_fs_status_mask_setsegsize, \ - tvb,offset,sizeof(guint32), mask); \ + tvb,offset,sizeof(guint32), mask_ofsm); \ proto_tree_add_boolean(tree, hf_afs_fs_status_mask_fsync, \ - tvb,offset,sizeof(guint32), mask); \ + tvb,offset,sizeof(guint32), mask_ofsm); \ offset += 4; \ - tree = save; \ + tree = save_ofsm; \ } /* Output vldb flags */ diff --git a/epan/dissectors/packet-aim-generic.c b/epan/dissectors/packet-aim-generic.c index d0a1c92fb5..9c6aa82757 100644 --- a/epan/dissectors/packet-aim-generic.c +++ b/epan/dissectors/packet-aim-generic.c @@ -183,8 +183,8 @@ static int dissect_generic_rateinfo(tvbuff_t *tvb, packet_info *pinfo _U_, proto for(i = 0; i < numclasses; i++) { guint16 myid = tvb_get_ntohs(tvb, offset); - proto_item *ti = proto_tree_add_text(classes_tree, tvb, offset, 35, "Rate Class 0x%02x", myid); - proto_tree *class_tree = proto_item_add_subtree(ti, ett_generic_rateinfo_class); + proto_item *ti_local = proto_tree_add_text(classes_tree, tvb, offset, 35, "Rate Class 0x%02x", myid); + proto_tree *class_tree = proto_item_add_subtree(ti_local, ett_generic_rateinfo_class); offset = dissect_rate_class(tvb, pinfo, offset, class_tree); } @@ -199,8 +199,8 @@ static int dissect_generic_rateinfo(tvbuff_t *tvb, packet_info *pinfo _U_, proto * sizeof(rate_group) = sizeof(class_id) + sizeof(numpairs) + numpairs * 2 * sizeof(uint16_t) * = 2 + 2 + numpairs * 4 */ - proto_item *ti = proto_tree_add_text(groups_tree, tvb, offset, 4 + 4 * numpairs, "Rate Group 0x%02x", myid); - group_tree = proto_item_add_subtree(ti, ett_generic_rateinfo_group); + proto_item *ti_local = proto_tree_add_text(groups_tree, tvb, offset, 4 + 4 * numpairs, "Rate Group 0x%02x", myid); + group_tree = proto_item_add_subtree(ti_local, ett_generic_rateinfo_group); proto_tree_add_uint(group_tree, hf_generic_rateinfo_classid, tvb, offset, 2, myid);offset+=2; proto_tree_add_uint(group_tree, hf_generic_rateinfo_numpairs, tvb, offset, 2, numpairs); offset+=2; for(j = 0; j < numpairs; j++) { diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c index ee7e89ae3d..2315c51ac1 100644 --- a/epan/dissectors/packet-aim.c +++ b/epan/dissectors/packet-aim.c @@ -1187,8 +1187,8 @@ int dissect_aim_tlv_value_uint16 (proto_item *ti, guint16 valueid _U_, tvbuff_t } int dissect_aim_tlv_value_ipv4 (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb, packet_info *pinfo _U_){ - guint32 ipv4_addr = tvb_get_ipv4(tvb, 0); - proto_item_set_text(ti, "Value: %s", ip_to_str((guint8 *)&ipv4_addr)); + guint32 ipv4_address = tvb_get_ipv4(tvb, 0); + proto_item_set_text(ti, "Value: %s", ip_to_str((guint8 *)&ipv4_address)); return 4; } diff --git a/epan/dissectors/packet-dcerpc-nt.c b/epan/dissectors/packet-dcerpc-nt.c index 272cf434a8..76ec09008c 100644 --- a/epan/dissectors/packet-dcerpc-nt.c +++ b/epan/dissectors/packet-dcerpc-nt.c @@ -887,18 +887,18 @@ dissect_nt_hnd(tvbuff_t *tvb, gint offset, packet_info *pinfo, &close_frame, pinfo->fd->num)) { if (open_frame) { - proto_item *item; + proto_item *item_local; item=proto_tree_add_uint( subtree, hf_nt_policy_open_frame, tvb, old_offset, sizeof(e_ctx_hnd), open_frame); - PROTO_ITEM_SET_GENERATED(item); + PROTO_ITEM_SET_GENERATED(item_local); } if (close_frame) { - proto_item *item; - item=proto_tree_add_uint( + proto_item *item_local; + item_local=proto_tree_add_uint( subtree, hf_nt_policy_close_frame, tvb, old_offset, sizeof(e_ctx_hnd), close_frame); - PROTO_ITEM_SET_GENERATED(item); + PROTO_ITEM_SET_GENERATED(item_local); } /* diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c index 168fef8dee..7dd6e8e9b8 100644 --- a/epan/dissectors/packet-sccp.c +++ b/epan/dissectors/packet-sccp.c @@ -1644,7 +1644,7 @@ static void dissect_sccp_segmentation_param(tvbuff_t *tvb, proto_tree *tree, guint length) { guint8 first, class, remaining; - guint32 slr; + guint32 slrx; proto_item *param_item; proto_tree *param_tree; @@ -1652,7 +1652,7 @@ dissect_sccp_segmentation_param(tvbuff_t *tvb, proto_tree *tree, guint length) class = tvb_get_guint8(tvb, 0) & SEGMENTATION_CLASS_MASK; remaining = tvb_get_guint8(tvb, 0) & SEGMENTATION_REMAINING_MASK; - slr = tvb_get_letoh24(tvb, 1); + slrx = tvb_get_letoh24(tvb, 1); param_item = proto_tree_add_text(tree, tvb, 0, length, val_to_str(PARAMETER_SEGMENTATION, @@ -1666,7 +1666,7 @@ dissect_sccp_segmentation_param(tvbuff_t *tvb, proto_tree *tree, guint length) proto_tree_add_uint(param_tree, hf_sccp_segmentation_remaining, tvb, 0, length, remaining); proto_tree_add_uint(param_tree, hf_sccp_segmentation_slr, tvb, 1, length, - slr); + slrx); } static void diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c index 96dc723def..f237174675 100644 --- a/epan/dissectors/packet-sctp.c +++ b/epan/dissectors/packet-sctp.c @@ -613,12 +613,12 @@ tsn_tree(sctp_tsn_t *t, proto_item *tsn_item, packet_info *pinfo, { proto_item *pi; proto_tree *pt; - proto_tree *tsn_tree = proto_item_add_subtree(tsn_item, ett_sctp_tsn); + proto_tree *tsn_tree_pt = proto_item_add_subtree(tsn_item, ett_sctp_tsn); if (t->first_transmit.framenum != framenum) { nstime_t rto; - pi = proto_tree_add_uint(tsn_tree, hf_sctp_retransmission, tvb, 0, 0, t->first_transmit.framenum); + pi = proto_tree_add_uint(tsn_tree_pt, hf_sctp_retransmission, tvb, 0, 0, t->first_transmit.framenum); pt = proto_item_add_subtree(pi, ett_sctp_tsn_retransmission); PROTO_ITEM_SET_GENERATED(pi); expert_add_info_format(pinfo, pi, PI_SEQUENCE, PI_NOTE, "Retransmitted TSN"); @@ -648,7 +648,7 @@ tsn_tree(sctp_tsn_t *t, proto_item *tsn_item, packet_info *pinfo, else ds[0] = 0; - pi = proto_tree_add_uint_format(tsn_tree, + pi = proto_tree_add_uint_format(tsn_tree_pt, hf_sctp_retransmitted_count, tvb, 0, 0, t->retransmit_count, "This TSN was retransmitted %u time%s%s", @@ -676,7 +676,7 @@ tsn_tree(sctp_tsn_t *t, proto_item *tsn_item, packet_info *pinfo, if (t->ack.framenum) { nstime_t rtt; - pi = proto_tree_add_uint(tsn_tree, hf_sctp_acked, tvb, 0 , 0, t->ack.framenum); + pi = proto_tree_add_uint(tsn_tree_pt, hf_sctp_acked, tvb, 0 , 0, t->ack.framenum); PROTO_ITEM_SET_GENERATED(pi); pt = proto_item_add_subtree(pi, ett_sctp_ack); @@ -1000,18 +1000,18 @@ static const value_string address_types_values[] = { static void dissect_supported_address_types_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { - guint16 address_type, number_of_address_types, address_type_number; + guint16 addr_type, number_of_addr_types, addr_type_number; guint offset; - number_of_address_types = (tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH) + number_of_addr_types = (tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH) / SUPPORTED_ADDRESS_TYPE_PARAMETER_ADDRESS_TYPE_LENGTH; offset = PARAMETER_VALUE_OFFSET; proto_item_append_text(parameter_item, " (Supported types: "); - for(address_type_number = 1; address_type_number <= number_of_address_types; address_type_number++) { + for(addr_type_number = 1; addr_type_number <= number_of_addr_types; addr_type_number++) { proto_tree_add_item(parameter_tree, hf_supported_address_type, parameter_tvb, offset, SUPPORTED_ADDRESS_TYPE_PARAMETER_ADDRESS_TYPE_LENGTH, NETWORK_BYTE_ORDER); - address_type = tvb_get_ntohs(parameter_tvb, offset); - switch (address_type) { + addr_type = tvb_get_ntohs(parameter_tvb, offset); + switch (addr_type) { case IPv4_ADDRESS_TYPE: proto_item_append_text(parameter_item, "IPv4"); break; @@ -1022,9 +1022,9 @@ dissect_supported_address_types_parameter(tvbuff_t *parameter_tvb, proto_tree *p proto_item_append_text(parameter_item, "hostname"); break; default: - proto_item_append_text(parameter_item, "%u", address_type); + proto_item_append_text(parameter_item, "%u", addr_type); } - if (address_type_number < number_of_address_types) + if (addr_type_number < number_of_addr_types) proto_item_append_text(parameter_item, ", "); offset += SUPPORTED_ADDRESS_TYPE_PARAMETER_ADDRESS_TYPE_LENGTH; } diff --git a/epan/dissectors/packet-user_encap.c b/epan/dissectors/packet-user_encap.c index 341584ad8b..9e32f94fda 100644 --- a/epan/dissectors/packet-user_encap.c +++ b/epan/dissectors/packet-user_encap.c @@ -97,15 +97,15 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) { if (!encap) { char* msg = ep_strdup_printf("user encap not hanlded: DLT=%d, check you Preferences->Protocols->DLT_USER", pinfo->match_port + 147 - WTAP_ENCAP_USER0); - proto_item* i = proto_tree_add_text(tree, tvb, 0, 0, msg); + proto_item* item = proto_tree_add_text(tree, tvb, 0, 0, msg); - expert_add_info_format(pinfo, i, PI_UNDECODED, PI_WARN, msg); + expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN, msg); call_dissector(data_handle, tvb, pinfo, tree); return; } else { - proto_item* i = proto_tree_add_item(tree,proto_user_encap,tvb,0,0,FALSE); - proto_item_set_text(i,"DLT: %d",pinfo->match_port + 147 - WTAP_ENCAP_USER0); + proto_item* item = proto_tree_add_item(tree,proto_user_encap,tvb,0,0,FALSE); + proto_item_set_text(item,"DLT: %d",pinfo->match_port + 147 - WTAP_ENCAP_USER0); } len = tvb_reported_length(tvb) - (encap->header_size + encap->trailer_size); |