diff --git a/traffxml/traff_model.hpp b/traffxml/traff_model.hpp index 40bded85a..e169e1208 100644 --- a/traffxml/traff_model.hpp +++ b/traffxml/traff_model.hpp @@ -341,7 +341,7 @@ struct TraffEvent { EventClass m_class = EventClass::Invalid; EventType m_type = EventType::Invalid; - std::optional m_length; + std::optional m_length; std::optional m_probability; std::optional m_qDurationMins; /* diff --git a/traffxml/traff_model_xml.cpp b/traffxml/traff_model_xml.cpp index b61bde7e9..bc9026527 100644 --- a/traffxml/traff_model_xml.cpp +++ b/traffxml/traff_model_xml.cpp @@ -122,13 +122,13 @@ const boost::bimap kEventTypeMap = MakeBimap OptionalIntegerFromXml(pugi::xml_attribute const & attribute) +std::optional OptionalIntegerFromXml(pugi::xml_attribute const & attribute) { if (attribute.empty()) return std::nullopt; try { - uint8_t result = std::stoi(attribute.as_string()); + int result = std::stoi(attribute.as_string()); return result; } catch (std::invalid_argument const& ex)