Make config::attribute_value.type_ a proper enum,
...to attempt to fix MSVC assigning an out-of-range value to enum.
This commit is contained in:
parent
7c084e7227
commit
bb02feb844
3 changed files with 6 additions and 2 deletions
|
@ -182,6 +182,7 @@ bool config::attribute_value::operator==(const config::attribute_value &other) c
|
|||
case(DOUBLE) : retval &= double_value_ == other.double_value_; break;
|
||||
case(TSTRING) : retval &= t_string_value_ == other.t_string_value_; break;
|
||||
case(TOKEN) : retval &= token_value_ == other.token_value_; break;
|
||||
case(EMPTY) : break;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
|
@ -211,6 +212,7 @@ bool config::attribute_value::empty() const {
|
|||
switch(type_){
|
||||
case(TSTRING) : return t_string_value_.empty();
|
||||
case(TOKEN) : return token_value_.empty();
|
||||
default : break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -246,6 +248,7 @@ t_token const & config::attribute_value::token() const {
|
|||
return token_value_;
|
||||
case(TSTRING) :
|
||||
return t_string_value_.token();
|
||||
default : break;
|
||||
}
|
||||
assert(false);
|
||||
return token_value_;
|
||||
|
@ -270,6 +273,7 @@ t_string const & config::attribute_value::t_str() const {
|
|||
is_t_string_ = true;
|
||||
t_string_value_ = t_string(token());
|
||||
return t_string_value_;
|
||||
default : break;
|
||||
}
|
||||
assert(false);
|
||||
return t_string_value_;
|
||||
|
|
|
@ -195,7 +195,7 @@ public:
|
|||
mutable t_string t_string_value_;
|
||||
mutable t_token token_value_;
|
||||
|
||||
attribute_type type_ : 3;
|
||||
attribute_type type_;
|
||||
mutable bool bool_value_ : 1;
|
||||
mutable bool is_bool_ : 1, is_int_ : 1, is_double_ : 1, is_t_string_ : 1, is_token_ : 1;
|
||||
|
||||
|
|
|
@ -1265,7 +1265,7 @@ bool load_font_config()
|
|||
known_fonts.insert(font["name"]);
|
||||
}
|
||||
|
||||
family_order = fonts_config["family_order"];
|
||||
family_order = fonts_config["family_order"].t_str();
|
||||
const std::vector<std::string> font_order = utils::split(fonts_config["order"]);
|
||||
std::vector<font::subset_descriptor> fontlist;
|
||||
std::vector<std::string>::const_iterator font;
|
||||
|
|
Loading…
Add table
Reference in a new issue