diff --git a/.clang-tidy b/.clang-tidy index b22c0d91d8..b9b9cda356 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,2 +1,2 @@ -Checks: "modernize-redundant-void-arg,modernize-deprecated-headers,-clang-analyzer-security.insecureAPI.rand" +Checks: "modernize-use-bool-literals,modernize-redundant-void-arg,modernize-deprecated-headers,-clang-analyzer-security.insecureAPI.rand" WarningsAsErrors: '*' diff --git a/Drv/LinuxGpioDriver/test/ut/Tester.cpp b/Drv/LinuxGpioDriver/test/ut/Tester.cpp index 6e8e22136b..494cd733a2 100644 --- a/Drv/LinuxGpioDriver/test/ut/Tester.cpp +++ b/Drv/LinuxGpioDriver/test/ut/Tester.cpp @@ -69,7 +69,7 @@ namespace Drv { // delay waiting for cycles to complete NATIVE_INT_TYPE maxCycles = 10; - while (1) { + while (true) { Os::Task::delay(500); bool state; //this->invoke_to_gpioRead(0,state); diff --git a/Drv/LinuxSerialDriver/LinuxSerialDriverComponentImpl.cpp b/Drv/LinuxSerialDriver/LinuxSerialDriverComponentImpl.cpp index 7e84a2851a..177eacf2e6 100644 --- a/Drv/LinuxSerialDriver/LinuxSerialDriverComponentImpl.cpp +++ b/Drv/LinuxSerialDriver/LinuxSerialDriverComponentImpl.cpp @@ -326,7 +326,7 @@ namespace Drv { Fw::Buffer buff; - while (1) { + while (true) { // wait for data int sizeRead = 0; diff --git a/Os/test/ut/OsQueueTest.cpp b/Os/test/ut/OsQueueTest.cpp index 49129d95d7..1458db3cfb 100644 --- a/Os/test/ut/OsQueueTest.cpp +++ b/Os/test/ut/OsQueueTest.cpp @@ -451,7 +451,7 @@ void qtest_performance() { printf("Testing deep queue...\n"); // Fill the queue up first: U32 count = 0; - while(1) { + while(true) { stat = testQueue->send(sendBuff, count%4, Os::Queue::QUEUE_NONBLOCKING); count++; if(stat == Os::Queue::QUEUE_FULL) @@ -488,7 +488,7 @@ void qtest_performance() { elapsedTime = static_cast(etime.tv_sec - stime.tv_sec) + static_cast(etime.tv_usec - stime.tv_usec)/1000000; printf("Time: %0.3fs (%0.3fus per)\n", elapsedTime, 1000000*elapsedTime/static_cast(numIterations)); #endif - while(1) { + while(true) { stat = testQueue->receive(recvBuff, prio, Os::Queue::QUEUE_NONBLOCKING); if(stat == Os::Queue::QUEUE_NO_MORE_MSGS) break; @@ -550,7 +550,7 @@ void qtest_concurrent() { printf("Testing deep queue...\n"); // Fill the queue up first: U32 count = 0; - while(1) { + while(true) { stat = testQueue->send(sendBuff,count%4, Os::Queue::QUEUE_NONBLOCKING); count++; if(stat == Os::Queue::QUEUE_FULL) diff --git a/Svc/BufferManager/test/ut/Tester.cpp b/Svc/BufferManager/test/ut/Tester.cpp index 0b9fc04c2e..73aa6ef5a8 100644 --- a/Svc/BufferManager/test/ut/Tester.cpp +++ b/Svc/BufferManager/test/ut/Tester.cpp @@ -247,7 +247,7 @@ namespace Svc { for (NATIVE_UINT_TYPE b=0; b @@ -18,7 +18,7 @@ namespace Svc { void LinuxTimerComponentImpl::startTimer(NATIVE_INT_TYPE interval) { - while (1) { + while (true) { Os::Task::delay(interval); if (this->m_quit) { return; diff --git a/Svc/LinuxTimer/LinuxTimerComponentImplTimerFd.cpp b/Svc/LinuxTimer/LinuxTimerComponentImplTimerFd.cpp index e7daa52d66..419d3b2f10 100644 --- a/Svc/LinuxTimer/LinuxTimerComponentImplTimerFd.cpp +++ b/Svc/LinuxTimer/LinuxTimerComponentImplTimerFd.cpp @@ -34,7 +34,7 @@ namespace Svc { timerfd_settime (fd, 0, &itval, NULL); - while (1) { + while (true) { unsigned long long missed; int ret = read (fd, &missed, sizeof (missed)); if (-1 == ret) { diff --git a/Svc/UdpReceiver/UdpReceiverComponentImpl.cpp b/Svc/UdpReceiver/UdpReceiverComponentImpl.cpp index f00b71ccad..4b6181a537 100644 --- a/Svc/UdpReceiver/UdpReceiverComponentImpl.cpp +++ b/Svc/UdpReceiver/UdpReceiverComponentImpl.cpp @@ -128,7 +128,7 @@ namespace Svc { void UdpReceiverComponentImpl::workerTask(void* ptr) { UdpReceiverComponentImpl *compPtr = static_cast(ptr); - while (1) { + while (true) { compPtr->doRecv(); } }