From b833687c4db2ccae97ed7ffa00bb9d9395482bf2 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sat, 3 Oct 2026 21:18:52 -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>
---
 src/kreplacements/ShellContextMenu.cpp | 72 +++++++++++++++++-----------------
 src/kreplacements/kreplacements.cpp    |  2 +-
 2 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/src/kreplacements/ShellContextMenu.cpp b/src/kreplacements/ShellContextMenu.cpp
index e79b68c..e43e07b 100644
--- a/src/kreplacements/ShellContextMenu.cpp
+++ b/src/kreplacements/ShellContextMenu.cpp
@@ -51,14 +51,14 @@ void showShellContextMenu( const TQString& itemPath, TQPoint pt, TQWidget* pPare
        pMenu->activateItemAt(id-1);
 }
 
-IContextMenu2 * g_IContext2 = NULL;
-IContextMenu3 * g_IContext3 = NULL;
+IContextMenu2 * g_IContext2 = nullptr;
+IContextMenu3 * g_IContext3 = nullptr;
 
 CShellContextMenu::CShellContextMenu()
 {
-	m_psfFolder = NULL;
-	m_pidlArray = NULL;
-	m_hMenu = NULL;
+	m_psfFolder = nullptr;
+	m_pidlArray = nullptr;
+	m_hMenu = nullptr;
 }
 
 CShellContextMenu::~CShellContextMenu()
@@ -66,9 +66,9 @@ CShellContextMenu::~CShellContextMenu()
 	// free all allocated datas
 	if (m_psfFolder && bDelete)
 		m_psfFolder->Release ();
-	m_psfFolder = NULL;
+	m_psfFolder = nullptr;
 	FreePIDLArray (m_pidlArray);
-	m_pidlArray = NULL;
+	m_pidlArray = nullptr;
 
 	if (m_hMenu)
 		DestroyMenu( m_hMenu );
@@ -80,13 +80,13 @@ CShellContextMenu::~CShellContextMenu()
 // and returns that interface
 BOOL CShellContextMenu::GetContextMenu (void ** ppContextMenu, int & iMenuType)
 {
-	*ppContextMenu = NULL;
-	LPCONTEXTMENU icm1 = NULL;
+	*ppContextMenu = nullptr;
+	LPCONTEXTMENU icm1 = nullptr;
 	
         if ( m_psfFolder==0 )
            return FALSE;
 	// first we retrieve the normal IContextMenu interface (every object should have it)
-	m_psfFolder->GetUIObjectOf (NULL, nItems, (LPCITEMIDLIST *) m_pidlArray, IID_IContextMenu, NULL, (void**) &icm1);
+	m_psfFolder->GetUIObjectOf (nullptr, nItems, (LPCITEMIDLIST *) m_pidlArray, IID_IContextMenu, nullptr, (void**) &icm1);
 
 	if (icm1)
 	{	// since we got an IContextMenu interface we can now obtain the higher version interfaces via that
@@ -183,7 +183,7 @@ UINT CShellContextMenu::ShowContextMenu(TQWidget * pParentWidget, TQPoint pt, TQ
 			g_IContext3 = (LPCONTEXTMENU3) pContextMenu;
 	}
 	else
-		OldWndProc = NULL;
+		OldWndProc = nullptr;
 
 	UINT idCommand = TrackPopupMenu (m_hMenu,TPM_RETURNCMD | TPM_LEFTALIGN, pt.x(), pt.y(), 0, pParentWidget->winId(), 0);
 
@@ -197,8 +197,8 @@ UINT CShellContextMenu::ShowContextMenu(TQWidget * pParentWidget, TQPoint pt, TQ
 	}
 	
 	pContextMenu->Release();
-	g_IContext2 = NULL;
-	g_IContext3 = NULL;
+	g_IContext2 = nullptr;
+	g_IContext3 = nullptr;
 
 	return (idCommand);
 }
@@ -231,27 +231,27 @@ void CShellContextMenu::SetObjects(const TQStringList &strList)
 	// free all allocated datas
 	if (m_psfFolder && bDelete)
 		m_psfFolder->Release ();
-	m_psfFolder = NULL;
+	m_psfFolder = nullptr;
 	FreePIDLArray (m_pidlArray);
-	m_pidlArray = NULL;
+	m_pidlArray = nullptr;
 	
 	// get IShellFolder interface of Desktop (root of shell namespace)
-	IShellFolder * psfDesktop = NULL;
+	IShellFolder * psfDesktop = nullptr;
 	SHGetDesktopFolder (&psfDesktop);	// needed to obtain full qualified pidl
 
 	// ParseDisplayName creates a PIDL from a file system path relative to the IShellFolder interface
 	// but since we use the Desktop as our interface and the Desktop is the namespace root
 	// that means that it's a fully qualified PIDL, which is what we need
-	LPITEMIDLIST pidl = NULL;
+	LPITEMIDLIST pidl = nullptr;
 	
-	psfDesktop->ParseDisplayName (NULL, 0, (LPOLESTR)strList[0].ucs2(), NULL, &pidl, NULL);
+	psfDesktop->ParseDisplayName (nullptr, 0, (LPOLESTR)strList[0].ucs2(), nullptr, &pidl, nullptr);
 
 	// now we need the parent IShellFolder interface of pidl, and the relative PIDL to that interface
-	LPITEMIDLIST pidlItem = NULL;	// relative pidl
-	SHBindToParentEx (pidl, IID_IShellFolder, (void **) &m_psfFolder, NULL);
+	LPITEMIDLIST pidlItem = nullptr;	// relative pidl
+	SHBindToParentEx (pidl, IID_IShellFolder, (void **) &m_psfFolder, nullptr);
 	free (pidlItem);
 	// get interface to IMalloc (need to free the PIDLs allocated by the shell functions)
-	LPMALLOC lpMalloc = NULL;
+	LPMALLOC lpMalloc = nullptr;
 	SHGetMalloc (&lpMalloc);
 	lpMalloc->Free (pidl);
 
@@ -259,12 +259,12 @@ void CShellContextMenu::SetObjects(const TQStringList &strList)
 	// since we assume that all objects are in the same folder (as it's stated in the MSDN)
 	// we now have the IShellFolder interface to every objects parent folder
 	
-	IShellFolder * psfFolder = NULL;
+	IShellFolder * psfFolder = nullptr;
 	nItems = strList.size ();
 	for (int i = 0; i < nItems; i++)
 	{
                 pidl=0;
-		psfDesktop->ParseDisplayName (NULL, 0, (LPOLESTR)strList[i].ucs2(), NULL, &pidl, NULL);
+		psfDesktop->ParseDisplayName (nullptr, 0, (LPOLESTR)strList[i].ucs2(), nullptr, &pidl, nullptr);
                 if (pidl)
                 {
                      m_pidlArray = (LPITEMIDLIST *) realloc (m_pidlArray, (i + 1) * sizeof (LPITEMIDLIST));
@@ -290,13 +290,13 @@ void CShellContextMenu::SetObjects(LPITEMIDLIST /*pidl*/)
    // free all allocated datas
 	if (m_psfFolder && bDelete)
 		m_psfFolder->Release ();
-	m_psfFolder = NULL;
+	m_psfFolder = nullptr;
 	FreePIDLArray (m_pidlArray);
-	m_pidlArray = NULL;
+	m_pidlArray = nullptr;
 
 		// full qualified PIDL is passed so we need
 	// its parent IShellFolder interface and its relative PIDL to that
-	LPITEMIDLIST pidlItem = NULL;
+	LPITEMIDLIST pidlItem = nullptr;
 	SHBindToParent ((LPCITEMIDLIST) pidl, IID_IShellFolder, (void **) &m_psfFolder, (LPCITEMIDLIST *) &pidlItem);	
 
 	m_pidlArray = (LPITEMIDLIST *) malloc (sizeof (LPITEMIDLIST));	// allocate ony for one elemnt
@@ -304,7 +304,7 @@ void CShellContextMenu::SetObjects(LPITEMIDLIST /*pidl*/)
 
 
 	// now free pidlItem via IMalloc interface (but not m_psfFolder, that we need later
-	LPMALLOC lpMalloc = NULL;
+	LPMALLOC lpMalloc = nullptr;
 	SHGetMalloc (&lpMalloc);
 	lpMalloc->Free (pidlItem);
 	lpMalloc->Release();
@@ -321,9 +321,9 @@ void CShellContextMenu::SetObjects(IShellFolder *psfFolder, LPITEMIDLIST pidlIte
 	// free all allocated datas
 	if (m_psfFolder && bDelete)
 		m_psfFolder->Release ();
-	m_psfFolder = NULL;
+	m_psfFolder = nullptr;
 	FreePIDLArray (m_pidlArray);
-	m_pidlArray = NULL;
+	m_pidlArray = nullptr;
 
 	m_psfFolder = psfFolder;
 
@@ -339,9 +339,9 @@ void CShellContextMenu::SetObjects(IShellFolder * psfFolder, LPITEMIDLIST *pidlA
 	// free all allocated datas
 	if (m_psfFolder && bDelete)
 		m_psfFolder->Release ();
-	m_psfFolder = NULL;
+	m_psfFolder = nullptr;
 	FreePIDLArray (m_pidlArray);
-	m_pidlArray = NULL;
+	m_pidlArray = nullptr;
 
 	m_psfFolder = psfFolder;
 
@@ -417,7 +417,7 @@ HRESULT CShellContextMenu::SHBindToParentEx (LPCITEMIDLIST pidl, REFIID riid, VO
 	if (nCount == 0)	// desktop pidl of invalid pidl
 		return E_POINTER;
 
-	IShellFolder * psfDesktop = NULL;
+	IShellFolder * psfDesktop = nullptr;
 	SHGetDesktopFolder (&psfDesktop);
 	if (nCount == 1)	// desktop pidl
 	{
@@ -431,11 +431,11 @@ HRESULT CShellContextMenu::SHBindToParentEx (LPCITEMIDLIST pidl, REFIID riid, VO
 	}
 
 	LPBYTE pRel = GetPIDLPos (pidl, nCount - 1);
-	LPITEMIDLIST pidlParent = NULL;
+	LPITEMIDLIST pidlParent = nullptr;
 	pidlParent = CopyPIDL (pidl, pRel - (LPBYTE) pidl);
-	IShellFolder * psfFolder = NULL;
+	IShellFolder * psfFolder = nullptr;
 	
-	if ((hr = psfDesktop->BindToObject (pidlParent, NULL, IID_IShellFolder, (void **) &psfFolder)) != S_OK)
+	if ((hr = psfDesktop->BindToObject (pidlParent, nullptr, IID_IShellFolder, (void **) &psfFolder)) != S_OK)
 	{
 		free (pidlParent);
 		psfDesktop->Release ();
@@ -469,7 +469,7 @@ LPBYTE CShellContextMenu::GetPIDLPos (LPCITEMIDLIST pidl, int nPos)
 	}
 	if (nCount == nPos) 
 		return pCur;
-	return NULL;
+	return nullptr;
 }
 
 
diff --git a/src/kreplacements/kreplacements.cpp b/src/kreplacements/kreplacements.cpp
index a742ca1..73c1376 100644
--- a/src/kreplacements/kreplacements.cpp
+++ b/src/kreplacements/kreplacements.cpp
@@ -91,7 +91,7 @@ static void showHelp()
       else
       {
          TQFileInfo prog( buf );
-         _spawnlp( _P_NOWAIT , prog.filePath().ascii(), prog.fileName().ascii(), ("\"file:///"+helpFile.absFilePath()+"\"").ascii(), NULL );
+         _spawnlp( _P_NOWAIT , prog.filePath().ascii(), prog.fileName().ascii(), ("\"file:///"+helpFile.absFilePath()+"\"").ascii(), nullptr );
       }
 
    #else
-- 
cgit v1.2.3

