Skip to content

Commit

Permalink
Fix warnings in release with more warnings flag
Browse files Browse the repository at this point in the history
  • Loading branch information
josephnoir committed Jan 16, 2015
1 parent 19bb3b8 commit 7ab1528
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions examples/brokers/simple_broker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ behavior broker_impl(broker* self, connection_handle hdl, const actor& buddy) {
// brokers can multiplex any number of connections, however
// this example assumes io_fsm to manage a broker with
// exactly one connection
assert(msg.handle == hdl);
aout(self) << "connection closed" << endl;
// force buddy to quit
self->send_exit(buddy, exit_reason::remote_link_unreachable);
self->quit(exit_reason::remote_link_unreachable);
if (msg.handle == hdl) {
aout(self) << "connection closed" << endl;
// force buddy to quit
self->send_exit(buddy, exit_reason::remote_link_unreachable);
self->quit(exit_reason::remote_link_unreachable);
}
},
[=](atom_value av, int32_t i) {
assert(av == atom("ping") || av == atom("pong"));
Expand Down
8 changes: 4 additions & 4 deletions examples/message_passing/typed_calculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ void tester(event_based_actor* self, const calculator_type& testee) {
// first test: 2 + 1 = 3
self->sync_send(testee, plus_request{2, 1}).then(
[=](int r1) {
assert(r1 == 3);
// second test: 2 - 1 = 1
self->sync_send(testee, minus_request{2, 1}).then(
[=](int r2) {
assert(r2 == 1);
// both tests succeeded
aout(self) << "AUT (actor under test) seems to be ok"
<< endl;
if (r1 == 3 && r2 == 1) {
aout(self) << "AUT (actor under test) seems to be ok"
<< endl;
}
self->send(testee, shutdown_request{});
}
);
Expand Down

1 comment on commit 7ab1528

@Neverlord
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be more precise, the warnings occur only if --more-warnings is combined with --build-type=release. Thanks for the fix anyways. :)

Please sign in to comment.