diff --git a/documentation/documentationfindwidget.h b/documentation/documentationfindwidget.h --- a/documentation/documentationfindwidget.h +++ b/documentation/documentationfindwidget.h @@ -39,7 +39,7 @@ }; Q_DECLARE_FLAGS(FindOptions, FindOption); - explicit DocumentationFindWidget(QWidget* parent = 0); + explicit DocumentationFindWidget(QWidget* parent = nullptr); virtual ~DocumentationFindWidget(); virtual void showEvent ( QShowEvent* ) override; diff --git a/interfaces/idocumentation.h b/interfaces/idocumentation.h --- a/interfaces/idocumentation.h +++ b/interfaces/idocumentation.h @@ -57,7 +57,7 @@ inside the documentation widget. The implementation will have to enable the widget if it means to support the search feature. */ - virtual QWidget* documentationWidget(DocumentationFindWidget* findWidget, QWidget* parent=0) = 0; + virtual QWidget* documentationWidget(DocumentationFindWidget* findWidget, QWidget* parent = nullptr) = 0; virtual IDocumentationProvider* provider() const = 0; diff --git a/interfaces/iplugincontroller.h b/interfaces/iplugincontroller.h --- a/interfaces/iplugincontroller.h +++ b/interfaces/iplugincontroller.h @@ -161,7 +161,7 @@ if (plugin) { return plugin->extension(); } - return 0L; + return nullptr; } /** diff --git a/interfaces/iuicontroller.h b/interfaces/iuicontroller.h --- a/interfaces/iuicontroller.h +++ b/interfaces/iuicontroller.h @@ -51,7 +51,7 @@ * @param parent the parent to use as parent for the widget * @returns the new widget for the toolview */ - virtual QWidget* create(QWidget *parent = 0) = 0; + virtual QWidget* create(QWidget *parent = nullptr) = 0; /** * @returns the identifier of this toolview. The identifier * is used to remember which areas the tool view should appear diff --git a/language/duchain/appendedlist.h b/language/duchain/appendedlist.h --- a/language/duchain/appendedlist.h +++ b/language/duchain/appendedlist.h @@ -121,14 +121,14 @@ //The only function that does not lock the mutex is getItem(..), because that function must be very efficient. //Since it's only a few instructions from the moment m_items is read to the moment it's used, //deleting the old data after a few seconds should be safe. - m_deleteLater.append(qMakePair(time(0), oldItems)); + m_deleteLater.append(qMakePair(time(nullptr), oldItems)); //We do this in this place so it isn't called too often. The result is that we will always have some additional data around. //However the index itself should anyway not consume too much data. if(!m_deleteLater.isEmpty()) { while(!m_deleteLater.isEmpty()) { //We delete after 5 seconds - if(time(0) - m_deleteLater.first().first > 5) { + if(time(nullptr) - m_deleteLater.first().first > 5) { m_deleteLater.removeFirst(); }else{ break; @@ -296,7 +296,7 @@ #define APPENDED_LIST_FIRST(container, type, name) \ APPENDED_LIST_COMMON(container, type, name) \ const type* name() const { \ - if((name ## Data & KDevelop::DynamicAppendedListRevertMask) == 0) return 0; \ + if((name ## Data & KDevelop::DynamicAppendedListRevertMask) == 0) return nullptr; \ if(!appendedListsDynamic()) return reinterpret_cast(reinterpret_cast(this) + classSize() + offsetBehindBase()); \ else return temporaryHash ## container ## name().getItem(name ## Data).data(); \ } \ @@ -309,7 +309,7 @@ #define APPENDED_LIST(container, type, name, predecessor) \ APPENDED_LIST_COMMON(container, type, name) \ const type* name() const {\ - if((name ## Data & KDevelop::DynamicAppendedListRevertMask) == 0) return 0; \ + if((name ## Data & KDevelop::DynamicAppendedListRevertMask) == 0) return nullptr; \ if(!appendedListsDynamic()) return reinterpret_cast(reinterpret_cast(this) + classSize() + predecessor ## OffsetBehind()); \ else return temporaryHash ## container ## name().getItem(name ## Data).data(); \ } \ diff --git a/language/duchain/classdeclaration.h b/language/duchain/classdeclaration.h --- a/language/duchain/classdeclaration.h +++ b/language/duchain/classdeclaration.h @@ -112,7 +112,7 @@ /**Returns whether base is a public base-class of this class * @param baseConversionLevels If nonzero, this will count the distance of the classes. * */ - bool isPublicBaseClass( ClassDeclaration* base, const KDevelop::TopDUContext* topContext, int* baseConversionLevels = 0 ) const; + bool isPublicBaseClass( ClassDeclaration* base, const KDevelop::TopDUContext* topContext, int* baseConversionLevels = nullptr ) const; QString toString() const override; diff --git a/language/duchain/duchainlock.h b/language/duchain/duchainlock.h --- a/language/duchain/duchainlock.h +++ b/language/duchain/duchainlock.h @@ -115,7 +115,7 @@ * \param duChainLock lock to read-acquire. If this is left zero, DUChain::lock() is used. * \param timeout Timeout in milliseconds. If this is not zero, you've got to check locked() to see whether the lock succeeded. */ - explicit DUChainReadLocker(DUChainLock* duChainLock = 0, unsigned int timeout = 0); + explicit DUChainReadLocker(DUChainLock* duChainLock = nullptr, unsigned int timeout = 0); /// Destructor. ~DUChainReadLocker(); @@ -147,7 +147,7 @@ * \param duChainLock lock to write-acquire. If this is left zero, DUChain::lock() is used. * \param timeout Timeout in milliseconds. If this is not zero, you've got to check locked() to see whether the lock succeeded. */ - explicit DUChainWriteLocker(DUChainLock* duChainLock = 0, unsigned int timeout = 0); + explicit DUChainWriteLocker(DUChainLock* duChainLock = nullptr, unsigned int timeout = 0); /// Destructor. ~DUChainWriteLocker(); diff --git a/language/duchain/duchainpointer.h b/language/duchain/duchainpointer.h --- a/language/duchain/duchainpointer.h +++ b/language/duchain/duchainpointer.h @@ -159,15 +159,15 @@ Type* data() const { if( !d ) - return 0; + return nullptr; return static_cast(d->base()); } DUChainPointer& operator= ( Type* rhs ) { if( rhs ) d = rhs->weakPointer(); else - d = 0; + d = nullptr; return *this; } diff --git a/language/duchain/duchainregister.h b/language/duchain/duchainregister.h --- a/language/duchain/duchainregister.h +++ b/language/duchain/duchainregister.h @@ -117,7 +117,7 @@ Q_ASSERT(m_factories.size() > T::Identity); Q_ASSERT(m_factories[T::Identity]); delete m_factories[T::Identity]; - m_factories[T::Identity] = 0; + m_factories[T::Identity] = nullptr; m_dataClassSizes[T::Identity] = 0; } diff --git a/language/duchain/duchainutils.h b/language/duchain/duchainutils.h --- a/language/duchain/duchainutils.h +++ b/language/duchain/duchainutils.h @@ -79,7 +79,7 @@ KDEVPLATFORMLANGUAGE_EXPORT ItemUnderCursor itemUnderCursor(const QUrl& url, const KTextEditor::Cursor& cursor); /**If the given declaration is a definition, and has a real declaration *attached, returns that declarations. Else returns the given argument. */ - KDEVPLATFORMLANGUAGE_EXPORT Declaration* declarationForDefinition(Declaration* definition, TopDUContext* topContext = 0); + KDEVPLATFORMLANGUAGE_EXPORT Declaration* declarationForDefinition(Declaration* definition, TopDUContext* topContext = nullptr); ///Returns the first declaration in the given line. Searches the given context and all sub-contexts. ///Must only be called from the foreground or with the foreground lock held. KDEVPLATFORMLANGUAGE_EXPORT Declaration* declarationInLine(const KTextEditor::Cursor& cursor, KDevelop::DUContext* ctx); diff --git a/language/duchain/functiondefinition.h b/language/duchain/functiondefinition.h --- a/language/duchain/functiondefinition.h +++ b/language/duchain/functiondefinition.h @@ -44,7 +44,7 @@ * @param topContext the top-context from which to search * \returns the declaration matching this definition, otherwise null if no matching declaration has been found. * */ - Declaration* declaration(const TopDUContext* topContext = 0) const; + Declaration* declaration(const TopDUContext* topContext = nullptr) const; ///Returns true if a Declaration has been assigned to this Definition bool hasDeclaration() const; diff --git a/language/duchain/indexeddeclaration.h b/language/duchain/indexeddeclaration.h --- a/language/duchain/indexeddeclaration.h +++ b/language/duchain/indexeddeclaration.h @@ -33,7 +33,7 @@ */ class KDEVPLATFORMLANGUAGE_EXPORT IndexedDeclaration { public: - IndexedDeclaration(const Declaration* decl = 0); + IndexedDeclaration(const Declaration* decl = nullptr); IndexedDeclaration(uint topContext, uint declarationIndex); /** @@ -60,7 +60,7 @@ ///@warning The duchain needs to be locked when this is called inline bool isValid() const { - return !isDummy() && declaration() != 0; + return !isDummy() && declaration() != nullptr; } inline bool operator<(const IndexedDeclaration& rhs) const { diff --git a/language/duchain/indexedducontext.h b/language/duchain/indexedducontext.h --- a/language/duchain/indexedducontext.h +++ b/language/duchain/indexedducontext.h @@ -55,7 +55,7 @@ } bool isValid() const { - return !isDummy() && context() != 0; + return !isDummy() && context() != nullptr; } bool operator<(const IndexedDUContext& rhs) const { diff --git a/language/duchain/indexedtopducontext.h b/language/duchain/indexedtopducontext.h --- a/language/duchain/indexedtopducontext.h +++ b/language/duchain/indexedtopducontext.h @@ -40,7 +40,7 @@ if(!index) setIsDummy(true); } - IndexedTopDUContext(TopDUContext* context = 0); + IndexedTopDUContext(TopDUContext* context = nullptr); enum { DummyMask = 1u<<31u diff --git a/language/duchain/localindexeddeclaration.h b/language/duchain/localindexeddeclaration.h --- a/language/duchain/localindexeddeclaration.h +++ b/language/duchain/localindexeddeclaration.h @@ -33,7 +33,7 @@ class KDEVPLATFORMLANGUAGE_EXPORT LocalIndexedDeclaration { public: - LocalIndexedDeclaration(Declaration* decl = 0); + LocalIndexedDeclaration(Declaration* decl = nullptr); LocalIndexedDeclaration(uint declarationIndex); /** diff --git a/language/duchain/navigation/navigationaction.h b/language/duchain/navigation/navigationaction.h --- a/language/duchain/navigation/navigationaction.h +++ b/language/duchain/navigation/navigationaction.h @@ -42,16 +42,16 @@ }; ///When executed, this navigation-action calls the "executeKeyAction(QString) function in its navigation-context - NavigationAction(QString _key) : targetContext(0), type(ExecuteKey), key(_key) { + NavigationAction(QString _key) : targetContext(nullptr), type(ExecuteKey), key(_key) { } - NavigationAction() : targetContext(0), type(None) { + NavigationAction() : targetContext(nullptr), type(None) { } - NavigationAction( DeclarationPointer decl_, Type type_ ) : targetContext(0), decl(decl_), type(type_) { + NavigationAction( DeclarationPointer decl_, Type type_ ) : targetContext(nullptr), decl(decl_), type(type_) { } - NavigationAction( const QUrl& _document, const KTextEditor::Cursor& _cursor) : targetContext(0), document(_document), cursor(_cursor) { + NavigationAction( const QUrl& _document, const KTextEditor::Cursor& _cursor) : targetContext(nullptr), document(_document), cursor(_cursor) { type = JumpToSource; } diff --git a/language/duchain/parsingenvironment.h b/language/duchain/parsingenvironment.h --- a/language/duchain/parsingenvironment.h +++ b/language/duchain/parsingenvironment.h @@ -142,7 +142,7 @@ ///Can additionally use language-specific information to decide whether the top-context that has this data attached needs to be reparsed. ///The standard-implementation checks the modification-time of this file stored using setModificationRevision, and all other modification-times ///stored with addModificationRevision(..). - virtual bool needsUpdate(const ParsingEnvironment* environment = 0) const; + virtual bool needsUpdate(const ParsingEnvironment* environment = nullptr) const; /** * A language-specific flag used by C++ to mark one context as a proxy of another. diff --git a/language/duchain/topducontext.h b/language/duchain/topducontext.h --- a/language/duchain/topducontext.h +++ b/language/duchain/topducontext.h @@ -58,7 +58,7 @@ ///keep a ReferencedTopDUContext. class KDEVPLATFORMLANGUAGE_EXPORT ReferencedTopDUContext { public: - ReferencedTopDUContext(TopDUContext* context = 0); + ReferencedTopDUContext(TopDUContext* context = nullptr); ReferencedTopDUContext(const ReferencedTopDUContext& rhs); ~ReferencedTopDUContext(); @@ -107,7 +107,7 @@ class KDEVPLATFORMLANGUAGE_EXPORT TopDUContext : public DUContext { public: - explicit TopDUContext(const IndexedString& url, const RangeInRevision& range, ParsingEnvironmentFile* file = 0); + explicit TopDUContext(const IndexedString& url, const RangeInRevision& range, ParsingEnvironmentFile* file = nullptr); explicit TopDUContext(TopDUContextData& data); TopDUContext* topContext() const override; diff --git a/language/duchain/topducontextutils.h b/language/duchain/topducontextutils.h --- a/language/duchain/topducontextutils.h +++ b/language/duchain/topducontextutils.h @@ -27,7 +27,7 @@ /// \todo move data to private d pointer classes struct KDEVPLATFORMLANGUAGE_EXPORT TopDUContext::DeclarationChecker { - DeclarationChecker(const TopDUContext* _top, const CursorInRevision& _position, const AbstractType::Ptr& _dataType, DUContext::SearchFlags _flags, KDevVarLengthArray* _createVisibleCache = 0); + DeclarationChecker(const TopDUContext* _top, const CursorInRevision& _position, const AbstractType::Ptr& _dataType, DUContext::SearchFlags _flags, KDevVarLengthArray* _createVisibleCache = nullptr); bool operator()(const Declaration* dec) const; mutable KDevVarLengthArray* createVisibleCache; diff --git a/language/duchain/types/arraytype.h b/language/duchain/types/arraytype.h --- a/language/duchain/types/arraytype.h +++ b/language/duchain/types/arraytype.h @@ -98,7 +98,7 @@ template<> inline ArrayType* fastCast(AbstractType* from) { if(!from || from->whichType() != AbstractType::TypeArray) - return 0; + return nullptr; else return static_cast(from); } diff --git a/language/duchain/types/constantintegraltype.h b/language/duchain/types/constantintegraltype.h --- a/language/duchain/types/constantintegraltype.h +++ b/language/duchain/types/constantintegraltype.h @@ -110,7 +110,7 @@ template<> inline ConstantIntegralType* fastCast(AbstractType* from) { if(!from || from->whichType() != KDevelop::AbstractType::TypeIntegral) - return 0; + return nullptr; else return dynamic_cast(from); } diff --git a/language/duchain/types/delayedtype.h b/language/duchain/types/delayedtype.h --- a/language/duchain/types/delayedtype.h +++ b/language/duchain/types/delayedtype.h @@ -97,7 +97,7 @@ template<> inline DelayedType* fastCast(AbstractType* from) { if(!from || from->whichType() != AbstractType::TypeDelayed) - return 0; + return nullptr; else return static_cast(from); } diff --git a/language/duchain/types/enumerationtype.h b/language/duchain/types/enumerationtype.h --- a/language/duchain/types/enumerationtype.h +++ b/language/duchain/types/enumerationtype.h @@ -65,7 +65,7 @@ template<> inline EnumerationType* fastCast(AbstractType* from) { if(!from || from->whichType() != KDevelop::AbstractType::TypeEnumeration) - return 0; + return nullptr; else return static_cast(from); } diff --git a/language/duchain/types/enumeratortype.h b/language/duchain/types/enumeratortype.h --- a/language/duchain/types/enumeratortype.h +++ b/language/duchain/types/enumeratortype.h @@ -67,7 +67,7 @@ template<> inline EnumeratorType* fastCast(AbstractType* from) { if(!from || from->whichType() != KDevelop::AbstractType::TypeEnumerator) - return 0; + return nullptr; else return static_cast(from); } diff --git a/language/duchain/types/functiontype.h b/language/duchain/types/functiontype.h --- a/language/duchain/types/functiontype.h +++ b/language/duchain/types/functiontype.h @@ -139,7 +139,7 @@ template<> inline FunctionType* fastCast(AbstractType* from) { if(!from || from->whichType() != AbstractType::TypeFunction) - return 0; + return nullptr; else return static_cast(from); } diff --git a/language/duchain/types/integraltype.h b/language/duchain/types/integraltype.h --- a/language/duchain/types/integraltype.h +++ b/language/duchain/types/integraltype.h @@ -118,7 +118,7 @@ template<> inline IntegralType* fastCast(AbstractType* from) { if(!from || from->whichType() != AbstractType::TypeIntegral) - return 0; + return nullptr; else return static_cast(from); } diff --git a/language/duchain/types/pointertype.h b/language/duchain/types/pointertype.h --- a/language/duchain/types/pointertype.h +++ b/language/duchain/types/pointertype.h @@ -88,7 +88,7 @@ template<> inline PointerType* fastCast(AbstractType* from) { if(!from || from->whichType() != AbstractType::TypePointer) - return 0; + return nullptr; else return static_cast(from); } diff --git a/language/duchain/types/referencetype.h b/language/duchain/types/referencetype.h --- a/language/duchain/types/referencetype.h +++ b/language/duchain/types/referencetype.h @@ -102,7 +102,7 @@ template<> inline ReferenceType* fastCast(AbstractType* from) { if(!from || from->whichType() != AbstractType::TypeReference) - return 0; + return nullptr; else return static_cast(from); } diff --git a/language/duchain/types/structuretype.h b/language/duchain/types/structuretype.h --- a/language/duchain/types/structuretype.h +++ b/language/duchain/types/structuretype.h @@ -77,7 +77,7 @@ template<> inline StructureType* fastCast(AbstractType* from) { if(!from || from->whichType() != AbstractType::TypeStructure) - return 0; + return nullptr; else return static_cast(from); } diff --git a/language/duchain/types/typealiastype.h b/language/duchain/types/typealiastype.h --- a/language/duchain/types/typealiastype.h +++ b/language/duchain/types/typealiastype.h @@ -76,7 +76,7 @@ template<> inline TypeAliasType* fastCast(AbstractType* from) { if(!from || from->whichType() != AbstractType::TypeIntegral) - return 0; + return nullptr; else return static_cast(from); } diff --git a/language/duchain/types/typepointer.h b/language/duchain/types/typepointer.h --- a/language/duchain/types/typepointer.h +++ b/language/duchain/types/typepointer.h @@ -48,7 +48,7 @@ ///Uses dynamic_cast to cast this pointer to the given type template - TypePtr cast(U * /*dummy*/ = 0) const { + TypePtr cast(U * /*dummy*/ = nullptr) const { return TypePtr(dynamic_cast(Base::data())); } diff --git a/language/duchain/types/typeutils.h b/language/duchain/types/typeutils.h --- a/language/duchain/types/typeutils.h +++ b/language/duchain/types/typeutils.h @@ -41,12 +41,12 @@ * Modifiers of aliases ore references are pushed into the targets. * @return return-value will only be zero if type is zero */ - KDEVPLATFORMLANGUAGE_EXPORT KDevelop::AbstractType::Ptr targetType(const KDevelop::AbstractType::Ptr& type, const KDevelop::TopDUContext* topContext, bool* constant = 0); + KDEVPLATFORMLANGUAGE_EXPORT KDevelop::AbstractType::Ptr targetType(const KDevelop::AbstractType::Ptr& type, const KDevelop::TopDUContext* topContext, bool* constant = nullptr); /** * Same as targetType(..), ecept that it does not un-aliases TypeAliasTypes * Modifiers of aliases ore references are pushed into the targets. */ - KDEVPLATFORMLANGUAGE_EXPORT KDevelop::AbstractType::Ptr targetTypeKeepAliases(const KDevelop::AbstractType::Ptr& type, const KDevelop::TopDUContext* topContext, bool* constant = 0); + KDEVPLATFORMLANGUAGE_EXPORT KDevelop::AbstractType::Ptr targetTypeKeepAliases(const KDevelop::AbstractType::Ptr& type, const KDevelop::TopDUContext* topContext, bool* constant = nullptr); /** * Resolves all type-aliases, returning the effective aliased type * All modifiers are pushed from the aliases into the targets. diff --git a/language/util/basicsetrepository.h b/language/util/basicsetrepository.h --- a/language/util/basicsetrepository.h +++ b/language/util/basicsetrepository.h @@ -291,7 +291,7 @@ if(index) return dataRepository.itemFromIndex(index); else - return 0; + return nullptr; } inline QMutex* mutex() const { diff --git a/language/util/setrepository.h b/language/util/setrepository.h --- a/language/util/setrepository.h +++ b/language/util/setrepository.h @@ -108,14 +108,14 @@ if(m_data->leftNode()) return StaticRepository::repository()->nodeFromIndex(m_data->leftNode()); else - return 0; + return nullptr; } inline VirtualSetNode rightChild() const { if(m_data->rightNode()) return StaticRepository::repository()->nodeFromIndex(m_data->rightNode()); else - return 0; + return nullptr; } ///Returns the start of this node's range. If this is a final node, the length of the range is 1. diff --git a/plugins/appwizard/appwizarddialog.h b/plugins/appwizard/appwizarddialog.h --- a/plugins/appwizard/appwizarddialog.h +++ b/plugins/appwizard/appwizarddialog.h @@ -44,7 +44,7 @@ Q_OBJECT public: AppWizardDialog( KDevelop::IPluginController*, ProjectTemplatesModel*, - QWidget *parent = 0, Qt::WindowFlags flags = 0); + QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr); ApplicationInfo appInfo() const; diff --git a/plugins/appwizard/appwizardpagewidget.h b/plugins/appwizard/appwizardpagewidget.h --- a/plugins/appwizard/appwizardpagewidget.h +++ b/plugins/appwizard/appwizardpagewidget.h @@ -26,7 +26,7 @@ { Q_OBJECT public: - explicit AppWizardPageWidget(QWidget* parent = 0); + explicit AppWizardPageWidget(QWidget* parent = nullptr); virtual ~AppWizardPageWidget(); virtual bool shouldContinue(); diff --git a/plugins/filetemplates/templateclassassistant.cpp b/plugins/filetemplates/templateclassassistant.cpp --- a/plugins/filetemplates/templateclassassistant.cpp +++ b/plugins/filetemplates/templateclassassistant.cpp @@ -58,17 +58,17 @@ #include #include -#define REMOVE_PAGE(name) \ -if (d->name##Page) \ -{ \ - removePage(d->name##Page); \ - d->name##Page = 0; \ - d->name##PageWidget = 0; \ +#define REMOVE_PAGE(name) \ +if (d->name##Page) \ +{ \ + removePage(d->name##Page); \ + d->name##Page = nullptr; \ + d->name##PageWidget = nullptr; \ } -#define ZERO_PAGE(name) \ -d->name##Page = 0; \ -d->name##PageWidget = 0; +#define ZERO_PAGE(name) \ +d->name##Page = nullptr; \ +d->name##PageWidget = nullptr; using namespace KDevelop; diff --git a/plugins/subversion/kdevsvncpp/client.hpp b/plugins/subversion/kdevsvncpp/client.hpp --- a/plugins/subversion/kdevsvncpp/client.hpp +++ b/plugins/subversion/kdevsvncpp/client.hpp @@ -112,7 +112,7 @@ /** * Initializes the primary memory pool. */ - Client(Context * context = 0); + Client(Context * context = nullptr); virtual ~Client(); diff --git a/plugins/subversion/kdevsvncpp/entry.hpp b/plugins/subversion/kdevsvncpp/entry.hpp --- a/plugins/subversion/kdevsvncpp/entry.hpp +++ b/plugins/subversion/kdevsvncpp/entry.hpp @@ -50,7 +50,7 @@ * * @param src another entry to copy from */ - Entry(const svn_wc_entry_t * src = 0); + Entry(const svn_wc_entry_t * src = nullptr); /** * copy constructor diff --git a/plugins/subversion/kdevsvncpp/info.hpp b/plugins/subversion/kdevsvncpp/info.hpp --- a/plugins/subversion/kdevsvncpp/info.hpp +++ b/plugins/subversion/kdevsvncpp/info.hpp @@ -49,7 +49,7 @@ * * @param src another entry to copy from */ - Info(const Path & path, const svn_info_t * src = 0); + Info(const Path & path, const svn_info_t * src = nullptr); /** * copy constructor diff --git a/plugins/subversion/kdevsvncpp/pool.hpp b/plugins/subversion/kdevsvncpp/pool.hpp --- a/plugins/subversion/kdevsvncpp/pool.hpp +++ b/plugins/subversion/kdevsvncpp/pool.hpp @@ -41,7 +41,7 @@ * * @param parent NULL -> global pool */ - Pool(apr_pool_t * parent = (apr_pool_t *)0); + Pool(apr_pool_t * parent = nullptr); virtual ~ Pool(); diff --git a/plugins/subversion/kdevsvncpp/property.hpp b/plugins/subversion/kdevsvncpp/property.hpp --- a/plugins/subversion/kdevsvncpp/property.hpp +++ b/plugins/subversion/kdevsvncpp/property.hpp @@ -64,7 +64,7 @@ class Property { public: - Property(Context * context = 0, + Property(Context * context = nullptr, const Path & path = ""); virtual ~Property(); diff --git a/plugins/subversion/kdevsvncpp/status.hpp b/plugins/subversion/kdevsvncpp/status.hpp --- a/plugins/subversion/kdevsvncpp/status.hpp +++ b/plugins/subversion/kdevsvncpp/status.hpp @@ -50,7 +50,7 @@ * @param path * @param status */ - Status(const char * path = 0, const svn_wc_status2_t * status = 0); + Status(const char * path = nullptr, const svn_wc_status2_t * status = nullptr); /** * copy constructor diff --git a/plugins/subversion/kdevsvncpp/targets.hpp b/plugins/subversion/kdevsvncpp/targets.hpp --- a/plugins/subversion/kdevsvncpp/targets.hpp +++ b/plugins/subversion/kdevsvncpp/targets.hpp @@ -64,7 +64,7 @@ * * @param target */ - Targets(const char * target = 0); + Targets(const char * target = nullptr); /** * Copy Constructor diff --git a/serialization/itemrepository.h b/serialization/itemrepository.h --- a/serialization/itemrepository.h +++ b/serialization/itemrepository.h @@ -130,12 +130,12 @@ Bucket() : m_monsterBucketExtent(0) , m_available(0) - , m_data(0) - , m_mappedData(0) - , m_objectMap(0) + , m_data(nullptr) + , m_mappedData(nullptr) + , m_objectMap(nullptr) , m_largestFreeItem(0) , m_freeItemCount(0) - , m_nextBucketHash(0) + , m_nextBucketHash(nullptr) , m_dirty(false) , m_changed(false) , m_lastUsed(0) @@ -214,7 +214,7 @@ if(static_cast(file->pos()) != offset + (1+m_monsterBucketExtent)*DataSize) { - KMessageBox::error(0, i18n("Failed writing to %1, probably the disk is full", file->fileName())); + KMessageBox::error(nullptr, i18n("Failed writing to %1, probably the disk is full", file->fileName())); abort(); } @@ -1013,7 +1013,7 @@ DynamicItem(const DynamicItem& rhs) : m_item(rhs.m_item), m_start(rhs.m_start) { // qDebug() << "stealing" << m_item; Q_ASSERT(rhs.m_start); - rhs.m_start = 0; + rhs.m_start = nullptr; } Item* operator->() { @@ -1057,20 +1057,20 @@ /// If this is zero, you have to care about storing the data using store() and/or close() by yourself. It does not happen automatically. /// For the global standard registry, the storing/loading is triggered from within duchain, so you don't need to care about it. ItemRepository(const QString& repositoryName, ItemRepositoryRegistry* registry = &globalItemRepositoryRegistry(), - uint repositoryVersion = 1, AbstractRepositoryManager* manager = 0) + uint repositoryVersion = 1, AbstractRepositoryManager* manager = nullptr) : m_ownMutex(QMutex::Recursive) , m_mutex(&m_ownMutex) , m_repositoryName(repositoryName) , m_registry(registry) - , m_file(0) - , m_dynamicFile(0) + , m_file(nullptr) + , m_dynamicFile(nullptr) , m_repositoryVersion(repositoryVersion) , m_manager(manager) { m_unloadingEnabled = true; m_metaDataChanged = true; m_buckets.resize(10); - m_buckets.fill(0); + m_buckets.fill(nullptr); memset(m_firstBucketForHash, 0, bucketHashSize * sizeof(short unsigned int)); @@ -1695,7 +1695,7 @@ const int unloadAfterTicks = 2; if(m_buckets[a]->lastUsed() > unloadAfterTicks) { delete m_buckets[a]; - m_buckets[a] = 0; + m_buckets[a] = nullptr; }else{ m_buckets[a]->tick(); } @@ -1910,9 +1910,9 @@ m_dynamicFile = new QFile(dir.absoluteFilePath( m_repositoryName + QLatin1String("_dynamic") )); if(!m_file->open( QFile::ReadWrite ) || !m_dynamicFile->open( QFile::ReadWrite ) ) { delete m_file; - m_file = 0; + m_file = nullptr; delete m_dynamicFile; - m_dynamicFile = 0; + m_dynamicFile = nullptr; return false; } @@ -1932,7 +1932,7 @@ m_file->write((char*)&m_statItemCount, sizeof(uint)); m_buckets.resize(10); - m_buckets.fill(0); + m_buckets.fill(nullptr); uint bucketCount = m_buckets.size(); m_file->write((char*)&bucketCount, sizeof(uint)); @@ -1944,7 +1944,7 @@ //We have completely initialized the file now if(m_file->pos() != BucketStartOffset) { - KMessageBox::error(0, i18n("Failed writing to %1, probably the disk is full", m_file->fileName())); + KMessageBox::error(nullptr, i18n("Failed writing to %1, probably the disk is full", m_file->fileName())); abort(); } @@ -1967,9 +1967,9 @@ if(storedVersion != m_repositoryVersion || hashSize != bucketHashSize || itemRepositoryVersion != staticItemRepositoryVersion()) { qDebug() << "repository" << m_repositoryName << "version mismatch in" << m_file->fileName() << ", stored: version " << storedVersion << "hashsize" << hashSize << "repository-version" << itemRepositoryVersion << " current: version" << m_repositoryVersion << "hashsize" << bucketHashSize << "repository-version" << staticItemRepositoryVersion(); delete m_file; - m_file = 0; + m_file = nullptr; delete m_dynamicFile; - m_dynamicFile = 0; + m_dynamicFile = nullptr; return false; } m_metaDataChanged = false; @@ -1990,7 +1990,7 @@ } m_fileMapSize = 0; - m_fileMap = 0; + m_fileMap = nullptr; #ifdef ITEMREPOSITORY_USE_MMAP_LOADING if(m_file->size() > BucketStartOffset){ @@ -2020,14 +2020,14 @@ if(m_file) m_file->close(); delete m_file; - m_file = 0; - m_fileMap = 0; + m_file = nullptr; + m_fileMap = nullptr; m_fileMapSize = 0; if(m_dynamicFile) m_dynamicFile->close(); delete m_dynamicFile; - m_dynamicFile = 0; + m_dynamicFile = nullptr; qDeleteAll(m_buckets); m_buckets.clear(); @@ -2136,7 +2136,7 @@ Q_ASSERT(bucketForIndex(bucketNumber)->isEmpty()); Q_ASSERT(bucketForIndex(bucketNumber)->noNextBuckets()); delete m_buckets[bucketNumber]; - m_buckets[bucketNumber] = 0; + m_buckets[bucketNumber] = nullptr; } //m_file must be opened diff --git a/serialization/repositorymanager.h b/serialization/repositorymanager.h --- a/serialization/repositorymanager.h +++ b/serialization/repositorymanager.h @@ -32,7 +32,7 @@ ///@param shareMutex Option repository from where this repository should take the thread-safety mutex RepositoryManager(QString name, int version = 1, - AbstractRepositoryManager*(*shareMutex)() = 0, + AbstractRepositoryManager*(*shareMutex)() = nullptr, ItemRepositoryRegistry& registry = globalItemRepositoryRegistry()) : m_name(name), m_version(version), diff --git a/shell/core.h b/shell/core.h --- a/shell/core.h +++ b/shell/core.h @@ -63,7 +63,7 @@ * @param session the name or uuid of the session to be loaded * */ - static bool initialize(QObject* splash = 0, Setup mode=Default, const QString& session = {} ); + static bool initialize(QObject* splash = nullptr, Setup mode=Default, const QString& session = {} ); /** * \brief Provide access an instance of Core @@ -123,11 +123,11 @@ protected: friend class CorePrivate; - Core( KDevelop::CorePrivate* dd, QObject* parent = 0 ); + Core( KDevelop::CorePrivate* dd, QObject* parent = nullptr ); KDevelop::CorePrivate *d; static Core *m_self; private: - Core(QObject *parent = 0); + Core(QObject *parent = nullptr); }; } diff --git a/sublime/areaindex.h b/sublime/areaindex.h --- a/sublime/areaindex.h +++ b/sublime/areaindex.h @@ -126,7 +126,7 @@ Does nothing if the view is already split. @param after if not 0, new view will be placed after this one. @param view the view to be added.*/ - void add(View *view, View *after = 0); + void add(View *view, View *after = nullptr); /**Removes view and unsplits the parent index when no views are left at the current index.*/ void remove(View *view); diff --git a/tests/json/jsondeclarationtests.h b/tests/json/jsondeclarationtests.h --- a/tests/json/jsondeclarationtests.h +++ b/tests/json/jsondeclarationtests.h @@ -182,7 +182,7 @@ const QString UN_ID_ERROR = QStringLiteral("Unable to identify declaration of type \"%1\"."); AbstractType::Ptr type = TypeUtils::targetType(decl->abstractType(), decl->topContext()); IdentifiedType* idType = dynamic_cast(type.data()); - Declaration* idDecl = idType ? idType->declaration(decl->topContext()) : 0; + Declaration* idDecl = idType ? idType->declaration(decl->topContext()) : nullptr; if (!idDecl) return UN_ID_ERROR.arg(type->toString()); @@ -238,7 +238,7 @@ DeclarationTest(definition) { KDevVarLengthArray definitions = DUChain::definitions()->definitions(decl->id()); - Declaration *declDef = 0; + Declaration *declDef = nullptr; if (!definitions.isEmpty()) declDef = definitions.at(0).declaration(); return testObject(declDef, value, QStringLiteral("Declaration's definition")); @@ -257,7 +257,7 @@ ///@returns whether the declaration's nullity matches the given value DeclarationTest(null) { - return compareValues(decl == 0, value, QStringLiteral("Declaration's nullity")); + return compareValues(decl == nullptr, value, QStringLiteral("Declaration's nullity")); } ///JSON type: bool ///@returns whether the declaration's default parameter matches the given value diff --git a/util/convenientfreelist.h b/util/convenientfreelist.h --- a/util/convenientfreelist.h +++ b/util/convenientfreelist.h @@ -36,7 +36,7 @@ template class ConstantConvenientEmbeddedSet { public: - ConstantConvenientEmbeddedSet() : m_data(0), m_dataSize(0), m_centralFreeItem(-1) { + ConstantConvenientEmbeddedSet() : m_data(nullptr), m_dataSize(0), m_centralFreeItem(-1) { } ConstantConvenientEmbeddedSet(const Data* data, uint count, int centralFreeItem) : m_data(data), m_dataSize(count), m_centralFreeItem(centralFreeItem) { } @@ -151,7 +151,7 @@ template class ConvenientEmbeddedSetIterator : public ConstantConvenientEmbeddedSet { public: - ConvenientEmbeddedSetIterator(const Data* data = 0, uint count = 0, int centralFreeItem = -1) : ConstantConvenientEmbeddedSet(data, count, centralFreeItem), m_pos(0) { + ConvenientEmbeddedSetIterator(const Data* data = nullptr, uint count = 0, int centralFreeItem = -1) : ConstantConvenientEmbeddedSet(data, count, centralFreeItem), m_pos(0) { //Move to first valid position moveToValid(); } diff --git a/util/embeddedfreetree.h b/util/embeddedfreetree.h --- a/util/embeddedfreetree.h +++ b/util/embeddedfreetree.h @@ -274,7 +274,7 @@ } ///Transfers the data into a new item-list. The size of the new item-list must equal newItemCount() - void transferData(Data* newItems, uint newCount, int* newCentralFree = 0) { + void transferData(Data* newItems, uint newCount, int* newCentralFree = nullptr) { DEBUG_FREEITEM_COUNT uint currentRealCount = m_itemCount - countFreeItems(*m_centralFreeItem); @@ -756,7 +756,7 @@ } ///Transfers the data into a new item-list. The size of the new item-list must equal newItemCount() - void transferData(Data* newItems, uint newCount, int* newCentralFree = 0) { + void transferData(Data* newItems, uint newCount, int* newCentralFree = nullptr) { DEBUG_FREEITEM_COUNT //We only transfer into a new list when all the free items are used up diff --git a/vcs/vcsjob.h b/vcs/vcsjob.h --- a/vcs/vcsjob.h +++ b/vcs/vcsjob.h @@ -44,7 +44,7 @@ { Q_OBJECT public: - explicit VcsJob( QObject* parent = 0, OutputJobVerbosity verbosity = OutputJob::Verbose); + explicit VcsJob( QObject* parent = nullptr, OutputJobVerbosity verbosity = OutputJob::Verbose); virtual ~VcsJob(); /** * To easily check which type of job this is.