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

Fix shadowing and conversion warnings on GCC

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