Commit 81a037df authored by Jim Meyering's avatar Jim Meyering Committed by Facebook Github Bot

folly/experimental: avoid shadowing warnings

Summary: Fix warnings exposed by the upstream-proposed -Wshadow-compatible-local option.

Reviewed By: philippv

Differential Revision: D4041749

fbshipit-source-id: 9e0dcec3b35c60e5588a2e53dfdb8605e74721c4
parent 4bcf8a24
...@@ -167,9 +167,9 @@ struct EliasFanoEncoderV2 { ...@@ -167,9 +167,9 @@ struct EliasFanoEncoderV2 {
/* static */ if (forwardQuantum != 0) { /* static */ if (forwardQuantum != 0) {
if ((size_ + 1) % forwardQuantum == 0) { if ((size_ + 1) % forwardQuantum == 0) {
const auto pos = size_ / forwardQuantum; const auto k = size_ / forwardQuantum;
// Store the number of preceding 0-bits. // Store the number of preceding 0-bits.
forwardPointers_[pos] = upperBits; forwardPointers_[k] = upperBits;
} }
} }
......
...@@ -287,9 +287,9 @@ void AsyncIOQueue::maybeDequeue() { ...@@ -287,9 +287,9 @@ void AsyncIOQueue::maybeDequeue() {
// Interpose our completion callback // Interpose our completion callback
auto& nextCb = op->notificationCallback(); auto& nextCb = op->notificationCallback();
op->setNotificationCallback([this, nextCb](AsyncIOOp* op) { op->setNotificationCallback([this, nextCb](AsyncIOOp* op2) {
this->onCompleted(op); this->onCompleted(op2);
if (nextCb) nextCb(op); if (nextCb) nextCb(op2);
}); });
asyncIO_->submit(op); asyncIO_->submit(op);
......
...@@ -45,8 +45,8 @@ struct StubClock { ...@@ -45,8 +45,8 @@ struct StubClock {
int StubClock::t = 0; int StubClock::t = 0;
TEST(TestAutoTimer, HandleBasicClosure) { TEST(TestAutoTimer, HandleBasicClosure) {
auto logger = [](StringPiece msg, auto sec) { auto logger = [](StringPiece mesg, auto sec) {
return StubLogger()(msg, sec); return StubLogger()(mesg, sec);
}; };
StubClock::t = 1; StubClock::t = 1;
// Here decltype is needed. But since most users are expected to use this // Here decltype is needed. But since most users are expected to use this
...@@ -93,8 +93,8 @@ TEST(TestAutoTimer, HandleRealTimerClosure) { ...@@ -93,8 +93,8 @@ TEST(TestAutoTimer, HandleRealTimerClosure) {
auto t = makeAutoTimer( auto t = makeAutoTimer(
"Third message on destruction", "Third message on destruction",
std::chrono::duration<double>::zero(), std::chrono::duration<double>::zero(),
[](StringPiece msg, auto sec) { [](StringPiece mesg, auto sec) {
GoogleLogger<GoogleLoggerStyle::PRETTY>()(msg, sec); GoogleLogger<GoogleLoggerStyle::PRETTY>()(mesg, sec);
}); });
t.log("First message"); t.log("First message");
t.log("Second message"); t.log("Second message");
......
...@@ -192,15 +192,15 @@ TEST(TestDynamicParser, AllParserFeaturesSuccess) { ...@@ -192,15 +192,15 @@ TEST(TestDynamicParser, AllParserFeaturesSuccess) {
p.required(4, [&](const dynamic& v) { p.required(4, [&](const dynamic& v) {
EXPECT_EQ(4, p.key().getInt()); EXPECT_EQ(4, p.key().getInt());
EXPECT_EQ(v, p.value()); EXPECT_EQ(v, p.value());
p.optional("bools", [&](const std::string& k, const dynamic& v) { p.optional("bools", [&](const std::string& k, const dynamic& v2) {
EXPECT_EQ(std::string("bools"), k); EXPECT_EQ(std::string("bools"), k);
EXPECT_EQ(k, p.key().getString()); EXPECT_EQ(k, p.key().getString());
EXPECT_EQ(v, p.value()); EXPECT_EQ(v2, p.value());
p.arrayItems([&](int64_t k, bool v) { p.arrayItems([&](int64_t k, bool v3) {
EXPECT_EQ(bools.size(), k); EXPECT_EQ(bools.size(), k);
EXPECT_EQ(k, p.key().getInt()); EXPECT_EQ(k, p.key().getInt());
EXPECT_EQ(v, p.value().asBool()); EXPECT_EQ(v3, p.value().asBool());
bools.push_back(v); bools.push_back(v3);
}); });
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment