Skip to content

Commit

Permalink
fixup silenced warnings in ai/actions.cpp
Browse files Browse the repository at this point in the history
Better to demote them to a lower channel rather than disable
completely.
  • Loading branch information
cbeck88 committed Jun 29, 2014
1 parent 164d716 commit 7185d6c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ai/actions.cpp
Expand Up @@ -92,7 +92,7 @@ void action_result::execute()
try {
do_execute();
} catch (end_level_exception&) {
is_ok(); //Silences "unchecked result" warning
if (!is_ok()) { DBG_AI_ACTIONS << "Return value of AI ACTION was not checked. This may cause bugs! " << std::endl; } //Demotes to DBG "unchecked result" warning
throw;
}
}
Expand Down Expand Up @@ -296,7 +296,7 @@ void attack_result::do_execute()
try {
manager::raise_gamestate_changed();
} catch (...) {
is_ok(); //Silences "unchecked result" warning
if (!is_ok()) { DBG_AI_ACTIONS << "Return value of AI ACTION was not checked. This may cause bugs! " << std::endl; } //Demotes to DBG "unchecked result" warning
throw;
}
}
Expand Down Expand Up @@ -471,7 +471,7 @@ void move_result::do_execute()
try {
manager::raise_gamestate_changed();
} catch (...) {
is_ok(); //Silences "unchecked result" warning
if (!is_ok()) { DBG_AI_ACTIONS << "Return value of AI ACTION was not checked. This may cause bugs! " << std::endl; } //Demotes to DBG "unchecked result" warning
throw;
}
}
Expand Down Expand Up @@ -616,7 +616,7 @@ void recall_result::do_execute()
try {
manager::raise_gamestate_changed();
} catch (...) {
is_ok(); //Silences "unchecked result" warning
if (!is_ok()) { DBG_AI_ACTIONS << "Return value of AI ACTION was not checked. This may cause bugs! " << std::endl; } //Demotes to DBG "unchecked result" warning
throw;
}
}
Expand Down Expand Up @@ -757,7 +757,7 @@ void recruit_result::do_execute()
try {
manager::raise_gamestate_changed();
} catch (...) {
is_ok(); //Silences "unchecked result" warning
if (!is_ok()) { DBG_AI_ACTIONS << "Return value of AI ACTION was not checked. This may cause bugs! " << std::endl; } //Demotes to DBG "unchecked result" warning
throw;
}
}
Expand Down Expand Up @@ -854,7 +854,7 @@ void stopunit_result::do_execute()
manager::raise_gamestate_changed();//to be on the safe side
}
} catch (...) {
is_ok(); //Silences "unchecked result" warning
if (!is_ok()) { DBG_AI_ACTIONS << "Return value of AI ACTION was not checked. This may cause bugs! " << std::endl; } //Demotes to DBG "unchecked result" warning
throw;
}
}
Expand Down Expand Up @@ -905,7 +905,7 @@ void synced_command_result::do_execute()
set_gamestate_changed();
manager::raise_gamestate_changed();
} catch (...) {
is_ok(); //Silences "unchecked result" warning
if (!is_ok()) { DBG_AI_ACTIONS << "Return value of AI ACTION was not checked. This may cause bugs! " << std::endl; } //Demotes to DBG "unchecked result" warning
throw;
}
}
Expand Down

0 comments on commit 7185d6c

Please sign in to comment.