From 5f36b7efbf8a6a22c3371b34451e0975aea57b30 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 18 Aug 2017 14:34:52 +0200 Subject: NULL -> nullptr --- fastos/src/tests/backtracetest.cpp | 2 +- fastos/src/tests/coretest.cpp | 8 +++--- fastos/src/tests/coretest2.cpp | 8 +++--- fastos/src/tests/filetest.cpp | 4 +-- fastos/src/tests/job.h | 18 ++++++------- fastos/src/tests/performancetest.cpp | 4 +-- fastos/src/tests/prefetchtest.cpp | 4 +-- fastos/src/tests/processtest.cpp | 28 ++++++++++----------- fastos/src/tests/sockettest.cpp | 40 ++++++++++++++--------------- fastos/src/tests/thread_bounce_test.cpp | 2 +- fastos/src/tests/thread_joinwait_test.cpp | 6 ++--- fastos/src/tests/thread_mutex_test.cpp | 14 +++++------ fastos/src/tests/thread_sleep_test.cpp | 6 ++--- fastos/src/tests/thread_stats_test.cpp | 2 +- fastos/src/tests/thread_test_base.hpp | 8 +++--- fastos/src/tests/threadtest.cpp | 42 +++++++++++++++---------------- fastos/src/tests/timetest.cpp | 2 +- fastos/src/tests/typetest.cpp | 2 +- fastos/src/tests/usecputest.cpp | 2 +- 19 files changed, 101 insertions(+), 101 deletions(-) (limited to 'fastos/src/tests') diff --git a/fastos/src/tests/backtracetest.cpp b/fastos/src/tests/backtracetest.cpp index df0887c6b63..6c68765c1ee 100644 --- a/fastos/src/tests/backtracetest.cpp +++ b/fastos/src/tests/backtracetest.cpp @@ -116,7 +116,7 @@ int main (int argc, char **argv) { BackTraceTest app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } diff --git a/fastos/src/tests/coretest.cpp b/fastos/src/tests/coretest.cpp index 2337c392730..a53eaf9d2a4 100644 --- a/fastos/src/tests/coretest.cpp +++ b/fastos/src/tests/coretest.cpp @@ -8,7 +8,7 @@ bomb(void) { char *p; - p = NULL; + p = nullptr; *p = 4; } @@ -29,8 +29,8 @@ bombMain(void) FastS_Bomber bomber; FastOS_ThreadInterface *thread; - thread = pool->NewThread(&bomber, NULL); - if (thread != NULL) + thread = pool->NewThread(&bomber, nullptr); + if (thread != nullptr) thread->Join(); pool->Close(); @@ -60,7 +60,7 @@ int main(int argc, char **argv) { FastS_CoreTestApp app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); if (argc == 1) return app.Entry(argc, argv); else diff --git a/fastos/src/tests/coretest2.cpp b/fastos/src/tests/coretest2.cpp index a8c416f2de4..e11d334e65e 100644 --- a/fastos/src/tests/coretest2.cpp +++ b/fastos/src/tests/coretest2.cpp @@ -8,7 +8,7 @@ bomb(void) { char *p; - p = NULL; + p = nullptr; *p = 4; } @@ -16,7 +16,7 @@ void *BomberRun(void *arg) { (void) arg; bomb(); - return NULL; + return nullptr; }; static int @@ -25,8 +25,8 @@ bombMain(void) pthread_t thread; void *ret; - (void) pthread_create(&thread, NULL, BomberRun, NULL); - ret = NULL; + (void) pthread_create(&thread, nullptr, BomberRun, nullptr); + ret = nullptr; (void) pthread_join(thread, &ret); return (0); } diff --git a/fastos/src/tests/filetest.cpp b/fastos/src/tests/filetest.cpp index ad411364c0c..e063ccbc89d 100644 --- a/fastos/src/tests/filetest.cpp +++ b/fastos/src/tests/filetest.cpp @@ -278,7 +278,7 @@ public: Progress(rc, "Opening file 'generated/memorymaptest' read-only"); if (rc) { bool mmapEnabled; - char *mmapBuffer = NULL; + char *mmapBuffer = nullptr; mmapEnabled = file.IsMemoryMapped(); mmapBuffer = static_cast(file.MemoryMapPtr(0)); @@ -832,6 +832,6 @@ int main (int argc, char **argv) { FileTest app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } diff --git a/fastos/src/tests/job.h b/fastos/src/tests/job.h index 5199169409d..a5b84fa0f9c 100644 --- a/fastos/src/tests/job.h +++ b/fastos/src/tests/job.h @@ -42,17 +42,17 @@ public: Job() : code(NOP), - message(NULL), - mutex(NULL), - condition(NULL), - boolcondition(NULL), - otherThread(NULL), - ownThread(NULL), - timebuf(NULL), + message(nullptr), + mutex(nullptr), + condition(nullptr), + boolcondition(nullptr), + otherThread(nullptr), + ownThread(nullptr), + timebuf(nullptr), average(0.0), result(-1), _threadId(), - otherjob(NULL), + otherjob(nullptr), bouncewakeupcnt(0), bouncewakeup(false) { @@ -60,7 +60,7 @@ public: ~Job() { - if(message != NULL) + if(message != nullptr) free(message); } }; diff --git a/fastos/src/tests/performancetest.cpp b/fastos/src/tests/performancetest.cpp index 1465ee3d223..55174fcc4e3 100644 --- a/fastos/src/tests/performancetest.cpp +++ b/fastos/src/tests/performancetest.cpp @@ -12,14 +12,14 @@ int main (int argc, char **argv) void (*test)(char *buffer) = PerformanceTest; - test(NULL); + test(nullptr); return 0; } void PerformanceTest (char *buffer) { // Cause exception - *static_cast(NULL) = 'e'; + *static_cast(nullptr) = 'e'; #if 1 FastOS_File file("test.txt"); diff --git a/fastos/src/tests/prefetchtest.cpp b/fastos/src/tests/prefetchtest.cpp index 26ab67251b3..38d3eed837c 100644 --- a/fastos/src/tests/prefetchtest.cpp +++ b/fastos/src/tests/prefetchtest.cpp @@ -35,7 +35,7 @@ public: size = 32; size *= 1024*1024/sizeof(*a); - if ((a = static_cast(calloc(size, sizeof(*a)))) != NULL) + if ((a = static_cast(calloc(size, sizeof(*a)))) != nullptr) { // Standard loop start.SetNow(); @@ -155,6 +155,6 @@ public: int main (int argc, char **argv) { PrefetchTestApp app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } diff --git a/fastos/src/tests/processtest.cpp b/fastos/src/tests/processtest.cpp index 5036676a504..11e1307027d 100644 --- a/fastos/src/tests/processtest.cpp +++ b/fastos/src/tests/processtest.cpp @@ -47,7 +47,7 @@ public: void OnReceiveData (const void *data, size_t length) override { _receivedBytes += length; - if(data != NULL) + if(data != nullptr) { #if 0 printf("[%s] received %u bytes of data:\n%s\n", @@ -62,7 +62,7 @@ public: int MyListener::_allocCount = 0; int MyListener::_successCount = 0; int MyListener::_failCount = 0; -FastOS_Mutex *MyListener::_counterLock = NULL; +FastOS_Mutex *MyListener::_counterLock = nullptr; class ThreadRunJob : public FastOS_Runnable @@ -128,7 +128,7 @@ public: ProcessTest () : _gotMessage(false), _receivedMessages(0), - _counterLock(NULL), + _counterLock(nullptr), _isChild(true) { } @@ -154,7 +154,7 @@ public: _gotMessage = true; // We only have the counter lock if we are the parent process. - if(_counterLock != NULL) + if(_counterLock != nullptr) { _counterLock->Lock(); _receivedMessages++; @@ -197,7 +197,7 @@ public: if(i == 5) { // Make sort quit - xproc->WriteStdin(NULL, 0); + xproc->WriteStdin(nullptr, 0); } FastOS_Thread::Sleep(1000); @@ -257,7 +257,7 @@ public: if(!waitKill && stdinPre) { xproc->WriteStdin(str, strlen(str)); - xproc->WriteStdin(NULL, 0); + xproc->WriteStdin(nullptr, 0); } if(doKill) @@ -269,7 +269,7 @@ public: if(!waitKill && !stdinPre) { xproc->WriteStdin(str, strlen(str)); - xproc->WriteStdin(NULL, 0); + xproc->WriteStdin(nullptr, 0); } } else @@ -277,7 +277,7 @@ public: Progress(false, "Process.CreateWithShell failure %d", GetLastError()); delete xproc; - xproc = NULL; + xproc = nullptr; } procs[j] = xproc; } @@ -285,7 +285,7 @@ public: for(j=0; j 0, "Number of files processed = %d\n", numProc); @@ -469,6 +469,6 @@ public: int main (int argc, char **argv) { ProcessTest app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } diff --git a/fastos/src/tests/sockettest.cpp b/fastos/src/tests/sockettest.cpp index 3a9c9dab565..29dcb1b089e 100644 --- a/fastos/src/tests/sockettest.cpp +++ b/fastos/src/tests/sockettest.cpp @@ -150,7 +150,7 @@ public: BaseTest *_app; MazeServer(BaseTest *app) - : _serverSocket(NULL), + : _serverSocket(nullptr), _app(app) { } @@ -185,7 +185,7 @@ public: { int serverPort = 18334; _serverSocket = new FastOS_ServerSocket(serverPort); - _app->Progress(_serverSocket != NULL, + _app->Progress(_serverSocket != nullptr, "Creating ServerSocket instance"); _app->Progress(_serverSocket->SetSoBlocking(false), @@ -224,12 +224,12 @@ public: { FastOS_Socket *connSocket = _serverSocket->AcceptPlain(); - _app->Progress(connSocket != NULL, "Accepting socket (%p)", + _app->Progress(connSocket != nullptr, "Accepting socket (%p)", connSocket); for(i=0; iSetSocketEvent(&socketEvent); connSocket->EnableReadEvent(true); @@ -256,7 +256,7 @@ public: for(i=0; i_socket)) { @@ -273,7 +273,7 @@ public: if(conn->_shouldFree) { delete(conn); - connections[i] = NULL; + connections[i] = nullptr; } } } @@ -438,7 +438,7 @@ public: #if 0 void PrintOut() { - if(_server != NULL) + if(_server != nullptr) { for(int y=0; yGetValidAddressFlag(); Progress(rc, "Address Valid Flag check"); @@ -684,7 +684,7 @@ public: TestHeader("HTTP Client Test"); FastOS_Socket *sock = new FastOS_Socket(); - Progress(sock != NULL, "Allocating socket instance"); + Progress(sock != nullptr, "Allocating socket instance"); char hostAddress[] = "www.vg.no"; @@ -714,7 +714,7 @@ public: int readLength = strlen(expectedResult); char *readBuffer = new char[readLength+1]; - if(readBuffer != NULL) + if(readBuffer != nullptr) { memset(readBuffer, 0, readLength+1); @@ -756,7 +756,7 @@ public: TestHeader("Client/Server Test"); FastOS_ServerSocket *serverSocket = new FastOS_ServerSocket(18333); - Progress(serverSocket != NULL, "Allocating serversocket instance"); + Progress(serverSocket != nullptr, "Allocating serversocket instance"); Progress(rc = serverSocket->Listen(), "Bind socket to port %d. Listen for incoming connections.", 18333); assert(rc); @@ -775,7 +775,7 @@ public: bool rc; FastOS_Socket *sock = new FastOS_Socket(); - Progress(rc = (sock != NULL), "Allocating socket instance"); + Progress(rc = (sock != nullptr), "Allocating socket instance"); if(rc) { sock->SetAddress(8001, serverAddress); @@ -786,7 +786,7 @@ public: { MazeClient *client = new MazeClient(this, sock); - Progress(rc = (client != NULL), "Allocating MazeClient instance"); + Progress(rc = (client != nullptr), "Allocating MazeClient instance"); if(rc) { client->Run(); @@ -818,7 +818,7 @@ public: #if DO_MAZE_SERVER DoMazeServer(); #else - char *mazeServerAddress = NULL; + char *mazeServerAddress = nullptr; if(_argc == 3) { @@ -832,7 +832,7 @@ public: ClientServerTest(); StrictBindTest(); - if(mazeServerAddress != NULL) + if(mazeServerAddress != nullptr) MazeTest(mazeServerAddress); #endif @@ -850,6 +850,6 @@ int main (int argc, char **argv) { SocketTest app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } diff --git a/fastos/src/tests/thread_bounce_test.cpp b/fastos/src/tests/thread_bounce_test.cpp index 729c16fab5f..bf94f3e1aab 100644 --- a/fastos/src/tests/thread_bounce_test.cpp +++ b/fastos/src/tests/thread_bounce_test.cpp @@ -89,6 +89,6 @@ int Thread_Bounce_Test::Main () int main (int argc, char **argv) { Thread_Bounce_Test app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } diff --git a/fastos/src/tests/thread_joinwait_test.cpp b/fastos/src/tests/thread_joinwait_test.cpp index 98e0a1ac467..05ab1627334 100644 --- a/fastos/src/tests/thread_joinwait_test.cpp +++ b/fastos/src/tests/thread_joinwait_test.cpp @@ -38,7 +38,7 @@ class Thread_JoinWait_Test : public ThreadTestBase jobs[i].ownThread = pool.NewThread(this, static_cast(&jobs[i])); - rc = (jobs[i].ownThread != NULL); + rc = (jobs[i].ownThread != nullptr); Progress(rc, "Creating Thread %d", i+1); if(!rc) @@ -56,7 +56,7 @@ class Thread_JoinWait_Test : public ThreadTestBase static_cast (&jobs[lastThreadNum])); - rc = (lastThread != NULL); + rc = (lastThread != nullptr); Progress(rc, "Creating last thread"); if(rc) @@ -115,6 +115,6 @@ int Thread_JoinWait_Test::Main () int main (int argc, char **argv) { Thread_JoinWait_Test app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } diff --git a/fastos/src/tests/thread_mutex_test.cpp b/fastos/src/tests/thread_mutex_test.cpp index 602d89c0b05..b8ac575038b 100644 --- a/fastos/src/tests/thread_mutex_test.cpp +++ b/fastos/src/tests/thread_mutex_test.cpp @@ -21,11 +21,11 @@ class Thread_Mutex_Test : public ThreadTestBase FastOS_ThreadPool *pool = new FastOS_ThreadPool(128*1024, MAX_THREADS); - if(Progress(pool != NULL, "Allocating ThreadPool")) + if(Progress(pool != nullptr, "Allocating ThreadPool")) { int i; Job jobs[MUTEX_TEST_THREADS]; - FastOS_Mutex *myMutex=NULL; + FastOS_Mutex *myMutex=nullptr; if(usingMutex) myMutex = new FastOS_Mutex(); @@ -40,7 +40,7 @@ class Thread_Mutex_Test : public ThreadTestBase for(i=0; iNewThread(this, + bool rc = (nullptr != pool->NewThread(this, static_cast(&jobs[i]))); Progress(rc, "Creating Thread with%s mutex", (usingMutex ? "" : "out")); }; @@ -99,7 +99,7 @@ class Thread_Mutex_Test : public ThreadTestBase } } - if(myMutex != NULL) + if(myMutex != nullptr) delete(myMutex); Progress(true, "Closing threadpool..."); @@ -125,9 +125,9 @@ class Thread_Mutex_Test : public ThreadTestBase job.ownThread = pool.NewThread(this, static_cast(&job)); - Progress(job.ownThread !=NULL, "Creating thread"); + Progress(job.ownThread !=nullptr, "Creating thread"); - if(job.ownThread != NULL) + if(job.ownThread != nullptr) { bool lockrc; @@ -188,6 +188,6 @@ int Thread_Mutex_Test::Main () int main (int argc, char **argv) { Thread_Mutex_Test app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } diff --git a/fastos/src/tests/thread_sleep_test.cpp b/fastos/src/tests/thread_sleep_test.cpp index 914438cdd83..7fd3412b7c3 100644 --- a/fastos/src/tests/thread_sleep_test.cpp +++ b/fastos/src/tests/thread_sleep_test.cpp @@ -14,9 +14,9 @@ class Thread_Sleep_Test : public ThreadTestBase FastOS_ThreadPool *pool = new FastOS_ThreadPool(128*1024); - if(Progress(pool != NULL, "Allocating ThreadPool")) + if(Progress(pool != nullptr, "Allocating ThreadPool")) { - bool rc = (NULL != pool->NewThread(this, NULL)); + bool rc = (nullptr != pool->NewThread(this, nullptr)); Progress(rc, "Creating Thread"); Progress(true, "Sleeping 3 seconds"); @@ -47,6 +47,6 @@ int Thread_Sleep_Test::Main () int main (int argc, char **argv) { Thread_Sleep_Test app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } diff --git a/fastos/src/tests/thread_stats_test.cpp b/fastos/src/tests/thread_stats_test.cpp index 3ac4b0a52d6..3633c12bcaa 100644 --- a/fastos/src/tests/thread_stats_test.cpp +++ b/fastos/src/tests/thread_stats_test.cpp @@ -131,6 +131,6 @@ int Thread_Stats_Test::Main () int main (int argc, char **argv) { Thread_Stats_Test app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } diff --git a/fastos/src/tests/thread_test_base.hpp b/fastos/src/tests/thread_test_base.hpp index 3cd16065726..5305b132d3c 100644 --- a/fastos/src/tests/thread_test_base.hpp +++ b/fastos/src/tests/thread_test_base.hpp @@ -57,7 +57,7 @@ public: void ThreadTestBase::Run (FastOS_ThreadInterface *thread, void *arg) { - if(arg == NULL) + if(arg == nullptr) return; Job *job = static_cast(arg); @@ -93,7 +93,7 @@ void ThreadTestBase::Run (FastOS_ThreadInterface *thread, void *arg) { int result; - if(job->mutex != NULL) + if(job->mutex != nullptr) job->mutex->Lock(); result = static_cast(number); @@ -107,7 +107,7 @@ void ThreadTestBase::Run (FastOS_ThreadInterface *thread, void *arg) FastOS_Thread::Sleep(1000); } - if(job->mutex != NULL) + if(job->mutex != nullptr) job->mutex->Unlock(); job->result = result; // This marks the end of the thread @@ -135,7 +135,7 @@ void ThreadTestBase::Run (FastOS_ThreadInterface *thread, void *arg) if(job->mutex) job->mutex->Lock(); - if(job->otherThread != NULL) + if(job->otherThread != nullptr) job->otherThread->Join(); if(job->mutex) diff --git a/fastos/src/tests/threadtest.cpp b/fastos/src/tests/threadtest.cpp index 57e60d9413b..81ea234fb97 100644 --- a/fastos/src/tests/threadtest.cpp +++ b/fastos/src/tests/threadtest.cpp @@ -54,7 +54,7 @@ class ThreadTest : public ThreadTestBase FastOS_ThreadPool *pool = new FastOS_ThreadPool(128*1024, MAX_THREADS); - if(Progress(pool != NULL, "Allocating ThreadPool")) + if(Progress(pool != nullptr, "Allocating ThreadPool")) { int i; Job jobs[MAX_THREADS]; @@ -70,13 +70,13 @@ class ThreadTest : public ThreadTestBase { if(i==MAX_THREADS) { - bool rc = (NULL == pool->NewThread(this, + bool rc = (nullptr == pool->NewThread(this, static_cast(&jobs[0]))); Progress(rc, "Creating too many threads should fail."); } else { - bool rc = (NULL != pool->NewThread(this, + bool rc = (nullptr != pool->NewThread(this, static_cast(&jobs[i]))); Progress(rc, "Creating Thread"); } @@ -110,7 +110,7 @@ class ThreadTest : public ThreadTestBase FastOS_ThreadPool *pool = new FastOS_ThreadPool(128*1024, HOW_MAX_THREADS); - if(Progress(pool != NULL, "Allocating ThreadPool")) + if(Progress(pool != nullptr, "Allocating ThreadPool")) { int i; Job jobs[HOW_MAX_THREADS]; @@ -126,13 +126,13 @@ class ThreadTest : public ThreadTestBase { if(i==HOW_MAX_THREADS) { - bool rc = (NULL == pool->NewThread(this, + bool rc = (nullptr == pool->NewThread(this, static_cast(&jobs[0]))); Progress(rc, "Creating too many threads should fail."); } else { - bool rc = (NULL != pool->NewThread(this, + bool rc = (nullptr != pool->NewThread(this, static_cast(&jobs[i]))); Progress(rc, "Creating Thread"); } @@ -164,14 +164,14 @@ class ThreadTest : public ThreadTestBase FastOS_ThreadPool *pool = new FastOS_ThreadPool(128*1024); - if(Progress(pool != NULL, "Allocating ThreadPool")) + if(Progress(pool != nullptr, "Allocating ThreadPool")) { Job job; job.code = NOP; job.result = -1; - bool rc = (NULL != pool->NewThread(this, &job)); + bool rc = (nullptr != pool->NewThread(this, &job)); Progress(rc, "Creating Thread"); WaitForThreadsToFinish(&job, 1); @@ -201,8 +201,8 @@ class ThreadTest : public ThreadTestBase FastOS_ThreadPool *pool = new FastOS_ThreadPool(128 * 1024); if (!silent) - Progress(pool != NULL, "Allocating ThreadPool"); - if (pool != NULL) { + Progress(pool != nullptr, "Allocating ThreadPool"); + if (pool != nullptr) { Job *jobs = new Job[count]; threadsok = 0; @@ -210,23 +210,23 @@ class ThreadTest : public ThreadTestBase for (i = 0; i < count; i++) { jobs[i].code = SILENTNOP; jobs[i].ownThread = pool->NewThread(this, &jobs[i]); - rc = (jobs[i].ownThread != NULL); + rc = (jobs[i].ownThread != nullptr); if (rc) threadsok++; } for (j = 0; j < outercount; j++) { for (i = 0; i < count; i++) { - if (jobs[i].ownThread != NULL) + if (jobs[i].ownThread != nullptr) jobs[i].ownThread->Join(); jobs[i].ownThread = pool->NewThread(this, &jobs[i]); - rc = (jobs[i].ownThread != NULL); + rc = (jobs[i].ownThread != nullptr); if (rc) threadsok++; } } for (i = 0; i < count; i++) { - if (jobs[i].ownThread != NULL) + if (jobs[i].ownThread != nullptr) jobs[i].ownThread->Join(); } endtime.SetNow(); @@ -286,7 +286,7 @@ class ThreadTest : public ThreadTestBase { jobs[i].code = INCREASE_NUMBER; - bool rc = (NULL != pool.NewThread(this, + bool rc = (nullptr != pool.NewThread(this, static_cast(&jobs[i]))); Progress(rc, "Creating Thread %d", i+1); } @@ -311,7 +311,7 @@ class ThreadTest : public ThreadTestBase { jobs[i].code = WAIT_FOR_BREAK_FLAG; - bool rc = (NULL != pool.NewThread(this, + bool rc = (nullptr != pool.NewThread(this, static_cast(&jobs[i]))); Progress(rc, "Creating Thread %d", i+1); } @@ -333,7 +333,7 @@ class ThreadTest : public ThreadTestBase jobs[i].ownThread = pool->NewThread(this, static_cast(&jobs[i])); - bool rc=(jobs[i].ownThread != NULL); + bool rc=(jobs[i].ownThread != nullptr); Progress(rc, "CreatingThread %d", i+1); } @@ -412,7 +412,7 @@ class ThreadTest : public ThreadTestBase jobs[i].mutex = &slowStartMutex; jobs[i].ownThread = pool.NewThread(this, static_cast(&jobs[i])); - bool rc=(jobs[i].ownThread != NULL); + bool rc=(jobs[i].ownThread != nullptr); if(rc) jobs[i]._threadId = jobs[i].ownThread->GetThreadId(); Progress(rc, "CreatingThread %d id:%lu", i+1, @@ -457,9 +457,9 @@ class ThreadTest : public ThreadTestBase job.ownThread = pool.NewThread(this, static_cast(&job)); - Progress(job.ownThread !=NULL, "Creating thread"); + Progress(job.ownThread !=nullptr, "Creating thread"); - if(job.ownThread != NULL) + if(job.ownThread != nullptr) { condition.Lock(); bool gotCond = condition.TimedWait(500); @@ -597,6 +597,6 @@ int ThreadTest::Main () int main (int argc, char **argv) { ThreadTest app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } diff --git a/fastos/src/tests/timetest.cpp b/fastos/src/tests/timetest.cpp index fa9ef71ba9c..0618e28bcd0 100644 --- a/fastos/src/tests/timetest.cpp +++ b/fastos/src/tests/timetest.cpp @@ -290,7 +290,7 @@ int main (int argc, char **argv) { TimeTest app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } diff --git a/fastos/src/tests/typetest.cpp b/fastos/src/tests/typetest.cpp index 87e3d76c461..51bda7e5dbc 100644 --- a/fastos/src/tests/typetest.cpp +++ b/fastos/src/tests/typetest.cpp @@ -51,7 +51,7 @@ public: int main (int argc, char **argv) { - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); TypeTest app; return app.Entry(argc, argv); } diff --git a/fastos/src/tests/usecputest.cpp b/fastos/src/tests/usecputest.cpp index 930b1fb305f..9812ed7575d 100644 --- a/fastos/src/tests/usecputest.cpp +++ b/fastos/src/tests/usecputest.cpp @@ -63,7 +63,7 @@ void UseSomeCpu (int i, ThreadRunJob *threadRunJob) int main (int argc, char **argv) { UseCpuTest app; - setvbuf(stdout, NULL, _IOLBF, 8192); + setvbuf(stdout, nullptr, _IOLBF, 8192); return app.Entry(argc, argv); } -- cgit v1.2.3