From 1ef5f4f008ef43e65edef5cf3041105543639fbd Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sat, 3 Oct 2026 17:47:21 -0300
Subject: Replace zero 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>
---
 kdbg/brkpt.cpp              | 18 ++++-----
 kdbg/brkpt.h                |  2 +-
 kdbg/dbgdriver.cpp          | 22 +++++------
 kdbg/dbgdriver.h            |  8 ++--
 kdbg/dbgmainwnd.cpp         | 60 ++++++++++++++---------------
 kdbg/debugger.cpp           | 92 ++++++++++++++++++++++-----------------------
 kdbg/exprwnd.cpp            | 86 +++++++++++++++++++++---------------------
 kdbg/gdbdriver.cpp          | 76 ++++++++++++++++++-------------------
 kdbg/main.cpp               | 20 +++++-----
 kdbg/mainwndbase.cpp        | 30 +++++++--------
 kdbg/memwindow.cpp          |  4 +-
 kdbg/pgmargs.cpp            | 22 +++++------
 kdbg/procattach.cpp         | 14 +++----
 kdbg/programconfig.cpp      |  2 +-
 kdbg/regwnd.cpp             | 18 ++++-----
 kdbg/regwnd.h               |  2 +-
 kdbg/sourcewnd.cpp          |  2 +-
 kdbg/sourcewnd.h            |  2 +-
 kdbg/testprogs/testfile.cpp |  4 +-
 kdbg/testprogs/widechar.cpp |  4 +-
 kdbg/threadlist.cpp         | 12 +++---
 kdbg/ttywnd.cpp             |  8 ++--
 kdbg/typetable.cpp          | 16 ++++----
 kdbg/winstack.cpp           | 22 +++++------
 kdbg/xsldbgdriver.cpp       | 46 +++++++++++------------
 25 files changed, 295 insertions(+), 297 deletions(-)

diff --git a/kdbg/brkpt.cpp b/kdbg/brkpt.cpp
index 4248436..6bf40a4 100644
--- a/kdbg/brkpt.cpp
+++ b/kdbg/brkpt.cpp
@@ -36,7 +36,7 @@ public:
 
 BreakpointTable::BreakpointTable(TQWidget* parent, const char* name) :
 	TQWidget(parent, name),
-	m_debugger(0),
+	m_debugger(nullptr),
 	m_bpEdit(this, "bpedit"),
 	m_list(this, "bptable"),
 	m_btAddBP(this, "addbp"),
@@ -123,7 +123,7 @@ void BreakpointTable::updateBreakList()
 {
     std::list<BreakpointItem*> deletedItems;
 
-    for (TQListViewItem* it = m_list.firstChild(); it != 0; it = it->nextSibling()) {
+    for (TQListViewItem* it = m_list.firstChild(); it; it = it->nextSibling()) {
 	deletedItems.push_back(static_cast<BreakpointItem*>(it));
     }
 
@@ -195,7 +195,7 @@ void BreakpointTable::addWP()
 void BreakpointTable::removeBP()
 {
     BreakpointItem* bp = static_cast<BreakpointItem*>(m_list.currentItem());
-    if (bp != 0) {
+    if (bp) {
 	m_debugger->deleteBreakpoint(bp->id);
 	// note that bp may be deleted by now
 	// (if bp was an orphaned breakpoint)
@@ -205,7 +205,7 @@ void BreakpointTable::removeBP()
 void BreakpointTable::enadisBP()
 {
     BreakpointItem* bp = static_cast<BreakpointItem*>(m_list.currentItem());
-    if (bp != 0) {
+    if (bp) {
 	m_debugger->enableDisableBreakpoint(bp->id);
     }
 }
@@ -213,7 +213,7 @@ void BreakpointTable::enadisBP()
 void BreakpointTable::viewBP()
 {
     BreakpointItem* bp = static_cast<BreakpointItem*>(m_list.currentItem());
-    if (bp == 0)
+    if (!bp)
 	return;
 
     emit activateFileLine(bp->fileName, bp->lineNo, bp->address);
@@ -226,9 +226,9 @@ void BreakpointTable::updateUI()
     m_btAddWP.setEnabled(enableChkpt);
 
     BreakpointItem* bp = static_cast<BreakpointItem*>(m_list.currentItem());
-    m_btViewCode.setEnabled(bp != 0);
+    m_btViewCode.setEnabled(bp);
 
-    if (bp == 0) {
+    if (!bp) {
 	enableChkpt = false;
     } else {
 	if (bp->enabled()) {
@@ -251,7 +251,7 @@ bool BreakpointTable::eventFilter(TQObject* ob, TQEvent* ev)
 	    // enable or disable the clicked-on item
 	    BreakpointItem* bp =
 		static_cast<BreakpointItem*>(m_list.itemAt(mev->pos()));
-	    if (bp != 0)
+	    if (bp)
 	    {
 		m_debugger->enableDisableBreakpoint(bp->id);
 	    }
@@ -287,7 +287,7 @@ protected:
 void BreakpointTable::conditionalBP()
 {
     BreakpointItem* bp = static_cast<BreakpointItem*>(m_list.currentItem());
-    if (bp == 0)
+    if (!bp)
 	return;
 
     /*
diff --git a/kdbg/brkpt.h b/kdbg/brkpt.h
index 75af05e..00ff528 100644
--- a/kdbg/brkpt.h
+++ b/kdbg/brkpt.h
@@ -41,7 +41,7 @@ protected:
     TQValueVector<TQPixmap> m_icons;
 
     void insertBreakpoint(int num, bool temp, bool enabled, TQString location,
-			  TQString fileName = 0, int lineNo = -1,
+			  TQString fileName = nullptr, int lineNo = -1,
 			  int hits = 0, uint ignoreCount = 0,
 			  TQString condition = TQString());
     void initListAndIcons();
diff --git a/kdbg/dbgdriver.cpp b/kdbg/dbgdriver.cpp
index 3f9f1f6..d7e203b 100644
--- a/kdbg/dbgdriver.cpp
+++ b/kdbg/dbgdriver.cpp
@@ -20,10 +20,10 @@
 DebuggerDriver::DebuggerDriver() :
 	TDEProcess(),
 	m_state(DSidle),
-	m_output(0),
+	m_output(nullptr),
 	m_outputLen(0),
 	m_outputAlloc(0),
-	m_activeCmd(0),
+	m_activeCmd(nullptr),
 	m_promptMinLen(0),
 	m_promptLastChar('\0')
 {
@@ -65,7 +65,7 @@ bool DebuggerDriver::startup(TQString cmdStr)
 {
     // clear command queues
     delete m_activeCmd;
-    m_activeCmd = 0;
+    m_activeCmd = nullptr;
     flushHiPriQueue();
     flushLoPriQueue();
     m_state = DSidle;
@@ -132,7 +132,7 @@ CmdQueueItem* DebuggerDriver::executeCmdString(DbgCommand cmd,
 	    ASSERT(m_activeCmd != 0);
 	    TRACE(TQString("interrupted the command %1").arg((m_activeCmd ? m_activeCmd->m_cmd : -1)));
 	    delete m_activeCmd;
-	    m_activeCmd = 0;
+	    m_activeCmd = nullptr;
 	}
 	flushLoPriQueue();
     }
@@ -155,12 +155,12 @@ CmdQueueItem* DebuggerDriver::queueCmdString(DbgCommand cmd,
 {
     // place a new command into the low-priority queue
     std::list<CmdQueueItem*>::iterator i;
-    CmdQueueItem* cmdItem = 0;
+    CmdQueueItem* cmdItem = nullptr;
     switch (mode) {
     case TQMoverrideMoreEqual:
     case TQMoverride:
 	// check whether gdb is currently processing this command
-	if (m_activeCmd != 0 &&
+	if (m_activeCmd &&
 	    m_activeCmd->m_cmd == cmd && m_activeCmd->m_cmdString == cmdString)
 	{
 	    return m_activeCmd;
@@ -284,7 +284,7 @@ void DebuggerDriver::slotCommandRead(TDEProcess*)
     while (!m_delayedOutput.empty()) {
 	TQByteArray delayed = m_delayedOutput.front();
 	m_delayedOutput.pop();
-	slotReceiveOutput(0, const_cast<char*>(delayed.data()), delayed.size());
+	slotReceiveOutput(nullptr, const_cast<char*>(delayed.data()), delayed.size());
     }
 }
 
@@ -319,7 +319,7 @@ void DebuggerDriver::slotReceiveOutput(TDEProcess*, char* buffer, int buflen)
      * The user haltet kdbg with Ctrl-Z, then continues it with "fg", which
      * also continues gdb, which repeats the prompt!
      */
-    if (m_activeCmd == 0 && m_state != DSinterrupted) {
+    if (!m_activeCmd && m_state != DSinterrupted) {
 	// ignore the output
 	TRACE("ignoring stray output: " + TQString::fromLatin1(buffer, buflen));
 	return;
@@ -403,7 +403,7 @@ void DebuggerDriver::slotReceiveOutput(TDEProcess*, char* buffer, int buflen)
 	     */
 	    ASSERT(m_state != DSidle);
 	    CmdQueueItem* cmd = m_activeCmd;
-	    m_activeCmd = 0;
+	    m_activeCmd = nullptr;
 	    commandFinished(cmd);
 	    delete cmd;
 	}
@@ -435,12 +435,12 @@ void DebuggerDriver::slotReceiveOutput(TDEProcess*, char* buffer, int buflen)
 
 void DebuggerDriver::dequeueCmdByVar(VarTree* var)
 {
-    if (var == 0)
+    if (!var)
 	return;
 
     std::list<CmdQueueItem*>::iterator i = m_lopriCmdQueue.begin();
     while (i != m_lopriCmdQueue.end()) {
-	if ((*i)->m_expr != 0 && var->isAncestorEq((*i)->m_expr)) {
+	if ((*i)->m_expr && var->isAncestorEq((*i)->m_expr)) {
 	    // this is indeed a critical command; delete it
 	    TRACE("removing critical lopri-cmd: " + (*i)->m_cmdString);
 	    delete *i;
diff --git a/kdbg/dbgdriver.h b/kdbg/dbgdriver.h
index f7e2a01..10d5769 100644
--- a/kdbg/dbgdriver.h
+++ b/kdbg/dbgdriver.h
@@ -160,10 +160,10 @@ struct CmdQueueItem
     	m_cmd(cmd),
 	m_cmdString(str),
 	m_committed(false),
-	m_expr(0),
-	m_exprWnd(0),
+	m_expr(nullptr),
+	m_exprWnd(nullptr),
 	m_lineNo(0),
-	m_brkpt(0),
+	m_brkpt(nullptr),
 	m_existingBrkpt(0),
 	m_byUser(false)
     { }
@@ -219,7 +219,7 @@ struct StackFrame : FrameInfo
 {
     int frameNo;
     ExprValue* var;			/* more information if non-zero */
-    StackFrame() : var(0) { }
+    StackFrame() : var(nullptr) { }
     ~StackFrame();
 };
 
diff --git a/kdbg/dbgmainwnd.cpp b/kdbg/dbgmainwnd.cpp
index 6aabbbe..28b25cc 100644
--- a/kdbg/dbgmainwnd.cpp
+++ b/kdbg/dbgmainwnd.cpp
@@ -38,12 +38,12 @@
 
 
 DebuggerMainWnd::DebuggerMainWnd(const char* name) :
-	KDockMainWindow(0, name),
+	KDockMainWindow(nullptr, name),
 	DebuggerMainWndBase()
 {
     TQPixmap p;
 
-    KDockWidget* dw0 = createDockWidget("Source", p, 0, i18n("Source"));
+    KDockWidget* dw0 = createDockWidget("Source", p, nullptr, i18n("Source"));
     m_filesWindow = new WinStack(dw0, "files");
     dw0->setWidget(m_filesWindow);
     dw0->setDockSite(KDockWidget::DockCorner);
@@ -51,28 +51,28 @@ DebuggerMainWnd::DebuggerMainWnd(const char* name) :
     setView(dw0);
     setMainDockWidget(dw0);
 
-    KDockWidget* dw1 = createDockWidget("Stack", p, 0, i18n("Stack"));
+    KDockWidget* dw1 = createDockWidget("Stack", p, nullptr, i18n("Stack"));
     m_btWindow = new TQListBox(dw1, "backtrace");
     dw1->setWidget(m_btWindow);
-    KDockWidget* dw2 = createDockWidget("Locals", p, 0, i18n("Locals"));
+    KDockWidget* dw2 = createDockWidget("Locals", p, nullptr, i18n("Locals"));
     m_localVariables = new ExprWnd(dw2, i18n("Variable"), "locals");
     dw2->setWidget(m_localVariables);
-    KDockWidget* dw3 = createDockWidget("Watches", p, 0, i18n("Watches"));
+    KDockWidget* dw3 = createDockWidget("Watches", p, nullptr, i18n("Watches"));
     m_watches = new WatchWindow(dw3, "watches");
     dw3->setWidget(m_watches);
-    KDockWidget* dw4 = createDockWidget("Registers", p, 0, i18n("Registers"));
+    KDockWidget* dw4 = createDockWidget("Registers", p, nullptr, i18n("Registers"));
     m_registers = new RegisterView(dw4, "registers");
     dw4->setWidget(m_registers);
-    KDockWidget* dw5 = createDockWidget("Breakpoints", p, 0, i18n("Breakpoints"));
+    KDockWidget* dw5 = createDockWidget("Breakpoints", p, nullptr, i18n("Breakpoints"));
     m_bpTable = new BreakpointTable(dw5, "breakpoints");
     dw5->setWidget(m_bpTable);
-    KDockWidget* dw6 = createDockWidget("Output", p, 0, i18n("Output"));
+    KDockWidget* dw6 = createDockWidget("Output", p, nullptr, i18n("Output"));
     m_ttyWindow = new TTYWindow(dw6, "output");
     dw6->setWidget(m_ttyWindow);
-    KDockWidget* dw7 = createDockWidget("Threads", p, 0, i18n("Threads"));
+    KDockWidget* dw7 = createDockWidget("Threads", p, nullptr, i18n("Threads"));
     m_threads = new ThreadList(dw7, "threads");
     dw7->setWidget(m_threads);
-    KDockWidget* dw8 = createDockWidget("Memory", p, 0, i18n("Memory"));
+    KDockWidget* dw8 = createDockWidget("Memory", p, nullptr, i18n("Memory"));
     m_memoryWindow = new MemoryWindow(dw8, "memory");
     dw8->setWidget(m_memoryWindow);
 
@@ -160,7 +160,7 @@ DebuggerMainWnd::~DebuggerMainWnd()
     saveSettings(tdeApp->config());
     // must delete m_debugger early since it references our windows
     delete m_debugger;
-    m_debugger = 0;
+    m_debugger = nullptr;
 
     delete m_memoryWindow;
     delete m_threads;
@@ -325,7 +325,7 @@ void DebuggerMainWnd::initToolbar()
 
 bool DebuggerMainWnd::queryClose()
 {
-    if (m_debugger != 0) {
+    if (m_debugger) {
 	m_debugger->shutdown();
     }
     return true;
@@ -337,7 +337,7 @@ void DebuggerMainWnd::saveProperties(TDEConfig* config)
 {
     // session management
     TQString executable = "";
-    if (m_debugger != 0) {
+    if (m_debugger) {
 	executable = m_debugger->executable();
     }
     config->writeEntry("executable", executable);
@@ -498,7 +498,7 @@ void DebuggerMainWnd::updateLineItems()
 
 void DebuggerMainWnd::slotAddWatch()
 {
-    if (m_debugger != 0) {
+    if (m_debugger) {
 	TQString t = m_watches->watchText();
 	m_debugger->addWatch(t);
     }
@@ -506,7 +506,7 @@ void DebuggerMainWnd::slotAddWatch()
 
 void DebuggerMainWnd::slotAddWatch(const TQString& text)
 {
-    if (m_debugger != 0) {
+    if (m_debugger) {
 	m_debugger->addWatch(text);
     }
 }
@@ -514,29 +514,29 @@ void DebuggerMainWnd::slotAddWatch(const TQString& text)
 void DebuggerMainWnd::slotNewFileLoaded()
 {
     // updates program counter in the new file
-    if (m_debugger != 0)
+    if (m_debugger)
 	m_filesWindow->updateLineItems(m_debugger);
 }
 
 KDockWidget* DebuggerMainWnd::dockParent(TQWidget* w)
 {
-    while ((w = w->parentWidget()) != 0) {
+    while ((w = w->parentWidget()) != nullptr) {
 	if (w->isA("KDockWidget"))
 	    return static_cast<KDockWidget*>(w);
     }
-    return 0;
+    return nullptr;
 }
 
 bool DebuggerMainWnd::isDockVisible(TQWidget* w)
 {
     KDockWidget* d = dockParent(w);
-    return d != 0 && d->mayBeHide();
+    return d && d->mayBeHide();
 }
 
 bool DebuggerMainWnd::canChangeDockVisibility(TQWidget* w)
 {
     KDockWidget* d = dockParent(w);
-    return d != 0 && (d->mayBeHide() || d->mayBeShow());
+    return d && (d->mayBeHide() || d->mayBeShow());
 }
 
 // upgrades the entries from version 0.0.4 to 0.0.5 and back
@@ -638,7 +638,7 @@ void DebuggerMainWnd::slotToggleBreak(const TQString& fileName, int lineNo,
 				      const DbgAddr& address, bool temp)
 {
     // lineNo is zero-based
-    if (m_debugger != 0) {
+    if (m_debugger) {
 	m_debugger->setBreakpoint(fileName, lineNo, address, temp);
     }
 }
@@ -647,7 +647,7 @@ void DebuggerMainWnd::slotEnaDisBreak(const TQString& fileName, int lineNo,
 				      const DbgAddr& address)
 {
     // lineNo is zero-based
-    if (m_debugger != 0) {
+    if (m_debugger) {
 	m_debugger->enableDisableBreakpoint(fileName, lineNo, address);
     }
 }
@@ -713,7 +713,7 @@ void DebuggerMainWnd::slotLocalsPopup(TQListViewItem*, const TQPoint& pt)
 {
     TQPopupMenu* popup =
 	static_cast<TQPopupMenu*>(factory()->container("popup_locals", this));
-    if (popup == 0) {
+    if (!popup) {
         return;
     }
     if (popup->isVisible()) {
@@ -730,7 +730,7 @@ void DebuggerMainWnd::slotLocalsToWatch()
 {
     VarTree* item = m_localVariables->selectedItem();
 
-    if (item != 0 && m_debugger != 0) {
+    if (item && m_debugger) {
 	TQString text = item->computeExpr();
 	m_debugger->addWatch(text);
     }
@@ -759,7 +759,7 @@ void DebuggerMainWnd::slotEditValue()
     }
     
     VarTree* expr = wnd->currentItem();
-    if (expr != 0 && m_debugger != 0 && m_debugger->canSingleStep())
+    if (expr && m_debugger && m_debugger->canSingleStep())
     {
 	TRACE("edit value");
 	// determine the text to edit
@@ -798,7 +798,7 @@ void DebuggerMainWnd::slotFileExe()
     {
 	// open a new executable
 	TQString executable = myGetFileName(i18n("Select the executable to debug"),
-					   m_lastDirectory, 0, this);
+					   m_lastDirectory, nullptr, this);
 	if (executable.isEmpty())
 	    return;
 
@@ -811,7 +811,7 @@ void DebuggerMainWnd::slotFileCore()
     if (m_debugger->canStart())
     {
 	TQString corefile = myGetFileName(i18n("Select core dump"),
-					 m_lastDirectory, 0, this);
+					 m_lastDirectory, nullptr, this);
 	if (!corefile.isEmpty()) {
 	    m_debugger->useCoreFile(corefile, false);
 	}
@@ -820,7 +820,7 @@ void DebuggerMainWnd::slotFileCore()
 
 void DebuggerMainWnd::slotFileProgSettings()
 {
-    if (m_debugger != 0) {
+    if (m_debugger) {
 	m_debugger->programSettings(this);
     }
 }
@@ -836,7 +836,7 @@ void DebuggerMainWnd::slotViewStatusbar()
 
 void DebuggerMainWnd::slotExecUntil()
 {
-    if (m_debugger != 0)
+    if (m_debugger)
     {
 	TQString file;
 	int lineNo;
@@ -863,7 +863,7 @@ void DebuggerMainWnd::slotExecAttach()
 
 void DebuggerMainWnd::slotExecArgs()
 {
-    if (m_debugger != 0) {
+    if (m_debugger) {
 	m_debugger->programArgs(this);
     }
 }
diff --git a/kdbg/debugger.cpp b/kdbg/debugger.cpp
index ca608bc..d428d62 100644
--- a/kdbg/debugger.cpp
+++ b/kdbg/debugger.cpp
@@ -38,9 +38,9 @@ KDebugger::KDebugger(TQWidget* parent,
 	m_programActive(false),
 	m_programRunning(false),
 	m_sharedLibsListed(false),
-	m_typeTable(0),
-	m_programConfig(0),
-	m_d(0),
+	m_typeTable(nullptr),
+	m_programConfig(nullptr),
+	m_d(nullptr),
 	m_localVariables(*localVars),
 	m_watchVariables(*watchVars),
 	m_btWindow(*backtrace)
@@ -63,7 +63,7 @@ KDebugger::KDebugger(TQWidget* parent,
 
 KDebugger::~KDebugger()
 {
-    if (m_programConfig != 0) {
+    if (m_programConfig) {
 	saveProgramSettings();
 	m_programConfig->sync();
 	delete m_programConfig;
@@ -93,7 +93,7 @@ const char KDebugger::DriverNameEntry[] = "DriverName";
 bool KDebugger::debugProgram(const TQString& name,
 			     DebuggerDriver* driver)
 {
-    if (m_d != 0 && m_d->isRunning())
+    if (m_d && m_d->isRunning())
     {
 	TQApplication::setOverrideCursor(waitCursor);
 
@@ -107,7 +107,7 @@ bool KDebugger::debugProgram(const TQString& name,
 	    return false;
 	}
 	delete m_d;
-	m_d = 0;
+	m_d = nullptr;
     }
 
     // wire up the driver
@@ -129,7 +129,7 @@ bool KDebugger::debugProgram(const TQString& name,
     openProgramConfig(name);
 
     // get debugger command from per-program settings
-    if (m_programConfig != 0) {
+    if (m_programConfig) {
 	m_programConfig->setGroup(GeneralGroup);
 	m_debuggerCmd = readDebuggerCmd();
 	// get terminal emulation level
@@ -141,7 +141,7 @@ bool KDebugger::debugProgram(const TQString& name,
 
     if (!startDriver()) {
 	TRACE("startDriver failed");
-	m_d = 0;
+	m_d = nullptr;
 	return false;
     }
 
@@ -170,7 +170,7 @@ bool KDebugger::debugProgram(const TQString& name,
 void KDebugger::shutdown()
 {
     // shut down debugger driver
-    if (m_d != 0 && m_d->isRunning())
+    if (m_d && m_d->isRunning())
     {
 	stopDriver();
     }
@@ -546,12 +546,12 @@ bool KDebugger::canStart()
 bool KDebugger::isReady() const 
 {
     return m_haveExecutable &&
-	m_d != 0 && m_d->canExecuteImmediately();
+	m_d && m_d->canExecuteImmediately();
 }
 
 bool KDebugger::isIdle() const
 {
-    return m_d == 0 || m_d->isIdle();
+    return !m_d || m_d->isIdle();
 }
 
 
@@ -631,18 +631,18 @@ void KDebugger::gdbExited(TDEProcess*)
      * main", otherwise we would save an empty config file, because it
      * isn't read in until then!
      */
-    if (m_programConfig != 0) {
+    if (m_programConfig) {
 	if (m_haveExecutable) {
 	    saveProgramSettings();
 	    m_programConfig->sync();
 	}
 	delete m_programConfig;
-	m_programConfig = 0;
+	m_programConfig = nullptr;
     }
 
     // erase types
     delete m_typeTable;
-    m_typeTable = 0;
+    m_typeTable = nullptr;
 
     if (m_explicitKill) {
 	TRACE(m_d->driverName() + " exited normally");
@@ -709,7 +709,7 @@ void KDebugger::saveProgramSettings()
     m_programConfig->writeEntry(DebuggerCmdStr, m_debuggerCmd);
     m_programConfig->writeEntry(TTYLevelEntry, int(m_ttyLevel));
     TQString driverName;
-    if (m_d != 0)
+    if (m_d)
 	driverName = m_d->driverName();
     m_programConfig->writeEntry(DriverNameEntry, driverName);
 
@@ -720,7 +720,7 @@ void KDebugger::saveProgramSettings()
     EnvVar* var;
     TQString varName;
     TQString varValue;
-    for (int i = 0; (var = it) != 0; ++it, ++i) {
+    for (int i = 0; (var = it) != nullptr; ++it, ++i) {
 	varName.sprintf(Variable, i);
 	varValue.sprintf(Value, i);
 	m_programConfig->writeEntry(varName, it.currentKey());
@@ -736,7 +736,7 @@ void KDebugger::saveProgramSettings()
     m_programConfig->setGroup(WatchGroup);
     VarTree* item = m_watchVariables.firstChild();
     int watchNum = 0;
-    for (; item != 0; item = item->nextSibling(), ++watchNum) {
+    for (; item; item = item->nextSibling(), ++watchNum) {
 	varName.sprintf(ExprFmt, watchNum);
 	m_programConfig->writeEntry(varName, item->getText());
     }
@@ -978,7 +978,7 @@ void KDebugger::parse(CmdQueueItem* cmd, const char* output)
 	if (m_d->parseChangeExecutable(output, m_statusMessage))
 	{
 	    // success; restore breakpoints etc.
-	    if (m_programConfig != 0) {
+	    if (m_programConfig) {
 		restoreProgramSettings();
 	    }
 	    // load file containing main() or core file
@@ -1231,7 +1231,7 @@ void KDebugger::updateAllExprs()
 
     // update watch expressions
     VarTree* item = m_watchVariables.firstChild();
-    for (; item != 0; item = item->nextSibling()) {
+    for (; item; item = item->nextSibling()) {
 	m_watchEvalExpr.push_back(item->getText());
     }
 }
@@ -1253,7 +1253,7 @@ void KDebugger::updateProgEnvironment(const TQString& args, const TQString& wd,
     // update environment variables
     TQDictIterator<EnvVar> it = newVars;
     EnvVar* val;
-    for (; (val = it) != 0; ++it) {
+    for (; (val = it) != nullptr; ++it) {
 	TQString var = it.currentKey();
 	switch (val->status) {
 	case EnvVar::EVnew:
@@ -1333,7 +1333,7 @@ void KDebugger::handleLocals(const char* output)
 	    // old variable not in the new variables
 	    TRACE("old var deleted: " + *n);
 	    VarTree* v = m_localVariables.topLevelExprByName(*n);
-	    if (v != 0) {
+	    if (v) {
 		m_localVariables.removeExpr(v);
 	    }
 	} else {
@@ -1394,7 +1394,7 @@ bool KDebugger::handlePrint(CmdQueueItem* cmd, const char* output)
     ASSERT(cmd->m_expr != 0);
 
     ExprValue* variable = m_d->parsePrintExpr(output, true);
-    if (variable == 0)
+    if (!variable)
 	return false;
 
     // set expression "name"
@@ -1416,7 +1416,7 @@ bool KDebugger::handlePrintDeref(CmdQueueItem* cmd, const char* output)
     ASSERT(cmd->m_expr != 0);
 
     ExprValue* variable = m_d->parsePrintExpr(output, true);
-    if (variable == 0)
+    if (!variable)
 	return false;
 
     // set expression "name"
@@ -1465,7 +1465,7 @@ void KDebugger::handleBacktrace(const char* output)
 
 	for (; frm != stack.end(); ++frm) {
 	    TQString func;
-	    if (frm->var != 0)
+	    if (frm->var)
 		func = frm->var->m_name;
 	    else
 		func = frm->fileName + ":" + TQString().setNum(frm->lineNo+1);
@@ -1507,14 +1507,14 @@ void KDebugger::evalExpressions()
     //   types in watch expressions
     //   struct members in local variables
     //   struct members in watch expressions
-    VarTree* exprItem = 0;
+    VarTree* exprItem = nullptr;
     if (!m_watchEvalExpr.empty())
     {
 	TQString expr = m_watchEvalExpr.front();
 	m_watchEvalExpr.pop_front();
 	exprItem = m_watchVariables.topLevelExprByName(expr);
     }
-    if (exprItem != 0) {
+    if (exprItem) {
 	CmdQueueItem* cmd = m_d->queueCmd(DCprint, exprItem->getText(), DebuggerDriver::TQMoverride);
 	// remember which expr this was
 	cmd->m_expr = exprItem;
@@ -1524,15 +1524,15 @@ void KDebugger::evalExpressions()
 #define POINTER(widget) \
 		wnd = &widget; \
 		exprItem = widget.nextUpdatePtr(); \
-		if (exprItem != 0) goto pointer
+		if (exprItem) goto pointer
 #define STRUCT(widget) \
 		wnd = &widget; \
 		exprItem = widget.nextUpdateStruct(); \
-		if (exprItem != 0) goto ustruct
+		if (exprItem) goto ustruct
 #define TYPE(widget) \
 		wnd = &widget; \
 		exprItem = widget.nextUpdateType(); \
-		if (exprItem != 0) goto type
+		if (exprItem) goto type
     repeat:
 	POINTER(m_localVariables);
 	POINTER(m_watchVariables);
@@ -1552,7 +1552,7 @@ void KDebugger::evalExpressions()
 
 	ustruct:
 	// paranoia
-	if (exprItem->m_type == 0 || exprItem->m_type == TypeInfo::unknownType())
+	if (!exprItem->m_type || exprItem->m_type == TypeInfo::unknownType())
 	    goto repeat;
 	evalInitialStructExpression(exprItem, wnd, false);
 	return;
@@ -1563,7 +1563,7 @@ void KDebugger::evalExpressions()
 	 * it may happen that it has already been updated. Hence, we ignore
 	 * it here and go on to the next task.
 	 */
-	if (exprItem->m_type != 0)
+	if (exprItem->m_type)
 	    goto repeat;
 	determineType(wnd, exprItem);
     }
@@ -1610,7 +1610,7 @@ void KDebugger::handleFindType(CmdQueueItem* cmd, const char* output)
 
 	TypeInfo* info = m_typeTable->lookup(type);
 
-	if (info == 0) {
+	if (!info) {
 	    /*
 	     * We've asked gdb for the type of the expression in
 	     * cmd->m_expr, but it returned a name we don't know. The base
@@ -1621,12 +1621,12 @@ void KDebugger::handleFindType(CmdQueueItem* cmd, const char* output)
 	     */
 	    info = cmd->m_expr->inferTypeFromBaseClass();
 	    // if we found a type through this method, register an alias
-	    if (info != 0) {
+	    if (info) {
 		TRACE("infered alias: " + type);
 		m_typeTable->registerAlias(type, info);
 	    }
 	}
-	if (info == 0) {
+	if (!info) {
             TRACE("unknown type "+type);
 	    cmd->m_expr->m_type = TypeInfo::unknownType();
 	} else {
@@ -1654,10 +1654,8 @@ void KDebugger::handlePrintStruct(CmdQueueItem* cmd, const char* output)
     } else {
 	partExpr = m_d->parsePrintExpr(output, false);
     }
-    bool errorValue =
-	partExpr == 0 ||
-	/* we only allow simple values at the moment */
-	partExpr->m_child != 0;
+    /* we only allow simple values at the moment */
+    bool errorValue = !partExpr || partExpr->m_child;
 
     TQString partValue;
     if (errorValue)
@@ -1667,7 +1665,7 @@ void KDebugger::handlePrintStruct(CmdQueueItem* cmd, const char* output)
 	partValue = partExpr->m_value;
     }
     delete partExpr;
-    partExpr = 0;
+    partExpr = nullptr;
 
     /*
      * Updating a struct value works like this: var->m_partialValue holds
@@ -1816,7 +1814,7 @@ void KDebugger::addWatch(const TQString& t)
 {
     TQString expr = t.stripWhiteSpace();
     // don't add a watched expression again
-    if (expr.isEmpty() || m_watchVariables.topLevelExprByName(expr) != 0)
+    if (expr.isEmpty() || m_watchVariables.topLevelExprByName(expr))
 	return;
     ExprValue e(expr, VarTree::NKplain);
     m_watchVariables.insertExpr(&e, *m_typeTable);
@@ -1835,11 +1833,11 @@ void KDebugger::slotDeleteWatch()
 {
     // delete only allowed while debugger is idle; or else we might delete
     // the very expression the debugger is currently working on...
-    if (m_d == 0 || !m_d->isIdle())
+    if (!m_d || !m_d->isIdle())
 	return;
 
     VarTree* item = m_watchVariables.currentItem();
-    if (item == 0 || !item->isToplevelExpr())
+    if (!item || !item->isToplevelExpr())
 	return;
 
     // remove the variable from the list to evaluate
@@ -1868,7 +1866,7 @@ void KDebugger::handleRegisters(const char* output)
 void KDebugger::newBreakpoint(CmdQueueItem* cmd, const char* output)
 {
     BrkptIterator bp;
-    if (cmd->m_brkpt != 0) {
+    if (cmd->m_brkpt) {
 	// a new breakpoint, put it in the list
 	assert(cmd->m_brkpt->id == 0);
 	m_brkpts.push_back(*cmd->m_brkpt);
@@ -2032,15 +2030,15 @@ void KDebugger::slotValuePopup(const TQString& expr)
 {
     // search the local variables for a match
     VarTree* v = m_localVariables.topLevelExprByName(expr);
-    if (v == 0) {
+    if (!v) {
 	// not found, check watch expressions
 	v = m_watchVariables.topLevelExprByName(expr);
-	if (v == 0) {
+	if (!v) {
 	    // try a member of 'this'
 	    v = m_localVariables.topLevelExprByName("this");
-	    if (v != 0)
+	    if (v)
 		v = ExprWnd::ptrMemberByName(v, expr);
-	    if (v == 0) {
+	    if (!v) {
 		// nothing found; do nothing
 		return;
 	    }
diff --git a/kdbg/exprwnd.cpp b/kdbg/exprwnd.cpp
index a180fab..d0f4589 100644
--- a/kdbg/exprwnd.cpp
+++ b/kdbg/exprwnd.cpp
@@ -22,7 +22,7 @@ VarTree::VarTree(VarTree* parent, TQListViewItem* after, ExprValue* v) :
 	TQListViewItem(parent, after),
 	m_varKind(v->m_varKind),
 	m_nameKind(v->m_nameKind),
-	m_type(0),
+	m_type(nullptr),
 	m_exprIndex(0),
 	m_exprIndexUseGuard(false),
 	m_baseValue(v->m_value),
@@ -39,7 +39,7 @@ VarTree::VarTree(ExprWnd* parent, TQListViewItem* after, const TQString& name) :
 	TQListViewItem(parent, after),
 	m_varKind(VKsimple),
 	m_nameKind(VarTree::NKplain),
-	m_type(0),
+	m_type(nullptr),
 	m_exprIndex(0),
 	m_exprIndexUseGuard(false),
 	m_baseChanged(false),
@@ -119,16 +119,16 @@ TQString VarTree::computeExpr() const
 
 bool VarTree::isToplevelExpr() const
 {
-    return parent() == 0;
+    return parent() == nullptr;
 }
 
 bool VarTree::isAncestorEq(const VarTree* child) const
 {
     const TQListViewItem* c = child;
-    while (c != 0 && c != this) {
+    while (c && c != this) {
 	c = c->parent();
     }
-    return c != 0;
+    return c;
 }
 
 bool VarTree::updateValue(const TQString& newValue)
@@ -186,7 +186,7 @@ void VarTree::inferTypesOfChildren(ProgramTypeTable& typeTable)
 
     // first recurse children
     VarTree* child = firstChild();
-    while (child != 0) {
+    while (child) {
 	child->inferTypesOfChildren(typeTable);
 	child = child->nextSibling();
     }
@@ -211,7 +211,7 @@ void VarTree::inferTypesOfChildren(ProgramTypeTable& typeTable)
 	    m_type = typeTable.lookup(typeName);
 
 	    /* if we don't have a type yet, get it from the base class */
-	    if (m_type == 0) {
+	    if (!m_type) {
 		m_type = inferTypeFromBaseClass();
 		/*
 		 * If there is a known type now, it is the one from the
@@ -222,7 +222,7 @@ void VarTree::inferTypesOfChildren(ProgramTypeTable& typeTable)
 	    /*
 	     * If we still don't have a type, the type is really unknown.
 	     */
-	    if (m_type == 0) {
+	    if (!m_type) {
 		m_type = TypeInfo::unknownType();
 	    }
 	} // else
@@ -247,11 +247,11 @@ TypeInfo* VarTree::inferTypeFromBaseClass()
 {
     if (m_varKind == VKstruct) {
 	VarTree* child = firstChild();
-	while (child != 0 &&
+	while (child &&
 	       // only check base class parts (i.e. type names)
 	       child->m_nameKind == NKtype)
 	{
-	    if (child->m_type != 0 &&
+	    if (child->m_type &&
 		child->m_type != TypeInfo::unknownType())
 	    {
 		// got a type!
@@ -260,15 +260,15 @@ TypeInfo* VarTree::inferTypeFromBaseClass()
 	    child = child->nextSibling();
 	}
     }
-    return 0;
+    return nullptr;
 }
 
 ExprValue::ExprValue(const TQString& name, VarTree::NameKind aKind) :
 	m_name(name),
 	m_varKind(VarTree::VKsimple),
 	m_nameKind(aKind),
-	m_child(0),
-	m_next(0),
+	m_child(nullptr),
+	m_next(nullptr),
 	m_initiallyExpanded(false)
 {
 }
@@ -281,16 +281,16 @@ ExprValue::~ExprValue()
 
 void ExprValue::appendChild(ExprValue* newChild)
 {
-    if (m_child == 0) {
+    if (!m_child) {
 	m_child = newChild;
     } else {
 	// walk chain of children to find the last one
 	ExprValue* last = m_child;
-	while (last->m_next != 0)
+	while (last->m_next)
 	    last = last->m_next;
 	last->m_next = newChild;
     }
-    newChild->m_next = 0;	// just to be sure
+    newChild->m_next = nullptr;	// just to be sure
 }
 
 int ExprValue::childCount() const
@@ -308,7 +308,7 @@ int ExprValue::childCount() const
 
 ExprWnd::ExprWnd(TQWidget* parent, const TQString& colHeader, const char* name) :
 	TQListView(parent, name),
-	m_edit(0)
+	m_edit(nullptr)
 {
     addColumn(colHeader);
     addColumn(i18n("Value"));
@@ -331,7 +331,7 @@ TQStringList ExprWnd::exprList() const
 {
     TQStringList exprs;
     VarTree* item;
-    for (item = firstChild(); item != 0; item = item->nextSibling()) {
+    for (item = firstChild(); item; item = item->nextSibling()) {
 	exprs.append(item->getText());
     }
     return exprs;
@@ -340,8 +340,8 @@ TQStringList ExprWnd::exprList() const
 VarTree* ExprWnd::insertExpr(ExprValue* expr, ProgramTypeTable& typeTable)
 {
     // append a new dummy expression
-    VarTree* last = 0;	// last top-level item
-    for (VarTree* i = firstChild(); i != 0; i = i->nextSibling()) {
+    VarTree* last = nullptr;	// last top-level item
+    for (VarTree* i = firstChild(); i; i = i->nextSibling()) {
 	last = i;
     }
     VarTree* display = new VarTree(this, last, expr->m_name);
@@ -355,9 +355,9 @@ void ExprWnd::updateExpr(ExprValue* expr, ProgramTypeTable& typeTable)
 {
     // search the root variable
     VarTree* item = firstChild();
-    while (item != 0 && item->getText() != expr->m_name)
+    while (item && item->getText() != expr->m_name)
 	item = item->nextSibling();
-    if (item == 0) {
+    if (!item) {
 	return;
     }
     // now update it
@@ -406,14 +406,14 @@ void ExprWnd::updateExprRec(VarTree* display, ExprValue* newValues, ProgramTypeT
 	  * sub-tree for requiring an update.
 	  */
 	 (display->m_varKind != VarTree::VKpointer ||
-	  newValues->m_child != 0)))
+	  newValues->m_child)))
     {
 	if (isExpanded) {
 	    display->setOpen(false);
 	}
 
 	// since children changed, it is likely that the type has also changed
-	display->m_type = 0;		/* will re-evaluate the type */
+	display->m_type = nullptr;		/* will re-evaluate the type */
 
 	// display the new value
 	updateSingleExpr(display, newValues);
@@ -449,7 +449,7 @@ void ExprWnd::updateExprRec(VarTree* display, ExprValue* newValues, ProgramTypeT
 	 * If the visible sub-tree has children, but newValues doesn't, we
 	 * can stop here.
 	 */
-	if (newValues->m_child == 0) {
+	if (!newValues->m_child) {
 	    return;
 	}
     }
@@ -459,7 +459,7 @@ void ExprWnd::updateExprRec(VarTree* display, ExprValue* newValues, ProgramTypeT
     // go for children
     VarTree* vDisplay = display->firstChild();
     ExprValue* vNew = newValues->m_child;
-    while (vDisplay != 0) {
+    while (vDisplay) {
 	// check whether the names are the same
 	if (vDisplay->getText() != vNew->m_name) {
 	    // set new name
@@ -491,7 +491,7 @@ void ExprWnd::updateSingleExpr(VarTree* display, ExprValue* newValue)
      * as struct (has been set in inferTypesOfChildren()).
      */
     if (display->m_varKind == VarTree::VKstruct &&
-	display->m_type != 0 &&
+	display->m_type &&
 	display->m_type != TypeInfo::unknownType())
     {
 	ASSERT(newValue->m_varKind == VarTree::VKstruct);
@@ -531,8 +531,8 @@ void ExprWnd::replaceChildren(VarTree* display, ExprValue* newValues)
 	delete c;
     }
     // insert copies of the newValues
-    VarTree* vNew = 0;
-    for (ExprValue* v = newValues->m_child; v != 0; v = v->m_next)
+    VarTree* vNew = nullptr;
+    for (ExprValue* v = newValues->m_child; v; v = v->m_next)
     {
 	vNew = new VarTree(display, vNew, v);
 	// recurse
@@ -552,7 +552,7 @@ void ExprWnd::collectUnknownTypes(VarTree* var)
 void ExprWnd::checkUnknownType(VarTree* var)
 {
     ASSERT(var->m_varKind != VarTree::VKpointer || var->m_nameKind != VarTree::NKtype);
-    if (var->m_type == 0 &&
+    if (!var->m_type &&
 	var->m_varKind == VarTree::VKstruct &&
 	var->m_nameKind != VarTree::NKtype &&
 	var->m_nameKind != VarTree::NKanonymous)
@@ -587,7 +587,7 @@ TQString ExprWnd::formatWCharPointer(TQString value)
 VarTree* ExprWnd::topLevelExprByName(const TQString& name) const
 {
     VarTree* item = firstChild();
-    while (item != 0 && item->getText() != name)
+    while (item && item->getText() != name)
 	item = item->nextSibling();
 
     return item;
@@ -597,7 +597,7 @@ VarTree* ExprWnd::ptrMemberByName(VarTree* v, const TQString& name)
 {
     // v must be a pointer variable, must have children
     if (v->m_varKind != VarTree::VKpointer || v->childCount() == 0)
-	return 0;
+	return nullptr;
 
     // the only child of v is the pointer value that represents the struct
     VarTree* item = v->firstChild();
@@ -608,26 +608,26 @@ VarTree* ExprWnd::memberByName(VarTree* v, const TQString& name)
 {
     // search immediate children for name
     VarTree* item = v->firstChild();
-    while (item != 0 && item->getText() != name)
+    while (item && item->getText() != name)
 	item = item->nextSibling();
 
-    if (item != 0)
+    if (item)
 	return item;
 
     // try in base classes and members that are anonymous structs or unions
     item = v->firstChild();
-    while (item != 0)
+    while (item)
     {
 	if (item->m_nameKind == VarTree::NKtype ||
 	    item->m_nameKind == VarTree::NKanonymous)
 	{
 	    v = memberByName(item, name);
-	    if (v != 0)
+	    if (v)
 		return v;
 	}
 	item = item->nextSibling();
     }
-    return 0;
+    return nullptr;
 }
 
 void ExprWnd::removeExpr(VarTree* item)
@@ -648,7 +648,7 @@ void ExprWnd::unhookSubtree(VarTree* subTree)
 
 void ExprWnd::unhookSubtree(std::list<VarTree*>& list, VarTree* subTree)
 {
-    if (subTree == 0)
+    if (!subTree)
 	return;
 
     std::list<VarTree*>::iterator i = list.begin();
@@ -671,7 +671,7 @@ void ExprWnd::clearPendingUpdates()
 
 VarTree* ExprWnd::nextUpdatePtr()
 {
-    VarTree* ptr = 0;
+    VarTree* ptr = nullptr;
     if (!m_updatePtrs.empty()) {
 	ptr = m_updatePtrs.front();
 	m_updatePtrs.pop_front();
@@ -681,7 +681,7 @@ VarTree* ExprWnd::nextUpdatePtr()
 
 VarTree* ExprWnd::nextUpdateType()
 {
-    VarTree* ptr = 0;
+    VarTree* ptr = nullptr;
     if (!m_updateType.empty()) {
 	ptr = m_updateType.front();
 	m_updateType.pop_front();
@@ -691,7 +691,7 @@ VarTree* ExprWnd::nextUpdateType()
 
 VarTree* ExprWnd::nextUpdateStruct()
 {
-    VarTree* ptr = 0;
+    VarTree* ptr = nullptr;
     if (!m_updateStruct.empty()) {
 	ptr = m_updateStruct.front();
 	m_updateStruct.pop_front();
@@ -702,7 +702,7 @@ VarTree* ExprWnd::nextUpdateStruct()
 
 void ExprWnd::editValue(VarTree* item, const TQString& text)
 {
-    if (m_edit == 0)
+    if (!m_edit)
 	m_edit = new ValueEdit(this);
 
     TQRect r = itemRect(item);
@@ -751,7 +751,7 @@ void ExprWnd::editValue(VarTree* item, const TQString& text)
 
 bool ExprWnd::isEditing() const
 {
-    return m_edit != 0 && m_edit->isVisible();
+    return m_edit && m_edit->isVisible();
 }
 
 
diff --git a/kdbg/gdbdriver.cpp b/kdbg/gdbdriver.cpp
index 2cdaaa2..ca67eb1 100644
--- a/kdbg/gdbdriver.cpp
+++ b/kdbg/gdbdriver.cpp
@@ -343,14 +343,14 @@ void GdbDriver::commandFinished(CmdQueueItem* cmd)
 void GdbDriver::parseMarker()
 {
     char* startMarker = strstr(m_output, "\032\032");
-    if (startMarker == 0)
+    if (!startMarker)
 	return;
 
     // extract the marker
     startMarker += 2;
     TRACE(TQString("found marker: ") + startMarker);
     char* endMarker = strchr(startMarker, '\n');
-    if (endMarker == 0)
+    if (!endMarker)
 	return;
 
     *endMarker = '\0';
@@ -668,7 +668,7 @@ static bool parseErrorMessage(const char*& output,
     while (strncmp(output, "warning:", 8) == 0)
     {
 	const char* end = strchr(output+8, '\n');
-	if (end == 0)
+	if (!end)
 	    output += strlen(output);
 	else
 	    output = end+1;
@@ -680,11 +680,11 @@ static bool parseErrorMessage(const char*& output,
 	    // put the error message as value in the variable
 	    variable = new ExprValue(TQString(), VarTree::NKplain);
 	    const char* endMsg = strchr(output, '\n');
-	    if (endMsg == 0)
+	    if (!endMsg)
 		endMsg = output + strlen(output);
 	    variable->m_value = TQString::fromLatin1(output, endMsg-output);
 	} else {
-	    variable = 0;
+	    variable = nullptr;
 	}
 	return true;
     }
@@ -704,7 +704,7 @@ union TQt2TQChar {
 void GdbDriver::setPrintTQStringDataCmd(const char* cmd)
 {
     // don't accept the command if it is empty
-    if (cmd == 0 || *cmd == '\0')
+    if (!cmd || *cmd == '\0')
 	return;
     assert(strlen(cmd) <= MAX_FMTLEN);
     cmds[DCprintTQStringStruct].fmt = cmd;
@@ -712,7 +712,7 @@ void GdbDriver::setPrintTQStringDataCmd(const char* cmd)
 
 ExprValue* GdbDriver::parseTQCharArray(const char* output, bool wantErrorValue, bool qt3like)
 {
-    ExprValue* variable = 0;
+    ExprValue* variable = nullptr;
 
     /*
      * Parse off white space. gdb sometimes prints white space first if the
@@ -738,7 +738,7 @@ ExprValue* GdbDriver::parseTQCharArray(const char* output, bool wantErrorValue,
     // find '='
     const char* p = output;
     p = strchr(p, '=');
-    if (p == 0) {
+    if (!p) {
 	goto error;
     }
     // skip white space
@@ -761,7 +761,7 @@ ExprValue* GdbDriver::parseTQCharArray(const char* output, bool wantErrorValue,
 	 * the second index is from the enum above.
 	 */
 	static const char* separator[2][3] = {
-	    { "\"", 0,       ", \"" },	/* normal char is added */
+	    { "\"", nullptr,       ", \"" },	/* normal char is added */
 	    { "'",  "\", '", ", '" }	/* repeated char is added */
 	};
 
@@ -779,7 +779,7 @@ ExprValue* GdbDriver::parseTQCharArray(const char* output, bool wantErrorValue,
 	    if (repeats) {
 		const char* start = p;
 		p = strchr(p+9, '>');	/* search end and advance */
-		if (p == 0)
+		if (!p)
 		    goto error;
 		p++;			/* skip '>' */
 		repeatCount = TQString::fromLatin1(start, p-start);
@@ -895,7 +895,7 @@ static ExprValue* parseVar(const char*& s)
     else
     {
 	if (!parseName(p, name, kind)) {
-	    return 0;
+	    return nullptr;
 	}
 
 	// go for '='
@@ -903,7 +903,7 @@ static ExprValue* parseVar(const char*& s)
 	    p++;
 	if (*p != '=') {
 	    TRACE(TQString("parse error: = not found after %1").arg(name));
-	    return 0;
+	    return nullptr;
 	}
 	// skip the '=' and more whitespace
 	p++;
@@ -915,7 +915,7 @@ static ExprValue* parseVar(const char*& s)
     
     if (!parseValue(p, variable)) {
 	delete variable;
-	return 0;
+	return nullptr;
     }
     s = p;
     return variable;
@@ -1319,7 +1319,7 @@ repeat:
 	    p += 23;
 	    skipName(p);
 	    const char* e = strchr(p, '.');
-	    if (e == 0) {
+	    if (!e) {
 		p += strlen(p);
 	    } else {
 		p = e+1;
@@ -1440,7 +1440,7 @@ static bool parseVarSeq(const char*& s, ExprValue* variable)
 	    break;
 	}
 	var = parseVar(s);
-	if (var == 0)
+	if (!var)
 	    break;			/* syntax error */
 	variable->appendChild(var);
 	if (*s != ',')
@@ -1450,7 +1450,7 @@ static bool parseVarSeq(const char*& s, ExprValue* variable)
 	while (isspace(*s))
 	    s++;
     }
-    return var != 0;
+    return var;
 }
 
 static bool parseValueSeq(const char*& s, ExprValue* variable)
@@ -1738,7 +1738,7 @@ bool GdbDriver::parseBreakList(const char* output, std::list<Breakpoint>& brks)
 {
     // skip first line, which is the headline
     const char* p = strchr(output, '\n');
-    if (p == 0)
+    if (!p)
 	return false;
     p++;
     if (*p == '\0')
@@ -1799,7 +1799,7 @@ bool GdbDriver::parseBreakList(const char* output, std::list<Breakpoint>& brks)
 	}
 	// remainder is location, hit and ignore count, condition
 	end = strchr(p, '\n');
-	if (end == 0) {
+	if (!end) {
 	    bp.location = p;
 	    p += bp.location.length();
 	} else {
@@ -1815,7 +1815,7 @@ bool GdbDriver::parseBreakList(const char* output, std::list<Breakpoint>& brks)
 
 	    // seek end of line
 	    end = strchr(p, '\n');
-	    if (end == 0)
+	    if (!end)
 		end = p+strlen(p);
 
 	    if (strncmp(p, "breakpoint already hit", 22) == 0) {
@@ -1884,7 +1884,7 @@ std::list<ThreadInfo> GdbDriver::parseThreadList(const char* output)
 	 * Now follows the thread's SYSTAG. It is terminated by two blanks.
 	 */
 	end = strstr(p, "  ");
-	if (end == 0) {
+	if (!end) {
 	    // syntax error; bail out
 	    return threads;
 	}
@@ -1920,7 +1920,7 @@ bool GdbDriver::parseBreakpoint(const char* output, int& id,
     // skip lines of that begin with "(Cannot find"
     while (strncmp(o, "(Cannot find", 12) == 0) {
 	o = strchr(o, '\n');
-	if (o == 0)
+	if (!o)
 	    return false;
 	o++;				/* skip newline */
     }
@@ -1958,7 +1958,7 @@ static bool parseNewBreakpoint(const char* o, int& id,
     
     // file name
     char* fileStart = strstr(p, "file ");
-    if (fileStart == 0)
+    if (!fileStart)
 	return !address.isEmpty();     /* parse error only if there's no address */
     fileStart += 5;
     
@@ -2011,14 +2011,14 @@ void GdbDriver::parseLocals(const char* output, std::list<ExprValue*>& newVars)
 	    strncmp(output, "No arguments", 12) == 0)
 	{
 	    output = strchr(output, '\n');
-	    if (output == 0) {
+	    if (!output) {
 		break;
 	    }
 	    continue;
 	}
 
 	ExprValue* variable = parseVar(output);
-	if (variable == 0) {
+	if (!variable) {
 	    break;
 	}
 	// do not add duplicates
@@ -2035,7 +2035,7 @@ void GdbDriver::parseLocals(const char* output, std::list<ExprValue*>& newVars)
 
 ExprValue* GdbDriver::parsePrintExpr(const char* output, bool wantErrorValue)
 {
-    ExprValue* var = 0;
+    ExprValue* var = nullptr;
     // check for error conditions
     if (!parseErrorMessage(output, var, wantErrorValue))
     {
@@ -2078,7 +2078,7 @@ bool GdbDriver::parseChangeExecutable(const char* output, TQString& message)
     {
 	// this line is good, go to the next one
 	const char* end = strchr(output, '\n');
-	if (end == 0)
+	if (!end)
 	    output += strlen(output);
 	else
 	    output = end+1;
@@ -2093,7 +2093,7 @@ bool GdbDriver::parseChangeExecutable(const char* output, TQString& message)
 bool GdbDriver::parseCoreFile(const char* output)
 {
     // if command succeeded, gdb emits a line starting with "#0 "
-    m_haveCoreFile = strstr(output, "\n#0 ") != 0;
+    m_haveCoreFile = strstr(output, "\n#0 ") != nullptr;
     return m_haveCoreFile;
 }
 
@@ -2131,7 +2131,7 @@ uint GdbDriver::parseProgramStopped(const char* output, TQString& message)
 
 	    // set message
 	    const char* endOfMessage = strchr(start, '\n');
-	    if (endOfMessage == 0)
+	    if (!endOfMessage)
 		endOfMessage = start + strlen(start);
 	    message = TQString::fromLatin1(start, endOfMessage-start);
 	} else if (strncmp(start, "Breakpoint ", 11) == 0) {
@@ -2140,13 +2140,13 @@ uint GdbDriver::parseProgramStopped(const char* output, TQString& message)
 	     * that it stopped at a temporary breakpoint).
 	     */
 	    flags |= SFrefreshBreak;
-	} else if (strstr(start, "re-reading symbols.") != 0) {
+	} else if (strstr(start, "re-reading symbols.")) {
 	    flags |= SFrefreshSource;
 	}
 
 	// next line, please
 	start = strchr(start, '\n');
-    } while (start != 0);
+    } while (start);
 
     /*
      * Gdb only notices when new threads have appeared, but not when a
@@ -2168,7 +2168,7 @@ TQStringList GdbDriver::parseSharedLibs(const char* output)
 
     // strip off head line
     output = strchr(output, '\n');
-    if (output == 0)
+    if (!output)
 	return shlibs;
     output++;				/* skip '\n' */
     TQString shlibName;
@@ -2188,7 +2188,7 @@ TQStringList GdbDriver::parseSharedLibs(const char* output)
 	    return shlibs;
 	const char* start = output;
 	output = strchr(output, '\n');
-	if (output == 0)
+	if (!output)
 	    output = start + strlen(start);
 	shlibName = TQString::fromLatin1(start, output-start);
 	if (*output != '\0')
@@ -2325,7 +2325,7 @@ std::list<RegisterInfo> GdbDriver::parseRegisters(const char* output)
 	    // the rest of the line is the register value
 	    start = output;
 	    output = strchr(output,'\n');
-	    if (output == 0)
+	    if (!output)
 		output = start + strlen(start);
 	    value = TQString::fromLatin1(start, output-start).simplifyWhiteSpace();
 
@@ -2372,7 +2372,7 @@ bool GdbDriver::parseInfoLine(const char* output, TQString& addrFrom, TQString&
 {
     // "is at address" or "starts at address"
     const char* start = strstr(output, "s at address ");
-    if (start == 0)
+    if (!start)
 	return false;
 
     start += 13;
@@ -2382,7 +2382,7 @@ bool GdbDriver::parseInfoLine(const char* output, TQString& addrFrom, TQString&
     addrFrom = TQString::fromLatin1(start, p-start);
 
     start = strstr(p, "and ends at ");
-    if (start == 0) {
+    if (!start) {
 	addrTo = addrFrom;
 	return true;
     }
@@ -2410,14 +2410,14 @@ std::list<DisassembledCode> GdbDriver::parseDisassemble(const char* output)
 
     // remove first line
     const char* p = strchr(output, '\n');
-    if (p == 0)
+    if (!p)
 	return code;			/* not a regular output */
 
     p++;
 
     // remove last line
     const char* end = strstr(output, "End of assembler");
-    if (end == 0)
+    if (!end)
 	end = p + strlen(p);
 
     // remove function offsets from the lines
@@ -2498,7 +2498,7 @@ TQString GdbDriver::parseMemoryDump(const char* output, std::list<MemoryDump>& m
 	    p++;
 	// everything to the end of the line is the memory dump
 	const char* end = strchr(p, '\n');
-	if (end != 0) {
+	if (end) {
 	    md.dump = TQString::fromLatin1(p, end-p);
 	    p = end+1;
 	} else {
diff --git a/kdbg/main.cpp b/kdbg/main.cpp
index 51d002c..d9a2ccb 100644
--- a/kdbg/main.cpp
+++ b/kdbg/main.cpp
@@ -38,10 +38,10 @@ int main(int argc, char** argv)
 			 I18N_NOOP("A Debugger"),
 			 TDEAboutData::License_GPL, 
 			 "(c) 1998-2010 Johannes Sixt",
-			 0,		/* any text */
+			 nullptr,		/* any text */
 			 "http://www.kdbg.org/",
 			 "j6t@kdbg.org");
-    aboutData.addAuthor("Johannes Sixt", 0, "j6t@kdbg.org");
+    aboutData.addAuthor("Johannes Sixt", nullptr, "j6t@kdbg.org");
     aboutData.addCredit("Keith Isdale",
 			I18N_NOOP("XSLT debugging"),
 			"k_isdale@tpg.com.au");
@@ -51,15 +51,15 @@ int main(int argc, char** argv)
     TDECmdLineArgs::init( argc, argv, &aboutData );
 
     static TDECmdLineOptions options[] = {
-	{ "t <file>", I18N_NOOP("transcript of conversation with the debugger"), 0 },
-	{ "r <device>", I18N_NOOP("remote debugging via <device>"), 0 },
+	{ "t <file>", I18N_NOOP("transcript of conversation with the debugger"), nullptr },
+	{ "r <device>", I18N_NOOP("remote debugging via <device>"), nullptr },
 	{ "l <language>", I18N_NOOP("specify language: C, XSLT"), ""},
-	{ "x", I18N_NOOP("use language XSLT (deprecated)"), 0 },
-	{ "a <args>", I18N_NOOP("specify arguments of debugged executable"), 0},
-	{ "p <pid>", I18N_NOOP("specify PID of process to debug"), 0},
-	{ "+[program]", I18N_NOOP("path of executable to debug"), 0 },
-	{ "+[core]", I18N_NOOP("a core file to use"), 0},
-	{ 0, 0, 0 }
+	{ "x", I18N_NOOP("use language XSLT (deprecated)"), nullptr },
+	{ "a <args>", I18N_NOOP("specify arguments of debugged executable"), nullptr},
+	{ "p <pid>", I18N_NOOP("specify PID of process to debug"), nullptr},
+	{ "+[program]", I18N_NOOP("path of executable to debug"), nullptr },
+	{ "+[core]", I18N_NOOP("a core file to use"), nullptr},
+	{ nullptr, nullptr, nullptr }
     };
     TDECmdLineArgs::addCmdLineOptions(options);
     
diff --git a/kdbg/mainwndbase.cpp b/kdbg/mainwndbase.cpp
index d7e8c48..555919d 100644
--- a/kdbg/mainwndbase.cpp
+++ b/kdbg/mainwndbase.cpp
@@ -120,7 +120,7 @@ const char defaultHeaderFilter[] = "*.h *.hh *.hpp *.h++";
 
 DebuggerMainWndBase::DebuggerMainWndBase() :
 	m_outputTermCmdStr(defaultTermCmdStr),
-	m_outputTermProc(0),
+	m_outputTermProc(nullptr),
 	m_ttyLevel(-1),			/* no tty yet */
 #ifdef GDB_TRANSCRIPT
 	m_transcriptFile(GDB_TRANSCRIPT),
@@ -130,7 +130,7 @@ DebuggerMainWndBase::DebuggerMainWndBase() :
 	m_tabWidth(0),
 	m_sourceFilter(defaultSourceFilter),
 	m_headerFilter(defaultHeaderFilter),
-	m_debugger(0)
+	m_debugger(nullptr)
 {
     m_statusActive = i18n("active");
 }
@@ -140,7 +140,7 @@ DebuggerMainWndBase::~DebuggerMainWndBase()
     delete m_debugger;
 
     // if the output window is open, close it
-    if (m_outputTermProc != 0) {
+    if (m_outputTermProc) {
 	m_outputTermProc->disconnect();	/* ignore signals */
 	m_outputTermProc->kill();
 	shutdownTermWindow();
@@ -175,7 +175,7 @@ void DebuggerMainWndBase::setCoreFile(const TQString& corefile)
 
 void DebuggerMainWndBase::setRemoteDevice(const TQString& remoteDevice)
 {
-    if (m_debugger != 0) {
+    if (m_debugger) {
 	m_debugger->setRemoteDevice(remoteDevice);
     }
 }
@@ -189,7 +189,7 @@ void DebuggerMainWndBase::overrideProgramArguments(const TQString& args)
 void DebuggerMainWndBase::setTranscript(const TQString& name)
 {
     m_transcriptFile = name;
-    if (m_debugger != 0 && m_debugger->driver() != 0)
+    if (m_debugger && m_debugger->driver())
 	m_debugger->driver()->setLogFileName(m_transcriptFile);
 }
 
@@ -209,7 +209,7 @@ const char GeneralGroup[] = "General";
 
 void DebuggerMainWndBase::saveSettings(TDEConfig* config)
 {
-    if (m_debugger != 0) {
+    if (m_debugger) {
 	m_debugger->saveSettings(config);
     }
 
@@ -229,7 +229,7 @@ void DebuggerMainWndBase::saveSettings(TDEConfig* config)
 
 void DebuggerMainWndBase::restoreSettings(TDEConfig* config)
 {
-    if (m_debugger != 0) {
+    if (m_debugger) {
 	m_debugger->restoreSettings(config);
     }
 
@@ -267,7 +267,7 @@ bool DebuggerMainWndBase::debugProgram(const TQString& executable,
     TRACE(TQString("trying language '%1'...").arg(lang));
     DebuggerDriver* driver = driverFromLang(lang);
 
-    if (driver == 0)
+    if (!driver)
     {
 	// see if there is a language in the per-program config file
 	TQString configName = m_debugger->getConfigForExe(executable);
@@ -287,7 +287,7 @@ bool DebuggerMainWndBase::debugProgram(const TQString& executable,
 	}
 
     }
-    if (driver == 0)
+    if (!driver)
     {
 	TQString name = driverNameFromFile(executable);
 
@@ -295,7 +295,7 @@ bool DebuggerMainWndBase::debugProgram(const TQString& executable,
 		" from file contents").arg(name));
 	driver = driverFromLang(name);
     }
-    if (driver == 0)
+    if (!driver)
     {
 	// oops
 	TQString msg = i18n("Don't know how to debug language `%1'");
@@ -358,7 +358,7 @@ DebuggerDriver* DebuggerMainWndBase::driverFromLang(TQString lang)
 	    break;
 	}
     }
-    DebuggerDriver* driver = 0;
+    DebuggerDriver* driver = nullptr;
     switch (driverID) {
     case 1:
 	{
@@ -566,7 +566,7 @@ TQString DebuggerMainWndBase::createOutputWindow()
 void DebuggerMainWndBase::shutdownTermWindow()
 {
     delete m_outputTermProc;
-    m_outputTermProc = 0;
+    m_outputTermProc = nullptr;
 }
 
 void DebuggerMainWndBase::setTerminalCmd(const TQString& cmd)
@@ -580,7 +580,7 @@ void DebuggerMainWndBase::setTerminalCmd(const TQString& cmd)
 
 void DebuggerMainWndBase::slotDebuggerStarting()
 {
-    if (m_debugger == 0)		/* paranoia check */
+    if (!m_debugger)		/* paranoia check */
 	return;
 
     if (m_ttyLevel == m_debugger->ttyLevel())
@@ -594,7 +594,7 @@ void DebuggerMainWndBase::slotDebuggerStarting()
 	    ttyWindow()->deactivate();
 	    break;
 	case KDebugger::ttyFull:
-	    if (m_outputTermProc != 0) {
+	    if (m_outputTermProc) {
 		m_outputTermProc->kill();
 		// will be deleted in slot
 	    }
@@ -610,7 +610,7 @@ void DebuggerMainWndBase::slotDebuggerStarting()
 	    ttyName = ttyWindow()->activate();
 	    break;
 	case KDebugger::ttyFull:
-	    if (m_outputTermProc == 0) {
+	    if (!m_outputTermProc) {
 		// create an output window
 		ttyName = createOutputWindow();
 		TRACE(ttyName.isEmpty() ?
diff --git a/kdbg/memwindow.cpp b/kdbg/memwindow.cpp
index 183aedb..536b493 100644
--- a/kdbg/memwindow.cpp
+++ b/kdbg/memwindow.cpp
@@ -41,7 +41,7 @@ void MemoryViewItem::paintCell(TQPainter* p, const TQColorGroup& cg,
 
 MemoryWindow::MemoryWindow(TQWidget* parent, const char* name) :
 	TQWidget(parent, name),
-	m_debugger(0),
+	m_debugger(nullptr),
 	m_expression(true, this, "expression"),
 	m_memory(this, "memory"),
 	m_layout(this, 0, 2),
@@ -189,7 +189,7 @@ void MemoryWindow::slotNewMemoryDump(const TQString& msg, const std::list<Memory
 	return;
     }
 
-    MemoryViewItem* after = 0;
+    MemoryViewItem* after = nullptr;
     std::list<MemoryDump>::const_iterator md = memdump.begin();
 
     // remove all columns, except the address column
diff --git a/kdbg/pgmargs.cpp b/kdbg/pgmargs.cpp
index 15a7b9a..5c12f62 100644
--- a/kdbg/pgmargs.cpp
+++ b/kdbg/pgmargs.cpp
@@ -37,7 +37,7 @@ PgmArgs::PgmArgs(TQWidget* parent, const TQString& pgm, TQDict<EnvVar>& envVars,
     else
     {
 	delete xsldbgOptionsPage;
-	xsldbgOptionsPage = 0;
+	xsldbgOptionsPage = nullptr;
     }
 
     initEnvList();
@@ -65,7 +65,7 @@ void PgmArgs::setOptions(const TQStringList& selectedOptions)
 TQStringList PgmArgs::options() const
 {
     TQStringList sel;
-    if (xsldbgOptionsPage != 0)
+    if (xsldbgOptionsPage)
     {
 	for (uint i = 0; i < xsldbgOptions->count(); i++) {
 	    if (xsldbgOptions->isSelected(i))
@@ -90,7 +90,7 @@ void PgmArgs::modifyVar(bool resurrect)
 
     // lookup the value in the dictionary
     EnvVar* val = m_envVars[name];
-    if (val != 0) {
+    if (val) {
 	// see if this is a zombie
 	if (val->status == EnvVar::EVdeleted) {
 	    // resurrect
@@ -123,16 +123,16 @@ void PgmArgs::modifyVar(bool resurrect)
 void PgmArgs::deleteVar()
 {
     TQListViewItem* item = envList->selectedItem();
-    if (item == 0)
+    if (!item)
 	return;
     TQString name = item->text(0);
 
     // lookup the value in the dictionary
     EnvVar* val = m_envVars[name];
-    if (val != 0)
+    if (val)
     {
 	// delete from list
-	val->item = 0;
+	val->item = nullptr;
 	// if this is a new item, delete it completely, otherwise zombie-ize it
 	if (val->status == EnvVar::EVnew) {
 	    m_envVars.remove(name);
@@ -166,28 +166,28 @@ void PgmArgs::initEnvList()
     TQDictIterator<EnvVar> it = m_envVars;
     EnvVar* val;
     TQString name;
-    for (; (val = it) != 0; ++it) {
+    for (; (val = it) != nullptr; ++it) {
 	val->status = EnvVar::EVclean;
 	name = it.currentKey();
 	val->item = new TQListViewItem(envList, name, val->value);	// inserts itself
     }
 
     envList->setAllColumnsShowFocus(true);
-    buttonDelete->setEnabled(envList->selectedItem() != 0);
+    buttonDelete->setEnabled(envList->selectedItem() != nullptr);
 }
 
 void PgmArgs::envListCurrentChanged()
 {
     TQListViewItem* item = envList->selectedItem();
-    buttonDelete->setEnabled(item != 0);
-    if (item == 0)
+    buttonDelete->setEnabled(item);
+    if (!item)
 	return;
 
     // must get name from list box
     TQString name = item->text(0);
     EnvVar* val = m_envVars[name];
     ASSERT(val != 0);
-    if (val != 0) {
+    if (val) {
 	envVar->setText(name + "=" + val->value);
     } else {
 	envVar->setText(name);
diff --git a/kdbg/procattach.cpp b/kdbg/procattach.cpp
index 50b1184..b145970 100644
--- a/kdbg/procattach.cpp
+++ b/kdbg/procattach.cpp
@@ -44,9 +44,9 @@ ProcAttachPS::ProcAttachPS(TQWidget* parent) :
 #else
 	"/bin/false",
 #endif
-	0
+	nullptr
     };
-    for (int i = 0; psCommand[i] != 0; i++) {
+    for (int i = 0; psCommand[i]; i++) {
 	*m_ps << psCommand[i];
     }
 
@@ -145,14 +145,14 @@ void ProcAttachPS::pushLine()
     {
 	// insert a line
 	// find the parent process
-	TQListViewItem* parent = 0;
+	TQListViewItem* parent = nullptr;
 	if (m_ppidCol >= 0 && m_ppidCol < int(m_line.size())) {
 	    parent = processList->findItem(m_line[m_ppidCol], 1);
 	}
 
 	// we assume that the last column is the command
 	TQListViewItem* item;
-	if (parent == 0) {
+	if (!parent) {
 	    item = new TQListViewItem(processList, m_line.back());
 	} else {
 	    item = new TQListViewItem(parent, m_line.back());
@@ -179,7 +179,7 @@ void ProcAttachPS::pushLine()
 	     * and check whether we must reparent them.
 	     */
 	    TQListViewItem* i = processList->firstChild();
-	    while (i != 0)
+	    while (i)
 	    {
 		// advance before we reparent the item
 		TQListViewItem* it = i;
@@ -202,7 +202,7 @@ TQString ProcAttachPS::text() const
 {
     TQListViewItem* item = processList->selectedItem();
 
-    if (item == 0)
+    if (!item)
 	return TQString();
 
     return item->text(1);
@@ -254,7 +254,7 @@ bool ProcAttachPS::setVisibility(TQListViewItem* i, const TQString& text)
 
 void ProcAttachPS::selectedChanged()
 {
-    buttonOk->setEnabled(processList->selectedItem() != 0);
+    buttonOk->setEnabled(processList->selectedItem() != nullptr);
 }
 
 
diff --git a/kdbg/programconfig.cpp b/kdbg/programconfig.cpp
index 617f796..2f56286 100644
--- a/kdbg/programconfig.cpp
+++ b/kdbg/programconfig.cpp
@@ -73,7 +73,7 @@ void ProgramConfig::reparseConfiguration()
 
     if (useit)
     {
-	m_iniBackend->parseSingleConfigFile(file, 0, false, false);
+	m_iniBackend->parseSingleConfigFile(file, nullptr, false, false);
     }
     else
     {
diff --git a/kdbg/regwnd.cpp b/kdbg/regwnd.cpp
index e3cee61..ab5c284 100644
--- a/kdbg/regwnd.cpp
+++ b/kdbg/regwnd.cpp
@@ -67,7 +67,7 @@ struct MenuPair
 {
     const char* name;
     uint mode;
-    bool isSeparator() { return name == 0; }
+    bool isSeparator() { return !name; }
 };
 
 static MenuPair menuitems[] = {
@@ -80,7 +80,7 @@ static MenuPair menuitems[] = {
     { I18N_NOOP("Real (&e)"),    RegisterDisplay::realE },
     { I18N_NOOP("Real (&f)"),    RegisterDisplay::realF },
     { I18N_NOOP("&Real (g)"),    RegisterDisplay::realG },
-    { 0, 0 },
+    { nullptr, 0 },
     { "8 bits",  RegisterDisplay::bits8 },
     { "16 bits", RegisterDisplay::bits16 },
     { "32 bits", RegisterDisplay::bits32 },
@@ -123,7 +123,7 @@ public:
     {
 	gmode=mode; 
 	TQListViewItem *it=firstChild();
-	for (; 0!=it; it=it->nextSibling()) {
+	for (; it; it=it->nextSibling()) {
 	    (static_cast<ModeItem*>(it))->setMode(gmode);
 	}
     }
@@ -280,7 +280,7 @@ static char* toRaw(const TQString& hex, uint& length)
 
     if (littleendian) {
 	uint j=0;
-	if (hex.length()<=2) return 0;
+	if (hex.length()<=2) return nullptr;
 	for (int i=hex.length()-1; i>=2; ) {
 	    if (j%2==0) data[j/2]=hexCharToDigit(hex[i].latin1());
 	    else data[j/2]|=(hexCharToDigit(hex[i].latin1())<<4);
@@ -288,7 +288,7 @@ static char* toRaw(const TQString& hex, uint& length)
 	}
     } else { // big endian
 	uint j=0;
-	if (hex.length()<=2) return 0;
+	if (hex.length()<=2) return nullptr;
 	for (uint i=2; i<hex.length(); ) {
 	    if (j%2==0) data[j/2]=hexCharToDigit(hex[i].latin1())<<4;
 	    else data[j/2]|=hexCharToDigit(hex[i].latin1());
@@ -480,7 +480,7 @@ RegisterView::~RegisterView()
 
 GroupingViewItem* RegisterView::findMatchingGroup(const TQString& regName)
 {
-    for (TQListViewItem* it = firstChild(); it != 0; it = it->nextSibling())
+    for (TQListViewItem* it = firstChild(); it; it = it->nextSibling())
     {
 	GroupingViewItem* i = static_cast<GroupingViewItem*>(it);
 	if (i->matchName(regName))
@@ -492,17 +492,17 @@ GroupingViewItem* RegisterView::findMatchingGroup(const TQString& regName)
 
 GroupingViewItem* RegisterView::findGroup(const TQString& groupName)
 {
-    for (TQListViewItem* it = firstChild(); it != 0; it = it->nextSibling())
+    for (TQListViewItem* it = firstChild(); it; it = it->nextSibling())
     {
 	if (it->text(0) == groupName)
 	    return static_cast<GroupingViewItem*>(it);
     }
-    return 0;
+    return nullptr;
 }
 
 void RegisterView::updateGroupVisibility()
 {
-    for (TQListViewItem* it = firstChild(); it != 0; it = it->nextSibling())
+    for (TQListViewItem* it = firstChild(); it; it = it->nextSibling())
     {
 	it->setVisible(it->childCount() > 0);
     }
diff --git a/kdbg/regwnd.h b/kdbg/regwnd.h
index 7178130..ed7bf4e 100644
--- a/kdbg/regwnd.h
+++ b/kdbg/regwnd.h
@@ -21,7 +21,7 @@ class RegisterView : public TQListView
 {
     TQ_OBJECT
 public:
-    RegisterView(TQWidget* parent, const char *name = 0L);
+    RegisterView(TQWidget* parent, const char *name = nullptr);
     ~RegisterView();
 
 protected slots:
diff --git a/kdbg/sourcewnd.cpp b/kdbg/sourcewnd.cpp
index b939d11..6ffa071 100644
--- a/kdbg/sourcewnd.cpp
+++ b/kdbg/sourcewnd.cpp
@@ -505,7 +505,7 @@ void SourceWindow::disassembled(int lineNo, const std::list<DisassembledCode>& d
 int SourceWindow::rowToLine(int row, int* sourceRow)
 {
     int line = row >= 0  ?  m_rowToLine[row]  :  -1;
-    if (sourceRow != 0) {
+    if (sourceRow) {
 	// search back until we hit the first entry with the current line number
 	while (row > 0 && m_rowToLine[row-1] == line)
 	    row--;
diff --git a/kdbg/sourcewnd.h b/kdbg/sourcewnd.h
index 12eca40..b322bbf 100644
--- a/kdbg/sourcewnd.h
+++ b/kdbg/sourcewnd.h
@@ -39,7 +39,7 @@ public:
      * If sourceRow is non-zero, it is filled with the source code row
      * belonging to the line number.
      */
-    int rowToLine(int row, int* sourceRow = 0);
+    int rowToLine(int row, int* sourceRow = nullptr);
     /** Translates zero-based source line number to row number (zero-based) */
     int lineToRow(int line);
     /** Is the row disassembled? */
diff --git a/kdbg/testprogs/testfile.cpp b/kdbg/testprogs/testfile.cpp
index 8a80521..5132ad2 100644
--- a/kdbg/testprogs/testfile.cpp
+++ b/kdbg/testprogs/testfile.cpp
@@ -93,7 +93,7 @@ void strtest(const char* t)
 {
     const char* s = t;
     const char*& s2 = s;
-    if (t == 0)
+    if (!t)
 	strtest(s2);
     std::cout << s2 << std::endl;
 }
@@ -125,7 +125,7 @@ void templated_strtest(F f, const char* t)
 
 void segFault()
 {
-	*(char*)0 = 's';
+	*(char*)nullptr = 's';
 }
 
 int main(int argc, char* argv[])
diff --git a/kdbg/testprogs/widechar.cpp b/kdbg/testprogs/widechar.cpp
index ae0725a..e44ec94 100644
--- a/kdbg/testprogs/widechar.cpp
+++ b/kdbg/testprogs/widechar.cpp
@@ -10,13 +10,13 @@ struct WChar {
 int main()
 {
    int j=3;
-   const wchar_t* nullPtr = 0;
+   const wchar_t* nullPtr = nullptr;
    const wchar_t* uninitializedPtr = (const wchar_t*)0xdeadbeef;
    const wchar_t* str = L"abc";
    wchar_t* str2 = L"def";
    const char* shortStr = "12345";
 
-   WChar s = { 0, L"Some string" };
+   WChar s = { nullptr, L"Some string" };
    s.cwstr = s.wstr;
 
    wchar_t wstr[64], *wstrPtr = wstr;
diff --git a/kdbg/threadlist.cpp b/kdbg/threadlist.cpp
index 979a0f3..fc0ff92 100644
--- a/kdbg/threadlist.cpp
+++ b/kdbg/threadlist.cpp
@@ -56,7 +56,7 @@ ThreadList::~ThreadList()
 void ThreadList::updateThreads(const std::list<ThreadInfo>& threads)
 {
     // reset flag in all items
-    for (TQListViewItem* e = firstChild(); e != 0; e = e->nextSibling()) {
+    for (TQListViewItem* e = firstChild(); e; e = e->nextSibling()) {
 	static_cast<ThreadEntry*>(e)->m_delete = true;
     }
 
@@ -64,7 +64,7 @@ void ThreadList::updateThreads(const std::list<ThreadInfo>& threads)
     {
 	// look up this thread by id
 	ThreadEntry* te = threadById(i->id);
-	if (te == 0) {
+	if (!te) {
 	    te = new ThreadEntry(this, *i);
 	} else {
 	    te->m_delete = false;
@@ -76,7 +76,7 @@ void ThreadList::updateThreads(const std::list<ThreadInfo>& threads)
     }
 
     // delete all entries that have not been seen
-    for (TQListViewItem* e = firstChild(); e != 0;) {
+    for (TQListViewItem* e = firstChild(); e;) {
 	ThreadEntry* te = static_cast<ThreadEntry*>(e);
 	e = e->nextSibling();		/* step ahead before deleting it ;-) */
 	if (te->m_delete) {
@@ -87,13 +87,13 @@ void ThreadList::updateThreads(const std::list<ThreadInfo>& threads)
 
 ThreadEntry* ThreadList::threadById(int id)
 {
-    for (TQListViewItem* e = firstChild(); e != 0; e = e->nextSibling()) {
+    for (TQListViewItem* e = firstChild(); e; e = e->nextSibling()) {
 	ThreadEntry* te = static_cast<ThreadEntry*>(e);
 	if (te->id == id) {
 	    return te;
 	}
     }
-    return 0;
+    return nullptr;
 }
 
 /*
@@ -112,7 +112,7 @@ void ThreadList::makeNoFocusIcon()
 
 void ThreadList::slotCurrentChanged(TQListViewItem* newItem)
 {
-    if (newItem == 0)
+    if (!newItem)
 	return;
 
     ThreadEntry* te = static_cast<ThreadEntry*>(newItem);
diff --git a/kdbg/ttywnd.cpp b/kdbg/ttywnd.cpp
index 734f0ef..6232afc 100644
--- a/kdbg/ttywnd.cpp
+++ b/kdbg/ttywnd.cpp
@@ -41,7 +41,7 @@ STTY::STTY() :
 	TQObject(),
 	m_masterfd(-1),
 	m_slavefd(-1),
-	m_outNotifier(0)
+	m_outNotifier(nullptr)
 {
     if (findTTY())
     {
@@ -140,7 +140,7 @@ void STTY::outReceived(int f)
 
 TTYWindow::TTYWindow(TQWidget* parent, const char* name) :
 	TQTextEdit(parent, name),
-	m_tty(0),
+	m_tty(nullptr),
 	m_hPos(0)
 {
     setFont(TDEGlobalSettings::fixedFont());
@@ -166,7 +166,7 @@ TQString TTYWindow::activate()
     if (ttyName.isEmpty()) {
 	// failed to allocate terminal
 	delete m_tty;
-	m_tty = 0;
+	m_tty = nullptr;
 	return TQString();
     } else {
 	connect(m_tty, TQ_SIGNAL(output(char*,int)), TQ_SLOT(slotAppend(char*,int)));
@@ -177,7 +177,7 @@ TQString TTYWindow::activate()
 void TTYWindow::deactivate()
 {
     delete m_tty;
-    m_tty = 0;
+    m_tty = nullptr;
 }
 
 /**
diff --git a/kdbg/typetable.cpp b/kdbg/typetable.cpp
index 7da20eb..01ce60a 100644
--- a/kdbg/typetable.cpp
+++ b/kdbg/typetable.cpp
@@ -57,7 +57,7 @@ void TypeTable::loadTypeTables()
 
 
 TypeTable::TypeTable() :
-	m_printTQStringDataCmd(0)
+	m_printTQStringDataCmd(nullptr)
 {
     m_typeDict.setAutoDelete(true);
     // aliasDict keeps only pointers to items into typeDict
@@ -108,7 +108,7 @@ void TypeTable::loadFromFile(const TQString& fileName)
 
     TQString printTQString = cf.readEntry(PrintTQStringCmd);
     const char* ascii = printTQString.ascii();
-    if (ascii == 0)
+    if (!ascii)
 	ascii = "";
     m_printTQStringDataCmd = new char[strlen(ascii)+1];
     strcpy(m_printTQStringDataCmd, ascii);
@@ -140,7 +140,7 @@ void TypeTable::loadFromFile(const TQString& fileName)
 	    } else {
 		// look up the alias type and insert it
 		TypeInfo* info = m_typeDict[alias];
-		if (info == 0) {
+		if (!info) {
 		    TRACE(*it + ": alias " + alias + " not found");
 		} else {
 		    m_aliasDict.insert(alias, info);
@@ -188,10 +188,10 @@ void TypeTable::readType(TDEConfigBase& cf, const TQString& type)
 
 void TypeTable::copyTypes(TQDict<TypeInfo>& dict)
 {
-    for (TQDictIterator<TypeInfo> it = m_typeDict; it != 0; ++it) {
+    for (TQDictIterator<TypeInfo> it = m_typeDict; it; ++it) {
 	dict.insert(it.currentKey(), it);
     }
-    for (TQDictIterator<TypeInfo> it = m_aliasDict; it != 0; ++it) {
+    for (TQDictIterator<TypeInfo> it = m_aliasDict; it; ++it) {
 	dict.insert(it.currentKey(), it);
     }
 }
@@ -230,7 +230,7 @@ TypeInfo::~TypeInfo()
 ProgramTypeTable::ProgramTypeTable() :
 	m_parseTQt2TQStrings(false),
 	m_QCharIsShort(false),
-	m_printTQStringDataCmd(0)
+	m_printTQStringDataCmd(nullptr)
 {
     m_types.setAutoDelete(false);	/* paranoia */
     m_aliasDict.setAutoDelete(false);	/* paranoia */
@@ -340,14 +340,14 @@ TypeInfo* ProgramTypeTable::lookup(TQString type)
      */
     TQStringList parts = splitTemplateArgs(type);
     if (parts.size() == 1)
-	return 0;	// not a template
+	return nullptr;	// not a template
 
     // We can have several patterns for the same template name.
     std::pair<TemplateMap::const_iterator, TemplateMap::const_iterator> range =
 	m_templates.equal_range(parts.front());
     // We pick the one that has the wildcards in the later parameters.
     unsigned minPenalty = ~0U;
-    TypeInfo* result = 0;
+    TypeInfo* result = nullptr;
     parts.pop_front();
 
     for (TemplateMap::const_iterator i = range.first; i != range.second; ++i)
diff --git a/kdbg/winstack.cpp b/kdbg/winstack.cpp
index 525267e..8ac3fc8 100644
--- a/kdbg/winstack.cpp
+++ b/kdbg/winstack.cpp
@@ -94,14 +94,14 @@ void WinStack::activateFile(const TQString& fileName)
 bool WinStack::activatePath(TQString pathName, int lineNo, const DbgAddr& address)
 {
     // check whether the file is already open
-    SourceWindow* fw = 0;
+    SourceWindow* fw = nullptr;
     for (int i = count()-1; i >= 0; i--) {
 	if (windowAt(i)->fileName() == pathName) {
 	    fw = windowAt(i);
 	    break;
 	}
     }
-    if (fw == 0) {
+    if (!fw) {
 	// not found, load it
 	fw = new SourceWindow(pathName, this, "fileWindow");
 
@@ -161,7 +161,7 @@ bool WinStack::activeLine(TQString& fileName, int& lineNo)
 
 bool WinStack::activeLine(TQString& fileName, int& lineNo, DbgAddr& address)
 {
-    if (activeWindow() == 0) {
+    if (!activeWindow()) {
 	return false;
     }
     
@@ -198,7 +198,7 @@ SourceWindow* WinStack::findByFileName(const TQString& fileName) const
 	    return windowAt(i);
 	}
     }
-    return 0;
+    return nullptr;
 }
 
 void WinStack::setPC(bool set, const TQString& fileName, int lineNo,
@@ -224,21 +224,21 @@ SourceWindow* WinStack::activeWindow() const
 TQString WinStack::activeFileName() const
 {
     TQString f;
-    if (activeWindow() != 0)
+    if (activeWindow())
 	f = activeWindow()->fileName();
     return f;
 }
 
 void WinStack::slotFindForward()
 {
-    if (activeWindow() != 0)
+    if (activeWindow())
 	activeWindow()->find(m_findDlg.searchText(), m_findDlg.caseSensitive(),
 			     SourceWindow::findForward);
 }
 
 void WinStack::slotFindBackward()
 {
-    if (activeWindow() != 0)
+    if (activeWindow())
 	activeWindow()->find(m_findDlg.searchText(), m_findDlg.caseSensitive(),
 			     SourceWindow::findBackward);
 }
@@ -246,7 +246,7 @@ void WinStack::slotFindBackward()
 void WinStack::maybeTip(const TQPoint& p)
 {
     SourceWindow* w = activeWindow();
-    if (w == 0)
+    if (!w)
 	return;
 
     // get the word at the point
@@ -274,7 +274,7 @@ void WinStack::slotDisassembled(const TQString& fileName, int lineNo,
 				const std::list<DisassembledCode>& disass)
 {
     SourceWindow* fw = findByFileName(fileName);
-    if (fw == 0) {
+    if (!fw) {
 	// not found: ignore
 	return;
     }
@@ -303,7 +303,7 @@ void WinStack::slotSetTabWidth(int numChars)
 
 void WinStack::slotFileReload()
 {
-    if (activeWindow() != 0) {
+    if (activeWindow()) {
 	TRACE("reloading one file");
 	activeWindow()->reloadFile();
     }
@@ -378,7 +378,7 @@ void ValueTip::maybeTip(const TQPoint& p)
 
 
 FindDialog::FindDialog() :
-	TQDialog(0, "find", false),
+	TQDialog(nullptr, "find", false),
 	m_searchText(this, "text"),
 	m_caseCheck(this, "case"),
 	m_buttonForward(this, "forward"),
diff --git a/kdbg/xsldbgdriver.cpp b/kdbg/xsldbgdriver.cpp
index a19f5f8..d865bac 100644
--- a/kdbg/xsldbgdriver.cpp
+++ b/kdbg/xsldbgdriver.cpp
@@ -274,7 +274,7 @@ XsldbgDriver::commandFinished(CmdQueueItem * cmd)
 	  else{
 	    // This only shows an error for DCinfolocals 
 	    //  need to update KDebugger::handleRunCommand ? 
-	    KMessageBox::sorry(0L, m_output);
+	    KMessageBox::sorry(nullptr, m_output);
 	  }
 	}
             break;
@@ -298,7 +298,7 @@ XsldbgDriver::parseMarker()
     char *p = m_output;
 
     while (markerStart == -1) {
-        if ((p == 0) || (*p == '\0')) {
+        if (!p || *p == '\0') {
             m_output[0] = '\0';
             return;
         }
@@ -307,7 +307,7 @@ XsldbgDriver::parseMarker()
         if (markerStart == -1) {
             // try to marker on next line !
             p = strchr(p, '\n');
-            if ((p != 0) && (*p != '\0'))
+            if (p && *p != '\0')
                 p++;
         }
         else {
@@ -322,7 +322,7 @@ XsldbgDriver::parseMarker()
     //TRACE(TQString("found marker:") + startMarker);
     char *endMarker = strchr(startMarker, '\n');
 
-    if (endMarker == 0)
+    if (!endMarker)
         return;
 
     *endMarker = '\0';
@@ -660,7 +660,7 @@ isErrorExpr(const char *output)
       if (strncmp(output, 
 		  errorWords[wordIndex], 
 		  errorWordLength[wordIndex]) == 0 && 
-		    (wordIndex == 0 && strstr(output, "try stepping past the xsl:param") == 0) )   {
+		    (wordIndex == 0 && !strstr(output, "try stepping past the xsl:param")) )   {
 	result = true;
         TRACE(TQString("Error/Warning/Information from xsldbg ") + output);
 	break;
@@ -684,11 +684,11 @@ parseErrorMessage(const char *output,
             variable = new ExprValue(TQString(), VarTree::NKplain);
             const char *endMsg = strchr(output, '\n');
 
-            if (endMsg == 0)
+            if (!endMsg)
                 endMsg = output + strlen(output);
             variable->m_value = TQString::fromLatin1(output, endMsg - output);
         } else {
-            variable = 0;
+            variable = nullptr;
         }
         return true;
     }
@@ -705,7 +705,7 @@ ExprValue *
 XsldbgDriver::parseTQCharArray(const char */*output*/, bool /*wantErrorValue*/,
                               bool /*qt3like*/)
 {
-    ExprValue *variable = 0;
+    ExprValue *variable = nullptr;
 
     TRACE("XsldbgDriver::parseTQCharArray not implmented");
     return variable;
@@ -716,7 +716,7 @@ parseVar(const char *&s)
 {
     const char *p = s;
     bool foundLocalVar = false;
-    ExprValue *variable = 0L;
+    ExprValue *variable = nullptr;
     TQString name;
 
     VarTree::NameKind kind;
@@ -765,10 +765,10 @@ parseVar(const char *&s)
       // No value provided just a name
       TRACE(TQString("Parse var: name") + p);
       if (!parseName(p, name, kind)) {
-        return 0;
+        return nullptr;
       }
       variable = new ExprValue(name, kind);
-      if (variable != 0L) {
+      if (variable) {
 	  variable->m_varKind = VarTree::VKsimple;
       }
     }else{
@@ -778,17 +778,17 @@ parseVar(const char *&s)
         p++;
       TRACE(TQString("Parse var: name") + p);
       if (!parseName(p, name, kind)) {
-        return 0;
+        return nullptr;
       }
       variable = new ExprValue(name, kind);
-      if (variable != 0L) {
+      if (variable) {
 	  variable->m_varKind = VarTree::VKsimple;
       }
       if (*p == '\n')
 	p++;
       if (!parseValue(p, variable)) {
 	delete variable;
-	return 0;
+	return nullptr;
       }
     }
 
@@ -855,18 +855,18 @@ parseValue(const char *&s, ExprValue * variable)
 	 "Information:",
         "runtime error",
 	 "xmlXPathEval:",
-	0		     				     
+	nullptr		     				     
     };
     static char valueBuffer[2048];
     int markerIndex = 0, foundEnd = 0;
     size_t copySize;
 
-    if (variable == 0L)
+    if (!variable)
         return false;           /* should never happen but .. */
 
     while (start && (*start != '\0')) {
         /* look for the next marker */
-        for (markerIndex = 0; marker[markerIndex] != 0; markerIndex++) {
+        for (markerIndex = 0; marker[markerIndex]; markerIndex++) {
             foundEnd =
                 strncmp(start, marker[markerIndex],
                         strlen(marker[markerIndex])) == 0;
@@ -1105,7 +1105,7 @@ XsldbgDriver::parseBreakList(const char *output,
     char *dummy;
     p =  strchr(output, '\n');/* skip the first blank line*/
 
-    while ((p != 0) && (*p != '\0')) {
+    while (p && *p != '\0') {
 	if (*p == '\n')
 	    p++;
         TQString templateName;
@@ -1121,7 +1121,7 @@ XsldbgDriver::parseBreakList(const char *output,
         bp.id = strtol(p, &dummy, 10);     /* don't care about overflows */
 
         p = dummy;
-        if ((p == 0) || (p[1] == '\0'))
+        if (!p || p[1] == '\0')
             break;
         p++;
 
@@ -1212,7 +1212,7 @@ XsldbgDriver::parseBreakList(const char *output,
         bp.fileName = file;
         brks.push_back(bp);
 
-        if (p != 0) {
+        if (p) {
             p = strchr(p, '\n');
 	    if (p)
 		p++;
@@ -1263,7 +1263,7 @@ XsldbgDriver::parseLocals(const char *output, std::list < ExprValue* > &newVars)
     while (*output != '\0') {
         ExprValue *variable = parseVar(output);
 
-        if (variable == 0) {
+        if (!variable) {
             break;
         }
         // do not add duplicates
@@ -1283,7 +1283,7 @@ XsldbgDriver::parseLocals(const char *output, std::list < ExprValue* > &newVars)
 ExprValue *
 XsldbgDriver::parsePrintExpr(const char *output, bool wantErrorValue)
 {
-    ExprValue* var = 0;
+    ExprValue* var = nullptr;
     // check for error conditions
     if (!parseErrorMessage(output, var, wantErrorValue)) {
         // parse the variable
@@ -1368,7 +1368,7 @@ XsldbgDriver::parseProgramStopped(const char *output, TQString & message)
 
         // next line, please
         start = strchr(start, '\n');
-    } while (start != 0);
+    } while (start);
 
     return flags;
 }
-- 
cgit v1.2.3

