aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-07-28 10:22:10 -0400
committerNick Mathewson <nickm@torproject.org>2016-07-28 10:22:10 -0400
commit9fe6fea1cceb39fc415ad813020bbd863121e0c9 (patch)
tree0437c4df402c6b7128d67e8c34d981bdd656b400 /src/test
parent0390e1a60cb91fa581ec568879bf300224db6322 (diff)
downloadtor-9fe6fea1cceb39fc415ad813020bbd863121e0c9.tar.gz
tor-9fe6fea1cceb39fc415ad813020bbd863121e0c9.zip
Fix a huge pile of -Wshadow warnings.
These appeared on some of the Jenkins platforms. Apparently some GCCs care when you shadow globals, and some don't.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_address.c8
-rw-r--r--src/test/test_util.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/test/test_address.c b/src/test/test_address.c
index 82d6bc7a13..b4638f0702 100644
--- a/src/test/test_address.c
+++ b/src/test/test_address.c
@@ -562,13 +562,13 @@ static int last_connected_socket_fd = 0;
static int connect_retval = 0;
static tor_socket_t
-pretend_to_connect(tor_socket_t socket, const struct sockaddr *address,
+pretend_to_connect(tor_socket_t sock, const struct sockaddr *address,
socklen_t address_len)
{
(void)address;
(void)address_len;
- last_connected_socket_fd = socket;
+ last_connected_socket_fd = sock;
return connect_retval;
}
@@ -576,11 +576,11 @@ pretend_to_connect(tor_socket_t socket, const struct sockaddr *address,
static struct sockaddr *mock_addr = NULL;
static int
-fake_getsockname(tor_socket_t socket, struct sockaddr *address,
+fake_getsockname(tor_socket_t sock, struct sockaddr *address,
socklen_t *address_len)
{
socklen_t bytes_to_copy = 0;
- (void) socket;
+ (void) sock;
if (!mock_addr)
return -1;
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 843a57a2a2..5432b2ccc4 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -5240,12 +5240,12 @@ test_util_pwdb(void *arg)
tt_assert(dir != NULL);
/* Try failing cases. First find a user that doesn't exist by name */
- char rand[4];
+ char randbytes[4];
char badname[9];
int i, found=0;
for (i = 0; i < 100; ++i) {
- crypto_rand(rand, sizeof(rand));
- base16_encode(badname, sizeof(badname), rand, sizeof(rand));
+ crypto_rand(randbytes, sizeof(randbytes));
+ base16_encode(badname, sizeof(badname), randbytes, sizeof(randbytes));
if (tor_getpwnam(badname) == NULL) {
found = 1;
break;