Skip to content

Commit

Permalink
Merge pull request #17 from mat007/fix-clang-4
Browse files Browse the repository at this point in the history
Fix clang compilation errors
  • Loading branch information
Mathieu Champlon committed Aug 6, 2017
2 parents 52b2f6e + a6950b9 commit b77f3ef
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ env:
# - CXX_STANDARD=c++14

compiler:
# - clang
- gcc
- clang

before_install:
- CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
Expand All @@ -29,6 +29,6 @@ before_install:
script:
- mkdir build/cmake
- cd build/cmake
- cmake -G "Unix Makefiles" ../..
- cmake ../..
- make
- ctest
2 changes: 1 addition & 1 deletion src/libraries/xeumeuleu/bridges/xerces/detail/import.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace detail
XERCES_CPP_NAMESPACE::DOMNode& to )
{
xerces_ptr< XERCES_CPP_NAMESPACE::DOMNode > child( document.importNode( const_cast< XERCES_CPP_NAMESPACE::DOMNode* >( &from ), false ) );
*to.appendChild( child.get() );
to.appendChild( child.get() );
return child.release();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,14 @@ class locator_handler : public XERCES_CPP_NAMESPACE::DOMUserDataHandler
break;
case NODE_CLONED:
case NODE_IMPORTED:
{
const locator* l = static_cast< locator* >( src->getUserData( key ) );
delete static_cast< locator* >( dst->getUserData( key ) );
dst->setUserData( key, l ? new locator( *l ) : 0, this );
break;
}
default:
break;
}
}
//@}
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/xeumeuleu/streams/id.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace xml
*/
// Created: MAT 2014-12-04
// =============================================================================
class id
class id
{
public:
//! @name Constructors/Destructor
Expand Down
14 changes: 12 additions & 2 deletions src/libraries/xeumeuleu/streams/xistringstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,22 @@ class xistringstream : private document, public xistream
public:
//! @name Constructors/Destructor
//@{
xistringstream( const std::string& data, const grammar& grammar = null_grammar(), const id& id = id() )
explicit xistringstream( const std::string& data, const grammar& grammar = null_grammar() )
: document( data.c_str(), data.size(), 0, grammar, id() )
, xistream( input_ )
, input_( *document_ )
{}
xistringstream( const std::string& data, const grammar& grammar, const id& id )
: document( data.c_str(), data.size(), 0, grammar, id )
, xistream( input_ )
, input_( *document_ )
{}
xistringstream( const std::string& data, const encoding& encoding, const grammar& grammar = null_grammar(), const id& id = id() )
xistringstream( const std::string& data, const encoding& encoding, const grammar& grammar = null_grammar() )
: document( data.c_str(), data.size(), &encoding, grammar, id() )
, xistream( input_ )
, input_( *document_ )
{}
xistringstream( const std::string& data, const encoding& encoding, const grammar& grammar, const id& id )
: document( data.c_str(), data.size(), &encoding, grammar, id )
, xistream( input_ )
, input_( *document_ )
Expand Down
8 changes: 0 additions & 8 deletions src/libraries/xeumeuleu/streams/xisubstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,6 @@ class xisubstream : private xi_base_member, public xistream
virtual ~xisubstream()
{}
//@}

//! @name Operators
//@{
operator xistream&() const
{
return const_cast< xisubstream& >( *this );
}
//@}
};

}
Expand Down
9 changes: 8 additions & 1 deletion src/libraries/xeumeuleu/streams/xofstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ class xofstream : private document, private flushable, public xostream
public:
//! @name Constructors/Destructor
//@{
explicit xofstream( const std::string& filename, const encoding& encoding = encoding() )
explicit xofstream( const std::string& filename )
: xostream( output_ )
, output_ ( *document_, *document_, *this )
, filename_( filename )
, encoding_( encoding() )
, flushed_ ( false )
{}
xofstream( const std::string& filename, const encoding& encoding )
: xostream( output_ )
, output_ ( *document_, *document_, *this )
, filename_( filename )
Expand Down
9 changes: 8 additions & 1 deletion src/libraries/xeumeuleu/streams/xostreamstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ class xostreamstream : private document, private flushable, public xostream
public:
//! @name Constructors/Destructor
//@{
explicit xostreamstream( std::basic_ostream< char >& stream, const encoding& encoding = encoding() )
explicit xostreamstream( std::basic_ostream< char >& stream )
: xostream( output_ )
, output_ ( *document_, *document_, *this )
, stream_ ( stream )
, encoding_( encoding() )
, flushed_ ( false )
{}
xostreamstream( std::basic_ostream< char >& stream, const encoding& encoding )
: xostream( output_ )
, output_ ( *document_, *document_, *this )
, stream_ ( stream )
Expand Down
7 changes: 6 additions & 1 deletion src/libraries/xeumeuleu/streams/xostringstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ class xostringstream : private document, public xostream
public:
//! @name Constructors/Destructor
//@{
explicit xostringstream( const encoding& encoding = encoding() )
xostringstream()
: xostream( output_ )
, output_ ( *document_, *document_ )
, encoding_( encoding() )
{}
explicit xostringstream( const encoding& encoding )
: xostream( output_ )
, output_ ( *document_, *document_ )
, encoding_( encoding )
Expand Down
8 changes: 0 additions & 8 deletions src/libraries/xeumeuleu/streams/xosubstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,6 @@ class xosubstream : private xo_base_member, public xostream
{}
//@}

//! @name Operators
//@{
operator xostream&() const
{
return const_cast< xosubstream& >( *this );
}
//@}

private:
//! @name Operations
//@{
Expand Down
2 changes: 1 addition & 1 deletion src/tests/xeumeuleu_test/attribute_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ BOOST_AUTO_TEST_CASE( writing_attribute_pointer_equal_to_nullptr_fallback_value_
BOOST_AUTO_TEST_CASE( writing_attribute_pointer_different_from_nullptr_fallback_value_writes_it )
{
xml::xostringstream xos;
const user_type t;
const user_type t = user_type();
xos << xml::start( "root" )
<< xml::attribute( "attribute", &t, nullptr );
const std::string expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n"
Expand Down

0 comments on commit b77f3ef

Please sign in to comment.