Commit 813fed9b authored by Dominik Charousset's avatar Dominik Charousset

Fix several warnings

parent 1031dae6
...@@ -321,6 +321,7 @@ logger::logger(actor_system& sys) : system_(sys) { ...@@ -321,6 +321,7 @@ logger::logger(actor_system& sys) : system_(sys) {
} }
void logger::init(actor_system_config& cfg) { void logger::init(actor_system_config& cfg) {
CAF_IGNORE_UNUSED(cfg);
#if defined(CAF_LOG_LEVEL) #if defined(CAF_LOG_LEVEL)
auto lvl_atom = cfg.logger_verbosity; auto lvl_atom = cfg.logger_verbosity;
switch (static_cast<uint64_t>(lvl_atom)) { switch (static_cast<uint64_t>(lvl_atom)) {
......
...@@ -241,7 +241,7 @@ struct binary_serialization_policy { ...@@ -241,7 +241,7 @@ struct binary_serialization_policy {
T y; T y;
g(y); g(y);
CAF_CHECK_EQUAL(x, y); CAF_CHECK_EQUAL(x, y);
return x == y; return detail::safe_equal(x, y);
} }
}; };
} // namespace <anonymous> } // namespace <anonymous>
......
...@@ -302,16 +302,16 @@ CAF_TEST(single_timeout) { ...@@ -302,16 +302,16 @@ CAF_TEST(single_timeout) {
CAF_MESSAGE("test implemenation " << f.second); CAF_MESSAGE("test implemenation " << f.second);
auto testee = system.spawn(f.first, &had_timeout, auto testee = system.spawn(f.first, &had_timeout,
system.spawn<lazy_init>(pong)); system.spawn<lazy_init>(pong));
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1); CAF_REQUIRE_EQUAL(sched.jobs.size(), 1u);
CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"ping"}); CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"ping"});
sched.run_once(); sched.run_once();
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1); CAF_REQUIRE_EQUAL(sched.jobs.size(), 1u);
CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"pong"}); CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"pong"});
sched.dispatch(); sched.dispatch();
CAF_REQUIRE_EQUAL(sched.jobs.size(), 2); CAF_REQUIRE_EQUAL(sched.jobs.size(), 2u);
// now, the timeout message is already dispatched, while pong did // now, the timeout message is already dispatched, while pong did
// not respond to the message yet, i.e., timeout arrives before response // not respond to the message yet, i.e., timeout arrives before response
CAF_CHECK_EQUAL(sched.run(), 2); CAF_CHECK_EQUAL(sched.run(), 2u);
CAF_CHECK(had_timeout); CAF_CHECK(had_timeout);
} }
} }
...@@ -325,13 +325,13 @@ CAF_TEST(nested_timeout) { ...@@ -325,13 +325,13 @@ CAF_TEST(nested_timeout) {
CAF_MESSAGE("test implemenation " << f.second); CAF_MESSAGE("test implemenation " << f.second);
auto testee = system.spawn(f.first, &had_timeout, auto testee = system.spawn(f.first, &had_timeout,
system.spawn<lazy_init>(pong)); system.spawn<lazy_init>(pong));
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1); CAF_REQUIRE_EQUAL(sched.jobs.size(), 1u);
CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"ping"}); CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"ping"});
sched.run_once(); sched.run_once();
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1); CAF_REQUIRE_EQUAL(sched.jobs.size(), 1u);
CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"pong"}); CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"pong"});
sched.dispatch(); sched.dispatch();
CAF_REQUIRE_EQUAL(sched.jobs.size(), 2); CAF_REQUIRE_EQUAL(sched.jobs.size(), 2u);
// now, the timeout message is already dispatched, while pong did // now, the timeout message is already dispatched, while pong did
// not respond to the message yet, i.e., timeout arrives before response // not respond to the message yet, i.e., timeout arrives before response
sched.run(); sched.run();
...@@ -355,13 +355,13 @@ CAF_TEST(multiplexed_timeout) { ...@@ -355,13 +355,13 @@ CAF_TEST(multiplexed_timeout) {
CAF_MESSAGE("test implemenation " << f.second); CAF_MESSAGE("test implemenation " << f.second);
auto testee = system.spawn(f.first, &had_timeout, auto testee = system.spawn(f.first, &had_timeout,
system.spawn<lazy_init>(pong)); system.spawn<lazy_init>(pong));
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1); CAF_REQUIRE_EQUAL(sched.jobs.size(), 1u);
CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"ping"}); CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"ping"});
sched.run_once(); sched.run_once();
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1); CAF_REQUIRE_EQUAL(sched.jobs.size(), 1u);
CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"pong"}); CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"pong"});
sched.dispatch(); sched.dispatch();
CAF_REQUIRE_EQUAL(sched.jobs.size(), 2); CAF_REQUIRE_EQUAL(sched.jobs.size(), 2u);
// now, the timeout message is already dispatched, while pong did // now, the timeout message is already dispatched, while pong did
// not respond to the message yet, i.e., timeout arrives before response // not respond to the message yet, i.e., timeout arrives before response
sched.run(); sched.run();
......
...@@ -104,7 +104,7 @@ CAF_TEST(duration_conversion) { ...@@ -104,7 +104,7 @@ CAF_TEST(duration_conversion) {
duration d1{time_unit::milliseconds, 100}; duration d1{time_unit::milliseconds, 100};
std::chrono::milliseconds d2{100}; std::chrono::milliseconds d2{100};
duration d3{d2}; duration d3{d2};
CAF_CHECK_EQUAL(d1.count, d2.count()); CAF_CHECK_EQUAL(d1.count, static_cast<uint64_t>(d2.count()));
CAF_CHECK_EQUAL(d1, d3); CAF_CHECK_EQUAL(d1, d3);
} }
......
...@@ -26,9 +26,6 @@ ...@@ -26,9 +26,6 @@
#include "caf/all.hpp" #include "caf/all.hpp"
#define ERROR_HANDLER \
[&](error& err) { CAF_FAIL(system.render(err)); }
using namespace caf; using namespace caf;
namespace { namespace {
......
...@@ -49,7 +49,7 @@ bool equal_to(const T& t, const U& u) { ...@@ -49,7 +49,7 @@ bool equal_to(const T& t, const U& u) {
auto y = static_cast<long double>(u); auto y = static_cast<long double>(u);
auto max = std::max(std::abs(x), std::abs(y)); auto max = std::max(std::abs(x), std::abs(y));
auto dif = std::abs(x - y); auto dif = std::abs(x - y);
return dif <= max * 1e-5; return dif <= max * 1e-5l;
} }
template <class T, class U, template <class T, class U,
......
...@@ -47,7 +47,7 @@ std::istream& skip_to_next_line(std::istream& in) { ...@@ -47,7 +47,7 @@ std::istream& skip_to_next_line(std::istream& in) {
std::istream& skip_word(std::istream& in) { std::istream& skip_word(std::istream& in) {
skip_whitespaces(in); skip_whitespaces(in);
auto nonspace = [](char x) { return isprint(x) && !isspace(x); }; auto nonspace = [](char x) { return isprint(x) && !isspace(x); };
while (nonspace(in.peek())) while (nonspace(static_cast<char>(in.peek())))
in.get(); in.get();
return in; return in;
} }
......
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