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