Skip to content

Commit f9f9e3d

Browse files
committed
Squelch a few warnings from old GCC.
Debian 6.0.10 i386 gcc (Debian 4.4.5-8) 4.4.5 print-erspan.c: In function 'erspan_i_ii_print': print-erspan.c:71: warning: declaration of 'index' shadows a global declaration /usr/include/string.h:487: warning: shadowed declaration is here print-radius.c: In function 'print_attr_location_information': print-radius.c:1093: warning: declaration of 'index' shadows a global declaration /usr/include/string.h:487: warning: shadowed declaration is here print-radius.c: In function 'print_attr_location_data': print-radius.c:1137: warning: declaration of 'index' shadows a global declaration /usr/include/string.h:487: warning: shadowed declaration is here
1 parent 6af686f commit f9f9e3d

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

print-erspan.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
void
6969
erspan_i_ii_print(netdissect_options *ndo, uint16_t flags, const u_char *bp, u_int len)
7070
{
71-
uint32_t hdr, ver, vlan, cos, en, sid, index;
71+
uint32_t hdr, ver, vlan, cos, en, sid;
7272

7373
ndo->ndo_protocol = "erspan";
7474
nd_print_protocol(ndo);
@@ -136,8 +136,8 @@ erspan_i_ii_print(netdissect_options *ndo, uint16_t flags, const u_char *bp, u_i
136136
len -= 4;
137137

138138
if (ndo->ndo_vflag) {
139-
index = (hdr & ERSPAN2_INDEX_MASK) >> ERSPAN2_INDEX_SHIFT;
140-
ND_PRINT(" index %u", index);
139+
ND_PRINT(" index %u",
140+
(hdr & ERSPAN2_INDEX_MASK) >> ERSPAN2_INDEX_SHIFT);
141141
}
142142

143143
ND_PRINT(": ");

print-radius.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,12 +1090,12 @@ static void
10901090
print_attr_location_information(netdissect_options *ndo,
10911091
const u_char *data, u_int length, u_short attr_code _U_)
10921092
{
1093-
uint16_t index;
1093+
uint16_t idx;
10941094
uint8_t code, entity;
10951095

10961096
ND_ICHECK_U(length, <, 21);
10971097

1098-
index = GET_BE_U_2(data);
1098+
idx = GET_BE_U_2(data);
10991099
data += 2;
11001100

11011101
code = GET_U_1(data);
@@ -1105,7 +1105,7 @@ print_attr_location_information(netdissect_options *ndo,
11051105
data++;
11061106

11071107
ND_PRINT("index %u, code %s, entity %s, ",
1108-
index,
1108+
idx,
11091109
tok2str(location_information_code_vector, "Unknown (%u)", code),
11101110
tok2str(location_information_entity_vector, "Unknown (%u)", entity)
11111111
);
@@ -1134,13 +1134,10 @@ static void
11341134
print_attr_location_data(netdissect_options *ndo,
11351135
const u_char *data, u_int length, u_short attr_code _U_)
11361136
{
1137-
uint16_t index;
1138-
11391137
ND_ICHECK_U(length, <, 3);
11401138

1141-
index = GET_BE_U_2(data);
1139+
ND_PRINT("index %u, location", GET_BE_U_2(data));
11421140
data += 2;
1143-
ND_PRINT("index %u, location", index);
11441141

11451142
/* The Location field of the String field of the Location-Data attribute
11461143
* can have two completely different structures depending on the value of

0 commit comments

Comments
 (0)