Commit c4a54050 authored by Dominik Charousset's avatar Dominik Charousset

Fix shadowing warnings

parent fd0c18e2
...@@ -64,10 +64,10 @@ class proper_actor_base : public Policies::resume_policy::template ...@@ -64,10 +64,10 @@ class proper_actor_base : public Policies::resume_policy::template
scheduling_policy().enqueue(dptr(), sender, mid, msg, eu); scheduling_policy().enqueue(dptr(), sender, mid, msg, eu);
} }
inline void launch(bool hide, bool lazy, execution_unit* host) { inline void launch(bool hide, bool lazy, execution_unit* eu) {
CAF_LOG_TRACE(""); CAF_LOG_TRACE("");
this->is_registered(!hide); this->is_registered(!hide);
this->scheduling_policy().launch(this, host, lazy); this->scheduling_policy().launch(this, eu, lazy);
} }
template <class F> template <class F>
...@@ -255,17 +255,17 @@ class proper_actor<Base, Policies, true> ...@@ -255,17 +255,17 @@ class proper_actor<Base, Policies, true>
} }
restore_cache(); restore_cache();
} }
bool has_timeout = false; bool timeout_valid = false;
uint32_t timeout_id; uint32_t timeout_id;
// request timeout if needed // request timeout if needed
if (bhvr.timeout().valid()) { if (bhvr.timeout().valid()) {
has_timeout = true; timeout_valid = true;
timeout_id = this->request_timeout(bhvr.timeout()); timeout_id = this->request_timeout(bhvr.timeout());
} }
// workaround for GCC 4.7 bug (const this when capturing refs) // workaround for GCC 4.7 bug (const this when capturing refs)
auto& pending_timeouts = m_pending_timeouts; auto& pending_timeouts = m_pending_timeouts;
auto guard = detail::make_scope_guard([&] { auto guard = detail::make_scope_guard([&] {
if (has_timeout) { if (timeout_valid) {
auto e = pending_timeouts.end(); auto e = pending_timeouts.end();
auto i = std::find(pending_timeouts.begin(), e, timeout_id); auto i = std::find(pending_timeouts.begin(), e, timeout_id);
if (i != e) { if (i != e) {
......
...@@ -504,8 +504,8 @@ class local_actor : public extend<abstract_actor>::with<mixin::memory_cached> { ...@@ -504,8 +504,8 @@ class local_actor : public extend<abstract_actor>::with<mixin::memory_cached> {
// returns 0 if last_dequeued() is an asynchronous or sync request message, // returns 0 if last_dequeued() is an asynchronous or sync request message,
// a response id generated from the request id otherwise // a response id generated from the request id otherwise
inline message_id get_response_id() { inline message_id get_response_id() {
auto id = m_current_node->mid; auto mid = m_current_node->mid;
return (id.is_request()) ? id.response_id() : message_id(); return (mid.is_request()) ? mid.response_id() : message_id();
} }
void reply_message(message&& what); void reply_message(message&& what);
......
...@@ -43,10 +43,10 @@ class worker : public execution_unit { ...@@ -43,10 +43,10 @@ class worker : public execution_unit {
using coordinator_ptr = coordinator<Policy>*; using coordinator_ptr = coordinator<Policy>*;
using policy_data = typename Policy::worker_data; using policy_data = typename Policy::worker_data;
worker(size_t id, coordinator_ptr parent, size_t max_throughput) worker(size_t worker_id, coordinator_ptr worker_parent, size_t throughput)
: m_max_throughput(max_throughput), : m_max_throughput(throughput),
m_id(id), m_id(worker_id),
m_parent(parent) { m_parent(worker_parent) {
// nop // nop
} }
......
...@@ -44,7 +44,7 @@ bool abstract_group::subscription::matches(const token& what) { ...@@ -44,7 +44,7 @@ bool abstract_group::subscription::matches(const token& what) {
return ot.group == m_group; return ot.group == m_group;
} }
abstract_group::module::module(std::string name) : m_name(std::move(name)) { abstract_group::module::module(std::string mname) : m_name(std::move(mname)) {
// nop // nop
} }
......
...@@ -64,8 +64,8 @@ actor_exited::~actor_exited() noexcept { ...@@ -64,8 +64,8 @@ actor_exited::~actor_exited() noexcept {
// nop // nop
} }
actor_exited::actor_exited(uint32_t reason) : caf_exception(ae_what(reason)) { actor_exited::actor_exited(uint32_t rsn) : caf_exception(ae_what(rsn)) {
m_reason = reason; m_reason = rsn;
} }
network_error::network_error(const std::string& str) : super(str) { network_error::network_error(const std::string& str) : super(str) {
......
...@@ -30,10 +30,10 @@ using namespace std; ...@@ -30,10 +30,10 @@ using namespace std;
namespace caf { namespace caf {
forwarding_actor_proxy::forwarding_actor_proxy(actor_id aid, node_id nid, forwarding_actor_proxy::forwarding_actor_proxy(actor_id aid, node_id nid,
actor manager) actor mgr)
: actor_proxy(aid, nid), : actor_proxy(aid, nid),
m_manager(manager) { m_manager(mgr) {
CAF_REQUIRE(manager != invalid_actor); CAF_REQUIRE(mgr != invalid_actor);
CAF_LOG_INFO(CAF_ARG(aid) << ", " << CAF_TARG(nid, to_string)); CAF_LOG_INFO(CAF_ARG(aid) << ", " << CAF_TARG(nid, to_string));
} }
......
...@@ -30,7 +30,7 @@ group::group(const invalid_group_t&) : m_ptr(nullptr) { ...@@ -30,7 +30,7 @@ group::group(const invalid_group_t&) : m_ptr(nullptr) {
// nop // nop
} }
group::group(abstract_group_ptr ptr) : m_ptr(std::move(ptr)) { group::group(abstract_group_ptr gptr) : m_ptr(std::move(gptr)) {
// nop // nop
} }
......
...@@ -103,13 +103,13 @@ void local_actor::reply_message(message&& what) { ...@@ -103,13 +103,13 @@ void local_actor::reply_message(message&& what) {
if (!whom) { if (!whom) {
return; return;
} }
auto& id = m_current_node->mid; auto& mid = m_current_node->mid;
if (id.valid() == false || id.is_response()) { if (mid.valid() == false || mid.is_response()) {
send_tuple(actor_cast<channel>(whom), std::move(what)); send_tuple(actor_cast<channel>(whom), std::move(what));
} else if (!id.is_answered()) { } else if (!mid.is_answered()) {
auto ptr = actor_cast<actor>(whom); auto ptr = actor_cast<actor>(whom);
ptr->enqueue(address(), id.response_id(), std::move(what), host()); ptr->enqueue(address(), mid.response_id(), std::move(what), host());
id.mark_as_answered(); mid.mark_as_answered();
} }
} }
...@@ -117,10 +117,10 @@ void local_actor::forward_message(const actor& dest, message_priority prio) { ...@@ -117,10 +117,10 @@ void local_actor::forward_message(const actor& dest, message_priority prio) {
if (!dest) { if (!dest) {
return; return;
} }
auto id = (prio == message_priority::high) auto mid = (prio == message_priority::high)
? m_current_node->mid.with_high_priority() ? m_current_node->mid.with_high_priority()
: m_current_node->mid.with_normal_priority(); : m_current_node->mid.with_normal_priority();
dest->enqueue(m_current_node->sender, id, m_current_node->msg, host()); dest->enqueue(m_current_node->sender, mid, m_current_node->msg, host());
// treat this message as asynchronous message from now on // treat this message as asynchronous message from now on
m_current_node->mid = invalid_message_id; m_current_node->mid = invalid_message_id;
} }
...@@ -130,11 +130,11 @@ void local_actor::send_tuple(message_priority prio, const channel& dest, ...@@ -130,11 +130,11 @@ void local_actor::send_tuple(message_priority prio, const channel& dest,
if (!dest) { if (!dest) {
return; return;
} }
message_id id; message_id mid;
if (prio == message_priority::high) { if (prio == message_priority::high) {
id = id.with_high_priority(); mid = mid.with_high_priority();
} }
dest->enqueue(address(), id, std::move(what), host()); dest->enqueue(address(), mid, std::move(what), host());
} }
void local_actor::send_exit(const actor_addr& whom, uint32_t reason) { void local_actor::send_exit(const actor_addr& whom, uint32_t reason) {
......
...@@ -33,7 +33,7 @@ message::message(message&& other) : m_vals(std::move(other.m_vals)) { ...@@ -33,7 +33,7 @@ message::message(message&& other) : m_vals(std::move(other.m_vals)) {
// nop // nop
} }
message::message(const data_ptr& vals) : m_vals(vals) { message::message(const data_ptr& ptr) : m_vals(ptr) {
// nop // nop
} }
......
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
namespace caf { namespace caf {
namespace detail { namespace detail {
message_iterator::message_iterator(const_pointer data, size_t pos) message_iterator::message_iterator(const_pointer dataptr, size_t pos)
: m_pos(pos), : m_pos(pos),
m_data(data) { m_data(dataptr) {
// nop // nop
} }
......
...@@ -87,9 +87,9 @@ const uniform_type_info* uniform_type_info::from(const std::string& name) { ...@@ -87,9 +87,9 @@ const uniform_type_info* uniform_type_info::from(const std::string& name) {
return result; return result;
} }
uniform_value uniform_type_info::deserialize(deserializer* from) const { uniform_value uniform_type_info::deserialize(deserializer* src) const {
auto uval = create(); auto uval = create();
deserialize(uval->val, from); deserialize(uval->val, src);
return std::move(uval); return std::move(uval);
} }
......
...@@ -600,10 +600,10 @@ protected: ...@@ -600,10 +600,10 @@ protected:
class default_meta_message : public uniform_type_info { class default_meta_message : public uniform_type_info {
public: public:
default_meta_message(const std::string& name) { default_meta_message(const std::string& tname) {
m_name = name; m_name = tname;
std::vector<std::string> elements; std::vector<std::string> elements;
split(elements, name, is_any_of("+")); split(elements, tname, is_any_of("+"));
auto uti_map = detail::singletons::get_uniform_type_info_map(); auto uti_map = detail::singletons::get_uniform_type_info_map();
CAF_REQUIRE(elements.size() > 0 && elements.front() == "@<>"); CAF_REQUIRE(elements.size() > 0 && elements.front() == "@<>");
// ignore first element, because it's always "@<>" // ignore first element, because it's always "@<>"
......
...@@ -246,8 +246,8 @@ class event_handler { ...@@ -246,8 +246,8 @@ class event_handler {
/** /**
* Sets the bit field storing the subscribed events. * Sets the bit field storing the subscribed events.
*/ */
inline void eventbf(int eventbf) { inline void eventbf(int value) {
m_eventbf = eventbf; m_eventbf = value;
} }
/** /**
...@@ -442,9 +442,9 @@ class stream : public event_handler { ...@@ -442,9 +442,9 @@ class stream : public event_handler {
*/ */
using buffer_type = std::vector<char>; using buffer_type = std::vector<char>;
stream(default_multiplexer& backend) stream(default_multiplexer& backend_ref)
: event_handler(backend), : event_handler(backend_ref),
m_sock(backend), m_sock(backend_ref),
m_writing(false) { m_writing(false) {
configure_read(receive_policy::at_most(1024)); configure_read(receive_policy::at_most(1024));
} }
...@@ -466,8 +466,8 @@ class stream : public event_handler { ...@@ -466,8 +466,8 @@ class stream : public event_handler {
/** /**
* Initializes this stream, setting the socket handle to `fd`. * Initializes this stream, setting the socket handle to `fd`.
*/ */
void init(Socket fd) { void init(Socket sockfd) {
m_sock = std::move(fd); m_sock = std::move(sockfd);
} }
/** /**
...@@ -681,10 +681,10 @@ class acceptor : public event_handler { ...@@ -681,10 +681,10 @@ class acceptor : public event_handler {
*/ */
using manager_ptr = intrusive_ptr<manager_type>; using manager_ptr = intrusive_ptr<manager_type>;
acceptor(default_multiplexer& backend) acceptor(default_multiplexer& backend_ref)
: event_handler(backend), : event_handler(backend_ref),
m_accept_sock(backend), m_accept_sock(backend_ref),
m_sock(backend) { m_sock(backend_ref) {
// nop // nop
} }
...@@ -737,10 +737,10 @@ class acceptor : public event_handler { ...@@ -737,10 +737,10 @@ class acceptor : public event_handler {
CAF_LOG_TRACE("m_accept_sock.fd = " << m_accept_sock.fd() CAF_LOG_TRACE("m_accept_sock.fd = " << m_accept_sock.fd()
<< ", op = " << static_cast<int>(op)); << ", op = " << static_cast<int>(op));
if (m_mgr && op == operation::read) { if (m_mgr && op == operation::read) {
native_socket fd = invalid_native_socket; native_socket sockfd = invalid_native_socket;
if (try_accept(fd, m_accept_sock.fd())) { if (try_accept(sockfd, m_accept_sock.fd())) {
if (fd != invalid_native_socket) { if (sockfd != invalid_native_socket) {
m_sock = socket_type{backend(), fd}; m_sock = socket_type{backend(), sockfd};
m_mgr->new_connection(); m_mgr->new_connection();
} }
} }
......
...@@ -62,8 +62,9 @@ void broker::servant::disconnect(bool invoke_disconnect_message) { ...@@ -62,8 +62,9 @@ void broker::servant::disconnect(bool invoke_disconnect_message) {
} }
} }
broker::scribe::scribe(broker* parent, connection_handle hdl) broker::scribe::scribe(broker* ptr, connection_handle conn_hdl)
: servant(parent), m_hdl(hdl) { : servant(ptr),
m_hdl(conn_hdl) {
std::vector<char> tmp; std::vector<char> tmp;
m_read_msg = make_message(new_data_msg{m_hdl, std::move(tmp)}); m_read_msg = make_message(new_data_msg{m_hdl, std::move(tmp)});
} }
...@@ -100,8 +101,8 @@ void broker::scribe::io_failure(network::operation op) { ...@@ -100,8 +101,8 @@ void broker::scribe::io_failure(network::operation op) {
disconnect(true); disconnect(true);
} }
broker::doorman::doorman(broker* parent, accept_handle hdl) broker::doorman::doorman(broker* ptr, accept_handle acc_hdl)
: servant(parent), m_hdl(hdl) { : servant(ptr), m_hdl(acc_hdl) {
auto hdl2 = connection_handle::from_int(-1); auto hdl2 = connection_handle::from_int(-1);
m_accept_msg = make_message(new_connection_msg{m_hdl, hdl2}); m_accept_msg = make_message(new_connection_msg{m_hdl, hdl2});
} }
...@@ -334,8 +335,8 @@ void broker::close_all() { ...@@ -334,8 +335,8 @@ void broker::close_all() {
std::vector<connection_handle> broker::connections() const { std::vector<connection_handle> broker::connections() const {
std::vector<connection_handle> result; std::vector<connection_handle> result;
for (auto& scribe : m_scribes) { for (auto& kvp : m_scribes) {
result.push_back(scribe.first); result.push_back(kvp.first);
} }
return result; return result;
} }
......
...@@ -676,8 +676,8 @@ connection_handle default_multiplexer::add_tcp_scribe(broker* self, ...@@ -676,8 +676,8 @@ connection_handle default_multiplexer::add_tcp_scribe(broker* self,
CAF_LOG_TRACE(""); CAF_LOG_TRACE("");
class impl : public broker::scribe { class impl : public broker::scribe {
public: public:
impl(broker* parent, default_socket&& s) impl(broker* ptr, default_socket&& s)
: scribe(parent, network::conn_hdl_from_socket(s)), : scribe(ptr, network::conn_hdl_from_socket(s)),
m_launched(false), m_launched(false),
m_stream(s.backend()) { m_stream(s.backend()) {
m_stream.init(std::move(s)); m_stream.init(std::move(s));
...@@ -723,8 +723,8 @@ accept_handle default_multiplexer::add_tcp_doorman(broker* self, ...@@ -723,8 +723,8 @@ accept_handle default_multiplexer::add_tcp_doorman(broker* self,
CAF_REQUIRE(sock.fd() != network::invalid_native_socket); CAF_REQUIRE(sock.fd() != network::invalid_native_socket);
class impl : public broker::doorman { class impl : public broker::doorman {
public: public:
impl(broker* parent, default_socket_acceptor&& s) impl(broker* ptr, default_socket_acceptor&& s)
: doorman(parent, network::accept_hdl_from_socket(s)), : doorman(ptr, network::accept_hdl_from_socket(s)),
m_acceptor(s.backend()) { m_acceptor(s.backend()) {
m_acceptor.init(std::move(s)); m_acceptor.init(std::move(s));
} }
...@@ -861,11 +861,11 @@ event_handler::~event_handler() { ...@@ -861,11 +861,11 @@ event_handler::~event_handler() {
// nop // nop
} }
default_socket::default_socket(default_multiplexer& parent, native_socket fd) default_socket::default_socket(default_multiplexer& ref, native_socket sockfd)
: m_parent(parent), : m_parent(ref),
m_fd(fd) { m_fd(sockfd) {
CAF_LOG_TRACE(CAF_ARG(fd)); CAF_LOG_TRACE(CAF_ARG(sockfd));
if (fd != invalid_native_socket) { if (sockfd != invalid_native_socket) {
// enable nonblocking IO & disable Nagle's algorithm // enable nonblocking IO & disable Nagle's algorithm
nonblocking(m_fd, true); nonblocking(m_fd, true);
tcp_nodelay(m_fd, true); tcp_nodelay(m_fd, true);
......
...@@ -35,7 +35,7 @@ struct float_or_int : event_based_actor { ...@@ -35,7 +35,7 @@ struct float_or_int : event_based_actor {
struct popular_actor : event_based_actor { // popular actors have a buddy struct popular_actor : event_based_actor { // popular actors have a buddy
actor m_buddy; actor m_buddy;
popular_actor(const actor& buddy) : m_buddy(buddy) { popular_actor(const actor& buddy_arg) : m_buddy(buddy_arg) {
// nop // nop
} }
inline const actor& buddy() const { inline const actor& buddy() const {
...@@ -62,7 +62,7 @@ struct popular_actor : event_based_actor { // popular actors have a buddy ...@@ -62,7 +62,7 @@ struct popular_actor : event_based_actor { // popular actors have a buddy
\ ******************************************************************************/ \ ******************************************************************************/
struct A : popular_actor { struct A : popular_actor {
A(const actor& buddy) : popular_actor(buddy) { A(const actor& buddy_arg) : popular_actor(buddy_arg) {
// nop // nop
} }
behavior make_behavior() override { behavior make_behavior() override {
...@@ -85,7 +85,7 @@ struct A : popular_actor { ...@@ -85,7 +85,7 @@ struct A : popular_actor {
}; };
struct B : popular_actor { struct B : popular_actor {
B(const actor& buddy) : popular_actor(buddy) { B(const actor& buddy_arg) : popular_actor(buddy_arg) {
// nop // nop
} }
behavior make_behavior() override { behavior make_behavior() override {
...@@ -127,7 +127,7 @@ struct C : event_based_actor { ...@@ -127,7 +127,7 @@ struct C : event_based_actor {
\ ******************************************************************************/ \ ******************************************************************************/
struct D : popular_actor { struct D : popular_actor {
D(const actor& buddy) : popular_actor(buddy) {} D(const actor& buddy_arg) : popular_actor(buddy_arg) {}
behavior make_behavior() override { behavior make_behavior() override {
return { return {
others() >> [=] { others() >> [=] {
......
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