]> granicus.if.org Git - icinga2/commitdiff
Apply clang-tidy fix 'modernize-use-nullptr'
authorGunnar Beutner <gunnar.beutner@icinga.com>
Thu, 4 Jan 2018 08:18:50 +0000 (09:18 +0100)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Thu, 4 Jan 2018 11:24:57 +0000 (12:24 +0100)
icinga-studio/forms.cpp
lib/base/exception.cpp
lib/base/object.cpp
lib/base/tlsutility.cpp
lib/base/utility.cpp

index 2cf189e22388d1e41e9b6fcf27b0d0af595f4176..afe31d6d05808a42978f737d94d52a6b91bf7efa 100644 (file)
@@ -68,8 +68,8 @@ MainFormBase::MainFormBase( wxWindow* parent, wxWindowID id, const wxString& tit
        // Connect Events
        this->Connect( m_QuitMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFormBase::OnQuitClicked ) );
        this->Connect( m_AboutMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFormBase::OnAboutClicked ) );
-       m_TypesTree->Connect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( MainFormBase::OnTypeSelected ), NULL, this );
-       m_ObjectsList->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( MainFormBase::OnObjectSelected ), NULL, this );
+       m_TypesTree->Connect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( MainFormBase::OnTypeSelected ), nullptr, this );
+       m_ObjectsList->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( MainFormBase::OnObjectSelected ), nullptr, this );
 }
 
 MainFormBase::~MainFormBase()
@@ -77,8 +77,8 @@ MainFormBase::~MainFormBase()
        // Disconnect Events
        this->Disconnect( wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFormBase::OnQuitClicked ) );
        this->Disconnect( wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFormBase::OnAboutClicked ) );
-       m_TypesTree->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( MainFormBase::OnTypeSelected ), NULL, this );
-       m_ObjectsList->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( MainFormBase::OnObjectSelected ), NULL, this );
+       m_TypesTree->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( MainFormBase::OnTypeSelected ), nullptr, this );
+       m_ObjectsList->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( MainFormBase::OnObjectSelected ), nullptr, this );
 
 }
 
index 46927d66e6d5bfd7078924463e5cf77a15b236b2..663ec34332208bb852c383881695056e09a70c87 100644 (file)
@@ -115,7 +115,7 @@ void __cxa_throw(void *obj, TYPEINFO_TYPE *pvtinfo, void (*dest)(void *))
        l_LastExceptionDest.reset(new DestCallback(dest));
 #endif /* !defined(__GLIBCXX__) && !defined(_WIN32) */
 
-       if (real_cxa_throw == 0)
+       if (real_cxa_throw == nullptr)
                real_cxa_throw = (cxa_throw_fn)dlsym(RTLD_NEXT, "__cxa_throw");
 
 #ifndef NO_CAST_EXCEPTION
index 46e37072b881ffb78e64dd0fc8084529745a560b..b8288c11ab842f90dd91d51965b683376275fff2 100644 (file)
@@ -43,9 +43,6 @@ static Timer::Ptr l_ObjectCountTimer;
  */
 Object::Object()
        : m_References(0), m_Mutex(0)
-#ifdef I2_DEBUG
-       , m_LockOwner(0)
-#endif /* I2_DEBUG */
 { }
 
 /**
@@ -77,7 +74,7 @@ bool Object::OwnsLock() const
 
        return (tid == GetCurrentThreadId());
 #else /* _WIN32 */
-       pthread_t tid = __sync_fetch_and_add(&m_LockOwner, 0);
+       pthread_t tid = __sync_fetch_and_add(&m_LockOwner, nullptr);
 
        return (tid == pthread_self());
 #endif /* _WIN32 */
index 4746d8e83235beba8d5da15c1a6d87b096764828..4adf04f339aa42a140724538492f277062bba77f 100644 (file)
@@ -379,7 +379,7 @@ int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile,
                        << boost::errinfo_file_name(keyfile));
        }
 
-       if (!PEM_write_bio_PrivateKey(bio, key, nullptr, nullptr, 0, 0, nullptr)) {
+       if (!PEM_write_bio_PrivateKey(bio, key, nullptr, nullptr, 0, nullptr, nullptr)) {
                EVP_PKEY_free(key);
                EC_KEY_free(eckey);
                BIO_free(bio);
index edbf2e468639b430e58d9ea616f08eeef25efd04..0171ac4a51de31ce0a5cc45d84895202b5f47c1c 100644 (file)
@@ -84,7 +84,7 @@ String Utility::DemangleSymbolName(const String& sym)
 
 #ifdef HAVE_CXXABI_H
        int status;
-       char *realname = abi::__cxa_demangle(sym.CStr(), 0, 0, &status);
+       char *realname = abi::__cxa_demangle(sym.CStr(), nullptr, nullptr, &status);
 
        if (realname) {
                result = String(realname);