Commit 5d53b331 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Fix folly/experimental/pushmi/ under gcc8 with -Wshadow

Summary: [Folly] Fix `folly/experimental/pushmi/` under gcc8 with `-Wshadow`.

Reviewed By: ericniebler

Differential Revision: D13648409

fbshipit-source-id: 2d46c3a5fa3587e954cb842c2207dceb01958008
parent 9e17ee2e
......@@ -169,8 +169,8 @@ struct entangled {
entangled& operator=(const entangled&) = delete;
entangled& operator=(entangled&&) = delete;
explicit entangled(T t)
: stateMachine(kUnlocked), t(std::move(t)), dual(nullptr) {}
explicit entangled(T t_)
: stateMachine(kUnlocked), t(std::move(t_)), dual(nullptr) {}
entangled(entangled&& other)
: stateMachine((other.lockBoth(), kLocked)),
t(std::move(other.t)),
......@@ -236,7 +236,7 @@ struct locked_entangled_pair : std::pair<T*, Dual*> {
e->unlockBoth();
}
}
explicit locked_entangled_pair(entangled<T, Dual>& e) : e(std::addressof(e)) {
explicit locked_entangled_pair(entangled<T, Dual>& e_) : e(std::addressof(e_)) {
this->e->lockBoth();
this->first = std::addressof(this->e->t);
this->second = !!this->e->dual ? std::addressof(this->e->dual->t) : nullptr;
......@@ -303,8 +303,8 @@ struct locked_shared_entangled_pair : std::pair<T*, Dual*> {
e.lock->unlock();
}
}
explicit locked_shared_entangled_pair(shared_entangled<T, Dual>& e)
: e(std::move(e)) {
explicit locked_shared_entangled_pair(shared_entangled<T, Dual>& e_)
: e(std::move(e_)) {
this->e.lock->lock();
this->first = this->e.get();
this->second = this->e.dual;
......
......@@ -45,7 +45,7 @@ PUSHMI_INLINE_VAR constexpr struct bulk_fn {
make_receiver(
std::move(out),
[func, sb, se, driver, initFunc, selector](
auto& out, auto input) {
auto& out_, auto input) {
driver(
initFunc,
selector,
......@@ -53,7 +53,7 @@ PUSHMI_INLINE_VAR constexpr struct bulk_fn {
func,
sb,
se,
std::move(out));
std::move(out_));
}));
});
};
......
......@@ -44,8 +44,8 @@ auto println = [](auto v) { std::cout << v << std::endl; };
template <class T, class E = std::exception_ptr>
auto concat = [](auto in) {
return mi::make_single_sender([in](auto out) mutable {
mi::submit(in, mi::make_receiver(out, [](auto out, auto v) {
mi::submit(v, mi::any_receiver<E, T>(out));
mi::submit(in, mi::make_receiver(out, [](auto out_, auto v) {
mi::submit(v, mi::any_receiver<E, T>(out_));
}));
});
};
......
......@@ -31,8 +31,8 @@ using namespace folly::pushmi::aliases;
template <class T, class E = std::exception_ptr>
auto concat = [](auto in) {
return mi::make_single_sender([in](auto out) mutable {
mi::submit(in, mi::make_receiver(out, [](auto out, auto v) {
mi::submit(v, mi::any_receiver<E, T>(out));
mi::submit(in, mi::make_receiver(out, [](auto out_, auto v) {
mi::submit(v, mi::any_receiver<E, T>(out_));
}));
});
};
......
......@@ -79,11 +79,11 @@ PUSHMI_INLINE_VAR constexpr struct from_fn {
template <class I, class S, class Out, class Exec>
struct flow_from_producer {
flow_from_producer(I begin, S end, Out out, Exec exec, bool s)
flow_from_producer(I begin, S end_, Out out_, Exec exec_, bool s)
: c(begin),
end(end),
out(std::move(out)),
exec(std::move(exec)),
end(end_),
out(std::move(out_)),
exec(std::move(exec_)),
stop(s) {}
I c;
S end;
......@@ -96,7 +96,7 @@ template <class Producer>
struct flow_from_up {
using properties = properties_t<receiver<>>;
explicit flow_from_up(std::shared_ptr<Producer> p) : p(std::move(p)) {}
explicit flow_from_up(std::shared_ptr<Producer> p_) : p(std::move(p_)) {}
std::shared_ptr<Producer> p;
void value(std::ptrdiff_t requested) {
......
......@@ -35,8 +35,8 @@ struct via_fn_base {
};
template <class Executor, class Out>
struct via_fn_data : public Out, public via_fn_base<Executor> {
via_fn_data(Out out, Executor exec)
: Out(std::move(out)), via_fn_base<Executor>(std::move(exec)) {}
via_fn_data(Out out, Executor ex)
: Out(std::move(out)), via_fn_base<Executor>(std::move(ex)) {}
using Out::done;
using Out::error;
......
......@@ -52,7 +52,7 @@ class ImmediateFlowManySender : public Test {
return mi::MAKE(flow_many_sender)([&](auto out) {
using Out = decltype(out);
struct Data : mi::receiver<> {
explicit Data(Out out) : out(std::move(out)), stop(false) {}
explicit Data(Out out_) : out(std::move(out_)), stop(false) {}
Out out;
bool stop;
};
......@@ -149,8 +149,8 @@ class ConcurrentFlowManySender : public Test {
// boolean cancellation
struct producer {
producer(Out out, TNT tnt, bool s)
: out(std::move(out)), tnt(std::move(tnt)), stop(s) {}
producer(Out out_, TNT tnt_, bool s)
: out(std::move(out_)), tnt(std::move(tnt_)), stop(s) {}
Out out;
TNT tnt;
std::atomic<bool> stop;
......@@ -158,7 +158,7 @@ class ConcurrentFlowManySender : public Test {
auto p = std::make_shared<producer>(std::move(out), tnt_, false);
struct Data : mi::receiver<> {
explicit Data(std::shared_ptr<producer> p) : p(std::move(p)) {}
explicit Data(std::shared_ptr<producer> p_) : p(std::move(p_)) {}
std::shared_ptr<producer> p;
};
......
......@@ -65,7 +65,7 @@ class ImmediateFlowSingleSender : public Test {
using Stopper = decltype(tokens.second);
struct Data : mi::receiver<> {
explicit Data(Stopper stopper) : stopper(std::move(stopper)) {}
explicit Data(Stopper stopper_) : stopper(std::move(stopper_)) {}
Stopper stopper;
};
auto up = mi::MAKE(receiver)(
......@@ -165,7 +165,7 @@ class ConcurrentFlowSingleSender : public Test {
using Stopper = decltype(tokens.second);
struct Data : mi::receiver<> {
explicit Data(Stopper stopper) : stopper(std::move(stopper)) {}
explicit Data(Stopper stopper_) : stopper(std::move(stopper_)) {}
Stopper stopper;
};
auto up = mi::MAKE(receiver)(
......
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