summaryrefslogtreecommitdiff
path: root/libxsd/xsd/cxx/parser/expat
diff options
context:
space:
mode:
Diffstat (limited to 'libxsd/xsd/cxx/parser/expat')
-rw-r--r--libxsd/xsd/cxx/parser/expat/elements.hxx7
-rw-r--r--libxsd/xsd/cxx/parser/expat/elements.txx6
2 files changed, 9 insertions, 4 deletions
diff --git a/libxsd/xsd/cxx/parser/expat/elements.hxx b/libxsd/xsd/cxx/parser/expat/elements.hxx
index 284be5c..bd0b84c 100644
--- a/libxsd/xsd/cxx/parser/expat/elements.hxx
+++ b/libxsd/xsd/cxx/parser/expat/elements.hxx
@@ -1,5 +1,4 @@
// file : xsd/cxx/parser/expat/elements.hxx
-// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
#ifndef XSD_CXX_PARSER_EXPAT_ELEMENTS_HXX
@@ -87,6 +86,12 @@ namespace xsd
return parser_;
}
+ void
+ reset (XML_Parser parser)
+ {
+ *this = parser;
+ }
+
private:
parser_auto_ptr (const parser_auto_ptr&);
diff --git a/libxsd/xsd/cxx/parser/expat/elements.txx b/libxsd/xsd/cxx/parser/expat/elements.txx
index 11ea281..803c53c 100644
--- a/libxsd/xsd/cxx/parser/expat/elements.txx
+++ b/libxsd/xsd/cxx/parser/expat/elements.txx
@@ -1,5 +1,4 @@
// file : xsd/cxx/parser/expat/elements.txx
-// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
#include <new> // std::bad_alloc
@@ -313,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;
@@ -338,7 +337,8 @@ namespace xsd
//
if (auto_xml_parser_.get () == 0)
{
- auto_xml_parser_ = XML_ParserCreateNS (0, XML_Char (' '));
+ auto_xml_parser_.reset (
+ XML_ParserCreateNS (0, XML_Char (' ')));
if (auto_xml_parser_.get () == 0)
throw std::bad_alloc ();