From 0465ce1858080e88beb61d5f9b179a57b0a2b6b1 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sat, 3 Oct 2026 17:36:05 -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>
---
 kcron/ktprint.cpp                                  |  6 ++--
 kdat/Archive.cpp                                   |  2 +-
 kdat/BackupDlg.cpp                                 | 12 ++++----
 kdat/ErrorHandler.cpp                              | 10 +++----
 kdat/IndexDlg.cpp                                  | 12 ++++----
 kdat/KDatMainWindow.cpp                            |  4 +--
 kdat/Tape.cpp                                      | 28 +++++++++----------
 kdat/TapeDrive.cpp                                 | 14 +++++-----
 kdat/VerifyDlg.cpp                                 |  8 +++---
 kdat/main.cpp                                      |  4 +--
 knetworkconf/knetworkconf/kaddressvalidator.cpp    | 16 +++++------
 knetworkconf/knetworkconf/knetworkconf.cpp         | 32 +++++++++++-----------
 knetworkconf/knetworkconf/knetworkconfigparser.cpp | 10 +++----
 .../knetworkconf/kprofileslistviewtooltip.h        |  6 ++--
 kpackage/kissInterface.cpp                         |  8 +++---
 kpackage/kpackage.cpp                              |  6 ++--
 kpackage/packageDisplay.cpp                        |  6 ++--
 kpackage/packageInfo.cpp                           | 10 +++----
 kpackage/packageProperties.cpp                     |  2 +-
 kpackage/procbuf.cpp                               |  2 +-
 kpackage/slackInterface.cpp                        |  4 +--
 kpackage/updateLoc.cpp                             |  2 +-
 kpackage/utils.cpp                                 |  6 ++--
 kuser/editGroup.h                                  |  2 +-
 kuser/kgroup.cpp                                   |  4 +--
 kuser/kgroupfiles.cpp                              | 18 ++++++------
 kuser/kgroupsystem.cpp                             |  2 +-
 kuser/kuser.cpp                                    | 12 ++++----
 kuser/kuserfiles.cpp                               | 22 +++++++--------
 kuser/kusersystem.cpp                              |  6 ++--
 kuser/mainView.cpp                                 |  2 +-
 kuser/misc.cpp                                     |  2 +-
 kuser/pwddlg.h                                     |  2 +-
 lilo-config/common/Disks.cpp                       |  2 +-
 lilo-config/common/Files.cpp                       |  2 +-
 lilo-config/common/String.cpp                      |  6 ++--
 lilo-config/common/lilo.cpp                        |  8 +++---
 37 files changed, 150 insertions(+), 150 deletions(-)

diff --git a/kcron/ktprint.cpp b/kcron/ktprint.cpp
index 56d7070..b85d10a 100644
--- a/kcron/ktprint.cpp
+++ b/kcron/ktprint.cpp
@@ -79,7 +79,7 @@ bool KTPrint:: start ()
   prnt->addDialogPage(new KTPrintOpt(root));
 
   if (prnt->setup(0L, i18n("Print Cron Tab"))) { //Setup a printer
-    if (paint!=NULL) delete paint;
+    if (paint) delete paint;
     paint = new  TQPainter ();
     paint->begin(prnt);
     paint->setTabStops(20); // Setup a defualt tab stop size
@@ -111,7 +111,7 @@ void KTPrint :: print (const TQString &str, int col, int alignment, bool wordWra
 
   int format;
  
-  if (paint==NULL) 
+  if (!paint) 
     return;
   
 	
@@ -168,7 +168,7 @@ void KTPrint :: levelColumns(int space)
 
 void KTPrint :: finished ()
 {
-  if (paint!=NULL) {
+  if (paint) {
     paint->end(); //Send to printer or file
     delete paint;
   }
diff --git a/kdat/Archive.cpp b/kdat/Archive.cpp
index 6cd9df6..bf51e2e 100644
--- a/kdat/Archive.cpp
+++ b/kdat/Archive.cpp
@@ -375,7 +375,7 @@ void Archive::calcRanges()
       }
 #endif
 #endif /* DEBUG */
-      if( _ranges.getRanges().getFirst() == NULL ){
+      if(!_ranges.getRanges().getFirst()){
 	printf("There aren't any tar files on this tape as far as kdat can tell!\n");
         _endBlock = 0;
         return;
diff --git a/kdat/BackupDlg.cpp b/kdat/BackupDlg.cpp
index 70e4966..4dbf4eb 100644
--- a/kdat/BackupDlg.cpp
+++ b/kdat/BackupDlg.cpp
@@ -53,8 +53,8 @@ BackupDlg::BackupDlg( const TQString & archiveName, const TQString & workingDir,
                       const TQString & snapshot, bool removeSnapshot, int archiveSize, Tape* tape,
                       TQWidget* parent, const char* name )
         : TQDialog( parent, name, true ),
-          _proc( NULL ),
-          _tarParser( NULL ),
+          _proc( nullptr ),
+          _tarParser( nullptr ),
           _archiveName( archiveName ),
           _workingDir( workingDir ),
           _files(files),
@@ -67,7 +67,7 @@ BackupDlg::BackupDlg( const TQString & archiveName, const TQString & workingDir,
           _totalKBytes( 0.0 ),
           _totalRecords( 0 ),
           _startTime( 0 ),
-          _archive( NULL ),
+          _archive( nullptr ),
           _aborted( false ),
           _numFiles( 0 ),
           _fileSize( -1 ),
@@ -205,7 +205,7 @@ void BackupDlg::show()
 {
     bool bGoOn = false;
 
-    _archive = new Archive( _tape, time( NULL ), _archiveName.utf8() );
+    _archive = new Archive( _tape, time( nullptr ), _archiveName.utf8() );
 
     chdir( TQFile::encodeName(_workingDir) );
 
@@ -325,7 +325,7 @@ void BackupDlg::slotStdout( TDEProcess*, char* buf, int len )
 {
     // Don't start throughput timer until the first block of data is written.
     if ( _startTime == 0 ) {
-        _startTime = time( NULL );
+        _startTime = time( nullptr );
     }
 
     /* 2002-01-26 LEW */
@@ -408,7 +408,7 @@ void BackupDlg::updateStats()
 
     TQString str;
 
-    int elapsed = time( NULL ) - _startTime;
+    int elapsed = time( nullptr ) - _startTime;
     str = TQString::fromUtf8( TQCString().sprintf( i18n( "%02d:%02d:%02d" ).utf8().data(), elapsed / 3600, elapsed / 60 % 60, elapsed % 60 ) );
     _elapsedTime->setText( str );
 
diff --git a/kdat/ErrorHandler.cpp b/kdat/ErrorHandler.cpp
index f080d5c..06eba9d 100644
--- a/kdat/ErrorHandler.cpp
+++ b/kdat/ErrorHandler.cpp
@@ -64,7 +64,7 @@ void error_handler(int err_sig)
   switch (err_sig) {
    case SIGHUP:
      fprintf(stderr, "kdat: SIGHUP signal (\"Hangup (POSIX)\") caught\n");
-     i = TQMessageBox::critical( (TQWidget *)NULL, 
+     i = TQMessageBox::critical( (TQWidget *)nullptr, 
         msg3, 
         i18n( "SIGHUP signal (\"Hangup (POSIX)\")" ).append( msg1 ), 
         TQMessageBox::Ignore, TQMessageBox::Abort, TQMessageBox::NoButton);
@@ -72,7 +72,7 @@ void error_handler(int err_sig)
      break;
   case SIGINT:
      fprintf(stderr, "kdat: SIGINT signal (\"Interrupt (ANSI)\") caught\n");
-     i = TQMessageBox::critical( (TQWidget *)NULL, 
+     i = TQMessageBox::critical( (TQWidget *)nullptr, 
          msg3, 
          i18n( "SIGINT signal (\"Interrupt (ANSI)\")" ).append( msg1 ), 
          TQMessageBox::Ignore, TQMessageBox::Abort, TQMessageBox::NoButton);
@@ -80,7 +80,7 @@ void error_handler(int err_sig)
      break;
   case SIGFPE:
     fprintf(stderr, "kdat: SIGFPE signal (\"Floating-point exception (ANSI)\") caught\n");
-    i = TQMessageBox::critical( (TQWidget *)NULL, 
+    i = TQMessageBox::critical( (TQWidget *)nullptr, 
         msg3, 
         i18n("SIGFPE signal (\"Floating-point exception (ANSI)\")").append (msg2), 
          TQMessageBox::Ignore, TQMessageBox::Abort, TQMessageBox::NoButton);
@@ -88,7 +88,7 @@ void error_handler(int err_sig)
     break;
   case SIGSEGV:
     fprintf(stderr, "kdat: SIGSEGV signal (\"Segmentation violation (ANSI)\") caught\n");
-    i = TQMessageBox::critical( (TQWidget *)NULL, 
+    i = TQMessageBox::critical( (TQWidget *)nullptr, 
           msg3, 
           i18n( "SIGSEGV signal (\"Segmentation violation (ANSI)\")").append(msg2), 
           /* button1,           button2 */
@@ -97,7 +97,7 @@ void error_handler(int err_sig)
     break;
   case SIGTERM:
     fprintf(stderr, "kdat: SIGTERM signal (\"Termination (ANSI)\") caught\n");
-    i = TQMessageBox::critical( (TQWidget *)NULL, 
+    i = TQMessageBox::critical( (TQWidget *)nullptr, 
         msg3, 
         i18n( "SIGTERM signal (\"Termination (ANSI)\")").append(msg1), 
           TQMessageBox::Ignore, TQMessageBox::Abort, TQMessageBox::NoButton);
diff --git a/kdat/IndexDlg.cpp b/kdat/IndexDlg.cpp
index b446925..2f7d3fe 100644
--- a/kdat/IndexDlg.cpp
+++ b/kdat/IndexDlg.cpp
@@ -43,9 +43,9 @@
 
 IndexDlg::IndexDlg( Tape* tape, TQWidget* parent, const char* name )
         : TQDialog( parent, name, true ),
-          _tarParser( NULL ),
+          _tarParser( nullptr ),
           _tape( tape ),
-          _archive( NULL ),
+          _archive( nullptr ),
           _totalKBytes( 0.0 ),
           _archiveCount( 0 ),
           _fileCount( 0 ),
@@ -250,7 +250,7 @@ void IndexDlg::timerEvent( TQTimerEvent* )
         return;
     }
 
-    _startTime = time( NULL );
+    _startTime = time( nullptr );
 
     int oldElapsed = 0;
     TQString msg;
@@ -259,7 +259,7 @@ void IndexDlg::timerEvent( TQTimerEvent* )
     bool atLeastOneGoodRead = true;
     while ( ( !_aborted ) && ( atLeastOneGoodRead ) ) {
         atLeastOneGoodRead = false;
-        _archive = NULL;
+        _archive = nullptr;
 
         delete _tarParser;
         _tarParser = new TarParser();
@@ -295,7 +295,7 @@ void IndexDlg::timerEvent( TQTimerEvent* )
             _totalKBytes += (float)count / 1024.0;
 
             // Update stats.
-            int elapsed = time( NULL ) - _startTime;
+            int elapsed = time( nullptr ) - _startTime;
             if ( elapsed > oldElapsed )
             {
                 updateStats();
@@ -340,7 +340,7 @@ void IndexDlg::timerEvent( TQTimerEvent* )
 void IndexDlg::updateStats()
 {
     TQString str;
-    int elapsed = time( NULL ) - _startTime;
+    int elapsed = time( nullptr ) - _startTime;
 
     str = TQString::fromUtf8( TQCString().sprintf( i18n( "%02d:%02d:%02d" ).utf8(), elapsed / 3600, elapsed / 60 % 60, elapsed % 60 ) );
     _elapsedTime->setText( str );
diff --git a/kdat/KDatMainWindow.cpp b/kdat/KDatMainWindow.cpp
index 280a504..76de3a9 100644
--- a/kdat/KDatMainWindow.cpp
+++ b/kdat/KDatMainWindow.cpp
@@ -476,7 +476,7 @@ void KDatMainWindow::fileBackup()
         // Make sure the archive will fit on the tape.
         int tapeSize = 1;
         TQPtrListIterator<Archive> i( TapeManager::instance()->getMountedTape()->getChildren() );
-        if ( i.toLast() != NULL ) {
+        if (i.toLast()) {
             tapeSize = i.current()->getEndBlock();
             tapeSize = (int)((float)tapeSize / 1024.0 * (float)Options::instance()->getTapeBlockSize()) + 1;
         }
@@ -1294,7 +1294,7 @@ void KDatMainWindow::configureUI( Tape* tape )
     }
 
     // Index tape
-    _fileMenu->setItemEnabled( _fileMenu->idAt( 4 ), tape != NULL );
+    _fileMenu->setItemEnabled( _fileMenu->idAt( 4 ), tape != nullptr );
 
     // Delete archive
     _fileMenu->setItemEnabled( _fileMenu->idAt( 7 ), ( sel ) && sel->isType( Node::ArchiveNodeType ) );
diff --git a/kdat/Tape.cpp b/kdat/Tape.cpp
index f98163f..c95476f 100644
--- a/kdat/Tape.cpp
+++ b/kdat/Tape.cpp
@@ -45,7 +45,7 @@ Tape::Tape()
 {
     char buffer[1024];
     gethostname( buffer, 1024 );
-    time_t tm = time( NULL );
+    time_t tm = time( nullptr );
     _ctime = tm;
     _mtime = tm;
     _id.sprintf("%s:%d", buffer, tm);
@@ -187,7 +187,7 @@ void Tape::read()
             readAll( version );
             calcRanges();
             fclose( _fptr );
-            _fptr = NULL;
+            _fptr = nullptr;
             write();
             break;
 
@@ -196,7 +196,7 @@ void Tape::read()
             readAll( version );
             calcRanges();
             fclose( _fptr );
-            _fptr = NULL;
+            _fptr = nullptr;
             write();
             break;
 
@@ -205,7 +205,7 @@ void Tape::read()
             readAll( version );
             calcRanges();
             fclose( _fptr );
-            _fptr = NULL;
+            _fptr = nullptr;
             write();
             break;
 
@@ -382,11 +382,11 @@ void Tape::setName( const TQString & name )
         msg.append( "\": " );
 	msg.append( i18n(strerror( errno )) );
 	printf("%s\n", msg.latin1());      
-	KMessageBox::error(NULL, msg, i18n("File Access Error"));
+	KMessageBox::error(nullptr, msg, i18n("File Access Error"));
 #endif /* DEBUG */
 	return;      
       }
-    if( fgets( buf, 4096, _fptr ) == NULL )
+    if(!fgets( buf, 4096, _fptr ))
       {
 	clearerr( _fptr );
 #ifdef DEBUG    /* Can't create new i18n strings now, so we'll save this for KDE 3.1 */
@@ -395,11 +395,11 @@ void Tape::setName( const TQString & name )
         msg.append( "\": " );
 	msg.append( i18n(strerror( errno )) );
 	printf("%s\n", msg.latin1());      
-	KMessageBox::error(NULL, msg, i18n("File Access Error"));
+	KMessageBox::error(nullptr, msg, i18n("File Access Error"));
 #endif /* DEBUG */
 	return;      
       }
-    if( fgets( buf, 4096, _fptr ) == NULL )
+    if(!fgets( buf, 4096, _fptr ))
       {
 	clearerr( _fptr );
 #ifdef DEBUG    /* Can't create new i18n strings now, so we'll save this for KDE 3.1 */
@@ -408,7 +408,7 @@ void Tape::setName( const TQString & name )
         msg.append( "\": " );
 	msg.append( i18n(strerror( errno )) );
 	printf("%s\n", msg.latin1());      
-	KMessageBox::error(NULL, msg, i18n("File Access Error"));
+	KMessageBox::error(nullptr, msg, i18n("File Access Error"));
 #endif /* DEBUG */
 	return;      
       }
@@ -421,7 +421,7 @@ void Tape::setName( const TQString & name )
         msg.append( "\": " );
 	msg.append( i18n(strerror( errno )) );
 	printf("%s\n", msg.latin1());      
-	KMessageBox::error(NULL, msg, i18n("File Access Error"));
+	KMessageBox::error(nullptr, msg, i18n("File Access Error"));
 #endif /* DEBUG */
 	return;      
       }
@@ -436,7 +436,7 @@ void Tape::setName( const TQString & name )
       TQString msg = i18n("Error while updating archive name: ");
       msg.append( i18n(strerror( errno )) );
       printf("%s\n", msg.latin1());      
-      KMessageBox::error(NULL, msg, i18n("File Access Error"));
+      KMessageBox::error(nullptr, msg, i18n("File Access Error"));
       // return;      
     /* 2002-01-31 LEW */
     }
@@ -545,7 +545,7 @@ void Tape::addChild( Archive* archive )
     archive->write( _fptr );
     fflush( _fptr );
 
-    setMTime( time( NULL ) );
+    setMTime( time( nullptr ) );
 
     // change back to read-only   2002-01-31 LEW
     freopen( TQFile::encodeName(filename), "r", _fptr );
@@ -588,7 +588,7 @@ void Tape::removeChild( Archive* archive )
     // change back to read-only   2002-01-31 LEW
     freopen( TQFile::encodeName(filename), "r", _fptr );
 
-    setMTime( time( NULL ) );
+    setMTime( time( nullptr ) );
 }
 
 void Tape::clear()
@@ -620,7 +620,7 @@ void Tape::clear()
     // change back to read-only   2002-01-31 LEW
     freopen( TQFile::encodeName(filename), "r", _fptr );
 
-    setMTime( time( NULL ) );
+    setMTime( time( nullptr ) );
 }
 
 void Tape::readVersion1Index( FILE* fptr )
diff --git a/kdat/TapeDrive.cpp b/kdat/TapeDrive.cpp
index 82913e2..18686f8 100644
--- a/kdat/TapeDrive.cpp
+++ b/kdat/TapeDrive.cpp
@@ -218,13 +218,13 @@ void TapeDrive::eject()
 
 Tape* TapeDrive::readHeader()
 {
-    _tape = NULL;
+    _tape = nullptr;
     
     // Rewind tape.
     emit sigStatus( "Rewinding tape..." );
     if ( !rewind() ) {
         KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Rewinding tape failed." ));
-        return NULL;
+        return nullptr;
     }
 
     // KDat magic string.
@@ -232,11 +232,11 @@ Tape* TapeDrive::readHeader()
     char magic[9];
     if ( read( magic, 9 ) < 9 ) {
         KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Reading magic string failed." ));
-        return NULL;
+        return nullptr;
     }
     if ( strncmp( "KDatMAGIC", magic, 9 ) ) {
         // Bad magic.
-        return NULL;
+        return nullptr;
     }
 
     // Read version number.
@@ -244,7 +244,7 @@ Tape* TapeDrive::readHeader()
     int version;
     if ( read( (char*)&version, 4 ) < 4 ) {
         KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Reading version number failed." ));
-        return NULL;
+        return nullptr;
     }
 
     if ( version > KDAT_TAPE_HEADER_VERSION ) {
@@ -256,13 +256,13 @@ Tape* TapeDrive::readHeader()
     int len;
     if ( read( (char*)&len, 4 ) < 4 ) {
         KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Reading tape ID length failed." ));
-        return NULL;
+        return nullptr;
     }
     char* tapeID = new char[len];
     if ( read( tapeID, len ) < len ) {
         KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Reading tape ID failed." ));
         delete [] tapeID;
-        return NULL;
+        return nullptr;
     }
 
     _tape = TapeManager::instance()->findTape( tapeID );
diff --git a/kdat/VerifyDlg.cpp b/kdat/VerifyDlg.cpp
index 3f6a37b..79bc651 100644
--- a/kdat/VerifyDlg.cpp
+++ b/kdat/VerifyDlg.cpp
@@ -48,7 +48,7 @@ VerifyDlg::VerifyDlg( const TQString & workingDir, int fileno, const RangeList&
                       bool restore, TQWidget* parent, const char* name )
         : TQDialog( parent, name, true ),
           _restore( restore ),
-          _proc( NULL ),
+          _proc( nullptr ),
           _workingDir( workingDir ),
           _fileno( fileno ),
           _ranges( ranges ),
@@ -223,7 +223,7 @@ void VerifyDlg::show()
     connect( _proc, TQ_SIGNAL( receivedStdout( TDEProcess*, char*, int ) ), this, TQ_SLOT( slotStdout( TDEProcess*, char*, int ) ) );
     connect( _proc, TQ_SIGNAL( wroteStdin( TDEProcess* ) ), this, TQ_SLOT( slotWroteStdin( TDEProcess* ) ) );
 
-    _startTime = time( NULL );
+    _startTime = time( nullptr );
     startTimer( 100 );
 
     _proc->start( TDEProcess::NotifyOnExit, TDEProcess::All );
@@ -363,7 +363,7 @@ void VerifyDlg::timerEvent( TQTimerEvent* )
             _totalKBytes += (float)count / 1024.0;
 
             // Update stats.
-            int elapsed = time( NULL ) - _startTime;
+            int elapsed = time( nullptr ) - _startTime;
             if ( elapsed > oldElapsed )
             {
                 updateStats();
@@ -390,7 +390,7 @@ void VerifyDlg::timerEvent( TQTimerEvent* )
 void VerifyDlg::updateStats()
 {
     TQString str;
-    int elapsed = time( NULL ) - _startTime;
+    int elapsed = time( nullptr ) - _startTime;
 
     str= TQString::fromUtf8( TQCString().sprintf( i18n( "%02d:%02d:%02d" ).utf8(), elapsed / 3600, elapsed / 60 % 60, elapsed % 60 ) );
     _elapsedTime->setText( str );
diff --git a/kdat/main.cpp b/kdat/main.cpp
index e8f377e..1ebe62c 100644
--- a/kdat/main.cpp
+++ b/kdat/main.cpp
@@ -54,9 +54,9 @@ int main( int argc, char** argv )
 #ifdef DEBUG
   {
     char *newarg;
-    if( ( newarg = (char *)malloc( strlen("--nocrashhandler") + 1 ) ) == NULL )
+    if(!( newarg = (char *)malloc( strlen("--nocrashhandler") + 1 ) ))
       {
-	KMessageBox::sorry(NULL, i18n("Can't allocate memory in kdat"));
+	KMessageBox::sorry(nullptr, i18n("Can't allocate memory in kdat"));
         exit(1);
       }
     strcpy( newarg, "--nocrashhandler" );
diff --git a/knetworkconf/knetworkconf/kaddressvalidator.cpp b/knetworkconf/knetworkconf/kaddressvalidator.cpp
index 03d21c6..46d74ee 100644
--- a/knetworkconf/knetworkconf/kaddressvalidator.cpp
+++ b/knetworkconf/knetworkconf/kaddressvalidator.cpp
@@ -189,20 +189,20 @@ TQString KAddressValidator::calculateNetwork(TQString addr,TQString netmask){
   int prefix = 0;
   TQString s;  
   if (addr.isNull() || netmask.isNull())
-    return NULL; //bad address
+    return nullptr; //bad address
   if (!inet_pton(AF_INET,addr.latin1(),&_addr))
-    return NULL; //bad address
+    return nullptr; //bad address
   else
   {
     if (!inet_pton(AF_INET,netmask.latin1(),&_netmask))
-      return NULL; //bad address
+      return nullptr; //bad address
     else
     {
       prefix = mask2prefix(_netmask.s_addr);
       _network.s_addr = calc_network(_addr.s_addr, prefix);
       char * char_network = new char[20];
       if (!inet_ntop(AF_INET,&_network,char_network,20))
-        return NULL;
+        return nullptr;
       else
         s = char_network;
     }
@@ -217,20 +217,20 @@ TQString KAddressValidator::calculateBroadcast(TQString addr, TQString netmask){
   int prefix = 0;
   TQString s;
   if (addr.isNull() || netmask.isNull())
-    return NULL; //bad address
+    return nullptr; //bad address
   if (!inet_pton(AF_INET,addr.latin1(),&_addr))
-    return NULL; //bad address
+    return nullptr; //bad address
   else
   {
     if (!inet_pton(AF_INET,netmask.latin1(),&_netmask))
-      return NULL; //bad address
+      return nullptr; //bad address
     else
     {
       prefix = mask2prefix(_netmask.s_addr);
       _network.s_addr = calc_broadcast(_addr.s_addr, prefix);
       char * char_network = new char[20];
       if (!inet_ntop(AF_INET,&_network,char_network,20))
-        return NULL;
+        return nullptr;
       else
         s = char_network;
     }
diff --git a/knetworkconf/knetworkconf/knetworkconf.cpp b/knetworkconf/knetworkconf/knetworkconf.cpp
index b9912b5..53bd6d0 100644
--- a/knetworkconf/knetworkconf/knetworkconf.cpp
+++ b/knetworkconf/knetworkconf/knetworkconf.cpp
@@ -60,7 +60,7 @@ KNetworkConf::~KNetworkConf()
 void KNetworkConf::getNetworkInfoSlot()
 {
   netInfo = config->getNetworkInfo();
-  if (netInfo == NULL)
+  if (!netInfo)
   {
     KMessageBox::error(this,
                         i18n("Could not load network configuration information."),
@@ -222,12 +222,12 @@ void KNetworkConf::editServerSlot(){
 /** Pops up the window for adding a new interface. */
 void KNetworkConf::configureDeviceSlot(){
   TQListViewItem *item = klvCardList->currentItem();
-  KWirelessInterface *wifiDev = NULL;
+  KWirelessInterface *wifiDev = nullptr;
   
   //KAddDeviceContainer *configDlg = new KAddDeviceContainer(this,0);
   KAddDeviceContainer configDlg(this,0);
   
-  if (item != NULL)
+  if (item)
   {
     TQString currentDevice = item->text(0);
     configDlg.setCaption(i18n("Configure Device %1").arg(currentDevice));
@@ -375,7 +375,7 @@ KNetworkInterface * KNetworkConf::getDeviceInfo(TQString device){
     }
     ++i;
   }
-  return NULL;
+  return nullptr;
 }
 
 /**Returns the name of the network device that corresponds to the IP address 'ipAddr' or NULL if not found.'*/
@@ -391,7 +391,7 @@ TQString KNetworkConf::getDeviceName(TQString ipAddr){
     }
     ++i;
   }
-  return NULL;
+  return nullptr;
 }
 
 
@@ -438,7 +438,7 @@ void KNetworkConf::loadRoutingInfo(){
 
 void KNetworkConf::loadDNSInfo(){
   TQStringList nameServers;
-  if (dnsInfo == NULL)
+  if (!dnsInfo)
     KMessageBox::error(this,i18n("Could not open file '/etc/resolv.conf' for reading."),
                         i18n("Error Loading Config Files"));
   else
@@ -476,7 +476,7 @@ void KNetworkConf::loadDNSInfo(){
 
 void KNetworkConf::loadNetworkProfiles(){
   TQPtrListIterator<KNetworkInfo> it(profilesList);
-  KNetworkInfo *profile = NULL;
+  KNetworkInfo *profile = nullptr;
   
   klvProfilesList->clear();
   while ((profile = it.current()) != 0)
@@ -742,7 +742,7 @@ void KNetworkConf::verifyDeviceStateChanged(){
   else if (commandOutput == "\n<!-- GST: end of request -->")
   {
     TQListViewItem *item = klvCardList->findItem(currentDevice,0,ExactMatch);
-    if (item != NULL)
+    if (item)
     {
       dev = getDeviceInfo(currentDevice);
       if (!dev->isActive())
@@ -1006,13 +1006,13 @@ void KNetworkConf::enableProfileSlot()
   //Get selected profile
   TQListViewItem *item = klvProfilesList->currentItem();
   
-  if (item != NULL)
+  if (item)
   {
     TQString selectedProfile = item->text(0);  
   
     //And search for it in the profiles list
     KNetworkInfo *profile = getProfile(netInfo->getProfilesList(),selectedProfile);
-    if (profile != NULL)
+    if (profile)
     { 
       profile->setProfilesList(netInfo->getProfilesList()); 
       config->saveNetworkInfo(profile);
@@ -1029,7 +1029,7 @@ void KNetworkConf::enableProfileSlot()
 KNetworkInfo *KNetworkConf::getProfile(TQPtrList<KNetworkInfo> profilesList, TQString selectedProfile)
 {
   TQPtrListIterator<KNetworkInfo> it(profilesList);
-  KNetworkInfo *net = NULL;
+  KNetworkInfo *net = nullptr;
     
   while ((net = it.current()) != 0)
   {
@@ -1055,7 +1055,7 @@ void KNetworkConf::createProfileSlot()
     KNetworkInfo *newProfile = new KNetworkInfo();
 
     //If there isn't a profile with the new name we add it to the list.
-    if (currentProfile == NULL)
+    if (!currentProfile)
     {
       new TQListViewItem( klvProfilesList,newProfileName);
 
@@ -1107,7 +1107,7 @@ void KNetworkConf::createProfileSlot()
 void KNetworkConf::removeProfileSlot()
 {
   TQListViewItem *item= klvProfilesList->selectedItem();
-  if (item != NULL)
+  if (item)
   {
 /*    if (KMessageBox::warningContinueCancel(this,
                         i18n("Are you sure you want to delete the selected network profile?"),
@@ -1115,7 +1115,7 @@ void KNetworkConf::removeProfileSlot()
     {                    
       TQString selectedProfile = item->text(0);
       TQPtrList<KNetworkInfo> profiles = netInfo->getProfilesList();
-      KNetworkInfo *profileToDelete = NULL;
+      KNetworkInfo *profileToDelete = nullptr;
   
       for ( profileToDelete = profiles.first(); profileToDelete; profileToDelete = profiles.next() )
       {
@@ -1137,11 +1137,11 @@ void KNetworkConf::removeProfileSlot()
 void KNetworkConf::updateProfileSlot()
 {
   TQListViewItem *item= klvProfilesList->selectedItem();
-  if (item != NULL)
+  if (item)
   {
     TQString selectedProfile = item->text(0);
     TQPtrList<KNetworkInfo> profiles = netInfo->getProfilesList();
-    KNetworkInfo *profileToUpdate = NULL;
+    KNetworkInfo *profileToUpdate = nullptr;
     KNetworkInfo *newProfile = new KNetworkInfo();
   
     for ( profileToUpdate = profiles.first(); profileToUpdate; profileToUpdate = profiles.next() )
diff --git a/knetworkconf/knetworkconf/knetworkconfigparser.cpp b/knetworkconf/knetworkconf/knetworkconfigparser.cpp
index 2ffa4c3..863f8e6 100644
--- a/knetworkconf/knetworkconf/knetworkconfigparser.cpp
+++ b/knetworkconf/knetworkconf/knetworkconfigparser.cpp
@@ -128,7 +128,7 @@ void KNetworkConfigParser::readListIfacesSlot(){
         if (tempDevice->getType().lower() != LOOPBACK_IFACE_TYPE)
         {
           KNetworkInterface *originalDevice = getDeviceInfo(tempDevice->getDeviceName());
-          if (originalDevice == NULL)
+          if (!originalDevice)
           {
             node = node.nextSibling();
             continue;
@@ -575,7 +575,7 @@ KNetworkInfo * KNetworkConfigParser::getNetworkInfo(){
     object that contains all the info of the wireless interface. */
 KWirelessInterface * KNetworkConfigParser::getWirelessInterfaceInfo(TQDomElement interface, const TQString &type){
   KWirelessInterface *wifiDevice = new KWirelessInterface();
-  KNetworkInterface *tempDevice = NULL;
+  KNetworkInterface *tempDevice = nullptr;
   
   //first we get the standard network information
   tempDevice = getInterfaceInfo(interface,type);
@@ -924,13 +924,13 @@ void KNetworkConfigParser::parseNetworkInfo(TQDomNode node, KNetworkInfo *_netwo
           //aren't shown. 
           if ( attr == ETHERNET_IFACE_TYPE || attr == LOOPBACK_IFACE_TYPE )
           {
-            KNetworkInterface *tempDevice = NULL;
+            KNetworkInterface *tempDevice = nullptr;
             tempDevice = getInterfaceInfo(interface,attr);
             deviceList.append(tempDevice);
           }          
           else if (attr == WIRELESS_IFACE_TYPE)
           {
-            KWirelessInterface *wifiDevice = NULL;
+            KWirelessInterface *wifiDevice = nullptr;
             wifiDevice = getWirelessInterfaceInfo(interface,attr);
             deviceList.append(wifiDevice);
           }
@@ -1235,5 +1235,5 @@ KNetworkInterface * KNetworkConfigParser::getDeviceInfo(TQString device){
     }
     ++i;
   }
-  return NULL;
+  return nullptr;
 }
diff --git a/knetworkconf/knetworkconf/kprofileslistviewtooltip.h b/knetworkconf/knetworkconf/kprofileslistviewtooltip.h
index dc30c12..06459f3 100644
--- a/knetworkconf/knetworkconf/kprofileslistviewtooltip.h
+++ b/knetworkconf/knetworkconf/kprofileslistviewtooltip.h
@@ -83,10 +83,10 @@ inline void KProfilesListViewToolTip::maybeTip( const TQPoint& p )
   {
     tipStr = TQString(i18n("<b>Network Configuration of this Profile:</b>" ));
     KNetworkInfo *profile = getProfile(profiles,item->text(0)); 
-    if (profile != NULL)
+    if (profile)
     {
       TQPtrList<KNetworkInterface> devices = profile->getDeviceList();  
-      KNetworkInterface *device = NULL;
+      KNetworkInterface *device = nullptr;
       for (device = devices.first(); device; device = devices.next())
       {
         if (device->getType() != LOOPBACK_IFACE_TYPE)
@@ -125,7 +125,7 @@ inline void KProfilesListViewToolTip::maybeTip( const TQPoint& p )
 inline KNetworkInfo *KProfilesListViewToolTip::getProfile(TQPtrList<KNetworkInfo> profilesList, TQString selectedProfile)
 {
   TQPtrListIterator<KNetworkInfo> it(profilesList);
-  KNetworkInfo *net = NULL;
+  KNetworkInfo *net = nullptr;
     
   while ((net = it.current()) != 0)
   {
diff --git a/kpackage/kissInterface.cpp b/kpackage/kissInterface.cpp
index a2a3796..834569e 100644
--- a/kpackage/kissInterface.cpp
+++ b/kpackage/kissInterface.cpp
@@ -221,7 +221,7 @@ packageInfo *KISS::collectInfo(const char *_inp)
       str++;
     if (!strncmp("package",str,7))
       break;
-  } while ((str = strtok(NULL,"\n")));
+  } while ((str = strtok(nullptr,"\n")));
 
   // parse 'name: text' elements
 
@@ -256,7 +256,7 @@ packageInfo *KISS::collectInfo(const char *_inp)
 	a.insert(str, xstr);
       }
     }
-    } while ((str = strtok(NULL,"\n")));
+    } while ((str = strtok(nullptr,"\n")));
   }
 
   packageInfo *i = new packageInfo(a,this);
@@ -312,7 +312,7 @@ TQStringList KISS::getFileList(packageInfo *p)
 	if (str) {
 	  do {
 	    filelist.append(str);
-	  } while ((str = strtok(NULL,"\n")));
+	  } while ((str = strtok(nullptr,"\n")));
 	}
 	delete [] buffer;
       }
@@ -329,7 +329,7 @@ TQStringList KISS::getFileList(packageInfo *p)
 	if (str) {
 	  do {
 	    filelist.append(strdup(str));
-	  } while ((str = strtok(NULL,"\n")));
+	  } while ((str = strtok(nullptr,"\n")));
 	}
 	delete [] buffer;
       }
diff --git a/kpackage/kpackage.cpp b/kpackage/kpackage.cpp
index bbc1429..5c94cbc 100644
--- a/kpackage/kpackage.cpp
+++ b/kpackage/kpackage.cpp
@@ -314,9 +314,9 @@ KPACKAGE::KPACKAGE(TDEConfig *_config, TQWidget *parent)
 
   setupStatusBar();
 
-  file_dialog = NULL;
-  findialog = NULL;
-  srchdialog = NULL;
+  file_dialog = nullptr;
+  findialog = nullptr;
+  srchdialog = nullptr;
 
 }
 
diff --git a/kpackage/packageDisplay.cpp b/kpackage/packageDisplay.cpp
index 7553b49..a4766ba 100644
--- a/kpackage/packageDisplay.cpp
+++ b/kpackage/packageDisplay.cpp
@@ -59,7 +59,7 @@ packageDisplayWidget::packageDisplayWidget(TQWidget *parent)
   : TQTabWidget(parent)
 {
   // Initially we're not dealing with any package
-  package=NULL;
+  package=nullptr;
 
   // Set up the widgets
   setupWidgets();
@@ -162,7 +162,7 @@ void packageDisplayWidget::noPackage()
   if (isTabEnabled(cltab))
     setTabEnabled(cltab,false);
 
-  packageProperties->changePackage(NULL);
+  packageProperties->changePackage(nullptr);
 
   packageProperties->setText("");
   fileList->clear();
@@ -410,7 +410,7 @@ void packageDisplayWidget::updateFileList()
  TQString kpFileList::item2Path(TQListViewItem *it)
  {
         TQString res;
-        res = it ? it->text(0) : NULL;  
+        res = it ? it->text(0) : nullptr;  
         return res;
  }
  
diff --git a/kpackage/packageInfo.cpp b/kpackage/packageInfo.cpp
index 616bc2b..d3f819c 100644
--- a/kpackage/packageInfo.cpp
+++ b/kpackage/packageInfo.cpp
@@ -54,7 +54,7 @@
 #include "options.h"
 
 // Global pixmap for
-TQPixmap *pict = NULL;
+TQPixmap *pict = nullptr;
 
 //////////////////////////////////////////////////////////////////////////////
 // Constructor -- get the pixmap
@@ -63,7 +63,7 @@ packageInfo::packageInfo(TQMap<TQString, TQString> _info, pkgInterface *type)
   interface = type;
   info = _info;
 
-  item = NULL;
+  item = nullptr;
   packageState = UNSET;
   updated = false;
   url = TQString();
@@ -74,7 +74,7 @@ packageInfo::packageInfo(TQMap<TQString, TQString> _info, const TQString &_url)
 {
   info = _info;
   url = _url;
-  item = NULL;
+  item = nullptr;
 }
 
 packageInfo::~packageInfo()
@@ -391,7 +391,7 @@ bool packageInfo::display(int treeType)
 
 KpTreeListItem *packageInfo::place(KpTreeList *tree, bool insertI)
 {
-  KpTreeListItem *search = tree->firstChild(), *parent=NULL, *child=NULL;
+  KpTreeListItem *search = tree->firstChild(), *parent=nullptr, *child=nullptr;
   TQString qtmp, tmp;
   bool doit = false;
 
@@ -421,7 +421,7 @@ KpTreeListItem *packageInfo::place(KpTreeList *tree, bool insertI)
 	}
 	parent = group;
 	parent->setOpen(true);
-	search = NULL;
+	search = nullptr;
       }
       cnt++;
     }
diff --git a/kpackage/packageProperties.cpp b/kpackage/packageProperties.cpp
index 2c4557b..cf6143f 100644
--- a/kpackage/packageProperties.cpp
+++ b/kpackage/packageProperties.cpp
@@ -45,7 +45,7 @@ packagePropertiesWidget::packagePropertiesWidget
   TQStringList  cList();
 
   //  hide();
-  package=NULL;
+  package=nullptr;
   TQColorGroup cg = colorGroup();
   setBackgroundColor(cg.base());
   initTranslate();
diff --git a/kpackage/procbuf.cpp b/kpackage/procbuf.cpp
index bedbb9e..cb23f57 100644
--- a/kpackage/procbuf.cpp
+++ b/kpackage/procbuf.cpp
@@ -46,7 +46,7 @@ void Modal::terminate()
 
 procbuf::procbuf()
 {
-  m = NULL;
+  m = nullptr;
   tm = new TQTimer(this);
   connect(tm, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotTimeout()));
 }
diff --git a/kpackage/slackInterface.cpp b/kpackage/slackInterface.cpp
index 570216d..983a8ec 100644
--- a/kpackage/slackInterface.cpp
+++ b/kpackage/slackInterface.cpp
@@ -407,7 +407,7 @@ packageInfo *SLACK::collectInfo(const char *_inp, int insState)
 	  int i = 0;
 	  TQString qstr = "";
 
-	  while ((str = strtok(NULL,"\n"))) {
+	  while ((str = strtok(nullptr,"\n"))) {
 	    xstr = strchr(str,':');
 	    if (xstr) {
 	      *xstr++ = 0;
@@ -471,7 +471,7 @@ packageInfo *SLACK::collectInfo(const char *_inp, int insState)
 	  a.insert(str, xstr);
 	}
       }
-    } while ((str = strtok(NULL,"\n")));
+    } while ((str = strtok(nullptr,"\n")));
   }
 
   delete [] inp;
diff --git a/kpackage/updateLoc.cpp b/kpackage/updateLoc.cpp
index d4adc25..2cdbc30 100644
--- a/kpackage/updateLoc.cpp
+++ b/kpackage/updateLoc.cpp
@@ -665,7 +665,7 @@ void Locations::dLocations(int numberDirs,  int numberLines,
     TQVBox *page = addVBoxPage(mp);
     pn[i] = new pdUpdateLoc(page, i, inter,
 			    label, numberLines,
-			    filter, dirMsg, NULL, subdirs);
+			    filter, dirMsg, nullptr, subdirs);
   }
   numPanels += numberDirs;
 }
diff --git a/kpackage/utils.cpp b/kpackage/utils.cpp
index a4ca350..77dd881 100644
--- a/kpackage/utils.cpp
+++ b/kpackage/utils.cpp
@@ -48,15 +48,15 @@ void KpMsg(const TQString &lab, const TQString &msg, bool stop)
 KpTreeListItem *findGroup(const TQString &name, KpTreeListItem *search)
 {
   if(!search)
-    return NULL;
+    return nullptr;
 
   do {
     if (name == search->text(0)) {
       return search;
     }
-  } while( (search=search->nextSibling()) != NULL);
+  } while( (search=search->nextSibling()) != nullptr);
 
-  return NULL;
+  return nullptr;
 }
 
 
diff --git a/kuser/editGroup.h b/kuser/editGroup.h
index 3a55d8a..7ec941d 100644
--- a/kuser/editGroup.h
+++ b/kuser/editGroup.h
@@ -37,7 +37,7 @@ class editGroup : public KDialogBase
 public:
 
   editGroup(KU::KGroup *akg, bool samba, bool add, 
-    TQWidget* parent = NULL, const char* name = NULL);
+    TQWidget* parent = nullptr, const char* name = nullptr);
 
   virtual ~editGroup();
 
diff --git a/kuser/kgroup.cpp b/kuser/kgroup.cpp
index 5b61efd..1e8e719 100644
--- a/kuser/kgroup.cpp
+++ b/kuser/kgroup.cpp
@@ -228,7 +228,7 @@ gid_t KU::KGroups::first_free()
   gid_t t;
 
   for (t = mCfg->firstGID(); t<65534; t++)
-    if (lookup(t) == NULL)
+    if (!lookup(t))
       return t;
 
   return NO_FREE;
@@ -239,7 +239,7 @@ uint KU::KGroups::first_free_sam()
   uint t;
 
   for (t = 30000; t<65534; t++)
-    if (lookup_sam(t) == NULL)
+    if (!lookup_sam(t))
       return t;
 
   return 0;
diff --git a/kuser/kgroupfiles.cpp b/kuser/kgroupfiles.cpp
index d77308b..0cac37c 100644
--- a/kuser/kgroupfiles.cpp
+++ b/kuser/kgroupfiles.cpp
@@ -120,15 +120,15 @@ bool KGroupFiles::reload()
 #ifdef HAVE_FGETGRENT
     FILE *fgrp = fopen(TQFile::encodeName(filename), "r");
     TQString tmp;
-    if (fgrp == NULL) {
+    if (!fgrp) {
       KMessageBox::error( 0, i18n("Error opening %1 for reading.").arg(filename) );
       return false;
     }
 
-    while ((p = fgetgrent(fgrp)) != NULL) {
+    while ((p = fgetgrent(fgrp)) != nullptr) {
 #else
     setgrent();
-    while ((p = getgrent()) != NULL) {
+    while ((p = getgrent()) != nullptr) {
 #endif
       tmpKG = new KU::KGroup();
       tmpKG->setGID(p->gr_gid);
@@ -176,9 +176,9 @@ bool KGroupFiles::reload()
 bool KGroupFiles::save()
 {
   kdDebug() << "KGroupFiles::save() " << endl;
-  FILE *group_fd = NULL;
-  FILE *gshadow_fd = NULL;
-  FILE *nisgroup_fd = NULL;
+  FILE *group_fd = nullptr;
+  FILE *gshadow_fd = nullptr;
+  FILE *nisgroup_fd = nullptr;
   gid_t mingid = 0;
   int nis_groups_written = 0;
   gid_t tmp_gid = 0;
@@ -232,14 +232,14 @@ bool KGroupFiles::save()
   // Open file(s)
 
   if(!group_filename.isEmpty()) {
-    if((group_fd = fopen(TQFile::encodeName(new_group_filename), "w")) == NULL) {
+    if(!(group_fd = fopen(TQFile::encodeName(new_group_filename), "w"))) {
       KMessageBox::error( 0, i18n("Error opening %1 for writing.").arg(new_group_filename) );
       return false;
     }
   }
 
   if(!gshadow_filename.isEmpty()) {
-    if((gshadow_fd = fopen(TQFile::encodeName(new_gshadow_filename), "w")) == NULL) {
+    if(!(gshadow_fd = fopen(TQFile::encodeName(new_gshadow_filename), "w"))) {
       KMessageBox::error( 0, i18n("Error opening %1 for writing.").arg(new_gshadow_filename) );
       if ( group_fd ) fclose ( group_fd );
       return false;
@@ -247,7 +247,7 @@ bool KGroupFiles::save()
   }
 
   if(!nisgroup_filename.isEmpty() && (nisgroup_filename != group_filename)) {
-    if((nisgroup_fd = fopen(TQFile::encodeName(new_nisgroup_filename), "w")) == NULL) {
+    if(!(nisgroup_fd = fopen(TQFile::encodeName(new_nisgroup_filename), "w"))) {
       KMessageBox::error( 0, i18n("Error opening %1 for writing.").arg(new_nisgroup_filename) );
       if ( group_fd ) fclose ( group_fd );
       if ( gshadow_fd ) fclose ( gshadow_fd );
diff --git a/kuser/kgroupsystem.cpp b/kuser/kgroupsystem.cpp
index 63473ab..3177d75 100644
--- a/kuser/kgroupsystem.cpp
+++ b/kuser/kgroupsystem.cpp
@@ -49,7 +49,7 @@ bool KGroupSystem::reload()
   KU::KGroup *tmpKG = 0;
 
   setgrent();
-  while ((p = getgrent()) != NULL) {
+  while ((p = getgrent()) != nullptr) {
     tmpKG = new KU::KGroup();
     tmpKG->setGID(p->gr_gid);
     tmpKG->setName(TQString::fromLocal8Bit(p->gr_name));
diff --git a/kuser/kuser.cpp b/kuser/kuser.cpp
index 27c332c..4c5c794 100644
--- a/kuser/kuser.cpp
+++ b/kuser/kuser.cpp
@@ -748,7 +748,7 @@ int KU::KUser::removeHome()
 
   if (!stat(TQFile::encodeName(p_dir), &sb))
     if (S_ISDIR(sb.st_mode) && sb.st_uid == p_uid) {
-      if (!TDEIO::NetAccess::del(KURL::fromPathOrURL(p_dir), NULL)) {
+      if (!TDEIO::NetAccess::del(KURL::fromPathOrURL(p_dir), nullptr)) {
              KMessageBox::error( 0, i18n("Cannot remove home folder %1.\nError: %2")
                        .arg(p_dir).arg(TDEIO::NetAccess::lastErrorString()) );
       }
@@ -836,12 +836,12 @@ void KU::KUsers::parseGecos( const char *gecos, TQString &name,
 {
   int no = 0;
   const char *s = gecos;
-  const char *pos = NULL;
+  const char *pos = nullptr;
   // At least one part of the string exists
   for(;;) {
     pos = strchr(s, ',');
     TQString val;
-    if(pos == NULL)
+    if(!pos)
       val = TQString::fromLocal8Bit(s);
     else
       val = TQString::fromLocal8Bit(s, (int)(pos-s));
@@ -852,7 +852,7 @@ void KU::KUsers::parseGecos( const char *gecos, TQString &name,
       case 2: field2 = val; break;
       case 3: field3 = val; break;
     }
-    if(pos == NULL) break;
+    if(!pos) break;
     s = pos+1;
     no++;
   }
@@ -959,7 +959,7 @@ uid_t KU::KUsers::first_free()
   uid_t t;
 
   for (t = mCfg->firstUID() ; t<65534; t++)
-    if (lookup(t) == NULL)
+    if (!lookup(t))
       return t;
 
   return NO_FREE;
@@ -970,7 +970,7 @@ uint KU::KUsers::first_free_sam()
   uint t;
 
   for (t = 1000; t<65534; t++)
-    if (lookup_sam(t) == NULL)
+    if (!lookup_sam(t))
       return t;
 
   return 0;
diff --git a/kuser/kuserfiles.cpp b/kuser/kuserfiles.cpp
index be2f762..5a0233c 100644
--- a/kuser/kuserfiles.cpp
+++ b/kuser/kuserfiles.cpp
@@ -154,15 +154,15 @@ bool KUserFiles::loadpwd()
 
 #ifdef HAVE_FGETPWENT
     FILE *fpwd = fopen(TQFile::encodeName(filename), "r");
-    if(fpwd == NULL) {
+    if(!fpwd) {
       KMessageBox::error( 0, i18n("Error opening %1 for reading.").arg(filename) );
       return false;
     }
 
-    while ((p = fgetpwent(fpwd)) != NULL) {
+    while ((p = fgetpwent(fpwd)) != nullptr) {
 #else
     setpwent(); //This should be enough for BSDs
-    while ((p = getpwent()) != NULL) {
+    while ((p = getpwent()) != nullptr) {
 #endif
       tmpKU = new KU::KUser();
       tmpKU->setCaps( KU::KUser::Cap_POSIX );
@@ -222,7 +222,7 @@ bool KUserFiles::loadsdw()
 #ifdef HAVE_SHADOW
   TQString shadow_file,tmp;
   struct spwd *spw;
-  KU::KUser *up = NULL;
+  KU::KUser *up = nullptr;
   struct stat st;
 
   shadow_file = mCfg->shadowsrc();
@@ -237,7 +237,7 @@ bool KUserFiles::loadsdw()
 #ifdef HAVE_FGETSPENT
   FILE *f;
   kdDebug() << "open shadow file: " << shadow_file << endl;
-  if ((f = fopen( TQFile::encodeName(shadow_file), "r")) == NULL) {
+  if (!(f = fopen( TQFile::encodeName(shadow_file), "r"))) {
     KMessageBox::error( 0, i18n("Error opening %1 for reading.").arg(shadow_file) );
     caps &= ~Cap_Shadow;
     return true;
@@ -249,7 +249,7 @@ bool KUserFiles::loadsdw()
 #endif
 
     kdDebug() << "shadow entry: " << spw->sp_namp << endl;
-    if ((up = lookup(TQString::fromLocal8Bit(spw->sp_namp))) == NULL) {
+    if (!(up = lookup(TQString::fromLocal8Bit(spw->sp_namp)))) {
       KMessageBox::error( 0, i18n("No /etc/passwd entry for %1.\nEntry will be removed at the next `Save'-operation.").arg(TQString::fromLocal8Bit(spw->sp_namp)) );
       continue;
     }
@@ -293,8 +293,8 @@ bool KUserFiles::loadsdw()
 
 bool KUserFiles::savepwd()
 {
-  FILE *passwd_fd = NULL;
-  FILE *nispasswd_fd = NULL;
+  FILE *passwd_fd = nullptr;
+  FILE *nispasswd_fd = nullptr;
   uid_t minuid = 0;
   int nis_users_written = 0;
   uid_t tmp_uid = 0;
@@ -342,13 +342,13 @@ bool KUserFiles::savepwd()
 
   if(!passwd_filename.isEmpty()) {
     if ((passwd_fd =
-      fopen(TQFile::encodeName(new_passwd_filename),"w")) == NULL)
+      fopen(TQFile::encodeName(new_passwd_filename),"w")) == nullptr)
         KMessageBox::error( 0, i18n("Error opening %1 for writing.").arg(passwd_filename) );
   }
 
   if(!nispasswd_filename.isEmpty() && (nispasswd_filename != passwd_filename)){
     if ((nispasswd_fd =
-      fopen(TQFile::encodeName(new_nispasswd_filename),"w")) == NULL)
+      fopen(TQFile::encodeName(new_nispasswd_filename),"w")) == nullptr)
         KMessageBox::error( 0, i18n("Error opening %1 for writing.").arg(nispasswd_filename) );
   }
 
@@ -522,7 +522,7 @@ bool KUserFiles::savesdw()
     s_backuped = true;
   }
 
-  if ((f = fopen(TQFile::encodeName(new_shadow_file), "w")) == NULL) {
+  if (!(f = fopen(TQFile::encodeName(new_shadow_file), "w"))) {
     KMessageBox::error( 0, i18n("Error opening %1 for writing.").arg(new_shadow_file) );
     return false;
   }
diff --git a/kuser/kusersystem.cpp b/kuser/kusersystem.cpp
index 40bd99d..d938b74 100644
--- a/kuser/kusersystem.cpp
+++ b/kuser/kusersystem.cpp
@@ -73,7 +73,7 @@ bool KUserSystem::loadpwd()
   TQString tmp;
 
   setpwent(); //This should be enough for BSDs
-  while ((p = getpwent()) != NULL) {
+  while ((p = getpwent()) != nullptr) {
     tmpKU = new KU::KUser();
     tmpKU->setUID(p->pw_uid);
     tmpKU->setGID(p->pw_gid);
@@ -108,13 +108,13 @@ bool KUserSystem::loadsdw()
 {
 #ifdef HAVE_SHADOW
   struct spwd *spw;
-  KU::KUser *up = NULL;
+  KU::KUser *up = nullptr;
   TQString tmp;
 
   setspent();
   while ((spw = getspent())) {     // read a shadow password structure
 
-    if ((up = lookup(TQString::fromLocal8Bit(spw->sp_namp))) == NULL) {
+    if (!(up = lookup(TQString::fromLocal8Bit(spw->sp_namp)))) {
       continue;
     }
 
diff --git a/kuser/mainView.cpp b/kuser/mainView.cpp
index 9533b54..948ff92 100644
--- a/kuser/mainView.cpp
+++ b/kuser/mainView.cpp
@@ -431,7 +431,7 @@ void mainView::grpedit()
 void mainView::grpdel()
 {
   TQListViewItem *item;
-  KU::KGroup *group = NULL;
+  KU::KGroup *group = nullptr;
   int selected = 0;
 
   item = lbgroups->firstChild();
diff --git a/kuser/misc.cpp b/kuser/misc.cpp
index febd3b6..f1d4994 100644
--- a/kuser/misc.cpp
+++ b/kuser/misc.cpp
@@ -52,7 +52,7 @@ bool backup(const TQString & name)
 time_t now() {
   struct timeval tv;
   
-  gettimeofday( &tv, NULL );
+  gettimeofday( &tv, nullptr );
   return ( tv.tv_sec );
 }
 
diff --git a/kuser/pwddlg.h b/kuser/pwddlg.h
index 5ad4acb..86eb08f 100644
--- a/kuser/pwddlg.h
+++ b/kuser/pwddlg.h
@@ -30,7 +30,7 @@ class pwddlg : public KDialogBase {
   
 
 public:
-  pwddlg( TQWidget* parent = NULL, const char* name = NULL );
+  pwddlg( TQWidget* parent = nullptr, const char* name = nullptr );
   ~pwddlg();
 
   TQString getPassword() const;
diff --git a/lilo-config/common/Disks.cpp b/lilo-config/common/Disks.cpp
index fccd55a..f975c4d 100644
--- a/lilo-config/common/Disks.cpp
+++ b/lilo-config/common/Disks.cpp
@@ -182,7 +182,7 @@ void ptable::scandisk(String const &disk)
 			while(isspace(*buf)) strcpy(buf, buf+1);
 			strcpy(buf, strchr(buf, ' ')); // skip Blocks
 			while(isspace(*buf)) strcpy(buf, buf+1);
-			id[dev]=strtol(buf, NULL, 16);
+			id[dev]=strtol(buf, nullptr, 16);
 		}
 	}
 	pclose(fdisk);
diff --git a/lilo-config/common/Files.cpp b/lilo-config/common/Files.cpp
index 85171e5..9df2ad7 100644
--- a/lilo-config/common/Files.cpp
+++ b/lilo-config/common/Files.cpp
@@ -39,7 +39,7 @@ StringList &Files::glob(String name, enum Types types, bool dotfiles, bool brace
 		flags |= GLOB_PERIOD;
 	if(braces)
 		flags |= GLOB_BRACE;
-	::glob(name, flags, NULL, &gl);
+	::glob(name, flags, nullptr, &gl);
 	if(types==Any)
 		result=new StringList(gl.gl_pathv, gl.gl_pathc);
 	else {
diff --git a/lilo-config/common/String.cpp b/lilo-config/common/String.cpp
index 578d513..d2b6e37 100644
--- a/lilo-config/common/String.cpp
+++ b/lilo-config/common/String.cpp
@@ -122,7 +122,7 @@ int String::locate(String const &s, bool cs, unsigned int startat) const
 		s2=strstr(s0+startat, s1);
 	else
 		s2=strcasestr(s0+startat, s1);
-	if(s2==NULL) {
+	if(!s2) {
 		delete [] s0;
 		delete [] s1;
 		return -1;
@@ -274,7 +274,7 @@ StringList::StringList(String const &s)
 		if(line[strlen(line)-1]=='\r') // Handle sucking OSes
 			line[strlen(line)-1]=0;
 		insert(end(), line);
-		line=strtok_r(NULL, "\n", &tok);
+		line=strtok_r(nullptr, "\n", &tok);
 	}
 	free(st);
 }
@@ -286,7 +286,7 @@ StringList::StringList(char **strs, int num)
 		for(int i=0; i<num; i++)
 			insert(end(), strs[i]);
 	} else {
-		for(int i=0; strs[i]!=NULL; i++)
+		for(int i=0; strs[i]; i++)
 			insert(end(), strs[i]);
 	}
 }
diff --git a/lilo-config/common/lilo.cpp b/lilo-config/common/lilo.cpp
index d9d44c7..f7f0a2b 100644
--- a/lilo-config/common/lilo.cpp
+++ b/lilo-config/common/lilo.cpp
@@ -314,12 +314,12 @@ bool liloconf::probe()
 			String mp=p.mountpt[*it];
 			String lbl="DOS";
 			if(mp.empty()) {
-				char *tmp=tmpnam(NULL);
-				tmp=tmpnam(NULL);
+				char *tmp=tmpnam(nullptr);
+				tmp=tmpnam(nullptr);
 				mkdir(tmp, 0700);
-				if(!mount(*it, tmp, "msdos", MS_MGC_VAL|MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC, NULL))
+				if(!mount(*it, tmp, "msdos", MS_MGC_VAL|MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC, nullptr))
 					mp=tmp;
-				else if(!mount(*it, mp, "vfat", MS_MGC_VAL|MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC, NULL))
+				else if(!mount(*it, mp, "vfat", MS_MGC_VAL|MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC, nullptr))
 					mp=tmp;
 			}
 			if(!mp.empty()) {
-- 
cgit v1.2.3

