diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-12-19 17:12:05 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-01-13 22:32:44 +0300 |
commit | 818bcfa0dbbc1ef48bc3fe1f0c14d12866c51ef2 (patch) | |
tree | 08439f9422ff739e6b6e69f8f4623725a5ee367d /libxsd/libxsd/cxx/parser | |
parent | 2615896faa646e5830abf2c269150e1165c66515 (diff) |
Various fixes
Diffstat (limited to 'libxsd/libxsd/cxx/parser')
-rw-r--r-- | libxsd/libxsd/cxx/parser/expat/elements.txx | 4 | ||||
-rw-r--r-- | libxsd/libxsd/cxx/parser/validating/xml-schema-pimpl.txx | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libxsd/libxsd/cxx/parser/expat/elements.txx b/libxsd/libxsd/cxx/parser/expat/elements.txx index 8a068c4..910b3af 100644 --- a/libxsd/libxsd/cxx/parser/expat/elements.txx +++ b/libxsd/libxsd/cxx/parser/expat/elements.txx @@ -312,7 +312,7 @@ namespace xsd if (XML_Parse (parser.get (), buf, - is.gcount (), + static_cast<int> (is.gcount ()), is.eof ()) == XML_STATUS_ERROR) { r = false; @@ -337,7 +337,7 @@ namespace xsd // if (auto_xml_parser_.get () == 0) { - auto_xml_parser_ = XML_ParserCreateNS (0, XML_Char (' ')); + auto_xml_parser_ = parser_auto_ptr (XML_ParserCreateNS (0, XML_Char (' '))); if (auto_xml_parser_.get () == 0) throw std::bad_alloc (); diff --git a/libxsd/libxsd/cxx/parser/validating/xml-schema-pimpl.txx b/libxsd/libxsd/cxx/parser/validating/xml-schema-pimpl.txx index 0140a8a..60286a7 100644 --- a/libxsd/libxsd/cxx/parser/validating/xml-schema-pimpl.txx +++ b/libxsd/libxsd/cxx/parser/validating/xml-schema-pimpl.txx @@ -5,6 +5,7 @@ #include <locale> #ifdef XSD_CXX11 +# include <cmath> // std::isfinite # include <utility> // std::move #endif @@ -716,9 +717,13 @@ namespace xsd zc_istream<C> is (str); is.imbue (std::locale::classic ()); - //@@ TODO: now we accept scientific notations and INF/NaN. + // Note that std::isfinite() returns false for INF/NaN. // +#ifdef XSD_CXX11 + if (!(is >> value_ && std::isfinite (value_) && is.exhausted ())) +#else if (!(is >> value_ && is.exhausted ())) +#endif throw invalid_value<C> (bits::decimal<C> (), str); } |