From 88fdd714fa033f83148b843d72720b30c84df4d6 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sat, 3 Oct 2026 17:38:37 -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>
---
 kbackgammon/engines/gnubg/kbggnubg.cpp |  2 +-
 kbackgammon/engines/nextgen/kbgng.cpp  |  2 +-
 kbackgammon/kbgboard.cpp               | 10 +++---
 kblackbox/kbbgame.cpp                  |  4 +--
 kblackbox/kbbgfx.cpp                   | 14 ++++-----
 kenolaba/Network.cpp                   |  2 +-
 kgoldrunner/src/kgrgame.cpp            |  2 +-
 kgoldrunner/src/kgrobject.cpp          |  2 +-
 kmahjongg/Editor.cpp                   |  4 +--
 kmahjongg/Editor.h                     |  4 +--
 kmahjongg/HighScore.cpp                | 30 +++++++++---------
 kmahjongg/HighScore.h                  |  4 +--
 kmahjongg/Preview.cpp                  |  4 +--
 kmahjongg/Preview.h                    |  2 +-
 kmahjongg/kmahjongg.cpp                |  8 ++---
 konquest/gameboard.cpp                 |  4 +--
 konquest/gamecore.cpp                  | 10 +++---
 kpat/freecell-solver/test_arr.h        |  6 ++--
 kpat/freecell.cpp                      |  8 ++---
 kpat/spider.cpp                        |  2 +-
 kpoker/kpoker.cpp                      |  2 +-
 ksokoban/Bookmark.cpp                  |  4 +--
 ksokoban/InternalCollections.cpp       |  6 ++--
 kspaceduel/ai.cpp                      |  2 +-
 ktron/tron.cpp                         |  4 +--
 libtdegames/kcarddialog.h              |  2 +-
 lskat/lskat/lskatdoc.cpp               |  2 +-
 lskat/lskat/msgdlg.h                   |  2 +-
 lskat/lskat/networkdlg.h               |  2 +-
 lskat/lskatproc/lskatproc.cpp          |  2 +-
 tdefifteen/src/gameboard.cpp           | 57 +++++++++++++---------------------
 tdefifteen/src/gameboard.h             |  4 +--
 32 files changed, 99 insertions(+), 114 deletions(-)

diff --git a/kbackgammon/engines/gnubg/kbggnubg.cpp b/kbackgammon/engines/gnubg/kbggnubg.cpp
index 44998caf..aa85faf9 100644
--- a/kbackgammon/engines/gnubg/kbggnubg.cpp
+++ b/kbackgammon/engines/gnubg/kbggnubg.cpp
@@ -427,7 +427,7 @@ KBgEngineGNU::KBgEngineGNU(TQWidget *parent, TQString *name, TQPopupMenu *pmenu)
 	// obsolete
 	nameUS   = "US";
 	nameTHEM = "THEM";
-	random.setSeed(getpid()*time(NULL));
+	random.setSeed(getpid()*time(nullptr));
 
 	/*
 	 * internal statue variables
diff --git a/kbackgammon/engines/nextgen/kbgng.cpp b/kbackgammon/engines/nextgen/kbgng.cpp
index 6b0f72b3..c5dc3bbe 100644
--- a/kbackgammon/engines/nextgen/kbgng.cpp
+++ b/kbackgammon/engines/nextgen/kbgng.cpp
@@ -600,7 +600,7 @@ KBgPlayer * KBgEngineNg::createPlayer(int i, TQString name)
 void KBgEngineNg::initGame()
 {
     _game = new KBgGame(PROG_COOKIE);
-    _game->random()->setSeed(getpid()*time(NULL));
+    _game->random()->setSeed(getpid()*time(nullptr));
 
     connect(_game, TQ_SIGNAL(signalPlayerJoinedGame(KPlayer *)),
 	    this, TQ_SLOT(slotPlayerJoinedGame(KPlayer *)));
diff --git a/kbackgammon/kbgboard.cpp b/kbackgammon/kbgboard.cpp
index 80237eb7..14cc3d59 100644
--- a/kbackgammon/kbgboard.cpp
+++ b/kbackgammon/kbgboard.cpp
@@ -1437,7 +1437,7 @@ KBgBoardCell* KBgBoard::getCellByPos(const TQPoint& p) const
 		if (cells[i]->rect().contains(cells[i]->mapFromParent(p)))
 			return cells[i];
 	}
-	return NULL;
+	return nullptr;
 }
 
 /*
@@ -1463,7 +1463,7 @@ KBgBoardCell* KBgBoard::getCell(int num)
 	default:
 		int cell;
 		if (num < 0 || num > 25)
-			return NULL;
+			return nullptr;
 		else if (num < 7)
 			cell = ((direction > 0) ? num      : 29 - num);
 		else if (num < 13)
@@ -1527,7 +1527,7 @@ void KBgBoard::restoreCursor()
 	if (savedCursor) {
 		setCursor(*savedCursor);
 		delete savedCursor;
-		savedCursor = NULL;
+		savedCursor = nullptr;
 	}
 }
 
@@ -1564,7 +1564,7 @@ void KBgBoardCell::mouseReleaseEvent(TQMouseEvent *e)
 		KBgBoardCell *dest = board->getCellByPos
 			(mapToParent(e->pos()));
 		board->restoreCursor();
-		if ((dest != NULL) && (dest->dropPossible(cellID, ((board->getTurn() == US) ?
+		if (dest && (dest->dropPossible(cellID, ((board->getTurn() == US) ?
 								   color : -color)))) {
 			if (!board->getEditMode())
 				board->makeMove(getNumber(), dest->getNumber());
@@ -2833,7 +2833,7 @@ KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu)
 	cube = 1;
 	allowMoving(true);
 	setEditMode(false);
-	savedCursor = NULL;
+	savedCursor = nullptr;
 	checkerDiam = MINIMUM_CHECKER_SIZE;
 
 	/*
diff --git a/kblackbox/kbbgame.cpp b/kblackbox/kbbgame.cpp
index 3b89542d..3d14a89f 100644
--- a/kblackbox/kbbgame.cpp
+++ b/kblackbox/kbbgame.cpp
@@ -78,7 +78,7 @@ KBBGame::KBBGame()
     kdDebug(12009) << "Cannot find pixmap \"" << pFNames[0] << "\". Pixmaps will not be loaded." << endl;
     delete pix[0];
     delete pix;
-    pix = NULL;
+    pix = nullptr;
   }
   gr = new KBBGraphic( pix, this, "KBBGraphic" );
 
@@ -105,7 +105,7 @@ KBBGame::KBBGame()
      Game initializations
   */
   running = false;
-  gameBoard = NULL;
+  gameBoard = nullptr;
 
   TDEConfig *kConf;
   int j;
diff --git a/kblackbox/kbbgfx.cpp b/kblackbox/kbbgfx.cpp
index b83aa292..7ca50639 100644
--- a/kblackbox/kbbgfx.cpp
+++ b/kblackbox/kbbgfx.cpp
@@ -35,15 +35,15 @@ KBBGraphic::KBBGraphic( TQPixmap **p, TQWidget* parent, const char* name )
   setMouseTracking( false );
 
   pix = p;
-  if (pix == NULL) pixScaled = NULL;
+  if (!pix) pixScaled = nullptr;
   else {
     pixScaled = new TQPixmap * [NROFTYPES];
     for (i = 0; i < NROFTYPES; i++) {
        pixScaled[i] = new TQPixmap;
     }
   }
-  graphicBoard = NULL;
-  drawBuffer = NULL;
+  graphicBoard = nullptr;
+  drawBuffer = nullptr;
 }
 
 /*
@@ -54,13 +54,13 @@ KBBGraphic::~KBBGraphic()
 {
   int i;
 
-  if (pix != NULL) {
+  if (pix) {
     for (i = 0; i < NROFTYPES; i++) {
       delete pix[i];
     }
     delete pix;
   }
-  if (pixScaled != NULL) {
+  if (pixScaled) {
     for (i = 0; i < NROFTYPES; i++) {
       delete pixScaled[i];
     }
@@ -151,7 +151,7 @@ RectOnArray *KBBGraphic::getGraphicBoard() { return graphicBoard; }
 
 void KBBGraphic::paintCell( TQPainter* p, int row, int col )
 {
-  if (pix == NULL) paintCellDefault( p, row, col );
+  if (!pix) paintCellDefault( p, row, col );
   else paintCellPixmap( p, row, col );
 }
 
@@ -325,7 +325,7 @@ void KBBGraphic::resizeEvent( TQResizeEvent*  )
   } else {
     hNew = CELLH;
   }
-  if (pix != NULL) scalePixmaps( wNew, hNew );
+  if (pix) scalePixmaps( wNew, hNew );
   setCellWidth( wNew );
   setCellHeight( hNew );
 
diff --git a/kenolaba/Network.cpp b/kenolaba/Network.cpp
index fe191948..848f0e9b 100644
--- a/kenolaba/Network.cpp
+++ b/kenolaba/Network.cpp
@@ -143,7 +143,7 @@ void Network::addListener(const char* host, int port)
   name.sin_family = AF_INET;
   name.sin_port = htons (port);
   hostinfo = gethostbyname (host);
-  if (hostinfo == NULL) {
+  if (!hostinfo) {
     printf ("Error in addListener: Unknown host %s.\n", host);
     return;
   }
diff --git a/kgoldrunner/src/kgrgame.cpp b/kgoldrunner/src/kgrgame.cpp
index 6cc0638c..f770b310 100644
--- a/kgoldrunner/src/kgrgame.cpp
+++ b/kgoldrunner/src/kgrgame.cpp
@@ -56,7 +56,7 @@ KGrGame::KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDi
 
     setBlankLevel (true);		// Fill the playfield with blank walls.
 
-    enemy = NULL;
+    enemy = nullptr;
     newLevel = true;			// Next level will be a new one.
     loading  = true;			// Stop input until it is loaded.
 
diff --git a/kgoldrunner/src/kgrobject.cpp b/kgoldrunner/src/kgrobject.cpp
index 8b4e7229..b2654d3f 100644
--- a/kgoldrunner/src/kgrobject.cpp
+++ b/kgoldrunner/src/kgrobject.cpp
@@ -32,7 +32,7 @@ KGrObject::KGrObject (char objType)
     }
     xpos = 0;
     ypos = 0;
-    objectView = NULL;
+    objectView = nullptr;
 }
 
 bool KGrObject::frozen = false;	// Initialise game as running, not halted.
diff --git a/kmahjongg/Editor.cpp b/kmahjongg/Editor.cpp
index 7e816114..8eaf224a 100644
--- a/kmahjongg/Editor.cpp
+++ b/kmahjongg/Editor.cpp
@@ -271,7 +271,7 @@ void Editor::loadBoard() {
 	return;
 
     KURL url = KFileDialog::getOpenURL(
-				NULL,
+				nullptr,
 				i18n("*.layout|Board Layout (*.layout)\n"
 				"*|All Files"),
 				this,
@@ -308,7 +308,7 @@ void Editor::newBoard() {
 bool Editor::saveBoard() {
     // get a save file name
     KURL url = KFileDialog::getSaveURL(
-				NULL,
+				nullptr,
 				i18n("*.layout|Board Layout (*.layout)\n"
 				"*|All Files"),
 				this,
diff --git a/kmahjongg/Editor.h b/kmahjongg/Editor.h
index 8dfd45f7..8c0bb50a 100644
--- a/kmahjongg/Editor.h
+++ b/kmahjongg/Editor.h
@@ -23,8 +23,8 @@ public:
 
     Editor
     (
-        TQWidget* parent = NULL,
-        const char* name = NULL
+        TQWidget* parent = nullptr,
+        const char* name = nullptr
     );
 
     virtual ~Editor();
diff --git a/kmahjongg/HighScore.cpp b/kmahjongg/HighScore.cpp
index 6c92e434..66bc842b 100644
--- a/kmahjongg/HighScore.cpp
+++ b/kmahjongg/HighScore.cpp
@@ -155,7 +155,7 @@ HighScore::HighScore
 	resize( 350+70,390+45 );
 	setFixedSize(350+70,390+45);
 
-	tables = NULL; 
+	tables = nullptr; 
 	loadTables();
 	currTable = tables;
 
@@ -177,16 +177,16 @@ HighScore::~HighScore()
 {
 	TableInstance *t, *t1;
 
-	if (tables != NULL) {
+	if (tables) {
 		t = tables;
-		while(t != NULL)
+		while(t)
 		{
 			t1 = t;
 			t = t -> next;
 			delete t1;
 		}
 	}
-	tables = NULL;
+	tables = nullptr;
 }
 
 
@@ -200,7 +200,7 @@ void HighScore::loadTables() {
 
 	// open the file, on error set up the default table
 	FILE *fp = fopen( TQFile::encodeName(highScoreFile()), "r");
-	if (fp == NULL) 
+	if (!fp) 
 		goto error;	
 
 	// check magic
@@ -253,17 +253,17 @@ void HighScore::saveTables() {
 	int	      num = 0;
 
 	// Nothing to do
-	if (tables == NULL)
+	if (!tables)
 		return;
 
 
 	// open the outrput file, with naff error handling
 	FILE *fp = fopen( TQFile::encodeName(highScoreFile()), "w");
-	if (fp == NULL)
+	if (!fp)
 		return;
 	
 	// count up the number of tables to save
- 	for (p=tables; p != NULL; p = p->next)
+ 	for (p=tables; p; p = p->next)
 		num++;
 
 	// output the file magic
@@ -273,7 +273,7 @@ void HighScore::saveTables() {
 	fprintf(fp, "%d\n", num);
 
 	// output each table
-	for (p=tables; p != NULL; p = p->next) {
+	for (p=tables; p; p = p->next) {
 		fprintf(fp, "%s\n", p->name.utf8().data());
 		for (int e=0; e<numScores; e++) {
 			fprintf(fp,"%ld\n%ld\n%ld\n%s\n", 
@@ -296,7 +296,7 @@ void HighScore::selectTable(const TQString &board) {
 	TableInstance *pos = tables;
 
 
-	while (pos != NULL) {
+	while (pos) {
 		if (pos->name == board)
 			break;
 		pos = pos->next;
@@ -304,7 +304,7 @@ void HighScore::selectTable(const TQString &board) {
 
 
 
-	if (pos == NULL) {
+	if (!pos) {
 		// not found, add new board to the front of the list
 	        TableInstance *n = new TableInstance;
         	n->next = tables;
@@ -506,9 +506,9 @@ void HighScore::reset() {
 	// wipe ou the in memory list of tables	
 	TableInstance *t, *d;
 
-	if (tables != NULL) {
+	if (tables) {
 	    t = tables;
-	    while (t != NULL) {
+	    while (t) {
 		d = t;
 		t = t->next;
 		d->next=0;
@@ -518,8 +518,8 @@ void HighScore::reset() {
 	}
 	
 	// set the list empty
-	tables = NULL;
-	currTable=NULL;	
+	tables = nullptr;
+	currTable=nullptr;	
 
 	// clear out the combobox
 	combo->clear();
diff --git a/kmahjongg/HighScore.h b/kmahjongg/HighScore.h
index a5409fdc..a5fc6f51 100644
--- a/kmahjongg/HighScore.h
+++ b/kmahjongg/HighScore.h
@@ -35,8 +35,8 @@ public:
 
     HighScore
     (
-        TQWidget* parent = NULL,
-        const char* name = NULL
+        TQWidget* parent = nullptr,
+        const char* name = nullptr
     );
 
     virtual ~HighScore();
diff --git a/kmahjongg/Preview.cpp b/kmahjongg/Preview.cpp
index 0db5b6cc..d24ca4a0 100644
--- a/kmahjongg/Preview.cpp
+++ b/kmahjongg/Preview.cpp
@@ -380,7 +380,7 @@ void Preview::saveTheme() {
 
     // Get the name of the file to save
     KURL url = KFileDialog::getSaveURL(
-        NULL,
+        nullptr,
         "*.theme",
         parentWidget(),
         i18n("Save Theme" ));
@@ -407,7 +407,7 @@ void Preview::saveTheme() {
                 return ;
     }
     FILE *outFile = fopen( TQFile::encodeName(url.path()), "w" );
-    if (outFile == NULL) {
+    if (!outFile) {
         KMessageBox::sorry(this,
                 i18n("Could not write to file. Aborting."));
         return;
diff --git a/kmahjongg/Preview.h b/kmahjongg/Preview.h
index 6f8c842d..08bad774 100644
--- a/kmahjongg/Preview.h
+++ b/kmahjongg/Preview.h
@@ -17,7 +17,7 @@ class FrameImage: public TQFrame
 	TQ_OBJECT
   
 public:
-	FrameImage(TQWidget *parent=NULL, const char *name = NULL);
+	FrameImage(TQWidget *parent=nullptr, const char *name = nullptr);
 	~FrameImage();
 	void setGeometry(int x, int y, int w, int h);
 	TQPixmap *getPreviewPixmap() {return thePixmap;}
diff --git a/kmahjongg/kmahjongg.cpp b/kmahjongg/kmahjongg.cpp
index 629794ab..e577d7a3 100644
--- a/kmahjongg/kmahjongg.cpp
+++ b/kmahjongg/kmahjongg.cpp
@@ -461,7 +461,7 @@ void KMahjongg::loadGame() {
     TQString fname;
 
     // Get the name of the file to load
-    KURL url = KFileDialog::getOpenURL( NULL, "*.kmgame", this, i18n("Load Game" ) );
+    KURL url = KFileDialog::getOpenURL( nullptr, "*.kmgame", this, i18n("Load Game" ) );
 
     if ( url.isEmpty() )
 	return;
@@ -470,7 +470,7 @@ void KMahjongg::loadGame() {
 
     // open the file for reading
     FILE *outFile = fopen( TQFile::encodeName(fname), "r");
-    if (outFile == NULL) {
+    if (!outFile) {
 	KMessageBox::sorry(this,
 		i18n("Could not read from file. Aborting."));
 	return;
@@ -526,7 +526,7 @@ void KMahjongg::restartGame() {
 void KMahjongg::saveGame() {
 
     // Get the name of the file to save
-    KURL url = KFileDialog::getSaveURL( NULL, "*.kmgame", this, i18n("Save Game" ) );
+    KURL url = KFileDialog::getSaveURL( nullptr, "*.kmgame", this, i18n("Save Game" ) );
 
     if ( url.isEmpty() )
 	return;
@@ -538,7 +538,7 @@ void KMahjongg::saveGame() {
    }
 
     FILE *outFile = fopen( TQFile::encodeName(url.path()), "w");
-    if (outFile == NULL) {
+    if (!outFile) {
 	KMessageBox::sorry(this,
 		i18n("Could not write to file. Aborting."));
 	return;
diff --git a/konquest/gameboard.cpp b/konquest/gameboard.cpp
index 48e1d531..029958ce 100644
--- a/konquest/gameboard.cpp
+++ b/konquest/gameboard.cpp
@@ -178,7 +178,7 @@ GameBoard::keyPressEvent( TQKeyEvent *e )
     planetName += toupper( e->ascii() );
 
     for(Planet *p = planetSearch.toFirst();
-        p != NULL;
+        p != nullptr;
         p = ++planetSearch ) {
 
         if( p->getName() == planetName )
@@ -802,7 +802,7 @@ GameBoard::cleanupGame()
     players.clear();
 
     delete currentPlayer;
-    currentPlayer = NULL;
+    currentPlayer = nullptr;
 
     shipCountEdit->hide();
     endTurn->setEnabled( false );
diff --git a/konquest/gamecore.cpp b/konquest/gamecore.cpp
index dc8c0cc3..1a9b25f9 100644
--- a/konquest/gamecore.cpp
+++ b/konquest/gamecore.cpp
@@ -242,11 +242,11 @@ const int Map::getColumns() const
 //---------------------------------------------------------------------------
 
 Sector::Sector()
-: TQObject(0,0), planet( NULL ), parentMap(NULL ), x(0), y(0)
+: TQObject(0,0), planet( nullptr ), parentMap(nullptr ), x(0), y(0)
 {}
 
 Sector::Sector( Map *newParentMap, int xPos, int yPos )
-: TQObject(0,0), planet(NULL), parentMap( newParentMap ), x(xPos), y(yPos)
+: TQObject(0,0), planet(nullptr), parentMap( newParentMap ), x(xPos), y(yPos)
 {
 }
 
@@ -257,7 +257,7 @@ Sector::Sector( const Sector & other )
 
 bool Sector::hasPlanet() const
 {
-    return (planet != NULL);
+    return (planet != nullptr);
 }
 
 
@@ -277,7 +277,7 @@ Planet *Sector::getPlanet()
 
 void Sector::removePlanet()
 {
-    planet = NULL;
+    planet = nullptr;
 
     emit update();
 }
@@ -628,7 +628,7 @@ AttackFleet *
 DefenseFleet::spawnAttackFleet( Planet *dest, int count, double arrivalTurn )
 {
     if( shipCount < count ) {
-        return NULL;
+        return nullptr;
     }
 
     AttackFleet *newFleet = new AttackFleet( home, dest, count, arrivalTurn  );
diff --git a/kpat/freecell-solver/test_arr.h b/kpat/freecell-solver/test_arr.h
index cfc5cd12..6f99d79d 100644
--- a/kpat/freecell-solver/test_arr.h
+++ b/kpat/freecell-solver/test_arr.h
@@ -56,7 +56,7 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST
         int this_real_depth = 0;                                   \
         fcs_state_with_locations_t * ptr_state = (ptr_state_orig); \
         /* Count the number of states until the original state. */ \
-        while(ptr_state != NULL)                                   \
+        while(ptr_state)                                   \
         {                                                          \
             ptr_state = ptr_state->parent;                         \
             this_real_depth++;                                     \
@@ -85,7 +85,7 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST
         /* Mark as a dead end */        \
         ptr_state->visited |= FCS_VISITED_DEAD_END; \
         ptr_state = ptr_state->parent;          \
-        if (ptr_state != NULL)                    \
+        if (ptr_state)                    \
         {           \
             /* Decrease the refcount of the state */    \
             ptr_state->num_active_children--;   \
@@ -95,7 +95,7 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST
                 ptr_state->visited |= FCS_VISITED_DEAD_END;  \
                 /* Go to its parent state */       \
                 ptr_state = ptr_state->parent;    \
-                if (ptr_state == NULL)         \
+                if (!ptr_state)         \
                 {                \
                     break;             \
                 }      \
diff --git a/kpat/freecell.cpp b/kpat/freecell.cpp
index 5f3ccca0..b54f4404 100644
--- a/kpat/freecell.cpp
+++ b/kpat/freecell.cpp
@@ -90,7 +90,7 @@ FreecellBase::~FreecellBase()
     if (solver_instance)
     {
         freecell_solver_user_free(solver_instance);
-        solver_instance = NULL;
+        solver_instance = nullptr;
     }
 }
 //-------------------------------------------------------------------------//
@@ -223,7 +223,7 @@ void FreecellBase::findSolution()
 
         char * error_string;
         int error_arg;
-        char * known_parameters[1] = {NULL};
+        char * known_parameters[1] = {nullptr};
 
 
         ret = freecell_solver_user_cmd_line_parse_args(
@@ -232,8 +232,8 @@ void FreecellBase::findSolution()
             freecell_solver_cmd_line_args,
             0,
             known_parameters,
-            NULL,
-            NULL,
+            nullptr,
+            nullptr,
             &error_string,
             &error_arg
             );
diff --git a/kpat/spider.cpp b/kpat/spider.cpp
index 03b9847d..6b4843c4 100644
--- a/kpat/spider.cpp
+++ b/kpat/spider.cpp
@@ -135,7 +135,7 @@ void Spider::getHints()
     // first, get runs from each stack
     CardList cl[10];
 
-    Pile* empty = NULL;
+    Pile* empty = nullptr;
     for (int column = 0; column < 10; column++) {
         if (stack[column]->isEmpty())
            empty = stack[column];
diff --git a/kpoker/kpoker.cpp b/kpoker/kpoker.cpp
index 2d7e53f0..ee36b725 100644
--- a/kpoker/kpoker.cpp
+++ b/kpoker/kpoker.cpp
@@ -1214,7 +1214,7 @@ PokerPlayer* kpok::findHumanPlayer()
 
 bool kpok::readEntriesAndInitPoker()
 {
-  NewGameDlg  *newGameDlg = NULL;
+  NewGameDlg  *newGameDlg = nullptr;
   TDEConfig     *conf       = tdeApp->config();
   int          numPlayers = DEFAULT_PLAYERS;
 
diff --git a/ksokoban/Bookmark.cpp b/ksokoban/Bookmark.cpp
index b14112d7..1b493633 100644
--- a/ksokoban/Bookmark.cpp
+++ b/ksokoban/Bookmark.cpp
@@ -52,7 +52,7 @@ Bookmark::Bookmark(int _num) :
   fileName(p);
 
   FILE *file = fopen(p.latin1(), "r");
-  if (file == NULL) return;
+  if (!file) return;
 
   char buf[4096];
   buf[0] = '\0';
@@ -94,7 +94,7 @@ Bookmark::set(int _collection, int _level, int _moves, History *_h) {
   TQString p;
   fileName(p);
   FILE *file = fopen(TQFile::encodeName(p), "w");
-  if (file == NULL) return;
+  if (!file) return;
   fprintf(file, "%d %d %d\n", collection_, level_, moves_);
   fprintf(file, "%s\n", data_.latin1());
   fclose(file);
diff --git a/ksokoban/InternalCollections.cpp b/ksokoban/InternalCollections.cpp
index e54b8959..85715914 100644
--- a/ksokoban/InternalCollections.cpp
+++ b/ksokoban/InternalCollections.cpp
@@ -72,16 +72,16 @@ InternalCollections::InternalCollections() {
 
 #ifdef USE_LIBZ
   data_ = (char *) malloc(BUFSIZE);
-  if (data_ == NULL) abort();
+  if (!data_) abort();
 
   datasize = BUFSIZE;
   uncompress ((unsigned char *) data_, (long unsigned int *) &datasize, level_data_, sizeof (level_data_));
   data_ = (char *) realloc(data_, datasize);
-  if (data_ == NULL) abort ();
+  if (!data_) abort ();
 #else
   datasize = sizeof (level_data_);
   data_ = (char *) malloc(datasize);
-  if (data_ == NULL) abort();
+  if (!data_) abort();
   memcpy(data_, level_data_, datasize);
 #endif
 
diff --git a/kspaceduel/ai.cpp b/kspaceduel/ai.cpp
index 828c5e35..25989ae5 100644
--- a/kspaceduel/ai.cpp
+++ b/kspaceduel/ai.cpp
@@ -523,7 +523,7 @@ void Ai::shotScores()
 void Ai::chooseAction()
 {
    double bestScore=1e10;
-   Shot *bestShot=NULL,*s;
+   Shot *bestShot=nullptr,*s;
    AiSprite actualpos;
    double posangle,movephi,phiright,phileft,torotate=0,velangle;
    int framesleft,framesright;
diff --git a/ktron/tron.cpp b/ktron/tron.cpp
index c76cef5c..878e93fa 100644
--- a/ktron/tron.cpp
+++ b/ktron/tron.cpp
@@ -85,7 +85,7 @@ void Tron::loadSettings(){
   }
 
   // Backgroundimage
-  setBackgroundPix(NULL);
+  setBackgroundPix(nullptr);
   if(Settings::backgroundImageChoice()){
     KURL url ( Settings::backgroundImage() );
     if(!url.isEmpty()){
@@ -101,7 +101,7 @@ void Tron::loadSettings(){
       }
       TDEIO::NetAccess::removeTempFile(tmpFile);
     }
-    else setBackgroundPix(NULL);
+    else setBackgroundPix(nullptr);
   }
   setComputerplayer(One, Settings::computerplayer1());
   setComputerplayer(Two, Settings::computerplayer2());
diff --git a/libtdegames/kcarddialog.h b/libtdegames/kcarddialog.h
index c48c51d0..ea14f310 100644
--- a/libtdegames/kcarddialog.h
+++ b/libtdegames/kcarddialog.h
@@ -108,7 +108,7 @@ public:
    * @param name The name of the dialog.
    * @param flags Specifies whether the dialog is modal or not.
    */
-   KCardDialog (TQWidget* parent = NULL,const char* name = NULL,
+   KCardDialog (TQWidget* parent = nullptr,const char* name = nullptr,
                 CardFlags flags = Both);
    /**
    * Destructs a card deck selection dialog.
diff --git a/lskat/lskat/lskatdoc.cpp b/lskat/lskat/lskatdoc.cpp
index 24dece6e..7e9c5056 100644
--- a/lskat/lskat/lskatdoc.cpp
+++ b/lskat/lskat/lskatdoc.cpp
@@ -368,7 +368,7 @@ int r;
 
 void LSkatDoc::initrandom()
 {
-  srand( (unsigned)time( NULL ) ); // randomize
+  srand( (unsigned)time( nullptr ) ); // randomize
 }
 
 bool LSkatDoc::IsRunning() {return isrunning;}
diff --git a/lskat/lskat/msgdlg.h b/lskat/lskat/msgdlg.h
index 9c1e0440..c945d003 100644
--- a/lskat/lskat/msgdlg.h
+++ b/lskat/lskat/msgdlg.h
@@ -26,7 +26,7 @@ class MsgDlg : public TQDialog
   
 
   public:
-   MsgDlg (TQWidget* parent = NULL,const char* name = NULL,const char *sufi=NULL);
+   MsgDlg (TQWidget* parent = nullptr,const char* name = nullptr,const char *sufi=nullptr);
    TQString GetMsg();
 
 protected slots:
diff --git a/lskat/lskat/networkdlg.h b/lskat/lskat/networkdlg.h
index 7fb07215..a419f860 100644
--- a/lskat/lskat/networkdlg.h
+++ b/lskat/lskat/networkdlg.h
@@ -28,7 +28,7 @@ class NetworkDlg : public NetworkDlgBase
   
    
    public:
-    NetworkDlg(TQWidget* parent=NULL, const char* name=NULL);
+    NetworkDlg(TQWidget* parent=nullptr, const char* name=nullptr);
     ~NetworkDlg();
     void SetName(const TQString& name);
     void SetHost(const TQString& host);
diff --git a/lskat/lskatproc/lskatproc.cpp b/lskat/lskatproc/lskatproc.cpp
index 7f40bd69..0791fb31 100644
--- a/lskat/lskatproc/lskatproc.cpp
+++ b/lskat/lskatproc/lskatproc.cpp
@@ -488,7 +488,7 @@ int r;
 
 void lskatproc::initrandom()
 {
-	srand( (unsigned)time( NULL ) ); // randomize
+	srand( (unsigned)time( nullptr ) ); // randomize
 }
 
 
diff --git a/tdefifteen/src/gameboard.cpp b/tdefifteen/src/gameboard.cpp
index d3f9d6de..b82271b0 100644
--- a/tdefifteen/src/gameboard.cpp
+++ b/tdefifteen/src/gameboard.cpp
@@ -68,7 +68,7 @@ GameBoard::~GameBoard()
 	int	i;
 
 	for (i = 0; i < 16; ++i)
-		if (map[i] != NULL)
+		if (map[i])
 			delete map[i];
 
 	delete tmr;
@@ -101,7 +101,7 @@ GameBoard::initMap()
     }
 
 	for (i = 0; i < num; ++i) {
-		if (map[i] != NULL)
+		if (map[i])
 			delete map[i];
 		map[i] = new BoardItem(i, this);
 		map[i]->setFont(fnt);
@@ -117,9 +117,9 @@ GameBoard::initMap()
 			map[i]->setPixmap(xpm1);
 		}
 	}
-	if (map[num] != NULL)
+	if (map[num])
 		delete map[num];
-	map[num] = NULL;
+	map[num] = nullptr;
 }
 
 
@@ -132,7 +132,7 @@ GameBoard::mousePressEvent(TQMouseEvent *e)
 	
 	i = index(x, y);
 	if (mayMove(i) && (n == -1)) {
-		for (it = 0; (it < 16) && (map[it] != NULL); ++it);
+		for (it = 0; it < 16 && map[it]; ++it);
 		startMoving(i, it);
 	}
 }
@@ -146,61 +146,46 @@ GameBoard::mayMove(int n)
 	if ((n >= 0) && (n < 16)) {
 		switch (n) {
 			case 0:
-				res =	(map[n + 1] == NULL) ||
-					(map[n + 4] == NULL);
+				res = !map[n + 1] || !map[n + 4];
 				break;
 
 			case 1:
 			case 2:
-				res =	(map[n - 1] == NULL) ||
-					(map[n + 1] == NULL) ||
-					(map[n + 4] == NULL);
+				res = !map[n - 1] || !map[n + 1] || !map[n + 4];
 				break;
 
 			case 3:
-				res =	(map[n - 1] == NULL) ||
-					(map[n + 4] == NULL);
+				res = !map[n - 1] || !map[n + 4];
 				break;
 
 			case 4:
 			case 8:
-				res =	(map[n + 1] == NULL) ||
-					(map[n - 4] == NULL) ||
-					(map[n + 4] == NULL);
+				res = !map[n + 1] || !map[n - 4] || !map[n + 4];
 				break;
 
 			case 5:
 			case 6:
 			case 9:
 			case 10:
-				res =	(map[n - 1] == NULL) ||
-					(map[n + 1] == NULL) ||
-					(map[n - 4] == NULL) ||
-					(map[n + 4] == NULL);
+				res = !map[n - 1] || !map[n + 1] || !map[n - 4] || !map[n + 4];
 				break;
 
 			case 7:
 			case 11:
-				res =	(map[n - 1] == NULL) ||
-					(map[n - 4] == NULL) ||
-					(map[n + 4] == NULL);
+				res = !map[n - 1] || !map[n - 4] || !map[n + 4];
 				break;
 
 			case 12:
-				res =	(map[n + 1] == NULL) ||
-					(map[n - 4] == NULL);
+				res = !map[n + 1] || !map[n - 4];
 				break;
 
 			case 13:
 			case 14:
-				res =	(map[n - 1] == NULL) ||
-					(map[n + 1] == NULL) ||
-					(map[n - 4] == NULL);
+				res = !map[n - 1] || !map[n + 1] || !map[n - 4];
 				break;
 
 			case 15:
-				res =	(map[n - 1] == NULL) ||
-					(map[n - 4] == NULL);
+				res = !map[n - 1] || !map[n - 4];
 				break;
 		}
 	}
@@ -215,9 +200,9 @@ GameBoard::index(int x, int y)
 	int	ndx = -1,
 		i, x1, y1;
 
-	if ((map[0] != NULL) || (map[1] != NULL)) {
+	if (map[0] || map[1]) {
 		for (i = 0; i < 16; ++i) {
-			if (map[i] != NULL) {
+			if (map[i]) {
 				x1 = map[i]->x();
 				y1 = map[i]->y();
 				if ((x >= x1) && (y >= y1) &&
@@ -268,7 +253,7 @@ GameBoard::moveItem()
 {
 	int	x, y, stp, a;
 
-	if ((n != -1) && (nt != -1) && (map[n] != NULL)) {
+	if (n != -1 && nt != -1 && map[n]) {
 		x = map[n]->x();
 		y = map[n]->y();
 		stp = 0;
@@ -292,7 +277,7 @@ GameBoard::moveItem()
 		map[n]->move(x, y);
 		if (stp) {
 			map[nt] = map[n];
-			map[n] = NULL;
+			map[n] = nullptr;
 			nt = n = -1;
 			xt = yt = -1;
 			dx = dy = 0;
@@ -326,7 +311,7 @@ GameBoard::checkEndGame()
 	TQString	txt;
 
 	for (n = i = 0; i < 15; ++i)
-		if ((map[i] != NULL) && (map[i]->item() == i))
+		if (map[i] && map[i]->item() == i)
 			n++;
 	if (n == 15) {
 		txt = tr("Game Over");
@@ -370,7 +355,7 @@ GameBoard::newTask()
 	}
 
 	for (i = 0; i < 16; ++i)
-		if (map[i] != NULL) {
+		if (map[i]) {
 			y = (i >> 2);
 			x = i - (y << 2);
 			map[i]->move(x * map[i]->width(), y * map[i]->height());
@@ -385,7 +370,7 @@ GameBoard::loadImage()
 	TQString	str;
 	TQPixmap	img;
 
-	str = TQFileDialog::getOpenFileName(TQString::null, "*", this, NULL,
+	str = TQFileDialog::getOpenFileName(TQString::null, "*", this, nullptr,
 		tr("Open an image..."));
 
 	if (!str.isEmpty()) {
diff --git a/tdefifteen/src/gameboard.h b/tdefifteen/src/gameboard.h
index 5b00131c..f116df37 100644
--- a/tdefifteen/src/gameboard.h
+++ b/tdefifteen/src/gameboard.h
@@ -16,7 +16,7 @@ class BoardItem:public TQLabel
 {
 public:
 
-	BoardItem(int, TQWidget *parent = NULL, const char *name = NULL);
+	BoardItem(int, TQWidget *parent = nullptr, const char *name = nullptr);
 	~BoardItem();
 
 	int	item()const{return (num);}
@@ -35,7 +35,7 @@ class GameBoard:public TQWidget
 	TQ_OBJECT
 public:
 
-	GameBoard(TQWidget *parent = NULL, const char *name = NULL);
+	GameBoard(TQWidget *parent = nullptr, const char *name = nullptr);
 	~GameBoard();
 
 	void	newGame();
-- 
cgit v1.2.3

