Commit 64cff1d0 authored by Dominik Charousset's avatar Dominik Charousset

Fix shadowing and conversion warnings on GCC

parent 737a2d9a
...@@ -26,22 +26,15 @@ ...@@ -26,22 +26,15 @@
namespace caf { namespace caf {
namespace io { namespace io {
namespace { uint16_t publish_local_groups(uint16_t port, const char* addr) {
auto group_nameserver = []() -> behavior {
struct group_nameserver : event_based_actor {
behavior make_behavior() override {
return { return {
[](get_atom, const std::string& name) { [](get_atom, const std::string& name) {
return group::get("local", name); return group::get("local", name);
} }
}; };
} };
}; auto gn = spawn<hidden>(group_nameserver);
} // namespace <anonymous>
uint16_t publish_local_groups(uint16_t port, const char* addr) {
auto gn = spawn<group_nameserver, hidden>();
uint16_t result; uint16_t result;
try { try {
result = publish(gn, port, addr); result = publish(gn, port, addr);
......
...@@ -28,9 +28,9 @@ test_multiplexer::~test_multiplexer() { ...@@ -28,9 +28,9 @@ test_multiplexer::~test_multiplexer() {
} }
connection_handle test_multiplexer::new_tcp_scribe(const std::string& host, connection_handle test_multiplexer::new_tcp_scribe(const std::string& host,
uint16_t port) { uint16_t desired_port) {
connection_handle result; connection_handle result;
auto i = scribes_.find(std::make_pair(host, port)); auto i = scribes_.find(std::make_pair(host, desired_port));
if (i != scribes_.end()) { if (i != scribes_.end()) {
result = i->second; result = i->second;
scribes_.erase(i); scribes_.erase(i);
...@@ -86,22 +86,22 @@ connection_handle test_multiplexer::add_tcp_scribe(abstract_broker*, ...@@ -86,22 +86,22 @@ connection_handle test_multiplexer::add_tcp_scribe(abstract_broker*,
connection_handle test_multiplexer::add_tcp_scribe(abstract_broker* ptr, connection_handle test_multiplexer::add_tcp_scribe(abstract_broker* ptr,
const std::string& host, const std::string& host,
uint16_t port) { uint16_t desired_port) {
auto hdl = new_tcp_scribe(host, port); auto hdl = new_tcp_scribe(host, desired_port);
if (hdl != invalid_connection_handle) if (hdl != invalid_connection_handle)
assign_tcp_scribe(ptr, hdl); assign_tcp_scribe(ptr, hdl);
return hdl; return hdl;
} }
std::pair<accept_handle, uint16_t> std::pair<accept_handle, uint16_t>
test_multiplexer::new_tcp_doorman(uint16_t port, const char*, bool) { test_multiplexer::new_tcp_doorman(uint16_t desired_port, const char*, bool) {
accept_handle result; accept_handle result;
auto i = doormen_.find(port); auto i = doormen_.find(desired_port);
if (i != doormen_.end()) { if (i != doormen_.end()) {
result = i->second; result = i->second;
doormen_.erase(i); doormen_.erase(i);
} }
return {result, port}; return {result, desired_port};
} }
void test_multiplexer::assign_tcp_doorman(abstract_broker* ptr, void test_multiplexer::assign_tcp_doorman(abstract_broker* ptr,
...@@ -169,14 +169,15 @@ void test_multiplexer::run() { ...@@ -169,14 +169,15 @@ void test_multiplexer::run() {
// nop // nop
} }
void test_multiplexer::provide_scribe(std::string host, uint16_t port, void test_multiplexer::provide_scribe(std::string host, uint16_t desired_port,
connection_handle hdl) { connection_handle hdl) {
scribes_.emplace(std::make_pair(std::move(host), port), hdl); scribes_.emplace(std::make_pair(std::move(host), desired_port), hdl);
} }
void test_multiplexer::provide_acceptor(uint16_t port, accept_handle hdl) { void test_multiplexer::provide_acceptor(uint16_t desired_port,
doormen_.emplace(port, hdl); accept_handle hdl) {
doorman_data_[hdl].port = port; doormen_.emplace(desired_port, hdl);
doorman_data_[hdl].port = desired_port;
} }
/// The external input buffer should be filled by /// The external input buffer should be filled by
......
...@@ -90,7 +90,7 @@ namespace { ...@@ -90,7 +90,7 @@ namespace {
throw std::logic_error("unexpected timeout"); \ throw std::logic_error("unexpected timeout"); \
} }
static constexpr size_t num_remote_nodes = 2; static constexpr uint32_t num_remote_nodes = 2;
using buffer = std::vector<char>; using buffer = std::vector<char>;
...@@ -128,7 +128,7 @@ public: ...@@ -128,7 +128,7 @@ public:
for (uint32_t i = 0; i < num_remote_nodes; ++i) { for (uint32_t i = 0; i < num_remote_nodes; ++i) {
node_id::host_id_type tmp = this_node_.host_id(); node_id::host_id_type tmp = this_node_.host_id();
for (auto& c : tmp) for (auto& c : tmp)
c += static_cast<uint8_t>(i + 1); c = static_cast<uint8_t>(c + i + 1);
remote_node_[i] = node_id{this_node_.process_id() + i + 1, tmp}; remote_node_[i] = node_id{this_node_.process_id() + i + 1, tmp};
remote_hdl_[i] = connection_handle::from_int(i + 1); remote_hdl_[i] = connection_handle::from_int(i + 1);
auto& ptr = pseudo_remote_[i]; auto& ptr = pseudo_remote_[i];
...@@ -335,9 +335,8 @@ public: ...@@ -335,9 +335,8 @@ public:
message msg; message msg;
auto source = make_deserializer(buf); auto source = make_deserializer(buf);
msg.deserialize(source); msg.deserialize(source);
auto registry = detail::singletons::get_actor_registry(); auto src = registry_->get(hdr.source_actor);
auto src = registry->get(hdr.source_actor); auto dest = registry_->get(hdr.dest_actor);
auto dest = registry->get(hdr.dest_actor);
CAF_REQUIRE(dest != nullptr); CAF_REQUIRE(dest != nullptr);
dest->enqueue(src ? src->address() : invalid_actor_addr, dest->enqueue(src ? src->address() : invalid_actor_addr,
message_id::make(), std::move(msg), nullptr); message_id::make(), std::move(msg), nullptr);
...@@ -613,11 +612,11 @@ CAF_TEST(remote_actor_and_send) { ...@@ -613,11 +612,11 @@ CAF_TEST(remote_actor_and_send) {
} }
CAF_TEST(actor_serialize_and_deserialize) { CAF_TEST(actor_serialize_and_deserialize) {
auto testee_impl = [](event_based_actor* self) -> behavior { auto testee_impl = [](event_based_actor* testee_self) -> behavior {
return { return {
others >> [=] { others >> [=] {
self->quit(); testee_self->quit();
return self->current_message(); return testee_self->current_message();
} }
}; };
}; };
......
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