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