fix whitespace

This commit is contained in:
Celtic Minstrel 2021-07-28 13:49:02 -04:00 committed by Celtic Minstrel
parent 44da16d66a
commit 23bfa4c896
6 changed files with 15 additions and 15 deletions

View File

@ -306,7 +306,7 @@ if wesnoth.kernel_type() == "Mapgen Lua Kernel" then
return f.all(f.x(loc[1]), f.y(loc[2]))
end
}
-- More map module stuff
wesnoth.create_filter = wesnoth.deprecate_api('wesnoth.create_filter', 'wesnoth.map.filter', 1, nil, wesnoth.map.filter)
wesnoth.create_map = wesnoth.deprecate_api('wesnoth.create_map', 'wesnoth.map.create', 1, nil, wesnoth.map.create)

View File

@ -43,7 +43,7 @@ if rawget(_G, 'unit_test') ~= nil then
function unit_test.log(prefix, message)
std_print(prefix .. ': ' .. message)
end
-- This is a way to ensure that all assertions contain a descriptive message
setmetatable(unit_test, {
__newindex = function(self, key, val)

View File

@ -487,13 +487,13 @@ config& config::child_or_add(config_key_type key)
utils::optional_reference<const config> config::get_deprecated_child(config_key_type old_key, const std::string& in_tag, DEP_LEVEL level, const std::string& message) const {
check_valid();
if(auto i = children_.find(old_key); i != children_.end() && !i->second.empty()) {
const std::string what = formatter() << "[" << in_tag << "][" << old_key << "]";
deprecated_message(what, level, "", message);
return *i->second.front();
}
return std::nullopt;
}
@ -501,13 +501,13 @@ config::const_child_itors config::get_deprecated_child_range(config_key_type old
check_valid();
static child_list dummy;
const child_list* p = &dummy;
if(auto i = children_.find(old_key); i != children_.end() && !i->second.empty()) {
const std::string what = formatter() << "[" << in_tag << "][" << old_key << "]";
deprecated_message(what, level, "", message);
p = &i->second;
}
return const_child_itors(const_child_iterator(p->begin()), const_child_iterator(p->end()));
}
@ -800,7 +800,7 @@ config::attribute_value& config::operator[](config_key_type key)
const config::attribute_value& config::get_old_attribute(config_key_type key, const std::string& old_key, const std::string& in_tag, const std::string& message) const
{
check_valid();
if(has_attribute(old_key)) {
const std::string what = formatter() << "[" << in_tag << "]" << old_key << "=";
const std::string msg = formatter() << "Use " << key << "= instead. " << message;
@ -823,13 +823,13 @@ const config::attribute_value& config::get_old_attribute(config_key_type key, co
const config::attribute_value& config::get_deprecated_attribute(config_key_type old_key, const std::string& in_tag, DEP_LEVEL level, const std::string& message) const {
check_valid();
if(auto i = values_.find(old_key); i != values_.end()) {
const std::string what = formatter() << "[" << in_tag << "]" << old_key << "=";
deprecated_message(what, level, "", message);
return i->second;
}
static const attribute_value empty_attribute;
return empty_attribute;
}

View File

@ -389,7 +389,7 @@ public:
* @returns The wanted child node.
*/
const config& child(config_key_type key, const std::string& parent) const;
/**
* Get a deprecated child and log a deprecation message
* @param old_key The deprecated child to return if present
@ -399,7 +399,7 @@ public:
* @note The deprecation message will be a level 3 deprecation.
*/
utils::optional_reference<const config> get_deprecated_child(config_key_type old_key, const std::string& in_tag, DEP_LEVEL level, const std::string& message) const;
/**
* Get a deprecated child rangw and log a deprecation message
* @param old_key The deprecated child to return if present
@ -486,13 +486,13 @@ public:
* @note The deprecation message will be a level 1 deprecation.
*/
const attribute_value &get_old_attribute(config_key_type key, const std::string &old_key, const std::string& in_tag, const std::string& message = "") const;
/**
* Get a deprecated attribute without a direct substitute,
* and log a deprecation message
* @param old_key The deprecated attribute to return if present
* @param in_tag The name of the tag this attribute appears in
* @param level The deprecation level
* @param level The deprecation level
* @param message An explanation of the deprecation, possibly mentioning an alternative
*/
const attribute_value& get_deprecated_attribute(config_key_type old_key, const std::string& in_tag, DEP_LEVEL level, const std::string& message) const;

View File

@ -120,4 +120,4 @@ void migrate_version_selection::post_show(window& window)
preferences::load_credentials();
}
}
} // namespace gui2::dialogs
} // namespace gui2::dialogs

View File

@ -131,7 +131,7 @@ static int intf_default_generate_height_map(lua_State *L)
int height = luaL_checkinteger(L, 2);
config cfg = luaW_checkconfig(L, 3);
if(!cfg.has_attribute("location_set")) {
deprecated_message("generate_height_map(..., {location_set=false})", DEP_LEVEL::PREEMPTIVE, "1.17", "The default value of this option will be changed to true in 1.17.");
}