From 0fe1b67b5476ea3799bcbdb33398759939097dc8 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sun, 8 Nov 2026 08:04:32 -0300
Subject: Replace NULL pointer constants in news and mail components
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>
---
 knode/knprotocolclient.cpp | 14 +++++++-------
 ktnef/gui/metafuncs.h      |  2 +-
 ktnef/gui/qwmf.cpp         | 20 ++++++++++----------
 mimelib/msgid.cpp          |  2 +-
 mimelib/nntp.cpp           |  2 +-
 mimelib/protocol.cpp       |  2 +-
 mimelib/test/exampl01.cpp  |  2 +-
 mimelib/test/exampl03.cpp  |  2 +-
 mimelib/test/exampl05.cpp  |  2 +-
 9 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/knode/knprotocolclient.cpp b/knode/knprotocolclient.cpp
index 9a10ca778..a20856a1a 100644
--- a/knode/knprotocolclient.cpp
+++ b/knode/knprotocolclient.cpp
@@ -56,9 +56,9 @@ KNProtocolClient::~KNProtocolClient()
 
 void KNProtocolClient::run()
 {
-  if (0!=pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,NULL))
+  if (0!=pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,nullptr))
     tqWarning("pthread_setcancelstate failed!");
-  if (0!= pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS,NULL))
+  if (0!= pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS,nullptr))
     tqWarning("pthread_setcanceltype failed!");
 
   signal(SIGPIPE,SIG_IGN);   // ignore sigpipe
@@ -102,7 +102,7 @@ void KNProtocolClient::waitForWork()
       FD_SET(tcpSocket, &fdsE);
       tv.tv_sec = account.hold();
       tv.tv_usec = 0;
-      selectRet = KSocks::self()->select(FD_SETSIZE, &fdsR, NULL, &fdsE, &tv);
+      selectRet = KSocks::self()->select(FD_SETSIZE, &fdsR, nullptr, &fdsE, &tv);
       if ( mTerminate ) {
         clearPipe();
         closeConnection();
@@ -128,7 +128,7 @@ void KNProtocolClient::waitForWork()
     do {
       FD_ZERO(&fdsR);
       FD_SET(fdPipeIn, &fdsR);
-    } while (select(FD_SETSIZE, &fdsR, NULL, NULL, NULL) <= 0);  // don't get tricked by signals
+    } while (select(FD_SETSIZE, &fdsR, nullptr, nullptr, nullptr) <= 0);  // don't get tricked by signals
 
     clearPipe();      // remove start signal
 
@@ -232,7 +232,7 @@ void KNProtocolClient::closeConnection()
   FD_SET(tcpSocket, &fdsW);
   tv.tv_sec = 0;
   tv.tv_usec = 0;
-  int ret = KSocks::self()->select(FD_SETSIZE, NULL, &fdsW, NULL, &tv);
+  int ret = KSocks::self()->select(FD_SETSIZE, nullptr, &fdsW, nullptr, &tv);
 
   if (ret > 0) {    // we can write...
     TQCString cmd = "QUIT\r\n";
@@ -464,7 +464,7 @@ bool KNProtocolClient::waitForRead()
     FD_SET(fdPipeIn, &fdsE);
     tv.tv_sec = account.timeout();
     tv.tv_usec = 0;
-    ret = KSocks::self()->select(FD_SETSIZE, &fdsR, NULL, &fdsE, &tv);
+    ret = KSocks::self()->select(FD_SETSIZE, &fdsR, nullptr, &fdsE, &tv);
   } while ((ret<0)&&(errno==EINTR));             // don't get tricked by signals
 
   if (ret == -1) {     // select failed
@@ -626,7 +626,7 @@ void KNProtocolClient::clearPipe()
   do {
     FD_ZERO(&fdsR);
     FD_SET(fdPipeIn,&fdsR);
-    if (1==(selectRet=select(FD_SETSIZE,&fdsR,NULL,NULL,&tv)))
+    if (1==(selectRet=select(FD_SETSIZE,&fdsR,nullptr,nullptr,&tv)))
       if ( read(fdPipeIn, &buf, 1 ) == -1 )
   ::perror( "clearPipe()" );
   } while (selectRet == 1);
diff --git a/ktnef/gui/metafuncs.h b/ktnef/gui/metafuncs.h
index e8f1232de..3d506571f 100644
--- a/ktnef/gui/metafuncs.h
+++ b/ktnef/gui/metafuncs.h
@@ -83,7 +83,7 @@ static const struct MetaFuncRec
       { "CREATEREGION",         0x06FF, &TQWinMetaFile::createEmptyObject },
       { "END",                   0,      &TQWinMetaFile::end },
       // always the latest in the table : in case of unknown function
-      { NULL,                   0,      &TQWinMetaFile::noop },
+      { nullptr,                   0,      &TQWinMetaFile::noop },
   };
 
 
diff --git a/ktnef/gui/qwmf.cpp b/ktnef/gui/qwmf.cpp
index 64b64045c..739c4b89b 100644
--- a/ktnef/gui/qwmf.cpp
+++ b/ktnef/gui/qwmf.cpp
@@ -119,8 +119,8 @@ void WinObjFontHandle::apply( TQPainter& p )
 TQWinMetaFile::TQWinMetaFile()
 {
     mValid       = false;
-    mFirstCmd    = NULL;
-    mObjHandleTab = NULL;
+    mFirstCmd    = nullptr;
+    mObjHandleTab = nullptr;
     mDpi         = 1000;
 }
 
@@ -175,7 +175,7 @@ bool TQWinMetaFile::load( TQBuffer &buffer )
     mRotation = 0;
     mTextColor = TQt::black;
     if ( mFirstCmd ) delete mFirstCmd;
-    mFirstCmd = NULL;
+    mFirstCmd = nullptr;
 
     st.setDevice( &buffer );
     st.setByteOrder( TQDataStream::LittleEndian ); // Great, I love TQt !
@@ -279,7 +279,7 @@ bool TQWinMetaFile::load( TQBuffer &buffer )
     if ( mValid )
     {
         //----- Read Metafile Records
-        last = NULL;
+        last = nullptr;
         rdFunc = -1;
         while ( !st.eof() && (rdFunc != 0) )
         {
@@ -289,7 +289,7 @@ bool TQWinMetaFile::load( TQBuffer &buffer )
             rdSize -= 3;
 
             cmd = new WmfCmd;
-            cmd->next = NULL;
+            cmd->next = nullptr;
             if ( last ) last->next = cmd;
             else mFirstCmd = cmd;
 
@@ -340,13 +340,13 @@ bool TQWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute )
 
     if ( !mValid )  return false;
 
-    assert( aTarget!=NULL );
+    assert(aTarget);
     if ( mPainter.isActive() ) return false;
 
     if ( mObjHandleTab ) delete[] mObjHandleTab;
     mObjHandleTab = new WinObjHandle* [ MAX_OBJHANDLE ];
     for ( i=MAX_OBJHANDLE-1; i>=0; i-- )
-        mObjHandleTab[ i ] = NULL;
+        mObjHandleTab[ i ] = nullptr;
 
     mPainter.resetXForm();
     mWinding = false;
@@ -370,7 +370,7 @@ bool TQWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute )
 
         if ( TQWMF_DEBUG )  {
             TQString str = "", param;
-            if ( metaFuncTab[ idx ].name == NULL ) {
+            if (!metaFuncTab[ idx ].name) {
                 str += "UNKNOWN ";
             }
             if ( metaFuncTab[ idx ].method == &TQWinMetaFile::noop ) {
@@ -1147,7 +1147,7 @@ void TQWinMetaFile::addHandle( WinObjHandle* handle )
     int idx;
 
     for ( idx=0; idx < MAX_OBJHANDLE ; idx++ )
-        if ( mObjHandleTab[ idx ] == NULL )  break;
+        if (!mObjHandleTab[ idx ])  break;
 
     if ( idx < MAX_OBJHANDLE )
         mObjHandleTab[ idx ] = handle;
@@ -1161,7 +1161,7 @@ void TQWinMetaFile::deleteHandle( int idx )
     if ( idx >= 0 && idx < MAX_OBJHANDLE && mObjHandleTab[ idx ] )
     {
         delete mObjHandleTab[ idx ];
-        mObjHandleTab[ idx ] = NULL;
+        mObjHandleTab[ idx ] = nullptr;
     }
 }
 
diff --git a/mimelib/msgid.cpp b/mimelib/msgid.cpp
index 46656280d..6aef020f9 100644
--- a/mimelib/msgid.cpp
+++ b/mimelib/msgid.cpp
@@ -235,7 +235,7 @@ void DwMsgId::CreateDefault()
     GetHostName(hostname, 80);
     hostname[79] = 0;
     char scratch[80];
-    time_t tt = time(NULL);
+    time_t tt = time(nullptr);
     struct tm tms = *localtime(&tt);
     int pos = 0;
     scratch[pos++] = '<';
diff --git a/mimelib/nntp.cpp b/mimelib/nntp.cpp
index a89293ae6..32fbc86fe 100644
--- a/mimelib/nntp.cpp
+++ b/mimelib/nntp.cpp
@@ -605,7 +605,7 @@ void DwNntpClient::PGeStatusResponse()
     int len;
     int err = PGetLine(&ptr, &len);
     if (! err) {
-        mReplyCode = strtol(ptr, NULL, 10);
+        mReplyCode = strtol(ptr, nullptr, 10);
         mStatusResponse.assign(ptr, len);
         DBG_NNTP_STMT(char buffer[256];)
         DBG_NNTP_STMT(strncpy(buffer, ptr, len);)
diff --git a/mimelib/protocol.cpp b/mimelib/protocol.cpp
index 2806e4ee8..3211be660 100644
--- a/mimelib/protocol.cpp
+++ b/mimelib/protocol.cpp
@@ -145,7 +145,7 @@ int DwProtocolClient::Open(const char* aServer, DwUint16 aPort)
 
     else {
         struct hostent* hostentp = gethostbyname(mServerName);
-        if (hostentp == NULL) {
+        if (!hostentp) {
             // error!
             int err = h_errno;
             close(mSocket);
diff --git a/mimelib/test/exampl01.cpp b/mimelib/test/exampl01.cpp
index 497383bf9..4397663fa 100644
--- a/mimelib/test/exampl01.cpp
+++ b/mimelib/test/exampl01.cpp
@@ -56,7 +56,7 @@ int main()
 
     // Set header fields
 
-    msg.SetDate(time(NULL));
+    msg.SetDate(time(nullptr));
     msg.SetTypeStr("Text");
     msg.SetSubtypeStr("Plain");
     msg.SetCteStr("7bit");
diff --git a/mimelib/test/exampl03.cpp b/mimelib/test/exampl03.cpp
index 02350e9db..b23ee5a43 100644
--- a/mimelib/test/exampl03.cpp
+++ b/mimelib/test/exampl03.cpp
@@ -57,7 +57,7 @@ int main()
 
     // Set header fields
 
-    DwUint32 t = (DwUint32) time(NULL);
+    DwUint32 t = (DwUint32) time(nullptr);
     msg.SetDate(t);
     msg.SetFrom("Emily Postnews <emily.postnews@usenet.com>");
     msg.SetTo("verbose@noisy");
diff --git a/mimelib/test/exampl05.cpp b/mimelib/test/exampl05.cpp
index 5e3b16d86..83159d587 100644
--- a/mimelib/test/exampl05.cpp
+++ b/mimelib/test/exampl05.cpp
@@ -43,7 +43,7 @@ int main()
 
     // Set header fields
 
-    DwUint32 t = (DwUint32) time(NULL);
+    DwUint32 t = (DwUint32) time(nullptr);
     msg.SetDate(t);
     msg.SetFrom("Emily Postnews <emily.postnews@usenet.com>");
     msg.SetTo("verbose@noisy");
-- 
cgit v1.2.3

