diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-07-05 14:19:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-07-28 06:58:44 -0400 |
commit | 47573038736b96e2a353a25ed3c788dcb77d8fcb (patch) | |
tree | 20b95e3228fd153eead07944848c8cd62367d1ed /src/test/test_scheduler.c | |
parent | 1135405c8c6ea315cd035171770a6701edae57f0 (diff) | |
download | tor-47573038736b96e2a353a25ed3c788dcb77d8fcb.tar.gz tor-47573038736b96e2a353a25ed3c788dcb77d8fcb.zip |
Fix all -Wshadow warnings on Linux
This is a partial fix for 18902.
Diffstat (limited to 'src/test/test_scheduler.c')
-rw-r--r-- | src/test/test_scheduler.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/test_scheduler.c b/src/test/test_scheduler.c index 15fbb2d186..f8b5046c70 100644 --- a/src/test/test_scheduler.c +++ b/src/test/test_scheduler.c @@ -150,7 +150,7 @@ channel_flush_some_cells_mock_free_all(void) static void channel_flush_some_cells_mock_set(channel_t *chan, ssize_t num_cells) { - flush_mock_channel_t *flush_mock_ch = NULL; + int found = 0; if (!chan) return; if (num_cells <= 0) return; @@ -166,6 +166,7 @@ channel_flush_some_cells_mock_set(channel_t *chan, ssize_t num_cells) if (flush_mock_ch->chan == chan) { /* Found it */ flush_mock_ch->cells = num_cells; + found = 1; break; } } else { @@ -175,8 +176,9 @@ channel_flush_some_cells_mock_set(channel_t *chan, ssize_t num_cells) } } SMARTLIST_FOREACH_END(flush_mock_ch); - if (!flush_mock_ch) { + if (! found) { /* The loop didn't find it */ + flush_mock_channel_t *flush_mock_ch; flush_mock_ch = tor_malloc_zero(sizeof(*flush_mock_ch)); flush_mock_ch->chan = chan; flush_mock_ch->cells = num_cells; |