Use nullptr instead of NULL in the code and documentation
This is a combination of running clang-tidy with modernize-use-nullptr check for some ports (GTK, X11, OSX) and manual changes to the ports for which it couldn't be used easily (MSW, DFB) and also manually updating the docs. Also replace NULL with null or nullptr in the comments as this is more consistent with the use of nullptr in the code and makes it simpler to grep for the remaining occurrences of NULL itself. And also use null in the assert messages. Only a few occurrences of "NULL" are still left in non-C files, mostly corresponding to unclear comments or string output which it might not be safe to change.
This commit is contained in:
parent
39ea524943
commit
4f4c5fcfdf
1844 changed files with 13721 additions and 13734 deletions
|
|
@ -135,7 +135,7 @@ TEST_CASE("Atomic::WithThreads", "[atomic]")
|
|||
for ( i = 0; i < count; ++i )
|
||||
{
|
||||
// each thread should return 0, else it detected some problem
|
||||
CHECK (threads[i]->Wait() == (wxThread::ExitCode)0);
|
||||
CHECK (threads[i]->Wait() == (wxThread::ExitCode)nullptr);
|
||||
delete threads[i];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ wxThread::ExitCode MyDetachedThread::Entry()
|
|||
wxMilliSleep(100);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void MyDetachedThread::OnExit()
|
||||
|
|
@ -140,7 +140,7 @@ public:
|
|||
|
||||
//wxPrintf(wxT("Thread %lu finished to wait, exiting.\n"), GetId());
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
@ -181,7 +181,7 @@ public:
|
|||
|
||||
m_sem->Post();
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ void QueueTestCase::TestReceive()
|
|||
int i;
|
||||
for ( i = 0; i < threadCount; ++i )
|
||||
{
|
||||
MyThread *previousThread = i == 0 ? NULL : threads[i-1];
|
||||
MyThread *previousThread = i == 0 ? nullptr : threads[i-1];
|
||||
MyThread *thread =
|
||||
new MyThread(WaitInfinitlyLong, previousThread, msgCount);
|
||||
|
||||
|
|
@ -139,8 +139,8 @@ void QueueTestCase::TestReceive()
|
|||
// should return wxMSGQUEUUE_TIMEOUT.
|
||||
void QueueTestCase::TestReceiveTimeout()
|
||||
{
|
||||
MyThread* thread1 = new MyThread(WaitWithTimeout, NULL, 2);
|
||||
MyThread* thread2 = new MyThread(WaitWithTimeout, NULL, 2);
|
||||
MyThread* thread1 = new MyThread(WaitWithTimeout, nullptr, 2);
|
||||
MyThread* thread2 = new MyThread(WaitWithTimeout, nullptr, 2);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL ( thread1->Create(), wxTHREAD_NO_ERROR );
|
||||
CPPUNIT_ASSERT_EQUAL ( thread2->Create(), wxTHREAD_NO_ERROR );
|
||||
|
|
@ -185,7 +185,7 @@ void *QueueTestCase::MyThread::Entry()
|
|||
|
||||
if ( result == wxMSGQUEUE_NO_ERROR )
|
||||
{
|
||||
if ( m_nextThread != NULL )
|
||||
if ( m_nextThread != nullptr )
|
||||
{
|
||||
wxMessageQueueError res = m_nextThread->GetQueue().Post(msg);
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public:
|
|||
wxASSERT( gs_threadData.name == std::string("worker") );
|
||||
wxASSERT( gs_threadData.number == 2 );
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ void TLSTestCase::TestInt()
|
|||
|
||||
void TLSTestCase::TestStruct()
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL( NULL, gs_threadData.name );
|
||||
CPPUNIT_ASSERT_EQUAL( nullptr, gs_threadData.name );
|
||||
CPPUNIT_ASSERT_EQUAL( 0, gs_threadData.number );
|
||||
|
||||
gs_threadData.name = "main";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue