Fix build with GCC and Clang

Fixes #3712.
This commit is contained in:
Jyrki Vesterinen 2018-11-12 19:47:42 +02:00
parent 711434d571
commit a5ef8d040c
4 changed files with 20 additions and 5 deletions

View file

@ -67,6 +67,7 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
campaign_scenario(),
campaign_skip_story(false),
clock(false),
core_id(),
data_path(false),
data_dir(),
debug(false),
@ -119,14 +120,19 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
server(),
username(),
password(),
render_image(),
render_image_dst(),
screenshot(false),
screenshot_map_file(),
screenshot_output_file(),
script_file(),
plugin_file(),
script_unsafe_mode(false),
strict_validation(false),
test(),
unit_test(),
headless_unit_test(false),
timeout(),
noreplaycheck(false),
mptest(false),
userconfig_path(false),
@ -134,11 +140,16 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
userdata_path(false),
userdata_dir(),
validcache(false),
validate_core(false),
validate_addon(),
validate_schema(),
validate_wml(),
validate_with(),
version(false),
report(false),
windowed(false),
with_replay(false),
validate_core(false),
translation_percent(),
args_(args.begin() + 1 , args.end()),
args0_(*args.begin()),
all_(),

View file

@ -34,8 +34,10 @@ wml_tag::wml_tag(const config& cfg)
, tags_()
, keys_()
, links_()
, any_tag_(cfg["any_tag"].to_bool())
, conditions_()
, super_refs_()
, fuzzy_(name_.find_first_of("*?") != std::string::npos)
, any_tag_(cfg["any_tag"].to_bool())
{
if(max_ < 0) {
max_ = INT_MAX;
@ -467,12 +469,14 @@ bool wml_condition::matches(const config& cfg) const
return cfg.matches(filter_);
}
template<>
void wml_tag::tag_iterator::init(const wml_tag& base_tag)
{
current = base_tag.tags_.begin();
condition_queue.push(&base_tag);
}
template<>
void wml_tag::tag_iterator::ensure_valid_or_end() {
while(current == condition_queue.front()->tags_.end()) {
condition_queue.pop();
@ -485,12 +489,14 @@ void wml_tag::tag_iterator::ensure_valid_or_end() {
}
}
template<>
void wml_tag::key_iterator::init(const wml_tag& base_tag)
{
current = base_tag.keys_.begin();
condition_queue.push(&base_tag);
}
template<>
void wml_tag::key_iterator::ensure_valid_or_end() {
while(current == condition_queue.front()->keys_.end()) {
condition_queue.pop();

View file

@ -376,9 +376,6 @@ private:
void expand(wml_tag& root);
};
extern template class wml_tag::iterator<wml_tag>;
extern template class wml_tag::iterator<wml_key>;
/**
* Stores information about a conditional portion of a tag.
* Format is the same as wml_tag.

View file

@ -363,6 +363,7 @@ void schema_validator::print(message_info& el)
break;
case MISSING_KEY:
missing_key_error(el.file, el.line, el.tag, el.key, create_exceptions_);
break;
case WRONG_TYPE:
wrong_type_error(el.file, el.line, el.tag, el.key, el.value, create_exceptions_);
break;