From 8dd73fd330cb0d18ec6f24f01ce47641c659fc1b Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 23 Aug 2018 22:36:58 +0900 Subject: Fixed typedef-related warnings from compiler. Signed-off-by: Michele Calgaro --- umbrello/umbrello/codeimport/kdevcppparser/ast.cpp | 4 +- umbrello/umbrello/codeimport/kdevcppparser/ast.h | 182 ++++++--------------- 2 files changed, 50 insertions(+), 136 deletions(-) (limited to 'umbrello') diff --git a/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp b/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp index 8e6922ee..c10e6da6 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp +++ b/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp @@ -711,7 +711,7 @@ void DeclaratorAST::addArrayDimension( AST::Node& arrayDimension ) m_arrayDimensionList.append( arrayDimension.release() ); } -void DeclaratorAST::setParameterDeclarationClause( AUTO_PTR& parameterDeclarationClause ) +void DeclaratorAST::setParameterDeclarationClause( std::auto_ptr& parameterDeclarationClause ) { m_parameterDeclarationClause = parameterDeclarationClause; if( m_parameterDeclarationClause.get() ) m_parameterDeclarationClause->setParent( this ); @@ -1102,7 +1102,7 @@ void TypeParameterAST::setKind( AST::Node& kind ) if( m_kind.get() ) m_kind->setParent( this ); } -void TypeParameterAST::setTemplateParameterList( AUTO_PTR& templateParameterList ) +void TypeParameterAST::setTemplateParameterList( std::auto_ptr& templateParameterList ) { m_templateParameterList = templateParameterList; if( m_templateParameterList.get() ) m_templateParameterList->setParent( this ); diff --git a/umbrello/umbrello/codeimport/kdevcppparser/ast.h b/umbrello/umbrello/codeimport/kdevcppparser/ast.h index ed6d91b0..103276d5 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/ast.h +++ b/umbrello/umbrello/codeimport/kdevcppparser/ast.h @@ -24,92 +24,6 @@ #include #include -#if defined( Q_OS_WIN32 ) || defined( TQ_CC_SUN ) - -#ifndef _THROW0 -# define _THROW0() -#endif - -template class AUTO_PTR { -private: - _Tp* _M_ptr; - -public: - typedef _Tp element_type; - - explicit AUTO_PTR(_Tp* __p = 0) _THROW0() : _M_ptr(__p) {} - - template AUTO_PTR(AUTO_PTR<_Tp1>& __a) _THROW0() - : _M_ptr(__a.release()) {} - - AUTO_PTR(AUTO_PTR& __a) _THROW0() : _M_ptr(__a.release()) {} - - - - template - AUTO_PTR& operator=(AUTO_PTR<_Tp1>& __a) _THROW0() { - if (__a.get() != this->get()) { - delete _M_ptr; - _M_ptr = __a.release(); - } - return *this; - } - - AUTO_PTR& operator=(AUTO_PTR& __a) _THROW0() { - if (&__a != this) { - delete _M_ptr; - _M_ptr = __a.release(); - } - return *this; - } - - ~AUTO_PTR() _THROW0() { delete _M_ptr; } - - _Tp& operator*() const _THROW0() { - return *_M_ptr; - } - _Tp* operator->() const _THROW0() { - return _M_ptr; - } - _Tp* get() const _THROW0() { - return _M_ptr; - } - _Tp* release() _THROW0() { - _Tp* __tmp = _M_ptr; - _M_ptr = 0; - return __tmp; - } - void reset(_Tp* __p = 0) _THROW0() { - delete _M_ptr; - _M_ptr = __p; - } - - // According to the C++ standard, these conversions are required. Most - // present-day compilers, however, do not enforce that requirement---and, - // in fact, most present-day compilers do not support the language - // features that these conversions rely on. - - -private: - template struct AUTO_PTR_ref { - _Tp1* _M_ptr; - AUTO_PTR_ref(_Tp1* __p) : _M_ptr(__p) {} - }; - -public: - AUTO_PTR(AUTO_PTR_ref<_Tp> __ref) _THROW0() - : _M_ptr(__ref._M_ptr) {} - template operator AUTO_PTR_ref<_Tp1>() _THROW0() - { return AUTO_PTR_ref<_Tp>(this->release()); } - template operator AUTO_PTR<_Tp1>() _THROW0() - { return AUTO_PTR<_Tp1>(this->release()) } - -}; - -#else -#define AUTO_PTR std::auto_ptr -#endif - template typename T::Node CreateNode() { typename T::Node node( new T ); @@ -210,7 +124,7 @@ struct Slice class AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type=NodeType_Generic }; DECLARE_ALLOC( AST ) @@ -278,7 +192,7 @@ private: class GroupAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_Group }; DECLARE_ALLOC( GroupAST ) @@ -303,7 +217,7 @@ private: class TemplateArgumentListAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_TemplateArgumentList }; DECLARE_ALLOC( TemplateArgumentListAST ) @@ -327,7 +241,7 @@ private: class ClassOrNamespaceNameAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_ClassOrNamespaceName }; DECLARE_ALLOC( ClassOrNamespaceNameAST ) @@ -355,7 +269,7 @@ private: class NameAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_Name }; DECLARE_ALLOC( NameAST ) @@ -387,7 +301,7 @@ private: class TypeParameterAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_TypeParameter }; DECLARE_ALLOC( TypeParameterAST ) @@ -399,7 +313,7 @@ public: void setKind( AST::Node& kind ); class TemplateParameterListAST* templateParameterList() { return m_templateParameterList.get(); } - void setTemplateParameterList( AUTO_PTR& templateParameterList ); + void setTemplateParameterList( std::auto_ptr& templateParameterList ); NameAST* name() { return m_name.get(); } void setName( NameAST::Node& name ); @@ -409,7 +323,7 @@ public: private: AST::Node m_kind; - AUTO_PTR m_templateParameterList; + std::auto_ptr m_templateParameterList; NameAST::Node m_name; AST::Node m_typeId; @@ -421,7 +335,7 @@ private: class DeclarationAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_Declaration }; DECLARE_ALLOC( DeclarationAST ) @@ -437,7 +351,7 @@ private: class AccessDeclarationAST: public DeclarationAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_AccessDeclaration }; DECLARE_ALLOC( AccessDeclarationAST ) @@ -461,7 +375,7 @@ private: class TypeSpecifierAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_TypeSpecifier }; DECLARE_ALLOC( TypeSpecifierAST ) @@ -493,7 +407,7 @@ private: class BaseSpecifierAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_BaseSpecifier }; DECLARE_ALLOC( BaseSpecifierAST ) @@ -523,7 +437,7 @@ private: class BaseClauseAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_BaseClause }; DECLARE_ALLOC( BaseClauseAST ) @@ -545,7 +459,7 @@ private: class ClassSpecifierAST: public TypeSpecifierAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_ClassSpecifier }; DECLARE_ALLOC( ClassSpecifierAST ) @@ -579,7 +493,7 @@ private: class EnumeratorAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_Enumerator }; DECLARE_ALLOC( EnumeratorAST ) @@ -605,7 +519,7 @@ private: class EnumSpecifierAST: public TypeSpecifierAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_EnumSpecifier }; DECLARE_ALLOC( EnumSpecifierAST ) @@ -627,7 +541,7 @@ private: class ElaboratedTypeSpecifierAST: public TypeSpecifierAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_ElaboratedTypeSpecifier }; DECLARE_ALLOC( ElaboratedTypeSpecifierAST ) @@ -652,7 +566,7 @@ private: class LinkageBodyAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_LinkageBody }; DECLARE_ALLOC( LinkageBodyAST ) @@ -674,7 +588,7 @@ private: class LinkageSpecificationAST: public DeclarationAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_LinkageSpecification }; DECLARE_ALLOC( LinkageSpecificationAST ) @@ -704,7 +618,7 @@ private: class NamespaceAST: public DeclarationAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_Namespace }; DECLARE_ALLOC( NamespaceAST ) @@ -730,7 +644,7 @@ private: class NamespaceAliasAST: public DeclarationAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_NamespaceAlias }; DECLARE_ALLOC( NamespaceAliasAST ) @@ -756,7 +670,7 @@ private: class UsingAST: public DeclarationAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_Using }; DECLARE_ALLOC( UsingAST ) @@ -782,7 +696,7 @@ private: class UsingDirectiveAST: public DeclarationAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_UsingDirective }; DECLARE_ALLOC( UsingDirectiveAST ) @@ -804,7 +718,7 @@ private: class DeclaratorAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_Declarator }; DECLARE_ALLOC( DeclaratorAST ) @@ -828,7 +742,7 @@ public: void addArrayDimension( AST::Node& arrayDimension ); class ParameterDeclarationClauseAST* parameterDeclarationClause() { return m_parameterDeclarationClause.get(); } - void setParameterDeclarationClause( AUTO_PTR& parameterDeclarationClause ); + void setParameterDeclarationClause( std::auto_ptr& parameterDeclarationClause ); // ### replace 'constant' with cvQualify AST* constant() { return m_constant.get(); } @@ -843,7 +757,7 @@ private: NameAST::Node m_declaratorId; AST::Node m_bitfieldInitialization; TQPtrList m_arrayDimensionList; - AUTO_PTR m_parameterDeclarationClause; + std::auto_ptr m_parameterDeclarationClause; AST::Node m_constant; GroupAST::Node m_exceptionSpecification; @@ -855,7 +769,7 @@ private: class ParameterDeclarationAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_ParameterDeclaration }; DECLARE_ALLOC( ParameterDeclarationAST ) @@ -887,7 +801,7 @@ private: class ParameterDeclarationListAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_ParameterDeclarationList }; DECLARE_ALLOC( ParameterDeclarationListAST ) @@ -911,7 +825,7 @@ private: class ParameterDeclarationClauseAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_ParameterDeclarationClause }; DECLARE_ALLOC( ParameterDeclarationClauseAST ) @@ -940,7 +854,7 @@ private: class InitDeclaratorAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_InitDeclarator }; DECLARE_ALLOC( InitDeclaratorAST ) @@ -966,7 +880,7 @@ private: class InitDeclaratorListAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_InitDeclaratorList }; DECLARE_ALLOC( InitDeclaratorListAST ) @@ -988,7 +902,7 @@ private: class TypedefAST: public DeclarationAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_Typedef }; DECLARE_ALLOC( TypedefAST ) @@ -1014,7 +928,7 @@ private: class TemplateParameterAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_TemplateParameter }; DECLARE_ALLOC( TemplateParameterAST ) @@ -1040,7 +954,7 @@ private: class TemplateParameterListAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_TemplateParameterList }; DECLARE_ALLOC( TemplateParameterListAST ) @@ -1062,7 +976,7 @@ private: class TemplateDeclarationAST: public DeclarationAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_TemplateDeclaration }; DECLARE_ALLOC( TemplateDeclarationAST ) @@ -1092,7 +1006,7 @@ private: class SimpleDeclarationAST: public DeclarationAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_SimpleDeclaration }; DECLARE_ALLOC( SimpleDeclarationAST ) @@ -1130,7 +1044,7 @@ private: class StatementAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_Statement }; DECLARE_ALLOC( StatementAST ) @@ -1146,7 +1060,7 @@ private: class ExpressionStatementAST: public StatementAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_ExpressionStatement }; DECLARE_ALLOC( ExpressionStatementAST ) @@ -1168,7 +1082,7 @@ private: class ConditionAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_Condition }; DECLARE_ALLOC( ConditionAST ) @@ -1198,7 +1112,7 @@ private: class IfStatementAST: public StatementAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_IfStatement }; DECLARE_ALLOC( IfStatementAST ) @@ -1228,7 +1142,7 @@ private: class WhileStatementAST: public StatementAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_WhileStatement }; DECLARE_ALLOC( WhileStatementAST ) @@ -1254,7 +1168,7 @@ private: class DoStatementAST: public StatementAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_DoStatement }; DECLARE_ALLOC( DoStatementAST ) @@ -1280,7 +1194,7 @@ private: class ForStatementAST: public StatementAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_ForStatement }; DECLARE_ALLOC( ForStatementAST ) @@ -1314,7 +1228,7 @@ private: class SwitchStatementAST: public StatementAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_SwitchStatement }; DECLARE_ALLOC( SwitchStatementAST ) @@ -1340,7 +1254,7 @@ private: class StatementListAST: public StatementAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_StatementList }; DECLARE_ALLOC( StatementListAST ) @@ -1362,7 +1276,7 @@ private: class DeclarationStatementAST: public StatementAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_DeclarationStatement }; DECLARE_ALLOC( DeclarationStatementAST ) @@ -1384,7 +1298,7 @@ private: class FunctionDefinitionAST: public DeclarationAST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_FunctionDefinition }; DECLARE_ALLOC( FunctionDefinitionAST ) @@ -1427,7 +1341,7 @@ private: class TranslationUnitAST: public AST { public: - typedef AUTO_PTR Node; + typedef std::auto_ptr Node; enum { Type = NodeType_TranslationUnit }; DECLARE_ALLOC( TranslationUnitAST ) -- cgit v1.2.1