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