From de33c426c0a61198891229bd765a1c12bd1009ff Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sat, 3 Oct 2026 17:48:57 -0300
Subject: Replace NULL pointer constants with nullptr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 src/common/nokde/nokde_tdecmdlineargs.cpp | 2 +-
 src/common/port/serial.cpp                | 8 ++++----
 src/piklab-prog/cmdline.cpp               | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/common/nokde/nokde_tdecmdlineargs.cpp b/src/common/nokde/nokde_tdecmdlineargs.cpp
index 0bc2650..07ad4b8 100644
--- a/src/common/nokde/nokde_tdecmdlineargs.cpp
+++ b/src/common/nokde/nokde_tdecmdlineargs.cpp
@@ -727,7 +727,7 @@ TDECmdLineArgs::tqt_argv()
 //      TDEApplication::addCmdLineOptions(); // Lazy bastards!
 
    static char** tqt_argv;
-   if( tqt_argv != NULL )
+   if( tqt_argv )
       return &tqt_argv;
 
    TDECmdLineArgs *args = parsedArgs("tqt");
diff --git a/src/common/port/serial.cpp b/src/common/port/serial.cpp
index 977f31c..c278c21 100644
--- a/src/common/port/serial.cpp
+++ b/src/common/port/serial.cpp
@@ -44,7 +44,7 @@ Port::Serial::Handle Port::Serial::openHandle(const TQString &device, IODirs dir
   int mode = 0;
   if ( dirs & In ) mode |= GENERIC_READ;
   if ( dirs & Out ) mode |= GENERIC_WRITE;
-  return CreateFileA(device.latin1(), mode, 0, NULL, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, NULL);
+  return CreateFileA(device.latin1(), mode, 0, nullptr, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, nullptr);
 #endif
 }
 
@@ -224,7 +224,7 @@ bool Port::Serial::internalSend(const char *data, uint size, uint timeout)
     if ( res<0 && errno!=EAGAIN ) {
 #elif defined(Q_OS_WIN)
     DWORD res = 0;
-    if ( WriteFile(_fd, data+size-todo, todo, &res, NULL)==0 ) {
+    if ( WriteFile(_fd, data+size-todo, todo, &res, nullptr)==0 ) {
 #endif
       setSystemError(i18n("Error sending data"));
       return false;
@@ -269,7 +269,7 @@ bool Port::Serial::internalReceive(uint size, char *data, uint timeout)
     if ( res<0 && errno!=EAGAIN ) {
 #elif defined(Q_OS_WIN)
     DWORD res = 0;
-    if ( ReadFile(_fd, data+size-todo, todo, &res, NULL)==0 ) {
+    if ( ReadFile(_fd, data+size-todo, todo, &res, nullptr)==0 ) {
 #endif
       setSystemError(i18n("Error receiving data"));
       return false;
@@ -516,7 +516,7 @@ void Port::Serial::setSystemError(const TQString &message)
   log(Log::LineType::Error, message + TQString(" (errno=%1)").arg(strerror(errno)));
 #elif defined(Q_OS_WIN)
   LPVOID lpMsgBuf;
-  FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL);
+  FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, nullptr);
   log(Log::LineType::Error, message + TQString(" (last error=%1 %2)").arg(GetLastError()).arg((const char *)(LPCTSTR)lpMsgBuf));
   LocalFree(lpMsgBuf);
 #endif
diff --git a/src/piklab-prog/cmdline.cpp b/src/piklab-prog/cmdline.cpp
index 1f4a4ed..4e0b879 100644
--- a/src/piklab-prog/cmdline.cpp
+++ b/src/piklab-prog/cmdline.cpp
@@ -332,7 +332,7 @@ CLI::ExitCode CLI::Main::checkProgrammer()
   if ( !_hardware.isEmpty() ) {
     ::Hardware::Config *config = _progGroup->hardwareConfig();
     Port::Description pd = static_cast<Programmer::CliManager *>(Programmer::manager)->portDescription();
-    bool ok = (config==0 || config->hardwareNames(pd.type).contains(_hardware));
+    bool ok = (!config || config->hardwareNames(pd.type).contains(_hardware));
     delete config;
     if ( !ok ) return errorExit(i18n("The selected programmer does not support the specified hardware configuration (\"%1\").").arg(_hardware), NOT_SUPPORTED_ERROR);
   }
-- 
cgit v1.2.3

