Skip to content

Commit

Permalink
Mark wml_exception::show const and formula_ai::handle_exception's arg…
Browse files Browse the repository at this point in the history
…ument const
  • Loading branch information
Vultraz committed May 13, 2018
1 parent c3d7116 commit 74f86ae
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/ai/formula/ai.cpp
Expand Up @@ -114,12 +114,12 @@ formula_ai::formula_ai(readonly_context &context, const config &cfg)
LOG_AI << "creating new formula ai"<< std::endl;
}

void formula_ai::handle_exception(formula_error& e) const
void formula_ai::handle_exception(const formula_error& e) const
{
handle_exception(e, "Error while parsing formula");
}

void formula_ai::handle_exception(formula_error& e, const std::string& failed_operation) const
void formula_ai::handle_exception(const formula_error& e, const std::string& failed_operation) const
{
LOG_AI << failed_operation << ": " << e.formula << std::endl;
display_message(failed_operation + ": " + e.formula);
Expand Down
4 changes: 2 additions & 2 deletions src/ai/formula/ai.hpp
Expand Up @@ -118,8 +118,8 @@ class formula_ai : public readonly_context_proxy, public wfl::formula_callable {
// Check if given unit can reach another unit
bool can_reach_unit(map_location unit_A, map_location unit_B) const;

void handle_exception(wfl::formula_error& e) const;
void handle_exception(wfl::formula_error& e, const std::string& failed_operation) const;
void handle_exception(const wfl::formula_error& e) const;
void handle_exception(const wfl::formula_error& e, const std::string& failed_operation) const;

pathfind::teleport_map get_allowed_teleports(unit_map::iterator& unit_it) const;
pathfind::plain_route shortest_path_calculator(const map_location& src, const map_location& dst, unit_map::iterator& unit_it, pathfind::teleport_map& allowed_teleports) const;
Expand Down
2 changes: 1 addition & 1 deletion src/wml_exception.cpp
Expand Up @@ -53,7 +53,7 @@ void throw_wml_exception(
throw wml_exception(message, sstr.str());
}

void wml_exception::show()
void wml_exception::show() const
{
std::ostringstream sstr;

Expand Down
2 changes: 1 addition & 1 deletion src/wml_exception.hpp
Expand Up @@ -116,7 +116,7 @@ struct wml_exception
/**
* Shows the error in a dialog.
*/
void show();
void show() const;
private:
IMPLEMENT_LUA_JAILBREAK_EXCEPTION(wml_exception)
};
Expand Down

0 comments on commit 74f86ae

Please sign in to comment.