From 365f83b7899b6c9bdaad4634f637c1d411514dcf Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 11 Apr 2019 15:13:26 +0200 Subject: [PATCH] [libcalamares] Reduce warnings in KDAB code - Use nullptr and suitable include guards --- .../kdsingleapplicationguard.h | 12 ++++++------ .../kdsingleapplicationguard/kdtoolsglobal.h | 6 +++--- .../kdsingleapplicationguard/pimpl_ptr.h | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/libcalamares/kdsingleapplicationguard/kdsingleapplicationguard.h b/src/libcalamares/kdsingleapplicationguard/kdsingleapplicationguard.h index 7b744e110..3bd1e644d 100644 --- a/src/libcalamares/kdsingleapplicationguard/kdsingleapplicationguard.h +++ b/src/libcalamares/kdsingleapplicationguard/kdsingleapplicationguard.h @@ -1,5 +1,5 @@ -#ifndef __KDTOOLSCORE_KDSINGLEAPPLICATIONGUARD_H__ -#define __KDTOOLSCORE_KDSINGLEAPPLICATIONGUARD_H__ +#ifndef KDTOOLSCORE_KDSINGLEAPPLICATIONGUARD_H +#define KDTOOLSCORE_KDSINGLEAPPLICATIONGUARD_H #include @@ -31,9 +31,9 @@ public: AutoKillOtherInstances = 1 }; - explicit KDSingleApplicationGuard( QObject * parent=0 ); - explicit KDSingleApplicationGuard( Policy policy, QObject * parent=0 ); - explicit KDSingleApplicationGuard( const QStringList & arguments, QObject * parent=0 ); + explicit KDSingleApplicationGuard( QObject * parent=nullptr ); + explicit KDSingleApplicationGuard( Policy policy, QObject * parent=nullptr ); + explicit KDSingleApplicationGuard( const QStringList & arguments, QObject * parent=nullptr ); explicit KDSingleApplicationGuard( const QStringList & arguments, Policy policy, QObject * parent=0 ); ~KDSingleApplicationGuard(); @@ -138,4 +138,4 @@ QT_END_NAMESPACE #endif // QT_NO_SHAREDMEMORY -#endif /* __KDTOOLSCORE_KDSINGLEAPPLICATIONGUARD_H__ */ +#endif /* KDTOOLSCORE_KDSINGLEAPPLICATIONGUARD_H */ diff --git a/src/libcalamares/kdsingleapplicationguard/kdtoolsglobal.h b/src/libcalamares/kdsingleapplicationguard/kdtoolsglobal.h index a0f004589..e23b78965 100644 --- a/src/libcalamares/kdsingleapplicationguard/kdtoolsglobal.h +++ b/src/libcalamares/kdsingleapplicationguard/kdtoolsglobal.h @@ -1,5 +1,5 @@ -#ifndef __KDTOOLS_KDTOOLSGLOBAL_H__ -#define __KDTOOLS_KDTOOLSGLOBAL_H__ +#ifndef KDTOOLS_KDTOOLSGLOBAL_H +#define KDTOOLS_KDTOOLSGLOBAL_H #include @@ -110,5 +110,5 @@ private: \ void init(bool) -#endif /* __KDTOOLS_KDTOOLSGLOBAL_H__ */ +#endif /* KDTOOLS_KDTOOLSGLOBAL_H */ diff --git a/src/libcalamares/kdsingleapplicationguard/pimpl_ptr.h b/src/libcalamares/kdsingleapplicationguard/pimpl_ptr.h index 7b7f36839..6f01cd64c 100644 --- a/src/libcalamares/kdsingleapplicationguard/pimpl_ptr.h +++ b/src/libcalamares/kdsingleapplicationguard/pimpl_ptr.h @@ -1,5 +1,5 @@ -#ifndef __KDTOOLSCORE__PIMPL_PTR_H__ -#define __KDTOOLSCORE__PIMPL_PTR_H__ +#ifndef KDTOOLSCORE__PIMPL_PTR_H +#define KDTOOLSCORE__PIMPL_PTR_H #include "kdtoolsglobal.h" @@ -14,7 +14,7 @@ namespace kdtools { public: pimpl_ptr() : d( new T ) {} explicit pimpl_ptr( T * t ) : d( t ) {} - ~pimpl_ptr() { delete d; d = 0; } + ~pimpl_ptr() { delete d; d = nullptr; } T * get() { return d; } const T * get() const { return d; } @@ -40,5 +40,5 @@ namespace kdtools { } // namespace kdtools #endif -#endif /* __KDTOOLSCORE__PIMPL_PTR_H__ */ +#endif /* KDTOOLSCORE__PIMPL_PTR_H */