folly/futures/test/WhileDoTest.cpp: avoid shadowing warnings
authorJim Meyering <meyering@fb.com>
Wed, 19 Oct 2016 03:01:00 +0000 (20:01 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Wed, 19 Oct 2016 03:09:30 +0000 (20:09 -0700)
Summary: Fix warnings exposed by the upstream-proposed -Wshadow-compatible-local option.

Reviewed By: nisardan

Differential Revision: D4041779

fbshipit-source-id: 375e485a30f01a0610d881fe8b3237cc062aedef

folly/futures/test/WhileDoTest.cpp

index 15fdfbf3371f0099174b71c04ca873178f7e4523..ef7c422c8541763d956dad27e8c7855c67630148 100644 (file)
@@ -121,11 +121,11 @@ TEST(WhileDo, failure) {
 TEST(WhileDo, interrupt) {
   std::queue<std::shared_ptr<Promise<Unit>>> ps;
   std::mutex ps_mutex;
-  int i = 0;
   int interrupt = 0;
   bool complete = false;
   bool failure = false;
 
+  int i = 0;
   auto pred = makePred(i);
   auto thunk = makeThunk(ps, interrupt, ps_mutex);
   auto f = folly::whileDo(pred, thunk)
@@ -137,7 +137,7 @@ TEST(WhileDo, interrupt) {
   FutureException eggs("eggs");
   f.raise(eggs);
 
-  for (int i = 1; i <= 3; ++i) {
+  for (int j = 1; j <= 3; ++j) {
     EXPECT_EQ(1, interrupt);
     popAndFulfillPromise(ps, ps_mutex);
   }