summaryrefslogtreecommitdiff
path: root/libxsd
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-12-19 17:12:05 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-01-13 22:32:44 +0300
commit818bcfa0dbbc1ef48bc3fe1f0c14d12866c51ef2 (patch)
tree08439f9422ff739e6b6e69f8f4623725a5ee367d /libxsd
parent2615896faa646e5830abf2c269150e1165c66515 (diff)
Various fixes
Diffstat (limited to 'libxsd')
-rw-r--r--libxsd/libxsd/cxx/parser/expat/elements.txx4
-rw-r--r--libxsd/libxsd/cxx/parser/validating/xml-schema-pimpl.txx7
-rw-r--r--libxsd/libxsd/cxx/tree/containers.hxx2
-rw-r--r--libxsd/libxsd/cxx/xml/dom/auto-ptr.hxx3
4 files changed, 12 insertions, 4 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);
}
diff --git a/libxsd/libxsd/cxx/tree/containers.hxx b/libxsd/libxsd/cxx/tree/containers.hxx
index fd6cebf..07dff0d 100644
--- a/libxsd/libxsd/cxx/tree/containers.hxx
+++ b/libxsd/libxsd/cxx/tree/containers.hxx
@@ -1090,7 +1090,7 @@ namespace xsd
}
// Note that the container object of the two sequences being
- // swapped should be the same.
+ // swapped should be the same.
//
void
swap (sequence& x)
diff --git a/libxsd/libxsd/cxx/xml/dom/auto-ptr.hxx b/libxsd/libxsd/cxx/xml/dom/auto-ptr.hxx
index 4e19547..228391e 100644
--- a/libxsd/libxsd/cxx/xml/dom/auto-ptr.hxx
+++ b/libxsd/libxsd/cxx/xml/dom/auto-ptr.hxx
@@ -53,8 +53,11 @@ namespace xsd
unique_ptr (unique_ptr&& p): base (std::move (p)) {}
template <class T1>
unique_ptr (unique_ptr<T1>&& p): base (std::move (p)) {}
+
+#if !defined(__cplusplus) || __cplusplus < 201703L
template <class T1>
unique_ptr (std::auto_ptr<T1>&& p): base (std::move (p)) {}
+#endif
unique_ptr& operator= (unique_ptr&& p)
{