Code cleanup to pass gcc -Weffc++ warnings
This commit is contained in:
35
tinyxml2.h
35
tinyxml2.h
@@ -192,10 +192,11 @@ template <class T, int INITIAL_SIZE>
|
||||
class DynArray
|
||||
{
|
||||
public:
|
||||
DynArray() {
|
||||
_mem = _pool;
|
||||
_allocated = INITIAL_SIZE;
|
||||
_size = 0;
|
||||
DynArray() :
|
||||
_mem( _pool ),
|
||||
_allocated( INITIAL_SIZE ),
|
||||
_size( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
~DynArray() {
|
||||
@@ -333,7 +334,7 @@ template< int ITEM_SIZE >
|
||||
class MemPoolT : public MemPool
|
||||
{
|
||||
public:
|
||||
MemPoolT() : _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0) {}
|
||||
MemPoolT() : _blockPtrs(), _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0) {}
|
||||
~MemPoolT() {
|
||||
Clear();
|
||||
}
|
||||
@@ -1211,7 +1212,7 @@ public:
|
||||
private:
|
||||
enum { BUF_SIZE = 200 };
|
||||
|
||||
XMLAttribute() : _parseLineNum( 0 ), _next( 0 ), _memPool( 0 ) {}
|
||||
XMLAttribute() : _name(), _value(),_parseLineNum( 0 ), _next( 0 ), _memPool( 0 ) {}
|
||||
virtual ~XMLAttribute() {}
|
||||
|
||||
XMLAttribute( const XMLAttribute& ); // not supported
|
||||
@@ -1947,16 +1948,13 @@ class TINYXML2_LIB XMLHandle
|
||||
{
|
||||
public:
|
||||
/// Create a handle from any node (at any depth of the tree.) This can be a null pointer.
|
||||
XMLHandle( XMLNode* node ) {
|
||||
_node = node;
|
||||
XMLHandle( XMLNode* node ) : _node( node ) {
|
||||
}
|
||||
/// Create a handle from a node.
|
||||
XMLHandle( XMLNode& node ) {
|
||||
_node = &node;
|
||||
XMLHandle( XMLNode& node ) : _node( &node ) {
|
||||
}
|
||||
/// Copy constructor
|
||||
XMLHandle( const XMLHandle& ref ) {
|
||||
_node = ref._node;
|
||||
XMLHandle( const XMLHandle& ref ) : _node( ref._node ) {
|
||||
}
|
||||
/// Assignment
|
||||
XMLHandle& operator=( const XMLHandle& ref ) {
|
||||
@@ -2030,14 +2028,11 @@ private:
|
||||
class TINYXML2_LIB XMLConstHandle
|
||||
{
|
||||
public:
|
||||
XMLConstHandle( const XMLNode* node ) {
|
||||
_node = node;
|
||||
XMLConstHandle( const XMLNode* node ) : _node( node ) {
|
||||
}
|
||||
XMLConstHandle( const XMLNode& node ) {
|
||||
_node = &node;
|
||||
XMLConstHandle( const XMLNode& node ) : _node( &node ) {
|
||||
}
|
||||
XMLConstHandle( const XMLConstHandle& ref ) {
|
||||
_node = ref._node;
|
||||
XMLConstHandle( const XMLConstHandle& ref ) : _node( ref._node ) {
|
||||
}
|
||||
|
||||
XMLConstHandle& operator=( const XMLConstHandle& ref ) {
|
||||
@@ -2252,6 +2247,10 @@ private:
|
||||
bool _restrictedEntityFlag[ENTITY_RANGE];
|
||||
|
||||
DynArray< char, 20 > _buffer;
|
||||
|
||||
// Prohibit cloning, intentionally not implemented
|
||||
XMLPrinter( const XMLPrinter& );
|
||||
XMLPrinter& operator=( const XMLPrinter& );
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user