From e70a3ac36ca3ea1e7ac7246df9b61edfaf97dc1b Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sat, 3 Oct 2026 08:32:29 -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>
---
 build.py                          |   2 +-
 configure.py                      |   2 +-
 sip/tqt/tqapplication.sip         |  28 ++++-----
 sip/tqt/tqbytearray.sip           |   4 +-
 sip/tqt/tqcstring.sip             |   4 +-
 sip/tqt/tqdatastream.sip          |   2 +-
 sip/tqt/tqdir.sip                 |  12 ++--
 sip/tqt/tqfile.sip                |   8 +--
 sip/tqt/tqfontmetrics.sip         |   2 +-
 sip/tqt/tqimage.sip               |  10 +--
 sip/tqt/tqiodevice.sip            |  12 ++--
 sip/tqt/tqkeysequence.sip         |   2 +-
 sip/tqt/tqlayout.sip              |   2 +-
 sip/tqt/tqlineedit.sip            |   2 +-
 sip/tqt/tqmemarray.sip            |  20 +++---
 sip/tqt/tqobject.sip              | 124 +++++++++++++++++++-------------------
 sip/tqt/tqobjectlist.sip          |  12 ++--
 sip/tqt/tqpainter.sip             |   6 +-
 sip/tqt/tqpair.sip                |   8 +--
 sip/tqt/tqpixmap.sip              |   2 +-
 sip/tqt/tqpointarray.sip          |  14 ++---
 sip/tqt/tqptrlist.sip             |  12 ++--
 sip/tqt/tqstring.sip              |  12 ++--
 sip/tqt/tqstrlist.sip             |  14 ++---
 sip/tqt/tqtabbar.sip              |   6 +-
 sip/tqt/tqvaluelist.sip           |  20 +++---
 sip/tqt/tqwidgetlist.sip          |  12 ++--
 sip/tqtcanvas/tqcanvas.sip        |  14 ++---
 sip/tqtext/tqextscintillabase.sip |  16 ++---
 sip/tqtgl/tqgl.sip                |   2 +-
 sip/tqtnetwork/tqdns.sip          |  30 ++++-----
 sip/tqtnetwork/tqftp.sip          |   4 +-
 sip/tqtnetwork/tqhttp.sip         |   4 +-
 sip/tqtnetwork/tqsocket.sip       |  12 ++--
 sip/tqtnetwork/tqsocketdevice.sip |   4 +-
 sip/tqtpe/tqpeapplication.sip     |  20 +++---
 sip/tqtsql/tqsqldatabase.sip      |   4 +-
 sip/tqtsql/tqsqlrecord.sip        |  10 +--
 sip/tqttable/tqtable.sip          |   2 +-
 39 files changed, 238 insertions(+), 238 deletions(-)

diff --git a/build.py b/build.py
index 7dbc820..9644550 100644
--- a/build.py
+++ b/build.py
@@ -314,7 +314,7 @@ int main(int argc,char **argv)
     FILE *fp;
     TQApplication app(argc,argv,0);
 
-    if ((fp = fopen("%s","w")) == NULL)
+    if (!(fp = fopen("%s","w")))
     {
         printf("Unable to create '%s'\\n");
         return 1;
diff --git a/configure.py b/configure.py
index c943fa6..708d845 100644
--- a/configure.py
+++ b/configure.py
@@ -679,7 +679,7 @@ int main(int argc,char **argv)
     FILE *fp;
     TQApplication app(argc,argv,0);
 
-    if ((fp = fopen("%s","w")) == NULL)
+    if (!(fp = fopen("%s","w")))
     {
         printf("Unable to create '%s'\\n");
         return 1;
diff --git a/sip/tqt/tqapplication.sip b/sip/tqt/tqapplication.sip
index 434d8b7..20ae838 100644
--- a/sip/tqt/tqapplication.sip
+++ b/sip/tqt/tqapplication.sip
@@ -88,7 +88,7 @@ public:
 		char **argv;
 
 		// Convert the list.
-		if ((argv = pyArgvToC(a0,argc)) == NULL)
+		if (!(argv = pyArgvToC(a0,argc)))
 			sipIsErr = 1;
 		else
 		{
@@ -114,7 +114,7 @@ public:
 		char **argv;
 
 		// Convert the list.
-		if ((argv = pyArgvToC(a0,argc)) == NULL)
+		if (!(argv = pyArgvToC(a0,argc)))
 			sipIsErr = 1;
 		else
 		{
@@ -146,7 +146,7 @@ public:
 		char **argv;
 
 		// Convert the list.
-		if ((argv = pyArgvToC(a0,argc)) == NULL)
+		if (!(argv = pyArgvToC(a0,argc)))
 			sipIsErr = 1;
 		else
 		{
@@ -190,8 +190,8 @@ public:
 		{
 			PyObject *sw;
 
-			if ((sw = sipGetWrapper(w,sipClass_TQWidget)) != NULL)
-				sipTransferTo(sw,NULL);
+			if ((sw = sipGetWrapper(w,sipClass_TQWidget)))
+				sipTransferTo(sw,nullptr);
 
 			++it;
 		}
@@ -206,7 +206,7 @@ public:
 
 		int argc = sipCpp -> argc();
 
-		if ((sipRes = PyList_New(argc)) == NULL)
+		if (!(sipRes = PyList_New(argc)))
 			sipIsErr = 1;
 		else
 			for (int a = 0; a < argc; ++a)
@@ -363,8 +363,8 @@ static char **pyArgvToC(PyObject *argvlist,int &argc)
 
 	// Allocate space for two copies of the argument pointers, plus the
 	// terminating NULL.
-	if ((argv = (char **)sipMalloc(2 * (argc + 1) * sizeof (char *))) == NULL)
-		return NULL;
+	if (!(argv = (char **)sipMalloc(2 * (argc + 1) * sizeof (char *))))
+		return nullptr;
 
 	// Convert the list.
 	for (int a = 0; a < argc; ++a)
@@ -382,13 +382,13 @@ static char **pyArgvToC(PyObject *argvlist,int &argc)
 		}
 		else
 		{
-			return NULL;
+			return nullptr;
 		}
 
 		argv[a] = argv[a + argc + 1] = arg;
 	}
 
-	argv[argc] = argv[argc + argc + 1] = NULL;
+	argv[argc] = argv[argc + argc + 1] = nullptr;
 
 	return argv;
 }
@@ -404,7 +404,7 @@ static void updatePyArgv(PyObject *argvlist,int argc,char **argv)
 		if (argv[na] == argv[a + argc + 1])
 			++na;
 		else
-			PyList_SetSlice(argvlist,na,na + 1,NULL);
+			PyList_SetSlice(argvlist,na,na + 1,nullptr);
 	}
 }
 %End
@@ -453,13 +453,13 @@ static void pytqtMsgHandler(TQtMsgType type, const char *msg)
 
 	Py_XDECREF(res);
 
-	if (res != NULL && res != Py_None)
+	if (res && res != Py_None)
 	{
 		PyErr_SetString(PyExc_TypeError, "invalid result type from PyTQt message handler");
-		res = NULL;
+		res = nullptr;
 	}
 
-	if (res == NULL)
+	if (!res)
 		PyErr_Print();
 
 	SIP_UNBLOCK_THREADS
diff --git a/sip/tqt/tqbytearray.sip b/sip/tqt/tqbytearray.sip
index de5407a..5053283 100644
--- a/sip/tqt/tqbytearray.sip
+++ b/sip/tqt/tqbytearray.sip
@@ -137,7 +137,7 @@ public:
 		{
 			Py_INCREF(Py_None);
 		}
-		else if (res == NULL)
+		else if (!res)
 		{
 			sipIsErr = 1;
 		}
@@ -186,7 +186,7 @@ public:
 %ConvertToTypeCode
 	// Allow a Python string whenever a TQByteArray is expected.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 		return (PyBytes_Check(sipPy) ||
 			PyUnicode_Check(sipPy) ||
 			sipCanConvertToInstance(sipPy,sipClass_TQByteArray,SIP_NO_CONVERTORS));
diff --git a/sip/tqt/tqcstring.sip b/sip/tqt/tqcstring.sip
index 19387ae..707d3a2 100644
--- a/sip/tqt/tqcstring.sip
+++ b/sip/tqt/tqcstring.sip
@@ -190,7 +190,7 @@ public:
 		s = *sipCpp;
 		Py_END_ALLOW_THREADS
 
-		if (s == NULL)
+		if (!s)
 			s = "";
  
 		sipRes = PyBytes_FromString(s);
@@ -199,7 +199,7 @@ public:
 %ConvertToTypeCode
 	// Allow a Python string whenever a TQCString is expected.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 		return (PyBytes_Check(sipPy) ||
 			sipCanConvertToInstance(sipPy,sipClass_TQCString,SIP_NO_CONVERTORS));
 
diff --git a/sip/tqt/tqdatastream.sip b/sip/tqt/tqdatastream.sip
index 8a1479b..406750c 100644
--- a/sip/tqt/tqdatastream.sip
+++ b/sip/tqt/tqdatastream.sip
@@ -114,7 +114,7 @@ public:
 %MethodCode
 		char *buf;
  
-		if ((buf = (char *)sipMalloc(a0)) == NULL)
+		if (!(buf = (char *)sipMalloc(a0)))
 			sipIsErr = 1;
 		else
 		{
diff --git a/sip/tqt/tqdir.sip b/sip/tqt/tqdir.sip
index 1f1186f..2a16ba5 100644
--- a/sip/tqt/tqdir.sip
+++ b/sip/tqt/tqdir.sip
@@ -52,19 +52,19 @@ the return type of a function or the type of an argument, a Python list of
 
 	// Convert the list.
 
-	if ((pl = PyList_New(0)) == NULL)
-		return NULL;
+	if (!(pl = PyList_New(0)))
+		return nullptr;
 
-	for (TQFileInfoListIterator it(*sipCpp); (obj = it.current()) != NULL; ++it)
+	for (TQFileInfoListIterator it(*sipCpp); (obj = it.current()); ++it)
 	{
 		PyObject *inst;
 
-		if ((inst = sipConvertFromInstance(obj,sipClass_TQFileInfo,sipTransferObj)) == NULL || PyList_Append(pl,inst) < 0)
+		if (!(inst = sipConvertFromInstance(obj,sipClass_TQFileInfo,sipTransferObj)) || PyList_Append(pl,inst) < 0)
 		{
 			Py_XDECREF(inst);
 			Py_DECREF(pl);
 
-			return NULL;
+			return nullptr;
 		}
 
 		Py_DECREF(inst);
@@ -77,7 +77,7 @@ the return type of a function or the type of an argument, a Python list of
 	// Convert a Python list of TQFileInfo instances to a TQFileInfoList on
 	// the heap.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 	{
 		if (!PyList_Check(sipPy))
 			return 0;
diff --git a/sip/tqt/tqfile.sip b/sip/tqt/tqfile.sip
index 5536c98..4b86d95 100644
--- a/sip/tqt/tqfile.sip
+++ b/sip/tqt/tqfile.sip
@@ -121,7 +121,7 @@ public:
 %MethodCode
 		char *buf;
 
-		if ((buf = (char *)sipMalloc(a0)) == NULL)
+		if (!(buf = (char *)sipMalloc(a0)))
 			sipIsErr = 1;
 		else
 		{
@@ -136,7 +136,7 @@ public:
 				Py_INCREF(Py_None);
 				sipRes = Py_None;
 			}
-			else if ((sipRes = PyBytes_FromStringAndSize(buf,actlen)) == NULL)
+			else if (!(sipRes = PyBytes_FromStringAndSize(buf,actlen)))
 				sipIsErr = 1;
 
 			sipFree((void *)buf);
@@ -152,7 +152,7 @@ public:
 %MethodCode
 		char *buf;
 
-		if ((buf = (char *)sipMalloc(a0)) == NULL)
+		if (!(buf = (char *)sipMalloc(a0)))
 			sipIsErr = 1;
 		else
 		{
@@ -175,7 +175,7 @@ public:
 
 				sipFree((void *)buf);
 
-				if (sipRes == NULL)
+				if (!sipRes)
 					sipIsErr = 1;
 			}
 		}
diff --git a/sip/tqt/tqfontmetrics.sip b/sip/tqt/tqfontmetrics.sip
index 18e5b4e..9e0c54c 100644
--- a/sip/tqt/tqfontmetrics.sip
+++ b/sip/tqt/tqfontmetrics.sip
@@ -138,7 +138,7 @@ static int intListToArray(PyObject *pl,int **ap)
 
 	nint = PyList_Size(pl);
 
-	if ((*ap = (int *)sipMalloc((nint + 1) * sizeof (int))) == NULL)
+	if (!(*ap = (int *)sipMalloc((nint + 1) * sizeof (int))))
 		return -1;
 
 	// Convert the list.
diff --git a/sip/tqt/tqimage.sip b/sip/tqt/tqimage.sip
index 2164d09..85ee7fd 100644
--- a/sip/tqt/tqimage.sip
+++ b/sip/tqt/tqimage.sip
@@ -158,7 +158,7 @@ public:
 
 		const char **str;
 
-		if ((str = PyTQt_tqt_ListToArray(a0)) == NULL)
+		if (!(str = PyTQt_tqt_ListToArray(a0)))
 			sipIsErr = 1;
 		else
 		{
@@ -423,8 +423,8 @@ const char **PyTQt_tqt_ListToArray(PyObject *lst)
 
 	nstr = PyList_Size(lst);
 
-	if ((str = (const char **)sipMalloc(nstr * sizeof (char *))) == NULL)
-		return NULL;
+	if (!(str = (const char **)sipMalloc(nstr * sizeof (char *))))
+		return nullptr;
 
 	// Convert the list.
 	sp = str;
@@ -434,10 +434,10 @@ const char **PyTQt_tqt_ListToArray(PyObject *lst)
 		PyObject *item = PyList_GetItem(lst, i);
 		const char *item_utf8 = sipString_AsUTF8String(&item);
 
-		if (item_utf8 == NULL)
+		if (!item_utf8)
 		{
 			sipFree((void *)str);
-			return NULL;
+			return nullptr;
 		}
 
 		*sp++ = item_utf8;
diff --git a/sip/tqt/tqiodevice.sip b/sip/tqt/tqiodevice.sip
index 30ca235..d397190 100644
--- a/sip/tqt/tqiodevice.sip
+++ b/sip/tqt/tqiodevice.sip
@@ -120,7 +120,7 @@ public:
 %MethodCode
 		char *buf;
 
-		if ((buf = (char *)sipMalloc(a0)) == NULL)
+		if (!(buf = (char *)sipMalloc(a0)))
 			sipIsErr = 1;
 		else
 		{
@@ -143,7 +143,7 @@ public:
 
 				sipFree((void *)buf);
 
-				if (sipRes == NULL)
+				if (!sipRes)
 					sipIsErr = 1;
 			}
 		}
@@ -151,7 +151,7 @@ public:
 %VirtualCatcherCode
 		PyObject *result = sipCallMethod(&sipIsErr,sipMethod,"l",a1);
 
-		if (result != NULL)
+		if (result)
 		{
 			PyObject *buf;
 
@@ -182,7 +182,7 @@ public:
 %MethodCode
 		char *buf;
 
-		if ((buf = (char *)sipMalloc(a0)) == NULL)
+		if (!(buf = (char *)sipMalloc(a0)))
 			sipIsErr = 1;
 		else
 		{
@@ -205,7 +205,7 @@ public:
 
 				sipFree((void *)buf);
 
-				if (sipRes == NULL)
+				if (!sipRes)
 					sipIsErr = 1;
 			}
 		}
@@ -213,7 +213,7 @@ public:
 %VirtualCatcherCode
 		PyObject *result = sipCallMethod(&sipIsErr,sipMethod,"l",a1);
 
-		if (result != NULL)
+		if (result)
 		{
 			PyObject *buf;
 
diff --git a/sip/tqt/tqkeysequence.sip b/sip/tqt/tqkeysequence.sip
index 8b94cfd..7712218 100644
--- a/sip/tqt/tqkeysequence.sip
+++ b/sip/tqt/tqkeysequence.sip
@@ -57,7 +57,7 @@ public:
 	// Allow a TQString or a Python integer whenever a TQKeySequence is
 	// expected.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 	{
 		if (sipCanConvertToInstance(sipPy,sipClass_TQKeySequence,SIP_NO_CONVERTORS))
 			return 1;
diff --git a/sip/tqt/tqlayout.sip b/sip/tqt/tqlayout.sip
index 841e3b0..0e7d162 100644
--- a/sip/tqt/tqlayout.sip
+++ b/sip/tqt/tqlayout.sip
@@ -151,7 +151,7 @@ public:
 	else if (sipCpp->spacerItem())
 		sipClass = sipClass_TQSpacerItem;
 	else
-		sipClass = NULL;
+		sipClass = nullptr;
 %End
 
 	virtual TQSize sizeHint() const = 0;
diff --git a/sip/tqt/tqlineedit.sip b/sip/tqt/tqlineedit.sip
index 23488c3..4dd49d0 100644
--- a/sip/tqt/tqlineedit.sip
+++ b/sip/tqt/tqlineedit.sip
@@ -198,7 +198,7 @@ public:
 		res = sipCpp -> characterAt(a0,chr);
 		Py_END_ALLOW_THREADS
  
-		sipRes = sipBuildResult(&sipIsErr,"(iB)",res,chr,sipClass_TQChar,NULL);
+		sipRes = sipBuildResult(&sipIsErr,"(iB)",res,chr,sipClass_TQChar,nullptr);
 %End
 
 	// Obsolete.
diff --git a/sip/tqt/tqmemarray.sip b/sip/tqt/tqmemarray.sip
index 2df5299..14688f2 100644
--- a/sip/tqt/tqmemarray.sip
+++ b/sip/tqt/tqmemarray.sip
@@ -43,8 +43,8 @@ converted to and from Python lists of the type.
 	PyObject *l;
 
 	// Create the list.
-	if ((l = PyList_New(sipCpp -> size())) == NULL)
-		return NULL;
+	if (!(l = PyList_New(sipCpp -> size())))
+		return nullptr;
 
 	// Get it.
 	for (uint i = 0; i < sipCpp -> size(); ++i)
@@ -52,7 +52,7 @@ converted to and from Python lists of the type.
 		{
 			Py_DECREF(l);
 
-			return NULL;
+			return nullptr;
 		}
 
 	return l;
@@ -61,7 +61,7 @@ converted to and from Python lists of the type.
 %ConvertToTypeCode
 	// Convert a Python list of integers to a TQMemArray<int> on the heap.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 		return PyList_Check(sipPy);
 
 	TQMemArray<int> *tqma = new TQMemArray<int>(PyList_GET_SIZE(sipPy));
@@ -72,7 +72,7 @@ converted to and from Python lists of the type.
 	{
 		(*tqma)[i] = (int)PyLong_AsLong(PyList_GET_ITEM(sipPy,i));
  
-		if (PyErr_Occurred() != NULL)
+		if (PyErr_Occurred())
 		{
 			delete tqma;
 			*sipIsErr = 1;
@@ -98,8 +98,8 @@ template<TYPE>
     // Create the list.
     PyObject *l;
 
-    if ((l = PyList_New(sipCpp->size())) == NULL)
-        return NULL;
+    if (!(l = PyList_New(sipCpp->size())))
+        return nullptr;
 
     // Set the list elements.
     for (uint i = 0; i < sipCpp->size(); ++i)
@@ -107,12 +107,12 @@ template<TYPE>
         TYPE *t = new TYPE(sipCpp->at(i));
         PyObject *tobj;
 
-        if ((tobj = sipConvertFromNewInstance(t, sipClass_TYPE, sipTransferObj)) == NULL)
+        if (!(tobj = sipConvertFromNewInstance(t, sipClass_TYPE, sipTransferObj)))
         {
             Py_DECREF(l);
             delete t;
 
-            return NULL;
+            return nullptr;
         }
 
         PyList_SetItem(l, i, tobj);
@@ -123,7 +123,7 @@ template<TYPE>
 
 %ConvertToTypeCode
     // Check the type if that is all that is required.
-    if (sipIsErr == NULL)
+    if (!sipIsErr)
     {
         if (!PyList_Check(sipPy))
             return 0;
diff --git a/sip/tqt/tqobject.sip b/sip/tqt/tqobject.sip
index d359e34..6c16ef9 100644
--- a/sip/tqt/tqobject.sip
+++ b/sip/tqt/tqobject.sip
@@ -78,7 +78,7 @@ public:
 #if defined(SIP_FEATURE_TQt_ASSISTANTCLIENT)
 		{sipName_TQAssistantClient,	&sipClass_TQAssistantClient,	-1, 2},
 #else
-		{NULL,				NULL,				-1, 2},
+		{nullptr,				nullptr,				-1, 2},
 #endif
 		{sipName_TQSessionManager,	&sipClass_TQSessionManager,	-1, 3},
 		{sipName_TQTranslator,	&sipClass_TQTranslator,	-1, 4},
@@ -87,12 +87,12 @@ public:
 #if defined(SIP_FEATURE_TQt_FILEDIALOG)
 		{sipName_TQFileIconProvider,	&sipClass_TQFileIconProvider,	-1, 7},
 #else
-		{NULL,				NULL,				-1, 7},
+		{nullptr,				nullptr,				-1, 7},
 #endif
 #if defined(SIP_FEATURE_TQt_ACTION)
 		{sipName_TQAction,	&sipClass_TQAction,	89, 8},
 #else
-		{NULL,			NULL,			-1, 8},
+		{nullptr,			nullptr,			-1, 8},
 #endif
 		{sipName_TQObjectCleanupHandler,	&sipClass_TQObjectCleanupHandler,	-1, 9},
 		{sipName_TQTimer,	&sipClass_TQTimer,	-1, 10},
@@ -100,26 +100,26 @@ public:
 #if defined(SIP_FEATURE_TQt_NETWORKPROTOCOL)
 		{sipName_TQUrlOperator,	&sipClass_TQUrlOperator,	-1, 12},
 #else
-		{NULL,			NULL,			-1, 12},
+		{nullptr,			nullptr,			-1, 12},
 #endif
 		{sipName_TQStyleSheet,	&sipClass_TQStyleSheet,	-1, 13},
 		{sipName_TQValidator,	&sipClass_TQValidator,	94, 14},
 #if defined(SIP_FEATURE_TQt_NETWORKPROTOCOL)
 		{sipName_TQNetworkOperation,	&sipClass_TQNetworkOperation,	-1, 15},
 #else
-		{NULL,				NULL,				-1, 15},
+		{nullptr,				nullptr,				-1, 15},
 #endif
 		{sipName_TQAccel,	&sipClass_TQAccel,	-1, 16},
 		{sipName_TQEventLoop,	&sipClass_TQEventLoop,	-1, 17},
 #if defined(SIP_FEATURE_TQt_NETWORKPROTOCOL)
 		{sipName_TQNetworkProtocol,	&sipClass_TQNetworkProtocol,	-1, 18},
 #else
-		{NULL,				NULL,				-1, 18},
+		{nullptr,				nullptr,				-1, 18},
 #endif
 #if defined(SIP_FEATURE_TQt_SOUND)
 		{sipName_TQSound,	&sipClass_TQSound,	-1, 19},
 #else
-		{NULL,			NULL,			-1, 19},
+		{nullptr,			nullptr,			-1, 19},
 #endif
 		{sipName_TQApplication,	&sipClass_TQApplication,	-1, 20},
 		{sipName_TQDragObject,	&sipClass_TQDragObject,	97, 21},
@@ -129,13 +129,13 @@ public:
 #if defined(SIP_FEATURE_TQt_CLIPBOARD)
 		{sipName_TQClipboard,	&sipClass_TQClipboard,	-1, -1},
 #else
-		{NULL,			NULL,			-1, -1},
+		{nullptr,			nullptr,			-1, -1},
 #endif
 		{sipName_TQStatusBar,	&sipClass_TQStatusBar,	-1, 26},
 #if defined(SIP_FEATURE_TQt_SIZEGRIP)
 		{sipName_TQSizeGrip,	&sipClass_TQSizeGrip,	-1, 27},
 #else
-		{NULL,			NULL,			-1, 27},
+		{nullptr,			nullptr,			-1, 27},
 #endif
 		{sipName_TQTabWidget,	&sipClass_TQTabWidget,	-1, 28},
 		{sipName_TQDateEdit,	&sipClass_TQDateEdit,	-1, 29},
@@ -147,7 +147,7 @@ public:
 #if defined(SIP_FEATURE_TQt_DIAL)
 		{sipName_TQDial,		&sipClass_TQDial,	-1, 35},
 #else
-		{NULL,			NULL,			-1, 35},
+		{nullptr,			nullptr,			-1, 35},
 #endif
 		{sipName_TQButton,	&sipClass_TQButton,	75, 36},
 		{sipName_TQTabBar,	&sipClass_TQTabBar,	-1, 37},
@@ -161,7 +161,7 @@ public:
 #if defined(SIP_FEATURE_TQt_WORKSPACE)
 		{sipName_TQWorkspace,	&sipClass_TQWorkspace,	-1, 45},
 #else
-		{NULL,			NULL,			-1, 45},
+		{nullptr,			nullptr,			-1, 45},
 #endif
 		{sipName_TQDesktopWidget,	&sipClass_TQDesktopWidget,	-1, -1},
 		{sipName_TQGrid,	&sipClass_TQGrid,	-1, 47},
@@ -176,7 +176,7 @@ public:
 #if defined(SIP_FEATURE_TQt_SPLITTER)
 		{sipName_TQSplitter,	&sipClass_TQSplitter,	-1, 56},
 #else
-		{NULL,			NULL,			-1, 56},
+		{nullptr,			nullptr,			-1, 56},
 #endif
 		{sipName_TQProgressBar,	&sipClass_TQProgressBar,	-1, 57},
 		{sipName_TQScrollView,	&sipClass_TQScrollView,	66, 58},
@@ -191,7 +191,7 @@ public:
 #if defined(SIP_FEATURE_TQt_ICONVIEW)
 		{sipName_TQIconView,	&sipClass_TQIconView,	-1, 67},
 #else
-		{NULL,			NULL,			-1, 67},
+		{nullptr,			nullptr,			-1, 67},
 #endif
 		{sipName_TQListView,	&sipClass_TQListView,	-1, 68},
 		{sipName_TQListBox,	&sipClass_TQListBox,	-1, 69},
@@ -208,53 +208,53 @@ public:
 #if defined(WS_X11) && defined(SIP_FEATURE_TQt_PRINTDIALOG)
 		{sipName_TQPrintDialog,	&sipClass_TQPrintDialog,	-1, 80},
 #else
-		{NULL,			NULL,			-1, 80},
+		{nullptr,			nullptr,			-1, 80},
 #endif
 		{sipName_TQErrorMessage,	&sipClass_TQErrorMessage,	-1, 81},
 #if defined(SIP_FEATURE_TQt_INPUTDIALOG)
 		{sipName_TQInputDialog,	&sipClass_TQInputDialog,	-1, 82},
 #else
-		{NULL,			NULL,			-1, 82},
+		{nullptr,			nullptr,			-1, 82},
 #endif
 #if defined(SIP_FEATURE_TQt_MESSAGEBOX)
 		{sipName_TQMessageBox,	&sipClass_TQMessageBox,	-1, 83},
 #else
-		{NULL,			NULL,			-1, 83},
+		{nullptr,			nullptr,			-1, 83},
 #endif
 #if defined(SIP_FEATURE_TQt_WIZARD)
 		{sipName_TQWizard,	&sipClass_TQWizard,	-1, 84},
 #else
-		{NULL,			NULL,			-1, 84},
+		{nullptr,			nullptr,			-1, 84},
 #endif
 #if defined(SIP_FEATURE_TQt_COLORDIALOG)
 		{sipName_TQColorDialog,	&sipClass_TQColorDialog,	-1, 85},
 #else
-		{NULL,			NULL,			-1, 85},
+		{nullptr,			nullptr,			-1, 85},
 #endif
 #if defined(SIP_FEATURE_TQt_FONTDIALOG)
 		{sipName_TQFontDialog,	&sipClass_TQFontDialog,	-1, 86},
 #else
-		{NULL,			NULL,			-1, 86},
+		{nullptr,			nullptr,			-1, 86},
 #endif
 #if defined(SIP_FEATURE_TQt_FILEDIALOG)
 		{sipName_TQFileDialog,	&sipClass_TQFileDialog,	-1, 87},
 #else
-		{NULL,			NULL,			-1, 87},
+		{nullptr,			nullptr,			-1, 87},
 #endif
 #if defined(SIP_FEATURE_TQt_PROGRESSDIALOG)
 		{sipName_TQProgressDialog,	&sipClass_TQProgressDialog,	-1, 88},
 #else
-		{NULL,				NULL,				-1, 88},
+		{nullptr,				nullptr,				-1, 88},
 #endif
 #if defined(SIP_FEATURE_TQt_TABDIALOG)
 		{sipName_TQTabDialog,	&sipClass_TQTabDialog,	-1, -1},
 #else
-		{NULL,			NULL,			-1, -1},
+		{nullptr,			nullptr,			-1, -1},
 #endif
 #if defined(SIP_FEATURE_TQt_ACTION)
 		{sipName_TQActionGroup,	&sipClass_TQActionGroup,	-1, -1},
 #else
-		{NULL,			NULL,			-1, -1},
+		{nullptr,			nullptr,			-1, -1},
 #endif
 		{sipName_TQGridLayout,	&sipClass_TQGridLayout,	-1, 91},
 		{sipName_TQBoxLayout,	&sipClass_TQBoxLayout,	92, -1},
@@ -268,7 +268,7 @@ public:
 #if defined(SIP_FEATURE_TQt_ICONVIEW) && defined(SIP_FEATURE_TQt_DRAGANDDROP)
 		{sipName_TQIconDrag,	&sipClass_TQIconDrag,	-1, 100},
 #else
-		{NULL,			NULL,			-1, 100},
+		{nullptr,			nullptr,			-1, 100},
 #endif
 		{sipName_TQImageDrag,	&sipClass_TQImageDrag,	-1, -1},
 		{sipName_TQColorDrag,	&sipClass_TQColorDrag,	-1, 102},
@@ -277,49 +277,49 @@ public:
 #if defined(SIP_FEATURE_TQt_STYLE_WINDOWS)
 		{sipName_TQWindowsStyle,	&sipClass_TQWindowsStyle,	106, 105},
 #else
-		{NULL,			NULL,				-1, 105},
+		{nullptr,			nullptr,				-1, 105},
 #endif
 #if defined(SIP_FEATURE_TQt_STYLE_MOTIF)
 		{sipName_TQMotifStyle,	&sipClass_TQMotifStyle,	107, -1},
 #else
-		{NULL,			NULL,			-1, -1},
+		{nullptr,			nullptr,			-1, -1},
 #endif
 #if defined(SIP_FEATURE_TQt_STYLE_PLATINUM)
 		{sipName_TQPlatinumStyle,	&sipClass_TQPlatinumStyle,	-1, 110},
 #else
-		{NULL,				NULL,				-1, 110},
+		{nullptr,				nullptr,				-1, 110},
 #endif
 #if defined(SIP_FEATURE_TQt_STYLE_CDE)
 		{sipName_TQCDEStyle,	&sipClass_TQCDEStyle,	-1, 108},
 #else
-		{NULL,			NULL,			-1, 108},
+		{nullptr,			nullptr,			-1, 108},
 #endif
 #if defined(SIP_FEATURE_TQt_STYLE_MOTIFPLUS)
 		{sipName_TQMotifPlusStyle,	&sipClass_TQMotifPlusStyle,	-1, 109},
 #else
-		{NULL,				NULL,				-1, 109},
+		{nullptr,				nullptr,				-1, 109},
 #endif
 #if defined(SIP_FEATURE_TQt_STYLE_SGI)
 		{sipName_TQSGIStyle,	&sipClass_TQSGIStyle,	-1, -1},
 #else
-		{NULL,			NULL,			-1, -1},
+		{nullptr,			nullptr,			-1, -1},
 #endif
 #if defined(PYTQT_STYLE_WINDOWSXP)
 		{sipName_TQWindowsXPStyle,	&sipClass_TQWindowsXPStyle,	-1, -1},
 #else
-		{NULL,				NULL,				-1, -1},
+		{nullptr,				nullptr,				-1, -1},
 #endif
 	};
 
 	int i = 0;
 
-	sipClass = NULL;
+	sipClass = nullptr;
 
 	do
 	{
 		struct class_graph *cg = &graph[i];
 
-		if (cg->name != NULL && sipCpp->inherits(cg->name))
+		if (cg->name && sipCpp->inherits(cg->name))
 		{
 			sipClass = *cg->type;
 			i = cg->yes;
@@ -617,7 +617,7 @@ SIP_PYOBJECT TQ_SLOT(const char * /Encoding="ASCII"/) /TypeHint="TQ_SLOT"/;
 	{
 		int len = strlen(a0);
 
-		if ((sipRes = PyBytes_FromStringAndSize(NULL,1 + len)) == NULL)
+		if (!(sipRes = PyBytes_FromStringAndSize(nullptr,1 + len)))
 			sipIsErr = 1;
 		else
 		{
@@ -642,7 +642,7 @@ SIP_PYOBJECT TQ_SIGNAL(const char * /Encoding="ASCII"/) /TypeHint="TQ_SIGNAL"/;
 	{
 		int len = strlen(a0);
 
-		if ((sipRes = PyBytes_FromStringAndSize(NULL,1 + len)) == NULL)
+		if (!(sipRes = PyBytes_FromStringAndSize(nullptr,1 + len)))
 			sipIsErr = 1;
 		else
 		{
@@ -667,7 +667,7 @@ SIP_PYOBJECT PYSIGNAL(const char * /Encoding="ASCII"/);
 	{
 		int len = strlen(a0);
 
-		if ((sipRes = PyBytes_FromStringAndSize(NULL,1 + len)) == NULL)
+		if (!(sipRes = PyBytes_FromStringAndSize(nullptr,1 + len)))
 			sipIsErr = 1;
 		else
 		{
@@ -732,7 +732,7 @@ extern "C" {
 // The meta-type for PyTQt classes.  It is just a marker type so that we can
 // safely cast to get access to PyTQt3-specific data structures.
 PyTypeObject pytqtWrapperType_Type = {
-    PyVarObject_HEAD_INIT(NULL, 0)
+    PyVarObject_HEAD_INIT(nullptr, 0)
     "tqt.pytqtWrapperType",   /* tp_name */
     sizeof (sipWrapperType),    /* tp_basicsize */
     0,                      /* tp_itemsize */
@@ -843,11 +843,11 @@ static void clear_py_signals_slots(pytqtWrapper *pw)
 {
     pytqt3PySig *ps;
 
-    for (ps = pw->pySigList; ps != NULL; ps = ps->next)
+    for (ps = pw->pySigList; ps; ps = ps->next)
     {
         pytqt3SlotList *psrx;
 
-        for (psrx = ps->rxlist; psrx != NULL; psrx = psrx->next)
+        for (psrx = ps->rxlist; psrx; psrx = psrx->next)
             sipClearAnySlotReference(&psrx->rx);
     }
 }
@@ -860,7 +860,7 @@ static pytqt3PySig *find_py_signal(pytqtWrapper *pw, const char *sig)
 {
     pytqt3PySig *ps;
 
-    for (ps = pw->pySigList; ps != NULL; ps = ps->next)
+    for (ps = pw->pySigList; ps; ps = ps->next)
         if (sipTQtSameSignalSlotName(ps->name, sig))
             return ps;
 
@@ -896,7 +896,7 @@ static void pytqtWrapper_dealloc(pytqtWrapper *self)
 {
     clear_py_signals_slots(self);
 
-    while (self->pySigList != NULL)
+    while (self->pySigList)
     {
         pytqt3PySig *ps;
         pytqt3SlotList *psrx;
@@ -905,7 +905,7 @@ static void pytqtWrapper_dealloc(pytqtWrapper *self)
         ps = self->pySigList;
         self->pySigList = ps->next;
 
-        while ((psrx = ps->rxlist) != NULL)
+        while ((psrx = ps->rxlist))
         {
             ps->rxlist = psrx->next;
             free_slot_list(psrx);
@@ -930,11 +930,11 @@ static int pytqtWrapper_traverse(pytqtWrapper *self, visitproc visit, void *arg)
     if ((vret = sipWrapper_Type->tp_traverse((PyObject *)self, visit, arg)) != 0)
         return vret;
 
-    for (ps = self->pySigList; ps != NULL; ps = ps->next)
+    for (ps = self->pySigList; ps; ps = ps->next)
     {
         pytqt3SlotList *psrx;
 
-        for (psrx = ps->rxlist; psrx != NULL; psrx = psrx->next)
+        for (psrx = ps->rxlist; psrx; psrx = psrx->next)
             if ((vret = sipVisitSlot(&psrx->rx, visit, arg)) != 0)
                 return vret;
     }
@@ -1388,7 +1388,7 @@ static void *sipTQtCreateUniversalSlot(sipWrapper *tx, const char *sig,
     pytqt3SlotConnection conn;
 
     /* Initialise the connection. */
-    if (tx && sipGetAddress(&tx->super) == NULL)
+    if (tx && !sipGetAddress(&tx->super))
     {
         conn.sc_transmitter = 0;
     }
@@ -1402,7 +1402,7 @@ static void *sipTQtCreateUniversalSlot(sipWrapper *tx, const char *sig,
         return 0;
 
     /* Parse the signature and create the universal slot. */
-    if ((conn.sc_signature = parseSignature(sig)) == NULL)
+    if (!(conn.sc_signature = parseSignature(sig)))
     {
         sipFreeSipslot(&conn.sc_slot);
         return 0;
@@ -1426,7 +1426,7 @@ static void *sipTQtCreateUniversalSlot(sipWrapper *tx, const char *sig,
 // Parse the signal arguments for a connection.
 static pytqt3Signature *parseSignature(const char *sig)
 {
-    static pytqt3Signature *psig_list = NULL;
+    static pytqt3Signature *psig_list = nullptr;
     pytqt3Signature *psig;
     const char *sp, *ep;
 
@@ -1435,13 +1435,13 @@ static pytqt3Signature *parseSignature(const char *sig)
     // be different even though the signatures will probably be the same.  We
     // could be more clever, the most saving is when repeatedly emitting a
     // signal for which this is sufficient.
-    for (psig = psig_list; psig != NULL; psig = psig->sg_next)
+    for (psig = psig_list; psig; psig = psig->sg_next)
         if (sipTQtSameSignalSlotName(psig->sg_signature, sig))
             return psig;
 
     // Create a new one including space for the copy of the signature.
-    if ((psig = (pytqt3Signature *)sipMalloc(sizeof (pytqt3Signature) + strlen(sig) + 1)) == NULL)
-        return NULL;
+    if (!(psig = (pytqt3Signature *)sipMalloc(sizeof (pytqt3Signature) + strlen(sig) + 1)))
+        return nullptr;
 
     psig->sg_signature = (char *)&psig[1];
     psig->sg_nrargs = 0;
@@ -1516,10 +1516,10 @@ static pytqt3Signature *parseSignature(const char *sig)
             // Allocate the space.
             psig->sg_nrargs = nrcommas + 1;
 
-            if ((psig->sg_args = (pytqt3SigArg *)sipMalloc(sizeof (pytqt3SigArg) * psig->sg_nrargs)) == NULL)
+            if (!(psig->sg_args = (pytqt3SigArg *)sipMalloc(sizeof (pytqt3SigArg) * psig->sg_nrargs)))
             {
                 sipFree(psig);
-                return NULL;
+                return nullptr;
             }
 
             for (a = 0; a < psig->sg_nrargs; ++a)
@@ -1881,12 +1881,12 @@ static int sipTQtConnectPySignal(PyObject *txObj, const char *sig,
     pytqtWrapper *pw = (pytqtWrapper *)txObj;
 
     /* Create a new one if necessary. */
-    if ((ps = find_py_signal(pw, sig)) == NULL)
+    if (!(ps = find_py_signal(pw, sig)))
     {
-        if ((ps = (pytqt3PySig *)sipMalloc(sizeof (pytqt3PySig))) == NULL)
+        if (!(ps = (pytqt3PySig *)sipMalloc(sizeof (pytqt3PySig))))
             return -1;
 
-        if ((ps->name = (char *)sipMalloc(strlen(sig) + 1)) == NULL)
+        if (!(ps->name = (char *)sipMalloc(strlen(sig) + 1)))
         {
             sipFree(ps);
             return -1;
@@ -1894,14 +1894,14 @@ static int sipTQtConnectPySignal(PyObject *txObj, const char *sig,
 
         strcpy(ps->name, sig);
 
-        ps->rxlist = NULL;
+        ps->rxlist = nullptr;
         ps->next = pw->pySigList;
 
         pw->pySigList = ps;
     }
 
     /* Create the new receiver. */
-    if ((psrx = (pytqt3SlotList *)sipMalloc(sizeof (pytqt3SlotList))) == NULL)
+    if (!(psrx = (pytqt3SlotList *)sipMalloc(sizeof (pytqt3SlotList))))
         return -1;
 
     if (sipSaveSlot(&psrx->rx, rxObj, slot) < 0)
@@ -1923,11 +1923,11 @@ static void sipTQtDisconnectPySignal(PyObject *txObj, const char *sig,
 {
     pytqt3PySig *ps;
 
-    if ((ps = find_py_signal((pytqtWrapper *)txObj, sig)) != NULL)
+    if ((ps = find_py_signal((pytqtWrapper *)txObj, sig)))
     {
         pytqt3SlotList **psrxp;
 
-        for (psrxp = &ps->rxlist; *psrxp != NULL; psrxp = &(*psrxp)->next)
+        for (psrxp = &ps->rxlist; *psrxp; psrxp = &(*psrxp)->next)
         {
             pytqt3SlotList *psrx = *psrxp;
 
@@ -1968,7 +1968,7 @@ int pytqtEmitSignal(PyObject *self, const char *sig, PyObject *sigargs)
         pytqtTQtSignal *tab;
 
         // Search the table.
-        for (tab = ((pytqtClassTypeDef *)((sipWrapperType *)(self->ob_type))->type)->tqt_emit; tab->st_name != NULL; ++tab)
+        for (tab = ((pytqtClassTypeDef *)((sipWrapperType *)(self->ob_type))->type)->tqt_emit; tab->st_name; ++tab)
         {
             const char *sp, *tp;
             bool found;
@@ -2029,7 +2029,7 @@ int pytqtEmitSignal(PyObject *self, const char *sig, PyObject *sigargs)
         }
 
         // Forget this as a sender.
-        py_sender = NULL;
+        py_sender = nullptr;
 
         return rc;
     }
@@ -2048,7 +2048,7 @@ PyObject *pytqt3GetSender()
     if (UniversalSlot::lastSender)
     {
         sender = sipConvertFromType(UniversalSlot::lastSender, sipType_TQObject,
-                NULL);
+                nullptr);
     }
     else
     {
diff --git a/sip/tqt/tqobjectlist.sip b/sip/tqt/tqobjectlist.sip
index c0b2b48..9cefc62 100644
--- a/sip/tqt/tqobjectlist.sip
+++ b/sip/tqt/tqobjectlist.sip
@@ -43,19 +43,19 @@ return type of a function or the type of an argument, a Python list of
 	PyObject *pl;
 	TQObject *obj;
 
-	if ((pl = PyList_New(0)) == NULL)
-		return NULL;
+	if (!(pl = PyList_New(0)))
+		return nullptr;
 
-	for (TQObjectListIt it(*sipCpp); (obj = it.current()) != NULL; ++it)
+	for (TQObjectListIt it(*sipCpp); (obj = it.current()); ++it)
 	{
 		PyObject *inst;
 
-		if ((inst = sipConvertFromInstance(obj,sipClass_TQObject,sipTransferObj)) == NULL || PyList_Append(pl,inst) < 0)
+		if (!(inst = sipConvertFromInstance(obj,sipClass_TQObject,sipTransferObj)) || PyList_Append(pl,inst) < 0)
 		{
 			Py_XDECREF(inst);
 			Py_DECREF(pl);
 
-			return NULL;
+			return nullptr;
 		}
 
 		Py_DECREF(inst);
@@ -68,7 +68,7 @@ return type of a function or the type of an argument, a Python list of
 	// Convert a Python list of TQObject instances to a TQObjectList on the
 	// heap.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 	{
 		if (!PyList_Check(sipPy))
 			return 0;
diff --git a/sip/tqt/tqpainter.sip b/sip/tqt/tqpainter.sip
index 8111400..6761642 100644
--- a/sip/tqt/tqpainter.sip
+++ b/sip/tqt/tqpainter.sip
@@ -288,7 +288,7 @@ public:
 			while (*tp++ != 0);
 		}
 
-		if ((sipRes = PyList_New(len)) == NULL)
+		if (!(sipRes = PyList_New(len)))
 			sipIsErr = 1;
 		else if (tabs)
 		{
@@ -319,7 +319,7 @@ public:
 
 		// Allocate space for the array.  Note, this memory is never
 		// reclaimed.
-		if ((tabs = (int *)sipMalloc(len * sizeof (int))) == NULL)
+		if (!(tabs = (int *)sipMalloc(len * sizeof (int))))
 			sipIsErr = 1;
 		else
 		{
@@ -331,7 +331,7 @@ public:
 			{
 				*tp++ = (int)PyLong_AsLong(PyList_GET_ITEM(a0,i));
 
-				if (PyErr_Occurred() != NULL)
+				if (PyErr_Occurred())
 				{
 					sipFree((void *)tabs);
 					sipIsErr = 1;
diff --git a/sip/tqt/tqpair.sip b/sip/tqt/tqpair.sip
index 1744b58..8180b49 100644
--- a/sip/tqt/tqpair.sip
+++ b/sip/tqt/tqpair.sip
@@ -44,8 +44,8 @@ converted to and from Python tuples of two elements.
 
 	// Create the tuple.
 
-	if ((t = PyTuple_New(2)) == NULL)
-		return NULL;
+	if (!(t = PyTuple_New(2)))
+		return nullptr;
 
 	// Fill it.
 
@@ -58,7 +58,7 @@ converted to and from Python tuples of two elements.
 %ConvertToTypeCode
 	// Convert a Python tuple of integers to a TQPair<int,int> on the heap.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 		return (PyTuple_Size(sipPy) == 2);
 
 	PyErr_Clear();
@@ -66,7 +66,7 @@ converted to and from Python tuples of two elements.
 	int fst = (int)PyLong_AsLong(PyTuple_GET_ITEM(sipPy,0));
 	int sec = (int)PyLong_AsLong(PyTuple_GET_ITEM(sipPy,1));
 
-	if (PyErr_Occurred() != NULL)
+	if (PyErr_Occurred())
 	{
 		*sipIsErr = 1;
 		return 0;
diff --git a/sip/tqt/tqpixmap.sip b/sip/tqt/tqpixmap.sip
index 0c06601..24bdef4 100644
--- a/sip/tqt/tqpixmap.sip
+++ b/sip/tqt/tqpixmap.sip
@@ -93,7 +93,7 @@ public:
 
 		const char **str;
 
-		if ((str = PyTQt_tqt_ListToArray(a0)) == NULL)
+		if (!(str = PyTQt_tqt_ListToArray(a0)))
 			sipIsErr = 1;
 		else
 		{
diff --git a/sip/tqt/tqpointarray.sip b/sip/tqt/tqpointarray.sip
index e0c83b8..d264853 100644
--- a/sip/tqt/tqpointarray.sip
+++ b/sip/tqt/tqpointarray.sip
@@ -100,8 +100,8 @@ static TQCOORD *getPoints(int nrpnts,PyObject *pntlist)
 {
 	TQCOORD *pnts, *pp;
 
-	if ((pnts = (TQCOORD *)sipMalloc(nrpnts * sizeof (TQCOORD))) == NULL)
-		return NULL;
+	if (!(pnts = (TQCOORD *)sipMalloc(nrpnts * sizeof (TQCOORD))))
+		return nullptr;
 
 	// Convert the list.
 
@@ -111,10 +111,10 @@ static TQCOORD *getPoints(int nrpnts,PyObject *pntlist)
 	{
 		*pp++ = (TQCOORD)PyLong_AsLong(PyList_GetItem(pntlist,i));
 
-		if (PyErr_Occurred() != NULL)
+		if (PyErr_Occurred())
 		{
 			sipFree((void *)pnts);
-			return NULL;
+			return nullptr;
 		}
 	}
 
@@ -137,7 +137,7 @@ public:
 
 		nrpnts = PyList_GET_SIZE(a0);
 
-		if ((pnts = getPoints(nrpnts,a0)) == NULL)
+		if (!(pnts = getPoints(nrpnts,a0)))
 			sipIsErr = 1;
 		else
 		{
@@ -169,7 +169,7 @@ public:
 
 		nrpnts = PyList_GET_SIZE(a0);
 
-		if ((pnts = getPoints(nrpnts,a0)) == NULL)
+		if (!(pnts = getPoints(nrpnts,a0)))
 			sipIsErr = 1;
 		else
 		{
@@ -190,7 +190,7 @@ public:
 
 		nrpnts = PyList_GET_SIZE(a1);
 
-		if ((pnts = getPoints(nrpnts,a1)) == NULL)
+		if (!(pnts = getPoints(nrpnts,a1)))
 			sipIsErr = 1;
 		else
 		{
diff --git a/sip/tqt/tqptrlist.sip b/sip/tqt/tqptrlist.sip
index bd162cf..f586a5f 100644
--- a/sip/tqt/tqptrlist.sip
+++ b/sip/tqt/tqptrlist.sip
@@ -45,23 +45,23 @@ template<Type>
 
 	// Create the list.
 
-	if ((l = PyList_New(sipCpp -> count())) == NULL)
-		return NULL;
+	if (!(l = PyList_New(sipCpp -> count())))
+		return nullptr;
 
 	// Get it.
 
 	i = 0;
 
-	for (dw = sipCpp -> first(); dw != NULL; dw = sipCpp -> next())
+	for (dw = sipCpp -> first(); dw; dw = sipCpp -> next())
 	{
 		PyObject *dwobj;
 
-		if ((dwobj = sipConvertFromInstance(dw,sipClass_Type,sipTransferObj)) == NULL || PyList_SetItem(l,i,dwobj) < 0)
+		if (!(dwobj = sipConvertFromInstance(dw,sipClass_Type,sipTransferObj)) || PyList_SetItem(l,i,dwobj) < 0)
 		{
 			Py_XDECREF(dwobj);
 			Py_DECREF(l);
 
-			return NULL;
+			return nullptr;
 		}
 
 		++i;
@@ -71,7 +71,7 @@ template<Type>
 %End
 
 %ConvertToTypeCode
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 	{
 		if (!PyList_Check(sipPy))
 			return 0;
diff --git a/sip/tqt/tqstring.sip b/sip/tqt/tqstring.sip
index d713997..f6da33a 100644
--- a/sip/tqt/tqstring.sip
+++ b/sip/tqt/tqstring.sip
@@ -646,7 +646,7 @@ public:
 	// Allow a Python string (or a unicode string) whenever a TQString is
 	// expected.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 		return (PyBytes_Check(sipPy) ||
 			PyUnicode_Check(sipPy) ||
 			sipCanConvertToInstance(sipPy,sipClass_TQString,SIP_NO_CONVERTORS));
@@ -713,7 +713,7 @@ public:
 
 			enc = codec->fromUnicode(*sipCpp);
 
-			if ((encobj = PyBytes_FromString(enc.data())) != NULL)
+			if ((encobj = PyBytes_FromString(enc.data())))
     			{
 				*sipPtrPtr = (void *)PyString_AS_STRING(encobj);
 				sipRes = PyString_GET_SIZE(encobj);
@@ -775,8 +775,8 @@ PyObject *PyTQt_tqt_PyObject_FromTQString(const TQString *tqstr)
     }
 
     // Create the correctly sized object.
-    if ((obj = PyUnicode_New(tqt_len, maxchar)) == NULL)
-        return NULL;
+    if (!(obj = PyUnicode_New(tqt_len, maxchar)))
+        return nullptr;
 
     int kind = PyUnicode_KIND(obj);
     void *data = PyUnicode_DATA(obj);
@@ -827,14 +827,14 @@ TQString *PyTQt_tqt_PyObject_AsTQString(PyObject *obj)
             return tqstr;
         }
 
-        return NULL;
+        return nullptr;
     }
     else if (PyBytes_Check(obj))
     {
         return new TQString(PyBytes_AS_STRING(obj));
     }
 
-    return NULL;
+    return nullptr;
 }
 %End
 
diff --git a/sip/tqt/tqstrlist.sip b/sip/tqt/tqstrlist.sip
index a93f4e6..cc8fb2f 100644
--- a/sip/tqt/tqstrlist.sip
+++ b/sip/tqt/tqstrlist.sip
@@ -46,22 +46,22 @@ is used instead.
 
 	// Create the list.
 
-	if ((l = PyList_New(sipCpp -> count())) == NULL)
-		return NULL;
+	if (!(l = PyList_New(sipCpp -> count())))
+		return nullptr;
 
 	// Get it.
 
 	i = 0;
 
-	for (s = sipCpp -> first(); s != NULL; s = sipCpp -> next())
+	for (s = sipCpp -> first(); s; s = sipCpp -> next())
 	{
 		PyObject *ps;
 
-		if ((ps = PyBytes_FromString(s)) == NULL || PyList_SetItem(l,i,ps) < 0)
+		if (!(ps = PyBytes_FromString(s)) || PyList_SetItem(l,i,ps) < 0)
 		{
 			Py_XDECREF(ps);
 			Py_DECREF(l);
-			return NULL;
+			return nullptr;
 		}
 
 		++i;
@@ -73,7 +73,7 @@ is used instead.
 %ConvertToTypeCode
 	// Convert a Python list of strings to a TQStrList on the heap.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 		return PyList_Check(sipPy);
 
 	TQStrList *tqsl = new TQStrList;
@@ -87,7 +87,7 @@ is used instead.
 		{
 			s = tqstrdup(sipString_AsUTF8String(&object));
 		}
-		else if ((s = (char *)sipBytes_AsString(object)) == NULL)
+		else if (!(s = (char *)sipBytes_AsString(object)))
 		{
 			*sipIsErr = 1;
 			delete tqsl;
diff --git a/sip/tqt/tqtabbar.sip b/sip/tqt/tqtabbar.sip
index 10e886d..84e6134 100644
--- a/sip/tqt/tqtabbar.sip
+++ b/sip/tqt/tqtabbar.sip
@@ -138,7 +138,7 @@ protected:
 
 	SIP_PYLIST tabList() [TQPtrList<TQTab> *()];
 %MethodCode
-		if ((sipRes = PyList_New(0)) == NULL)
+		if (!(sipRes = PyList_New(0)))
 			sipIsErr = 1;
 		else
 		{
@@ -150,9 +150,9 @@ protected:
 			Py_END_ALLOW_THREADS
 
 			// Convert the list.
-			for (TQPtrListIterator<TQTab> it(*tl); (tab = it.current()) != NULL; ++it)
+			for (TQPtrListIterator<TQTab> it(*tl); (tab = it.current()); ++it)
 			{
-				PyObject *inst = sipBuildResult(&sipIsErr,"C",tab,sipClass_TQTab,NULL);
+				PyObject *inst = sipBuildResult(&sipIsErr,"C",tab,sipClass_TQTab,nullptr);
 
 				if (sipIsErr)
 					break;
diff --git a/sip/tqt/tqvaluelist.sip b/sip/tqt/tqvaluelist.sip
index 8b3b8d6..8bc01a2 100644
--- a/sip/tqt/tqvaluelist.sip
+++ b/sip/tqt/tqvaluelist.sip
@@ -44,8 +44,8 @@ template<Type>
 
 	// Create the list.
 
-	if ((l = PyList_New(sipCpp -> count())) == NULL)
-		return NULL;
+	if (!(l = PyList_New(sipCpp -> count())))
+		return nullptr;
 
 	// Get it.
 
@@ -56,12 +56,12 @@ template<Type>
 	{
 		PyObject *tmobj;
 
-		if ((tmobj = sipConvertFromNewInstance(new Type(*it),sipClass_Type,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0)
+		if (!(tmobj = sipConvertFromNewInstance(new Type(*it),sipClass_Type,sipTransferObj)) || PyList_SetItem(l,i,tmobj) < 0)
 		{
 			Py_XDECREF(tmobj);
 			Py_DECREF(l);
 
-			return NULL;
+			return nullptr;
 		}
 
 		++i;
@@ -71,7 +71,7 @@ template<Type>
 %End
 
 %ConvertToTypeCode
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 	{
 		if (!PyList_Check(sipPy))
 			return 0;
@@ -127,8 +127,8 @@ template<Type>
 
 	// Create the list.
 
-	if ((l = PyList_New(sipCpp -> count())) == NULL)
-		return NULL;
+	if (!(l = PyList_New(sipCpp -> count())))
+		return nullptr;
 
 	// Get it.
 
@@ -137,7 +137,7 @@ template<Type>
 		{
 			Py_DECREF(l);
 
-			return NULL;
+			return nullptr;
 		}
 
 	return l;
@@ -146,7 +146,7 @@ template<Type>
 %ConvertToTypeCode
 	// Convert a Python list of integers to a TQValueList<int> on the heap.
  
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 		return PyList_Check(sipPy);
 
 	TQValueList<int> *tqvl = new TQValueList<int>;
@@ -157,7 +157,7 @@ template<Type>
 	{
 		tqvl -> append(PyLong_AsLong(PyList_GET_ITEM(sipPy,i)));
  
-		if (PyErr_Occurred() != NULL)
+		if (PyErr_Occurred())
 		{
 			delete tqvl;
 			*sipIsErr = 1;
diff --git a/sip/tqt/tqwidgetlist.sip b/sip/tqt/tqwidgetlist.sip
index 0d060b8..89eec70 100644
--- a/sip/tqt/tqwidgetlist.sip
+++ b/sip/tqt/tqwidgetlist.sip
@@ -43,19 +43,19 @@ instances is used instead.
 	PyObject *pl;
 	TQWidget *obj;
 
-	if ((pl = PyList_New(0)) == NULL)
-		return NULL;
+	if (!(pl = PyList_New(0)))
+		return nullptr;
 
-	for (TQWidgetListIt it(*sipCpp); (obj = it.current()) != NULL; ++it)
+	for (TQWidgetListIt it(*sipCpp); (obj = it.current()); ++it)
 	{
 		PyObject *inst;
 
-		if ((inst = sipConvertFromInstance(obj,sipClass_TQWidget,sipTransferObj)) == NULL || PyList_Append(pl,inst) < 0)
+		if (!(inst = sipConvertFromInstance(obj,sipClass_TQWidget,sipTransferObj)) || PyList_Append(pl,inst) < 0)
 		{
 			Py_XDECREF(inst);
 			Py_DECREF(pl);
 
-			return NULL;
+			return nullptr;
 		}
 
 		Py_DECREF(inst);
@@ -68,7 +68,7 @@ instances is used instead.
 	// Convert a Python list of TQWidget instances to a TQWidgetList on the
 	// heap.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 	{
 		if (!PyList_Check(sipPy))
 			return 0;
diff --git a/sip/tqtcanvas/tqcanvas.sip b/sip/tqtcanvas/tqcanvas.sip
index 2fc5c0b..6ffa143 100644
--- a/sip/tqtcanvas/tqcanvas.sip
+++ b/sip/tqtcanvas/tqcanvas.sip
@@ -143,8 +143,8 @@ The <Literal>pixmaps</Literal> argument is a Python list of TQPixmap instances.
 
 	// Create the list.
 
-	if ((l = PyList_New(sipCpp -> count())) == NULL)
-		return NULL;
+	if (!(l = PyList_New(sipCpp -> count())))
+		return nullptr;
 
 	// Get it.
 
@@ -154,12 +154,12 @@ The <Literal>pixmaps</Literal> argument is a Python list of TQPixmap instances.
 	{
 		PyObject *ci;
 
-		if ((ci = sipConvertFromInstance(*it,sipClass_TQCanvasItem,sipTransferObj)) == NULL || PyList_SetItem(l,i,ci) < 0)
+		if (!(ci = sipConvertFromInstance(*it,sipClass_TQCanvasItem,sipTransferObj)) || PyList_SetItem(l,i,ci) < 0)
 		{
 			Py_XDECREF(ci);
 			Py_DECREF(l);
 
-			return NULL;
+			return nullptr;
 		}
 
 		++i;
@@ -172,7 +172,7 @@ The <Literal>pixmaps</Literal> argument is a Python list of TQPixmap instances.
 	// At the moment this will never be called, so provide a null
 	// implementation.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 		return PyList_Check(sipPy);
 
 	PyErr_Format(PyExc_TypeError,"Converting to TQCanvasItemList not yet implemented");
@@ -344,13 +344,13 @@ public:
 
 	int i = 0;
 
-	sipClass = NULL;
+	sipClass = nullptr;
 
 	do
 	{
 		struct class_graph *cg = &graph[i];
 
-		if (cg->name != NULL && sipCpp->inherits(cg->name))
+		if (cg->name && sipCpp->inherits(cg->name))
 		{
 			sipClass = *cg->type;
 			i = cg->yes;
diff --git a/sip/tqtext/tqextscintillabase.sip b/sip/tqtext/tqextscintillabase.sip
index 23a2a65..833082d 100644
--- a/sip/tqtext/tqextscintillabase.sip
+++ b/sip/tqtext/tqextscintillabase.sip
@@ -904,34 +904,34 @@ public:
 #if TQSCINTILLA_VERSION >= 0x010300
 		{sipName_TQextScintillaLexerPerl,	&sipClass_TQextScintillaLexerPerl,	-1, 4},
 #else
-		{NULL,					NULL,					-1, 4},
+		{nullptr,					nullptr,					-1, 4},
 #endif
 #if TQSCINTILLA_VERSION >= 0x010100
 		{sipName_TQextScintillaLexerHTML,	&sipClass_TQextScintillaLexerHTML,	-1, 5},
 #else
-		{NULL,					NULL,					-1, 5},
+		{nullptr,					nullptr,					-1, 5},
 #endif
 #if TQSCINTILLA_VERSION >= 0x010500
 		{sipName_TQextScintillaLexerRuby,	&sipClass_TQextScintillaLexerRuby,	-1, 6},
 #else
-		{NULL,					NULL,					-1, 6},
+		{nullptr,					nullptr,					-1, 6},
 #endif
 		{sipName_TQextScintillaLexerCPP,	&sipClass_TQextScintillaLexerCPP,	11, 7},
 		{sipName_TQextScintillaLexerPython,	&sipClass_TQextScintillaLexerPython,	-1, 8},
 #if TQSCINTILLA_VERSION >= 0x010100
 		{sipName_TQextScintillaLexerSQL,	&sipClass_TQextScintillaLexerSQL,	-1, 9},
 #else
-		{NULL,				NULL,					-1, 9},
+		{nullptr,				nullptr,					-1, 9},
 #endif
 #if TQSCINTILLA_VERSION >= 0x010400
 		{sipName_TQextScintillaLexerBash,	&sipClass_TQextScintillaLexerBash,	-1, 10},
 #else
-		{NULL,					NULL,					-1, 10},
+		{nullptr,					nullptr,					-1, 10},
 #endif
 #if TQSCINTILLA_VERSION >= 0x010500
 		{sipName_TQextScintillaLexerLua,	&sipClass_TQextScintillaLexerLua,	-1, -1},
 #else
-		{NULL,					NULL,				-1, -1},
+		{nullptr,					nullptr,				-1, -1},
 #endif
 		{sipName_TQextScintillaLexerIDL,	&sipClass_TQextScintillaLexerIDL,	-1, 12},
 		{sipName_TQextScintillaLexerJavaScript,	&sipClass_TQextScintillaLexerJavaScript,	-1, 13},
@@ -942,13 +942,13 @@ public:
 
 	int i = 0;
 
-	sipClass = NULL;
+	sipClass = nullptr;
 
 	do
 	{
 		struct class_graph *cg = &graph[i];
 
-		if (cg->name != NULL && sipCpp->inherits(cg->name))
+		if (cg->name && sipCpp->inherits(cg->name))
 		{
 			sipClass = *cg->type;
 			i = cg->yes;
diff --git a/sip/tqtgl/tqgl.sip b/sip/tqtgl/tqgl.sip
index 1d1b080..64deff7 100644
--- a/sip/tqtgl/tqgl.sip
+++ b/sip/tqtgl/tqgl.sip
@@ -199,7 +199,7 @@ public:
 		  const char * = 0,const TQGLWidget * = 0,WFlags = 0);
 
 %ConvertToSubClassCode
-	sipClass = (sipCpp->inherits(sipName_TQGLWidget) ? sipClass_TQGLWidget : NULL);
+	sipClass = (sipCpp->inherits(sipName_TQGLWidget) ? sipClass_TQGLWidget : nullptr);
 %End
 
 	void qglColor(const TQColor &) const;
diff --git a/sip/tqtnetwork/tqdns.sip b/sip/tqtnetwork/tqdns.sip
index 7d9c436..5a31b5d 100644
--- a/sip/tqtnetwork/tqdns.sip
+++ b/sip/tqtnetwork/tqdns.sip
@@ -116,8 +116,8 @@ signals:
 
 	// Create the list.
 
-	if ((l = PyList_New(sipCpp -> count())) == NULL)
-		return NULL;
+	if (!(l = PyList_New(sipCpp -> count())))
+		return nullptr;
 
 	// Get it.
 
@@ -128,12 +128,12 @@ signals:
 	{
 		PyObject *tmobj;
 
-		if ((tmobj = sipConvertFromNewInstance(new TQHostAddress(*it),sipClass_TQHostAddress,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0)
+		if (!(tmobj = sipConvertFromNewInstance(new TQHostAddress(*it),sipClass_TQHostAddress,sipTransferObj)) || PyList_SetItem(l,i,tmobj) < 0)
 		{
 			Py_XDECREF(tmobj);
 			Py_DECREF(l);
 
-			return NULL;
+			return nullptr;
 		}
 
 		++i;
@@ -146,7 +146,7 @@ signals:
 	// At the moment this will never be called, so provide a null
 	// implementation.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 		return PyList_Check(sipPy);
 
 	PyErr_Format(PyExc_TypeError,"Converting to TQValueList<TQHostAddress> not yet implemented");
@@ -172,8 +172,8 @@ signals:
 
 	// Create the list.
 
-	if ((l = PyList_New(sipCpp -> count())) == NULL)
-		return NULL;
+	if (!(l = PyList_New(sipCpp -> count())))
+		return nullptr;
 
 	// Get it.
 
@@ -184,12 +184,12 @@ signals:
 	{
 		PyObject *tmobj;
 
-		if ((tmobj = sipConvertFromNewInstance(new TQDns::MailServer(*it),sipClass_TQDns_MailServer,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0)
+		if (!(tmobj = sipConvertFromNewInstance(new TQDns::MailServer(*it),sipClass_TQDns_MailServer,sipTransferObj)) || PyList_SetItem(l,i,tmobj) < 0)
 		{
 			Py_XDECREF(tmobj);
 			Py_DECREF(l);
 
-			return NULL;
+			return nullptr;
 		}
 
 		++i;
@@ -202,7 +202,7 @@ signals:
 	// At the moment this will never be called, so provide a null
 	// implementation.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 		return PyList_Check(sipPy);
 
 	PyErr_Format(PyExc_TypeError,"Converting to TQValueList<TQDns::MailServer> not yet implemented");
@@ -228,8 +228,8 @@ signals:
 
 	// Create the list.
 
-	if ((l = PyList_New(sipCpp -> count())) == NULL)
-		return NULL;
+	if (!(l = PyList_New(sipCpp -> count())))
+		return nullptr;
 
 	// Get it.
 
@@ -240,12 +240,12 @@ signals:
 	{
 		PyObject *tmobj;
 
-		if ((tmobj = sipConvertFromNewInstance(new TQDns::Server(*it),sipClass_TQDns_Server,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0)
+		if (!(tmobj = sipConvertFromNewInstance(new TQDns::Server(*it),sipClass_TQDns_Server,sipTransferObj)) || PyList_SetItem(l,i,tmobj) < 0)
 		{
 			Py_XDECREF(tmobj);
 			Py_DECREF(l);
 
-			return NULL;
+			return nullptr;
 		}
 
 		++i;
@@ -258,7 +258,7 @@ signals:
 	// At the moment this will never be called, so provide a null
 	// implementation.
 
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 		return PyList_Check(sipPy);
 
 	PyErr_Format(PyExc_TypeError,"Converting to TQValueList<TQDns::Server> not yet implemented");
diff --git a/sip/tqtnetwork/tqftp.sip b/sip/tqtnetwork/tqftp.sip
index ee945db..febdc80 100644
--- a/sip/tqtnetwork/tqftp.sip
+++ b/sip/tqtnetwork/tqftp.sip
@@ -106,7 +106,7 @@ public:
 %MethodCode
 		char *buf;
 
-		if ((buf = (char *)sipMalloc(a0)) == NULL)
+		if (!(buf = (char *)sipMalloc(a0)))
 			sipIsErr = 1;
 		else
 		{
@@ -121,7 +121,7 @@ public:
 				Py_INCREF(Py_None);
 				sipRes = Py_None;
 			}
-			else if ((sipRes = PyBytes_FromStringAndSize(buf,actlen)) == NULL)
+			else if (!(sipRes = PyBytes_FromStringAndSize(buf,actlen)))
 				sipIsErr = 1;
 
 			sipFree((void *)buf);
diff --git a/sip/tqtnetwork/tqhttp.sip b/sip/tqtnetwork/tqhttp.sip
index 2f80e22..56dc69f 100644
--- a/sip/tqtnetwork/tqhttp.sip
+++ b/sip/tqtnetwork/tqhttp.sip
@@ -203,7 +203,7 @@ public:
 %MethodCode
 		char *buf;
 
-		if ((buf = (char *)sipMalloc(a0)) == NULL)
+		if (!(buf = (char *)sipMalloc(a0)))
 			sipIsErr = 1;
 		else
 		{
@@ -218,7 +218,7 @@ public:
 				Py_INCREF(Py_None);
 				sipRes = Py_None;
 			}
-			else if ((sipRes = PyBytes_FromStringAndSize(buf,actlen)) == NULL)
+			else if (!(sipRes = PyBytes_FromStringAndSize(buf,actlen)))
 				sipIsErr = 1;
 
 			sipFree((void *)buf);
diff --git a/sip/tqtnetwork/tqsocket.sip b/sip/tqtnetwork/tqsocket.sip
index ed52819..da31e34 100644
--- a/sip/tqtnetwork/tqsocket.sip
+++ b/sip/tqtnetwork/tqsocket.sip
@@ -97,13 +97,13 @@ public:
 
 	int i = 0;
 
-	sipClass = NULL;
+	sipClass = nullptr;
 
 	do
 	{
 		struct class_graph *cg = &graph[i];
 
-		if (cg->name != NULL && sipCpp->inherits(cg->name))
+		if (cg->name && sipCpp->inherits(cg->name))
 		{
 			sipClass = *cg->type;
 			i = cg->yes;
@@ -145,7 +145,7 @@ public:
 %MethodCode
 		char *buf;
  
-		if ((buf = (char *)sipMalloc(a0)) == NULL)
+		if (!(buf = (char *)sipMalloc(a0)))
 			sipIsErr = 1;
 		else
 		{
@@ -168,7 +168,7 @@ public:
  
 				sipFree((void *)buf);
  
-				if (sipRes == NULL)
+				if (!sipRes)
 					sipIsErr = 1;
 			}
 		}
@@ -181,7 +181,7 @@ public:
 %MethodCode
 		char *buf;
  
-		if ((buf = (char *)sipMalloc(a0)) == NULL)
+		if (!(buf = (char *)sipMalloc(a0)))
 			sipIsErr = 1;
 		else
 		{
@@ -204,7 +204,7 @@ public:
  
 				sipFree((void *)buf);
  
-				if (sipRes == NULL)
+				if (!sipRes)
 					sipIsErr = 1;
 			}
 		}
diff --git a/sip/tqtnetwork/tqsocketdevice.sip b/sip/tqtnetwork/tqsocketdevice.sip
index 32ee5e5..c0b92ab 100644
--- a/sip/tqtnetwork/tqsocketdevice.sip
+++ b/sip/tqtnetwork/tqsocketdevice.sip
@@ -108,7 +108,7 @@ public:
 %MethodCode
 		char *buf;
 
-		if ((buf = (char *)sipMalloc(a0)) == NULL)
+		if (!(buf = (char *)sipMalloc(a0)))
 			sipIsErr = 1;
 		else
 		{
@@ -123,7 +123,7 @@ public:
 				Py_INCREF(Py_None);
 				sipRes = Py_None;
 			}
-			else if ((sipRes = PyBytes_FromStringAndSize(buf,actlen)) == NULL)
+			else if (!(sipRes = PyBytes_FromStringAndSize(buf,actlen)))
 				sipIsErr = 1;
 
 			sipFree((void *)buf);
diff --git a/sip/tqtpe/tqpeapplication.sip b/sip/tqtpe/tqpeapplication.sip
index 07073c4..97ca1fa 100644
--- a/sip/tqtpe/tqpeapplication.sip
+++ b/sip/tqtpe/tqpeapplication.sip
@@ -43,7 +43,7 @@ public:
 		char **argv;
 
 		// Convert the list.
-		if ((argv = pyArgvToC(a0,&argc)) == NULL)
+		if (!(argv = pyArgvToC(a0,&argc)))
 			sipIsErr = 1;
 		else
 		{
@@ -72,8 +72,8 @@ public:
 		{
 			PyObject *sw;
 
-			if ((sw = sipGetWrapper(w,sipClass_TQWidget)) != NULL)
-				sipTransferTo(sw,NULL);
+			if ((sw = sipGetWrapper(w,sipClass_TQWidget)))
+				sipTransferTo(sw,nullptr);
 
 			++it;
 		}
@@ -177,8 +177,8 @@ static char **pyArgvToC(PyObject *argvlist,int *argcp)
 
 	// Allocate space for two copies of the argument pointers, plus the
 	// terminating NULL.
-	if ((argv = (char **)sipMalloc(2 * (argc + 1) * sizeof (char *))) == NULL)
-		return NULL;
+	if (!(argv = (char **)sipMalloc(2 * (argc + 1) * sizeof (char *))))
+		return nullptr;
 
 	// Convert the list.
 	for (int a = 0; a < argc; ++a)
@@ -186,16 +186,16 @@ static char **pyArgvToC(PyObject *argvlist,int *argcp)
 		char *arg;
 
 		// Get the argument and allocate memory for it.
-		if ((arg = (char *)sipBytes_AsString(PyList_GetItem(argvlist,a))) == NULL ||
-		    (argv[a] = (char *)sipMalloc(strlen(arg) + 1)) == NULL)
-			return NULL;
+		if (!(arg = (char *)sipBytes_AsString(PyList_GetItem(argvlist,a))) ||
+		    !(argv[a] = (char *)sipMalloc(strlen(arg) + 1)))
+			return nullptr;
 
 		// Copy the argument and save a pointer to it.
 		strcpy(argv[a],arg);
 		argv[a + argc + 1] = argv[a];
 	}
 
-	argv[argc + argc + 1] = argv[argc] = NULL;
+	argv[argc + argc + 1] = argv[argc] = nullptr;
 
 	*argcp = argc;
 
@@ -213,7 +213,7 @@ static void updatePyArgv(PyObject *argvlist,int argc,char **argv)
 		if (argv[na] == argv[a + argc + 1])
 			++na;
 		else
-			PyList_SetSlice(argvlist,na,na + 1,NULL);
+			PyList_SetSlice(argvlist,na,na + 1,nullptr);
 	}
 }
 %End
diff --git a/sip/tqtsql/tqsqldatabase.sip b/sip/tqtsql/tqsqldatabase.sip
index cab38d2..0f28421 100644
--- a/sip/tqtsql/tqsqldatabase.sip
+++ b/sip/tqtsql/tqsqldatabase.sip
@@ -58,13 +58,13 @@ public:
 
 	int i = 0;
 
-	sipClass = NULL;
+	sipClass = nullptr;
 
 	do
 	{
 		struct class_graph *cg = &graph[i];
 
-		if (cg->name != NULL && sipCpp->inherits(cg->name))
+		if (cg->name && sipCpp->inherits(cg->name))
 		{
 			sipClass = *cg->type;
 			i = cg->yes;
diff --git a/sip/tqtsql/tqsqlrecord.sip b/sip/tqtsql/tqsqlrecord.sip
index eb29824..935bf11 100644
--- a/sip/tqtsql/tqsqlrecord.sip
+++ b/sip/tqtsql/tqsqlrecord.sip
@@ -97,8 +97,8 @@ public:
 
 	// Create the list.
 
-	if ((l = PyList_New(sipCpp -> count())) == NULL)
-		return NULL;
+	if (!(l = PyList_New(sipCpp -> count())))
+		return nullptr;
 
 	// Get it.
 
@@ -109,12 +109,12 @@ public:
 	{
 		PyObject *tmobj;
 
-		if ((tmobj = sipConvertFromNewInstance(new TQSqlFieldInfo(*it),sipClass_TQSqlFieldInfo,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0)
+		if (!(tmobj = sipConvertFromNewInstance(new TQSqlFieldInfo(*it),sipClass_TQSqlFieldInfo,sipTransferObj)) || PyList_SetItem(l,i,tmobj) < 0)
 		{
 			Py_XDECREF(tmobj);
 			Py_DECREF(l);
 
-			return NULL;
+			return nullptr;
 		}
 
 		++i;
@@ -128,7 +128,7 @@ public:
 	// Convert a Python list of TQSqlFieldInfo instances to a TQSqlRecordInfo
 	// on the heap.
  
-	if (sipIsErr == NULL)
+	if (!sipIsErr)
 	{
 		if (!PyList_Check(sipPy))
 			return 0;
diff --git a/sip/tqttable/tqtable.sip b/sip/tqttable/tqtable.sip
index 8b19fea..3bbb5fb 100644
--- a/sip/tqttable/tqtable.sip
+++ b/sip/tqttable/tqtable.sip
@@ -222,7 +222,7 @@ public:
 	TQTable(int,int,TQWidget * /TransferThis/ = 0,const char * = 0);
 
 %ConvertToSubClassCode
-	sipClass = (sipCpp->inherits(sipName_TQTable) ? sipClass_TQTable : NULL);
+	sipClass = (sipCpp->inherits(sipName_TQTable) ? sipClass_TQTable : nullptr);
 %End
 
 	TQHeader *horizontalHeader() const;
-- 
cgit v1.2.3

