From 9d1a95370186cb7b9c5877b3049c164ca25e8aca Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Wed, 7 Oct 2026 07:10:04 -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>
---
 include/KeyWords.h     |  2 +-
 src/CallTip.cpp        |  4 ++--
 src/CellBuffer.cpp     |  6 +++---
 src/Editor.cpp         | 12 ++++++------
 src/ExternalLexer.cpp  | 34 +++++++++++++++++-----------------
 src/KeyWords.cpp       |  2 +-
 src/LexAda.cpp         |  2 +-
 src/LexBash.cpp        |  2 +-
 src/LexCLW.cpp         | 12 ++++++------
 src/LexHTML.cpp        |  4 ++--
 src/LexOpal.cpp        |  2 +-
 src/LexPerl.cpp        |  4 ++--
 src/LexPython.cpp      | 10 +++++-----
 src/LexRuby.cpp        | 10 +++++-----
 src/LexSmalltalk.cpp   |  2 +-
 src/LexSpice.cpp       |  2 +-
 src/LexYAML.cpp        | 12 ++++++------
 src/LineMarker.h       |  6 +++---
 src/PropSet.cpp        | 30 +++++++++++++++---------------
 src/ViewStyle.cpp      |  2 +-
 src/XPM.cpp            |  8 ++++----
 tqt/SciListBox.cpp     |  7 ++++---
 tqt/tqextscintilla.cpp |  6 +++---
 23 files changed, 91 insertions(+), 90 deletions(-)

diff --git a/include/KeyWords.h b/include/KeyWords.h
index 059ac0d..08dcca6 100644
--- a/include/KeyWords.h
+++ b/include/KeyWords.h
@@ -31,7 +31,7 @@ public:
 		LexerFunction fnLexer_, 
 		const char *languageName_=0, 
 		LexerFunction fnFolder_=0,
-		const char * const wordListDescriptions_[] = NULL,
+		const char * const wordListDescriptions_[] = nullptr,
 		int styleBits_=5);
 	virtual ~LexerModule() {
 	}
diff --git a/src/CallTip.cpp b/src/CallTip.cpp
index f4bc5f8..1012e46 100644
--- a/src/CallTip.cpp
+++ b/src/CallTip.cpp
@@ -172,7 +172,7 @@ int CallTip::PaintContents(Surface *surfaceWindow, bool draw) {
 	int maxWidth = 0;
 	while (moreChunks) {
 		char *chunkEnd = strchr(chunkVal, '\n');
-		if (chunkEnd == NULL) {
+		if (!chunkEnd) {
 			chunkEnd = chunkVal + strlen(chunkVal);
 			moreChunks = false;
 		}
@@ -267,7 +267,7 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
 	rectDown = PRectangle(0,0,0,0);
 	offsetMain = insetX;            // changed to right edge of any arrows
 	int width = PaintContents(surfaceMeasure, false) + insetX;
-	while ((newline = strchr(look, '\n')) != NULL) {
+	while (newline = strchr(look, '\n')) {
 		look = newline + 1;
 		numLines++;
 	}
diff --git a/src/CellBuffer.cpp b/src/CellBuffer.cpp
index 1109a17..1fbbdf8 100644
--- a/src/CellBuffer.cpp
+++ b/src/CellBuffer.cpp
@@ -301,12 +301,12 @@ int LineVector::AddMark(int line, int markerNum) {
 }
 
 void LineVector::MergeMarkers(int pos) {
-	if (linesData[pos + 1].handleSet != NULL) {
-		if (linesData[pos].handleSet == NULL )
+	if (linesData[pos + 1].handleSet) {
+		if (!linesData[pos].handleSet )
 			linesData[pos].handleSet = new MarkerHandleSet;
 		linesData[pos].handleSet->CombineWith(linesData[pos + 1].handleSet);
 		delete linesData[pos + 1].handleSet;
-		linesData[pos + 1].handleSet = NULL;
+		linesData[pos + 1].handleSet = nullptr;
 	}
 }
 
diff --git a/src/Editor.cpp b/src/Editor.cpp
index 132b03f..1b577bb 100644
--- a/src/Editor.cpp
+++ b/src/Editor.cpp
@@ -199,7 +199,7 @@ LineLayoutCache::~LineLayoutCache() {
 }
 
 void LineLayoutCache::Allocate(int length_) {
-	PLATFORM_ASSERT(cache == NULL);
+	PLATFORM_ASSERT(!cache);
 	allInvalidated = false;
 	length = length_;
 	size = length;
@@ -236,7 +236,7 @@ void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) {
 		length = lengthForLevel;
 	}
 	PLATFORM_ASSERT(length == lengthForLevel);
-	PLATFORM_ASSERT(cache != NULL || length == 0);
+	PLATFORM_ASSERT(cache || length == 0);
 }
 
 void LineLayoutCache::Deallocate() {
@@ -5314,7 +5314,7 @@ void Editor::ButtonMove(Point pt) {
 		EnsureCaretVisible(false, false, true);
 
 		if (hsStart != -1 && !PositionIsHotspot(movePos))
-			SetHotSpotRange(NULL);
+			SetHotSpotRange(nullptr);
 
 	} else {
 		if (vs.fixedColumnWidth > 0) {	// There is a margin
@@ -5331,7 +5331,7 @@ void Editor::ButtonMove(Point pt) {
 			SetHotSpotRange(&pt);
 		} else {
 			DisplayCursor(Window::cursorText);
-			SetHotSpotRange(NULL);
+			SetHotSpotRange(nullptr);
 		}
 	}
 }
@@ -5343,7 +5343,7 @@ void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
 			DisplayCursor(Window::cursorReverseArrow);
 		} else {
 			DisplayCursor(Window::cursorText);
-			SetHotSpotRange(NULL);
+			SetHotSpotRange(nullptr);
 		}
 		ptMouseLast = pt;
 		SetMouseCapture(false);
@@ -5510,7 +5510,7 @@ void Editor::SetDocPointer(Document *document) {
 	//Platform::DebugPrintf("** %x setdoc to %x\n", pdoc, document);
 	pdoc->RemoveWatcher(this, 0);
 	pdoc->Release();
-	if (document == NULL) {
+	if (!document) {
 		pdoc = new Document();
 	} else {
 		pdoc = document;
diff --git a/src/ExternalLexer.cpp b/src/ExternalLexer.cpp
index acf45bc..27846c8 100644
--- a/src/ExternalLexer.cpp
+++ b/src/ExternalLexer.cpp
@@ -21,7 +21,7 @@
 #include "KeyWords.h"
 #include "ExternalLexer.h"
 
-LexerManager *LexerManager::theInstance = NULL;
+LexerManager *LexerManager::theInstance = nullptr;
 
 //------------------------------------------
 //
@@ -110,8 +110,8 @@ void ExternalLexerModule::SetExternal(ExtLexerFunction fLexer, ExtFoldFunction f
 
 LexerLibrary::LexerLibrary(const char* ModuleName) {
 	// Initialise some members...
-	first = NULL;
-	last = NULL;
+	first = nullptr;
+	last = nullptr;
 
 	// Load the DLL
 	lib = DynamicLibrary::Load(ModuleName);
@@ -137,13 +137,13 @@ LexerLibrary::LexerLibrary(const char* ModuleName) {
 
 			for (int i = 0; i < nl; i++) {
 				GetLexerName(i, lexname, 100);
-				lex = new ExternalLexerModule(SCLEX_AUTOMATIC, NULL, lexname, NULL);
+				lex = new ExternalLexerModule(SCLEX_AUTOMATIC, nullptr, lexname, nullptr);
 
 				// Create a LexerMinder so we don't leak the ExternalLexerModule...
 				lm = new LexerMinder;
 				lm->self = lex;
-				lm->next = NULL;
-				if (first != NULL) {
+				lm->next = nullptr;
+				if (first) {
 					last->next = lm;
 					last = lm;
 				} else {
@@ -157,7 +157,7 @@ LexerLibrary::LexerLibrary(const char* ModuleName) {
 			}
 		}
 	}
-	next = NULL;
+	next = nullptr;
 }
 
 LexerLibrary::~LexerLibrary() {
@@ -170,15 +170,15 @@ void LexerLibrary::Release() {
 	LexerMinder *lm;
 	LexerMinder *next;
 	lm = first;
-	while (NULL != lm) {
+	while (lm) {
 		next = lm->next;
 		delete lm->self;
 		delete lm;
 		lm = next;
 	}
 
-	first = NULL;
-	last = NULL;
+	first = nullptr;
+	last = nullptr;
 }
 
 //------------------------------------------
@@ -199,14 +199,14 @@ void LexerManager::DeleteInstance()
 {
 	if(theInstance) {
 		delete theInstance;
-		theInstance = NULL;
+		theInstance = nullptr;
 	}
 }
 
 /// protected constructor - this is a singleton...
 LexerManager::LexerManager() {
-	first = NULL;
-	last = NULL;
+	first = nullptr;
+	last = nullptr;
 }
 
 LexerManager::~LexerManager() {
@@ -221,7 +221,7 @@ void LexerManager::Load(const char* path)
 void LexerManager::LoadLexerLibrary(const char* module)
 {
 	LexerLibrary *lib = new LexerLibrary(module);
-	if (NULL != first) {
+	if (first) {
 		last->next = lib;
 		last = lib;
 	} else {
@@ -232,7 +232,7 @@ void LexerManager::LoadLexerLibrary(const char* module)
 
 void LexerManager::Clear()
 {
-	if (NULL != first) {
+	if (first) {
 		LexerLibrary *cur = first;
 		LexerLibrary *next;
 		while (cur) {
@@ -240,8 +240,8 @@ void LexerManager::Clear()
 			delete cur;
 			cur = next;
 		}
-		first = NULL;
-		last = NULL;
+		first = nullptr;
+		last = nullptr;
 	}
 }
 
diff --git a/src/KeyWords.cpp b/src/KeyWords.cpp
index f82eb7d..d82942e 100644
--- a/src/KeyWords.cpp
+++ b/src/KeyWords.cpp
@@ -43,7 +43,7 @@ LexerModule::LexerModule(int language_,
 }
 
 int LexerModule::GetNumWordLists() const {
-	if (wordListDescriptions == NULL) {
+	if (!wordListDescriptions) {
 		return -1;
 	} else {
 		int numWordLists = 0;
diff --git a/src/LexAda.cpp b/src/LexAda.cpp
index 0227ce1..5f279b6 100644
--- a/src/LexAda.cpp
+++ b/src/LexAda.cpp
@@ -35,7 +35,7 @@ static const char * const adaWordListDesc[] = {
 	0
 };
 
-LexerModule lmAda(SCLEX_ADA, ColouriseDocument, "ada", NULL, adaWordListDesc);
+LexerModule lmAda(SCLEX_ADA, ColouriseDocument, "ada", nullptr, adaWordListDesc);
 
 /*
  * Implementation
diff --git a/src/LexBash.cpp b/src/LexBash.cpp
index e9c31d6..efce9ee 100644
--- a/src/LexBash.cpp
+++ b/src/LexBash.cpp
@@ -51,7 +51,7 @@ static bool isSingleCharOp(char ch) {
 	char strCharSet[2];
 	strCharSet[0] = ch;
 	strCharSet[1] = '\0';
-	return (NULL != strstr("rwxoRWXOezsfdlpSbctugkTBMACahGLNn", strCharSet));
+	return (nullptr != strstr("rwxoRWXOezsfdlpSbctugkTBMACahGLNn", strCharSet));
 }
 
 static inline bool isBashOperator(char ch) {
diff --git a/src/LexCLW.cpp b/src/LexCLW.cpp
index e28e4b1..a6bd909 100644
--- a/src/LexCLW.cpp
+++ b/src/LexCLW.cpp
@@ -70,13 +70,13 @@ inline bool IsAHexCharacter(const int iChar, bool bCaseSensitive) {
 
 	// Case insensitive.
 	if (!bCaseSensitive) {
-		if (strchr("ABCDEFabcdef", iChar) != NULL) {
+		if (strchr("ABCDEFabcdef", iChar)) {
 			return(true);
 		}
 	}
 	// Case sensitive
 	else {
-		if (strchr("ABCDEF", iChar) != NULL) {
+		if (strchr("ABCDEF", iChar)) {
 			return(true);
 		}
 	}
@@ -89,14 +89,14 @@ inline bool IsANumericBaseCharacter(const int iChar, bool bCaseSensitive) {
 	// Case insensitive.
 	if (!bCaseSensitive) {
 		// If character is a numeric base character
-		if (strchr("BOHboh", iChar) != NULL) {
+		if (strchr("BOHboh", iChar)) {
 			return(true);
 		}
 	}
 	// Case sensitive
 	else {
 		// If character is a numeric base character
-		if (strchr("BOH", iChar) != NULL) {
+		if (strchr("BOH", iChar)) {
 			return(true);
 		}
 	}
@@ -492,7 +492,7 @@ static void ColouriseClarionDoc(unsigned int uiStartPos, int iLength, int iInitS
 					// Case insensitive.
 					if (!bCaseSensitive) {
 						// If character is a valid picture token character
-						if (strchr("DEKNPSTdeknpst", scDoc.chNext) != NULL) {
+						if (strchr("DEKNPSTdeknpst", scDoc.chNext)) {
 							// Set to the picture string state
 							scDoc.SetState(SCE_CLW_PICTURE_STRING);
 						}
@@ -500,7 +500,7 @@ static void ColouriseClarionDoc(unsigned int uiStartPos, int iLength, int iInitS
 					// Case sensitive
 					else {
 						// If character is a valid picture token character
-						if (strchr("DEKNPST", scDoc.chNext) != NULL) {
+						if (strchr("DEKNPST", scDoc.chNext)) {
 							// Set the picture string state
 							scDoc.SetState(SCE_CLW_PICTURE_STRING);
 						}
diff --git a/src/LexHTML.cpp b/src/LexHTML.cpp
index dad8fce..1070db3 100644
--- a/src/LexHTML.cpp
+++ b/src/LexHTML.cpp
@@ -240,7 +240,7 @@ static int classifyTagHTML(unsigned int start, unsigned int end,
 
 	//...to find it in the list of no-container-tags
 	// (There are many more. We will need a keywordlist in the property file for this)
-	tagDontFold = (NULL != strstr("meta link img area br hr input ",s));
+	tagDontFold = (nullptr != strstr("meta link img area br hr input ",s));
 
 	//now we can remove the trailing space
 	s[i] = '\0';
@@ -1557,7 +1557,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
 		case SCE_HPHP_NUMBER:
 			// recognize bases 8,10 or 16 integers OR floating-point numbers
 			if (!IsADigit(ch)
-				&& strchr(".xXabcdefABCDEF", ch) == NULL
+				&& !strchr(".xXabcdefABCDEF", ch)
 				&& ((ch != '-' && ch != '+') || (chPrev != 'e' && chPrev != 'E'))) {
 				styler.ColourTo(i - 1, SCE_HPHP_NUMBER);
 				if (isoperator(ch))
diff --git a/src/LexOpal.cpp b/src/LexOpal.cpp
index d1d1889..b2ccfb7 100644
--- a/src/LexOpal.cpp
+++ b/src/LexOpal.cpp
@@ -515,4 +515,4 @@ static const char * const opalWordListDesc[] = {
 	0
 };
 
-LexerModule lmOpal(SCLEX_OPAL, ColouriseOpalDoc, "opal", NULL, opalWordListDesc);
+LexerModule lmOpal(SCLEX_OPAL, ColouriseOpalDoc, "opal", nullptr, opalWordListDesc);
diff --git a/src/LexPerl.cpp b/src/LexPerl.cpp
index 4a42bc2..6e2bd57 100644
--- a/src/LexPerl.cpp
+++ b/src/LexPerl.cpp
@@ -43,7 +43,7 @@ static bool isSingleCharOp(char ch) {
 	char strCharSet[2];
 	strCharSet[0] = ch;
 	strCharSet[1] = '\0';
-	return (NULL != strstr("rwxoRWXOezsfdlpSbctugkTBMAC", strCharSet));
+	return (nullptr != strstr("rwxoRWXOezsfdlpSbctugkTBMAC", strCharSet));
 }
 
 static inline bool isPerlOperator(char ch) {
@@ -525,7 +525,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
                     ch = styler.SafeGetCharAt(i);
                     chNext = styler.SafeGetCharAt(i + 1);
 				} else if (!isascii(chNext) || isalpha(chNext) || chNext == '_'
-                        || NULL != strstr("^/|,\\\";#%^:?<>)[]", strch)) {
+                        || strstr("^/|,\\\";#%^:?<>)[]", strch)) {
 					state = SCE_PL_SYMBOLTABLE;
                     i++;
                     ch = chNext;
diff --git a/src/LexPython.cpp b/src/LexPython.cpp
index 1bdebf6..ace15a7 100644
--- a/src/LexPython.cpp
+++ b/src/LexPython.cpp
@@ -318,10 +318,10 @@ static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unuse
 	// at least one line in all cases)
 	int spaceFlags = 0;
 	int lineCurrent = styler.GetLine(startPos);
-	int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+	int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, nullptr);
 	while (lineCurrent > 0) {
 		lineCurrent--;
-		indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+		indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, nullptr);
 		if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG) &&
 		        (!IsCommentLine(lineCurrent, styler)) &&
 		        (!IsQuoteLine(lineCurrent, styler)))
@@ -351,7 +351,7 @@ static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unuse
 		int quote = false;
 		if (lineNext <= docLines) {
 			// Information about next line is only available if not at end of document
-			indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL);
+			indentNext = styler.IndentAmount(lineNext, &spaceFlags, nullptr);
 			int style = styler.StyleAt(styler.LineStart(lineNext)) & 31;
 			quote = foldQuotes && ((style == SCE_P_TRIPLE) || (style == SCE_P_TRIPLEDOUBLE));
 		}
@@ -393,7 +393,7 @@ static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unuse
 		         (lineNext <= docLines && IsCommentLine(lineNext, styler)))) {
 
 			lineNext++;
-			indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL);
+			indentNext = styler.IndentAmount(lineNext, &spaceFlags, nullptr);
 		}
 
 		const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK;
@@ -408,7 +408,7 @@ static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unuse
 		int skipLevel = levelAfterComments;
 
 		while (--skipLine > lineCurrent) {
-			int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL);
+			int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, nullptr);
 
 			if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments)
 				skipLevel = levelBeforeComments;
diff --git a/src/LexRuby.cpp b/src/LexRuby.cpp
index f5ad020..bca2a88 100644
--- a/src/LexRuby.cpp
+++ b/src/LexRuby.cpp
@@ -243,7 +243,7 @@ static bool isEmptyLine(int pos,
                         Accessor &styler) {
 	int spaceFlags = 0;
 	int lineCurrent = styler.GetLine(pos);
-	int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+	int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, nullptr);
     return (indentCurrent & SC_FOLDLEVELWHITEFLAG) != 0;
 }
 
@@ -877,7 +877,7 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle,
                 if (strchr(q_chars, chNext) && !isSafeWordcharOrHigh(chNext2)) {
                     Quote.New();
                     const char *hit = strchr(q_chars, chNext);
-                    if (hit != NULL) {
+                    if (hit) {
                         state = q_states[hit - q_chars];
                         Quote.Open(chNext2);
                         i += 2;
@@ -909,7 +909,7 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle,
                 // we aren't ending an object exp'n, and ops
                 // like : << / are unary operators.
                 
-                preferRE = (strchr(")}].", ch) == NULL);
+                preferRE = (strchr(")}].", ch) == nullptr);
                 // Stay in default state
             } else if (isEOLChar(ch)) {
                 // Make sure it's a true line-end, with no backslash
@@ -931,7 +931,7 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle,
                 if (ch == '='
                     && isSafeWordcharOrHigh(chPrev)
                     && (chNext == '('
-                        || strchr(" \t\n\r", chNext) != NULL)
+                        || strchr(" \t\n\r", chNext))
                     && (!strcmp(prevWord, "def")
                         || followsDot(styler.GetStartSegment(), styler))) {
                     // <name>= is a name only when being def'd -- Get it the next time
@@ -1125,7 +1125,7 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle,
             }
         } else if (state == SCE_RB_POD) {
             // PODs end with ^=end\s, -- any whitespace can follow =end
-            if (strchr(" \t\n\r", ch) != NULL
+            if (strchr(" \t\n\r", ch)
                 && i > 5
                 && isEOLChar(styler[i - 5])
                 && isMatch(styler, lengthDoc, i - 4, "=end")) {
diff --git a/src/LexSmalltalk.cpp b/src/LexSmalltalk.cpp
index 6f43ec3..8434edc 100644
--- a/src/LexSmalltalk.cpp
+++ b/src/LexSmalltalk.cpp
@@ -314,4 +314,4 @@ static const char* const smalltalkWordListDesc[] = {
     0
 };
 
-LexerModule lmSmalltalk(SCLEX_SMALLTALK, colorizeSmalltalkDoc, "smalltalk", NULL, smalltalkWordListDesc);
+LexerModule lmSmalltalk(SCLEX_SMALLTALK, colorizeSmalltalkDoc, "smalltalk", nullptr, smalltalkWordListDesc);
diff --git a/src/LexSpice.cpp b/src/LexSpice.cpp
index 8a1683f..6db68e9 100644
--- a/src/LexSpice.cpp
+++ b/src/LexSpice.cpp
@@ -37,7 +37,7 @@ static const char * const spiceWordListDesc[] = {
     0
 };
 
-LexerModule lmSpice(SCLEX_SPICE, ColouriseDocument, "spice", NULL, spiceWordListDesc);
+LexerModule lmSpice(SCLEX_SPICE, ColouriseDocument, "spice", nullptr, spiceWordListDesc);
 
 /*
  * Implementation
diff --git a/src/LexYAML.cpp b/src/LexYAML.cpp
index e3053f8..7b37cc2 100644
--- a/src/LexYAML.cpp
+++ b/src/LexYAML.cpp
@@ -31,7 +31,7 @@ static inline bool AtEOL(Accessor &styler, unsigned int i) {
 }
 
 static unsigned int SpaceCount(char* lineBuffer) {
-	if (lineBuffer == NULL)
+	if (!lineBuffer)
 		return 0;
 	
 	char* headBuffer = lineBuffer;
@@ -202,10 +202,10 @@ static void FoldYAMLDoc(unsigned int startPos, int length, int /*initStyle - unu
 	// at least one line in all cases)
 	int spaceFlags = 0;
 	int lineCurrent = styler.GetLine(startPos);
-	int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+	int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, nullptr);
 	while (lineCurrent > 0) {
 		lineCurrent--;
-		indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+		indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, nullptr);
 		if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG) &&
 		        (!IsCommentLine(lineCurrent, styler)))
 			break;
@@ -228,7 +228,7 @@ static void FoldYAMLDoc(unsigned int startPos, int length, int /*initStyle - unu
 		int indentNext = indentCurrent;
 		if (lineNext <= docLines) {
 			// Information about next line is only available if not at end of document
-			indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL);
+			indentNext = styler.IndentAmount(lineNext, &spaceFlags, nullptr);
 	}
 		const int comment = foldComment && IsCommentLine(lineCurrent, styler);
 		const int comment_start = (comment && !prevComment && (lineNext <= docLines) &&
@@ -257,7 +257,7 @@ static void FoldYAMLDoc(unsigned int startPos, int length, int /*initStyle - unu
 		         (lineNext <= docLines && IsCommentLine(lineNext, styler)))) {
 
 			lineNext++;
-			indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL);
+			indentNext = styler.IndentAmount(lineNext, &spaceFlags, nullptr);
 		}
 
 		const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK;
@@ -272,7 +272,7 @@ static void FoldYAMLDoc(unsigned int startPos, int length, int /*initStyle - unu
 		int skipLevel = levelAfterComments;
 
 		while (--skipLine > lineCurrent) {
-			int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL);
+			int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, nullptr);
 
 			if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments)
 				skipLevel = levelBeforeComments;
diff --git a/src/LineMarker.h b/src/LineMarker.h
index 8ebdce4..66e79d1 100644
--- a/src/LineMarker.h
+++ b/src/LineMarker.h
@@ -22,7 +22,7 @@ public:
 		fore = ColourDesired(0,0,0);
 		back = ColourDesired(0xff,0xff,0xff);
 		alpha = SC_ALPHA_NOALPHA;
-		pxpm = NULL;
+		pxpm = nullptr;
 	}
 	LineMarker(const LineMarker &) {
 		// Defined to avoid pxpm being blindly copied, not as real copy constructor
@@ -30,7 +30,7 @@ public:
 		fore = ColourDesired(0,0,0);
 		back = ColourDesired(0xff,0xff,0xff);
 		alpha = SC_ALPHA_NOALPHA;
-		pxpm = NULL;
+		pxpm = nullptr;
 	}
 	~LineMarker() {
 		delete pxpm;
@@ -42,7 +42,7 @@ public:
 		back = ColourDesired(0xff,0xff,0xff);
 		alpha = SC_ALPHA_NOALPHA;
 		delete pxpm;
-		pxpm = NULL;
+		pxpm = nullptr;
 		return *this;
 	}
 	void RefreshColourPalette(Palette &pal, bool want);
diff --git a/src/PropSet.cpp b/src/PropSet.cpp
index c563d2b..3c1e25d 100644
--- a/src/PropSet.cpp
+++ b/src/PropSet.cpp
@@ -133,17 +133,17 @@ SString &SString::assign(const char *sOther, lenpos_t sSize_) {
 }
 
 bool SString::operator==(const SString &sOther) const {
-	if ((s == 0) && (sOther.s == 0))
+	if (!s && !sOther.s)
 		return true;
-	if ((s == 0) || (sOther.s == 0))
+	if (!s || !sOther.s)
 		return false;
 	return strcmp(s, sOther.s) == 0;
 }
 
 bool SString::operator==(const char *sOther) const {
-	if ((s == 0) && (sOther == 0))
+	if (!s && !sOther)
 		return true;
-	if ((s == 0) || (sOther == 0))
+	if (!s || !sOther)
 		return false;
 	return strcmp(s, sOther) == 0;
 }
@@ -391,7 +391,7 @@ void PropSet::Unset(const char *key, int lenKey) {
 	if (lenKey == -1)
 		lenKey = static_cast<int>(strlen(key));
 	unsigned int hash = HashString(key, lenKey);
-	Property *pPrev = NULL;
+	Property *pPrev = nullptr;
 	for (Property *p = props[hash % hashRoots]; p; p = p->next) {
 		if ((hash == p->hash) &&
 			((strlen(p->key) == static_cast<unsigned int>(lenKey)) &&
@@ -458,7 +458,7 @@ bool PropSet::IncludesVar(const char *value, const char *key) {
 // for that, through a recursive function and a simple chain of pointers.
 
 struct VarChain {
-	VarChain(const char*var_=NULL, const VarChain *link_=NULL): var(var_), link(link_) {}
+	VarChain(const char*var_=nullptr, const VarChain *link_=nullptr): var(var_), link(link_) {}
 
 	bool contains(const char *testVar) const {
 		return (var && (0 == strcmp(var, testVar)))
@@ -563,7 +563,7 @@ SString PropSet::GetWild(const char *keybase, const char *filename) {
 		for (Property *p = props[root]; p; p = p->next) {
 			if (isprefix(p->key, keybase)) {
 				char * orgkeyfile = p->key + strlen(keybase);
-				char *keyfile = NULL;
+				char *keyfile = nullptr;
 
 				if (strstr(orgkeyfile, "$(") == orgkeyfile) {
 					char *cpendvar = strchr(orgkeyfile, ')');
@@ -576,12 +576,12 @@ SString PropSet::GetWild(const char *keybase, const char *filename) {
 				}
 				char *keyptr = keyfile;
 
-				if (keyfile == NULL)
+				if (!keyfile)
 					keyfile = orgkeyfile;
 
 				for (;;) {
 					char *del = strchr(keyfile, ';');
-					if (del == NULL)
+					if (!del)
 						del = keyfile + strlen(keyfile);
 					char delchr = *del;
 					*del = '\0';
@@ -968,7 +968,7 @@ const char *WordList::GetNearestWord(const char *wordStart, int searchLen, bool
 	const char *word; // api array element just being compared
 
 	if (0 == words)
-		return NULL;
+		return nullptr;
 	if (ignoreCase) {
 		if (!sortedNoCase) {
 			sortedNoCase = true;
@@ -999,7 +999,7 @@ const char *WordList::GetNearestWord(const char *wordStart, int searchLen, bool
 						wordIndex--;
 					}
 				}
-				return NULL;
+				return nullptr;
 			}
 			else if (cond > 0)
 				start = pivot + 1;
@@ -1038,7 +1038,7 @@ const char *WordList::GetNearestWord(const char *wordStart, int searchLen, bool
 					}
 					pivot++;
 				}
-				return NULL;
+				return nullptr;
 			}
 			else if (cond > 0)
 				start = pivot + 1;
@@ -1046,7 +1046,7 @@ const char *WordList::GetNearestWord(const char *wordStart, int searchLen, bool
 				end = pivot - 1;
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 /**
@@ -1100,7 +1100,7 @@ char *WordList::GetNearestWords(
 	int cond; // comparison result (in the sense of strcmp() result)
 
 	if (0 == words)
-		return NULL;
+		return nullptr;
 	if (ignoreCase) {
 		if (!sortedNoCase) {
 			sortedNoCase = true;
@@ -1166,5 +1166,5 @@ char *WordList::GetNearestWords(
 			}
 		}
 	}
-	return NULL;
+	return nullptr;
 }
diff --git a/src/ViewStyle.cpp b/src/ViewStyle.cpp
index b4da30a..1861a30 100644
--- a/src/ViewStyle.cpp
+++ b/src/ViewStyle.cpp
@@ -234,7 +234,7 @@ void ViewStyle::RefreshColourPalette(Palette &pal, bool want) {
 void ViewStyle::Refresh(Surface &surface) {
 	selbar.desired = Platform::Chrome();
 	selbarlight.desired = Platform::ChromeHighlight();
-	styles[STYLE_DEFAULT].Realise(surface, zoomLevel, NULL, extraFontFlag);
+	styles[STYLE_DEFAULT].Realise(surface, zoomLevel, nullptr, extraFontFlag);
 	maxAscent = styles[STYLE_DEFAULT].ascent;
 	maxDescent = styles[STYLE_DEFAULT].descent;
 	someStylesProtected = false;
diff --git a/src/XPM.cpp b/src/XPM.cpp
index 36dbd1c..e60f8fc 100644
--- a/src/XPM.cpp
+++ b/src/XPM.cpp
@@ -113,11 +113,11 @@ void XPM::Init(const char * const *linesForm) {
 	height = 1;
 	width = 1;
 	nColours = 1;
-	data = NULL;
+	data = nullptr;
 	codeTransparent = ' ';
-	codes = NULL;
-	colours = NULL;
-	lines = NULL;
+	codes = nullptr;
+	colours = nullptr;
+	lines = nullptr;
 	if (!linesForm)
 		return;
 
diff --git a/tqt/SciListBox.cpp b/tqt/SciListBox.cpp
index 414b65d..3910235 100644
--- a/tqt/SciListBox.cpp
+++ b/tqt/SciListBox.cpp
@@ -243,10 +243,11 @@ void ListBoxX::SetList(const char *list,char separator,char typesep)
 
 	Clear();
 
-	if ((words = strdup(list)) != NULL)
+	words = strdup(list);
+	if (words)
 	{
 		char *startword = words;
-		char *numword = NULL;
+		char *numword = nullptr;
 
 		for (int i = 0; words[i] != '\0'; i++)
 		{
@@ -260,7 +261,7 @@ void ListBoxX::SetList(const char *list,char separator,char typesep)
 				Append(startword,numword ? atoi(numword + 1) : -1);
 
 				startword = words + i + 1;
-				numword = NULL;
+				numword = nullptr;
 			}
 			else if (words[i] == typesep)
 			{
diff --git a/tqt/tqextscintilla.cpp b/tqt/tqextscintilla.cpp
index 66dfd71..b1be29a 100644
--- a/tqt/tqextscintilla.cpp
+++ b/tqt/tqextscintilla.cpp
@@ -219,7 +219,7 @@ void TQextScintilla::handleCharAdded(int ch)
     }
 
     // Handle call tips.
-    if (strchr("(),", ch) != NULL)
+    if (strchr("(),", ch))
         callTip();
 
     // Handle auto-indentation.
@@ -514,7 +514,7 @@ bool TQextScintilla::isAutoCStartChar(char ch) const
     if (!start_chars)
         start_chars = acStart;
 
-    return (strchr(start_chars, ch) != NULL);
+    return (strchr(start_chars, ch) != nullptr);
 }
 
 
@@ -2842,7 +2842,7 @@ bool TQextScintilla::isWordChar(char ch) const
     if (!word_chars)
         word_chars = defaultWordChars;
 
-    return (strchr(word_chars, ch) != NULL);
+    return (strchr(word_chars, ch) != nullptr);
 }
 
 
-- 
cgit v1.2.3

