From e4a34cb9b7d59a08a162d642fbbca8c08804b3ff Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sun, 10 Jun 2018 00:16:59 +0100 Subject: Apply all modernize-* fixes from clang-tidy except for modernize-use-auto --- src/modules/dcc/DccVoiceCodec.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/modules/dcc/DccVoiceCodec.cpp') diff --git a/src/modules/dcc/DccVoiceCodec.cpp b/src/modules/dcc/DccVoiceCodec.cpp index 8f52060a2..1028e7c72 100644 --- a/src/modules/dcc/DccVoiceCodec.cpp +++ b/src/modules/dcc/DccVoiceCodec.cpp @@ -29,8 +29,7 @@ #include DccVoiceCodec::DccVoiceCodec() -{ -} + = default; DccVoiceCodec::~DccVoiceCodec() = default; @@ -95,8 +94,7 @@ int DccVoiceNullCodec::decodedFrameSize() } DccVideoCodec::DccVideoCodec() -{ -} + = default; DccVideoCodec::~DccVideoCodec() = default; -- cgit v1.3.1-10-gc9f91 From 3820267cf16d09b7e8e2d7a8f30b7a340f300934 Mon Sep 17 00:00:00 2001 From: IceN9ne Date: Mon, 3 Dec 2018 20:26:31 -0500 Subject: Convert 0s and NULLs to nullptr --- src/kvilib/core/KviCString.cpp | 2 +- src/kvilib/core/KviCString.h | 30 ++--- src/kvilib/core/KviMemory.cpp | 10 +- src/kvilib/core/KviPointerHashTable.h | 88 +++++++------- src/kvilib/core/KviPointerList.h | 129 ++++++++++----------- src/kvilib/core/KviShortcut.h | 6 +- src/kvilib/ext/KviDataBuffer.h | 2 +- src/kvilib/ext/KviOggTheoraDecoder.cpp | 4 +- src/kvilib/ext/KviOggTheoraEncoder.cpp | 2 +- src/kvilib/ext/KviRuntimeInfo.cpp | 4 +- src/kvilib/net/KviDnsResolver.cpp | 2 +- src/kvilib/net/KviHttpRequest.cpp | 2 +- src/kvilib/net/KviNetworkAccessManager.h | 2 +- src/kvilib/system/KviEnvironment.h | 2 +- src/kvilib/system/KviSignalHandler.h | 2 +- src/kvilib/system/KviThread.h | 6 +- src/kvilib/tal/KviTalFileDialog.h | 2 +- src/kvilib/tal/KviTalGroupBox.h | 10 +- src/kvilib/tal/KviTalHBox.h | 2 +- src/kvilib/tal/KviTalIconAndRichTextItemDelegate.h | 2 +- src/kvilib/tal/KviTalTabDialog.h | 2 +- src/kvilib/tal/KviTalVBox.h | 2 +- src/kvirc/kernel/KviApplication_setup.cpp | 10 +- src/kvirc/kernel/KviIrcConnection.h | 42 +++---- src/kvirc/kernel/KviIrcSocket.cpp | 2 +- src/kvirc/kernel/KviSSLMaster.h | 2 +- src/kvirc/kvs/KviKvsAction.h | 4 +- src/kvirc/kvs/KviKvsAsyncDnsOperation.h | 2 +- src/kvirc/kvs/KviKvsCallbackObject.h | 2 +- src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp | 2 +- src/kvirc/kvs/KviKvsDnsManager.h | 4 +- src/kvirc/kvs/KviKvsModuleInterface.h | 2 +- src/kvirc/kvs/KviKvsParameterProcessor.h | 10 +- src/kvirc/kvs/KviKvsProcessManager.cpp | 2 +- src/kvirc/kvs/KviKvsRunTimeContext.h | 2 +- src/kvirc/kvs/KviKvsScript.h | 10 +- src/kvirc/kvs/object/KviKvsObject.h | 6 +- src/kvirc/kvs/parser/KviKvsParser.cpp | 12 +- src/kvirc/kvs/parser/KviKvsParser.h | 88 +++++++------- src/kvirc/kvs/parser/KviKvsParser_command.cpp | 4 +- src/kvirc/kvs/parser/KviKvsParser_lside.cpp | 4 +- .../kvs/parser/KviKvsParser_specialCommands.cpp | 8 +- src/kvirc/module/KviModuleExtension.h | 6 +- src/kvirc/module/KviModuleManager.cpp | 2 +- src/kvirc/sparser/KviIrcNumericCodes.h | 20 ++-- src/kvirc/ui/KviConsoleWindow.h | 2 +- src/kvirc/ui/KviDynamicToolTip.h | 2 +- src/kvirc/ui/KviFileDialog.h | 10 +- src/kvirc/ui/KviInput.h | 2 +- src/kvirc/ui/KviIrcToolBar.h | 4 +- src/kvirc/ui/KviIrcView.h | 6 +- src/kvirc/ui/KviMainWindow.h | 4 +- src/kvirc/ui/KviMaskEditor.h | 2 +- src/kvirc/ui/KviOptionsWidget.h | 2 +- src/kvirc/ui/KviSelectors.h | 2 +- src/kvirc/ui/KviTopicWidget.h | 4 +- src/kvirc/ui/KviTreeWindowList.h | 2 +- src/kvirc/ui/KviUserListView.h | 2 +- src/kvirc/ui/KviWebPackageManagementDialog.h | 2 +- src/kvirc/ui/KviWindow.h | 6 +- src/kvirc/ui/KviWindowListBase.h | 10 +- src/modules/addon/AddonFunctions.h | 2 +- src/modules/context/libkvicontext.cpp | 8 +- src/modules/dcc/DccCanvasWindow.cpp | 4 +- src/modules/dcc/DccVideoWindow.cpp | 34 +++--- src/modules/dcc/DccVoiceCodec.cpp | 8 +- src/modules/dcc/DccVoiceGsmCodec.cpp | 14 +-- src/modules/dcc/DccVoiceWindow.h | 6 +- src/modules/dcc/DccWindow.h | 2 +- src/modules/dcc/canvaswidget.cpp | 10 +- src/modules/editor/ScriptEditorImplementation.h | 2 +- src/modules/file/libkvifile.cpp | 2 +- .../filetransferwindow/FileTransferWindow.cpp | 2 +- .../filetransferwindow/FileTransferWindow.h | 2 +- src/modules/ident/libkviident.h | 2 +- src/modules/list/ListWindow.h | 2 +- src/modules/mediaplayer/MpAmipInterface.cpp | 8 +- src/modules/mediaplayer/MpInterface.h | 2 +- src/modules/mediaplayer/MpWinampInterface.cpp | 23 ++-- src/modules/mediaplayer/winamp.cpp | 2 +- src/modules/my/libkvimy.cpp | 2 +- src/modules/objects/KvsObject_painter.cpp | 2 +- src/modules/objects/KvsObject_pixmap.h | 4 +- src/modules/objects/KvsObject_tableWidget.h | 2 +- src/modules/objects/object_macros.h | 4 +- src/modules/options/OptionsInstanceManager.cpp | 2 +- src/modules/options/OptionsWidget_message.h | 4 +- src/modules/options/mkcreateinstanceproc.sh | 14 +-- src/modules/popupeditor/PopupEditorWindow.h | 2 +- src/modules/reguser/RegisteredUsersDialog.h | 4 +- src/modules/reguser/RegistrationWizard.h | 2 +- src/modules/rijndael/Rijndael.h | 12 +- src/modules/setup/SetupWizard.cpp | 6 +- src/modules/sharedfileswindow/SharedFilesWindow.h | 2 +- src/modules/snd/libkvisnd.cpp | 4 +- src/modules/term/TermWidget.cpp | 14 +-- src/modules/term/TermWindow.cpp | 2 +- src/modules/theme/ThemeFunctions.h | 4 +- src/modules/theme/WebThemeInterfaceDialog.h | 2 +- src/modules/torrent/TorrentInterface.h | 2 +- src/modules/url/libkviurl.h | 2 +- src/modules/window/UserWindow.h | 2 +- 102 files changed, 422 insertions(+), 428 deletions(-) (limited to 'src/modules/dcc/DccVoiceCodec.cpp') diff --git a/src/kvilib/core/KviCString.cpp b/src/kvilib/core/KviCString.cpp index f7e3f3014..b4c8b4f07 100644 --- a/src/kvilib/core/KviCString.cpp +++ b/src/kvilib/core/KviCString.cpp @@ -360,7 +360,7 @@ bool kvi_matchWildExpr(const char * m1, const char * m2) bool kvi_matchWildExprCS(const char *m1,const char *m2) { if(!(m1 && m2 && (*m1)))return false; - const char * savePos1 = 0; + const char * savePos1 = nullptr; const char * savePos2 = m2; while(*m1){ //loop managed by m1 (initially first mask) if(*m1=='*'){ diff --git a/src/kvilib/core/KviCString.h b/src/kvilib/core/KviCString.h index 1a9d3ac74..43fb25b2f 100644 --- a/src/kvilib/core/KviCString.h +++ b/src/kvilib/core/KviCString.h @@ -243,7 +243,7 @@ public: // Assignment KviCString & operator=(const KviCString & str); // deep copy - KviCString & operator=(const char * str); // str can be NULL here + KviCString & operator=(const char * str); // str can be nullptr here KviCString & operator=(char c); // 2 bytes allocated,m_len = 1 KviCString & operator=(const QString & str); KviCString & operator=(const QByteArray & str); @@ -366,7 +366,7 @@ public: // if sep is not 0, it is inserted between the strings // if bLastSep is true and sep is non 0, then sep is also appended at the end // of the buffer (after the last string) - void joinFromArray(KviCString ** strings, const char * sep = 0, bool bLastSep = false); + void joinFromArray(KviCString ** strings, const char * sep = nullptr, bool bLastSep = false); // Utils // encodes chars that have nonzero in the jumptable @@ -410,16 +410,16 @@ public: // Numbers // everything in base 10.... no overflow checks here - long toLong(bool * bOk = 0) const; - unsigned long toULong(bool * bOk = 0) const; - long long toLongLong(bool * bOk = 0) const; - unsigned long long toULongLong(bool * bOk = 0) const; - char toChar(bool * bOk = 0) const { return (char)toLong(bOk); }; - unsigned char toUChar(bool * bOk = 0) const { return (unsigned char)toULong(bOk); }; - int toInt(bool * bOk = 0) const { return (int)toLong(bOk); }; - unsigned int toUInt(bool * bOk = 0) const { return (unsigned int)toULong(bOk); }; - short toShort(bool * bOk = 0) const { return (short)toLong(bOk); }; - unsigned short toUShort(bool * bOk = 0) const { return (unsigned short)toLong(bOk); }; + long toLong(bool * bOk = nullptr) const; + unsigned long toULong(bool * bOk = nullptr) const; + long long toLongLong(bool * bOk = nullptr) const; + unsigned long long toULongLong(bool * bOk = nullptr) const; + char toChar(bool * bOk = nullptr) const { return (char)toLong(bOk); }; + unsigned char toUChar(bool * bOk = nullptr) const { return (unsigned char)toULong(bOk); }; + int toInt(bool * bOk = nullptr) const { return (int)toLong(bOk); }; + unsigned int toUInt(bool * bOk = nullptr) const { return (unsigned int)toULong(bOk); }; + short toShort(bool * bOk = nullptr) const { return (short)toLong(bOk); }; + unsigned short toUShort(bool * bOk = nullptr) const { return (unsigned short)toLong(bOk); }; KviCString & setNum(long num); KviCString & setNum(unsigned long num); @@ -439,8 +439,8 @@ public: bool isUnsignedNum() const; // special functions for multiple bases - long toLongExt(bool * bOk = 0, int base = 0); - // unsigned long toULongExt(bool *bOk = 0,int base = 0); //never used + long toLongExt(bool * bOk = nullptr, int base = 0); + // unsigned long toULongExt(bool *bOk = nullptr,int base = 0); //never used // returns an empty string... // this if often useful! @@ -450,7 +450,7 @@ public: // Transform a pointer to a string with all 0 and 1 // void pointerToBitString(const void * ptr); - // Get a pointer from a string all of 0 and 1 : return 0 if invalid + // Get a pointer from a string all of 0 and 1 : return nullptr if invalid // void * bitStringToPointer(); // "External string" helper functions diff --git a/src/kvilib/core/KviMemory.cpp b/src/kvilib/core/KviMemory.cpp index e95eef8bb..6d3a2f2b2 100644 --- a/src/kvilib/core/KviMemory.cpp +++ b/src/kvilib/core/KviMemory.cpp @@ -58,14 +58,14 @@ namespace KviMemory }; int g_iMaxRequestSize = 0; - void * g_pMaxRequestReturnAddress1 = 0; - void * g_pMaxRequestReturnAddress2 = 0; + void * g_pMaxRequestReturnAddress1 = nullptr; + void * g_pMaxRequestReturnAddress2 = nullptr; unsigned int g_iMallocCalls = 0; unsigned int g_iReallocCalls = 0; unsigned int g_iFreeCalls = 0; unsigned int g_iTotalMemAllocated = 0; unsigned int g_uAllocationPeak = 0; - KviMallocEntry * g_pEntries = 0; + KviMallocEntry * g_pEntries = nullptr; void * allocate(int size) { @@ -85,7 +85,7 @@ namespace KviMemory e->return_addr1 = __builtin_return_address(1); e->return_addr2 = __builtin_return_address(2); e->next = g_pEntries; - e->prev = 0; + e->prev = nullptr; if(g_pEntries) g_pEntries->prev = e; g_pEntries = e; @@ -151,7 +151,7 @@ namespace KviMemory if(e != g_pEntries) fprintf(stderr, "Mem profiling internal error!\n"); if(e->next) - e->next->prev = 0; + e->next->prev = nullptr; g_pEntries = e->next; } free(e); diff --git a/src/kvilib/core/KviPointerHashTable.h b/src/kvilib/core/KviPointerHashTable.h index 844aa57f8..fa55be62f 100644 --- a/src/kvilib/core/KviPointerHashTable.h +++ b/src/kvilib/core/KviPointerHashTable.h @@ -137,7 +137,7 @@ inline void kvi_hash_key_destroy(const char *& szKey, bool bDeepCopy) */ inline const char *& kvi_hash_key_default(const char **) { - static const char * static_null = NULL; + static const char * static_null = nullptr; return static_null; } @@ -322,7 +322,7 @@ inline void kvi_hash_key_destroy(void *, bool) */ inline void *& kvi_hash_key_default(void *) { - static void * static_default = NULL; + static void * static_default = nullptr; return static_default; } @@ -463,7 +463,7 @@ public: /** * \brief Returns the item associated to the key * - * Returns NULL if no such item exists in the hash table. + * Returns nullptr if no such item exists in the hash table. * Places the hash table iterator at the position of the item found. * \param hKey The key to find * \return T * @@ -472,19 +472,19 @@ public: { m_uIteratorIdx = kvi_hash_hash(hKey, m_bCaseSensitive) % m_uSize; if(!m_pDataArray[m_uIteratorIdx]) - return 0; + return nullptr; for(KviPointerHashTableEntry * e = m_pDataArray[m_uIteratorIdx]->first(); e; e = m_pDataArray[m_uIteratorIdx]->next()) { if(kvi_hash_key_equal(e->hKey, hKey, m_bCaseSensitive)) return (T *)e->pData; } - return 0; + return nullptr; } /** * \brief Returns the item associated to the key hKey * - * Returns NULL if no such item exists in the hash table. + * Returns nullptr if no such item exists in the hash table. * Places the hash table iterator at the position of the item found. * This is an alias to find(). * \param hKey The key to find @@ -594,7 +594,7 @@ public: if(m_pDataArray[uEntry]->isEmpty()) { delete m_pDataArray[uEntry]; - m_pDataArray[uEntry] = 0; + m_pDataArray[uEntry] = nullptr; } m_uCount--; return true; @@ -629,7 +629,7 @@ public: if(m_pDataArray[i]->isEmpty()) { delete m_pDataArray[i]; - m_pDataArray[i] = 0; + m_pDataArray[i] = nullptr; } m_uCount--; return true; @@ -670,7 +670,7 @@ public: if(m_pDataArray[i]) { delete m_pDataArray[i]; - m_pDataArray[i] = 0; + m_pDataArray[i] = nullptr; } } m_uCount = 0; @@ -679,7 +679,7 @@ public: /** * \brief Searches for the item pointer pRef * - * Returns its hash table entry, if found, and NULL otherwise. + * Returns its hash table entry, if found, and nullptr otherwise. * The hash table iterator is placed at the item found. * \param pRef The pointer to search * \return KviPointerHashTableEntry * @@ -697,7 +697,7 @@ public: } } } - return 0; + return nullptr; } /** @@ -710,10 +710,10 @@ public: KviPointerHashTableEntry * currentEntry() { if(m_uIteratorIdx >= m_uSize) - return 0; + return nullptr; if(m_pDataArray[m_uIteratorIdx]) return m_pDataArray[m_uIteratorIdx]->current(); - return 0; + return nullptr; } /** @@ -728,7 +728,7 @@ public: m_uIteratorIdx++; } if(m_uIteratorIdx == m_uSize) - return 0; + return nullptr; return m_pDataArray[m_uIteratorIdx]->first(); } @@ -742,7 +742,7 @@ public: KviPointerHashTableEntry * nextEntry() { if(m_uIteratorIdx >= m_uSize) - return 0; + return nullptr; if(m_uIteratorIdx < m_uSize) { @@ -759,7 +759,7 @@ public: } if(m_uIteratorIdx == m_uSize) - return 0; + return nullptr; return m_pDataArray[m_uIteratorIdx]->first(); } @@ -774,15 +774,15 @@ public: T * current() { if(m_uIteratorIdx >= m_uSize) - return 0; + return nullptr; if(m_pDataArray[m_uIteratorIdx]) { KviPointerHashTableEntry * e = m_pDataArray[m_uIteratorIdx]->current(); if(!e) - return 0; + return nullptr; return e->data(); } - return 0; + return nullptr; } /** @@ -795,15 +795,15 @@ public: const Key & currentKey() { if(m_uIteratorIdx >= m_uSize) - return kvi_hash_key_default(((Key *)NULL)); + return kvi_hash_key_default(((Key *)nullptr)); if(m_pDataArray[m_uIteratorIdx]) { KviPointerHashTableEntry * e = m_pDataArray[m_uIteratorIdx]->current(); if(!e) - return kvi_hash_key_default(((Key *)NULL)); + return kvi_hash_key_default(((Key *)nullptr)); return e->key(); } - return kvi_hash_key_default(((Key *)NULL)); + return kvi_hash_key_default(((Key *)nullptr)); } /** \brief Places the hash table iterator at the first entry @@ -819,10 +819,10 @@ public: m_uIteratorIdx++; } if(m_uIteratorIdx == m_uSize) - return 0; + return nullptr; KviPointerHashTableEntry * e = m_pDataArray[m_uIteratorIdx]->first(); if(!e) - return 0; + return nullptr; return e->data(); } @@ -836,7 +836,7 @@ public: T * next() { if(m_uIteratorIdx >= m_uSize) - return 0; + return nullptr; if(m_uIteratorIdx < m_uSize) { @@ -855,11 +855,11 @@ public: } if(m_uIteratorIdx == m_uSize) - return 0; + return nullptr; KviPointerHashTableEntry * e = m_pDataArray[m_uIteratorIdx]->first(); if(!e) - return 0; + return nullptr; return e->data(); } @@ -923,7 +923,7 @@ public: m_uSize = uSize > 0 ? uSize : 32; m_pDataArray = new KviPointerList> *[m_uSize]; for(unsigned int i = 0; i < m_uSize; i++) - m_pDataArray[i] = NULL; + m_pDataArray[i] = nullptr; } /** @@ -942,7 +942,7 @@ public: m_uSize = t.m_uSize; m_pDataArray = new KviPointerList> *[m_uSize]; for(unsigned int i = 0; i < m_uSize; i++) - m_pDataArray[i] = NULL; + m_pDataArray[i] = nullptr; copyFrom(t); } @@ -985,7 +985,7 @@ public: if(src.m_pIterator) m_pIterator = new KviPointerListIterator>(*(src.m_pIterator)); else - m_pIterator = NULL; + m_pIterator = nullptr; } /** @@ -999,7 +999,7 @@ public: if(m_pIterator) { delete m_pIterator; - m_pIterator = NULL; + m_pIterator = nullptr; } m_uEntryIndex = 0; @@ -1016,7 +1016,7 @@ public: if(!bRet) { delete m_pIterator; - m_pIterator = NULL; + m_pIterator = nullptr; } return bRet; } @@ -1032,7 +1032,7 @@ public: if(m_pIterator) { delete m_pIterator; - m_pIterator = NULL; + m_pIterator = nullptr; } m_uEntryIndex = m_pHashTable->m_uSize; @@ -1046,7 +1046,7 @@ public: if(!bRet) { delete m_pIterator; - m_pIterator = NULL; + m_pIterator = nullptr; } return bRet; } @@ -1070,7 +1070,7 @@ public: if(m_pIterator) { delete m_pIterator; - m_pIterator = NULL; + m_pIterator = nullptr; } m_uEntryIndex++; while((m_uEntryIndex < m_pHashTable->m_uSize) && (!(m_pHashTable->m_pDataArray[m_uEntryIndex]))) @@ -1084,7 +1084,7 @@ public: if(!bRet) { delete m_pIterator; - m_pIterator = NULL; + m_pIterator = nullptr; } return bRet; } @@ -1119,7 +1119,7 @@ public: if(m_pIterator) { delete m_pIterator; - m_pIterator = NULL; + m_pIterator = nullptr; } if(m_uEntryIndex >= m_pHashTable->m_uSize) return false; @@ -1133,7 +1133,7 @@ public: if(!bRet) { delete m_pIterator; - m_pIterator = NULL; + m_pIterator = nullptr; } return bRet; } @@ -1164,7 +1164,7 @@ public: */ T * current() const { - return m_pIterator ? m_pIterator->current()->data() : NULL; + return m_pIterator ? m_pIterator->current()->data() : nullptr; } /** @@ -1176,7 +1176,7 @@ public: */ T * operator*() const { - return m_pIterator ? m_pIterator->current()->data() : NULL; + return m_pIterator ? m_pIterator->current()->data() : nullptr; } /** @@ -1189,19 +1189,19 @@ public: { if(m_pIterator) return m_pIterator->current()->key(); - return kvi_hash_key_default(((Key *)NULL)); + return kvi_hash_key_default(((Key *)nullptr)); } /** * \brief Moves the iterator to the first element of the hash table. * - * Returns the first item found or NULL if the hash table is empty. + * Returns the first item found or nullptr if the hash table is empty. * \return T * */ T * toFirst() { if(!moveFirst()) - return NULL; + return nullptr; return current(); } @@ -1215,7 +1215,7 @@ public: { m_pHashTable = &hTable; m_uEntryIndex = 0; - m_pIterator = NULL; + m_pIterator = nullptr; moveFirst(); } diff --git a/src/kvilib/core/KviPointerList.h b/src/kvilib/core/KviPointerList.h index 5eff4d07c..0f8d12b7d 100644 --- a/src/kvilib/core/KviPointerList.h +++ b/src/kvilib/core/KviPointerList.h @@ -45,7 +45,6 @@ * been removed from Qt4 in favor of the value based non-autodeleting * lists... anyway: here we go :) * -* \def NULL Define NULL type to 0 * \def KviPointerListBase Defines KviPointerListBase as KviPointerList */ @@ -56,10 +55,6 @@ class KviPointerList; template class KviPointerListIterator; -#ifndef NULL -#define NULL 0 -#endif - /** * \class KviPointerListNode * \brief A KviPointerList node pointers. @@ -213,7 +208,7 @@ public: bool moveFirst() { m_pNode = m_pList->m_pHead; - return m_pNode != NULL; + return m_pNode != nullptr; } /** @@ -225,7 +220,7 @@ public: bool moveLast() { m_pNode = m_pList->m_pTail; - return m_pNode != NULL; + return m_pNode != nullptr; } /** @@ -240,7 +235,7 @@ public: if(!m_pNode) return false; m_pNode = m_pNode->m_pNext; - return m_pNode != NULL; + return m_pNode != nullptr; } /** @@ -256,7 +251,7 @@ public: if(!m_pNode) return false; m_pNode = m_pNode->m_pNext; - return m_pNode != NULL; + return m_pNode != nullptr; } /** @@ -272,7 +267,7 @@ public: if(!m_pNode) return false; m_pNode = m_pNode->m_pPrev; - return m_pNode != NULL; + return m_pNode != nullptr; } /** @@ -289,30 +284,30 @@ public: if(!m_pNode) return false; m_pNode = m_pNode->m_pPrev; - return m_pNode != NULL; + return m_pNode != nullptr; } /** * \brief Returns the value pointed by the iterator. * - * If the iterator is not valid, returns NULL. + * If the iterator is not valid, returns nullptr. * \return T * */ T * current() { - return m_pNode ? (T *)(m_pNode->m_pData) : NULL; + return m_pNode ? (T *)(m_pNode->m_pData) : nullptr; } /** * \brief Returns the value pointed by the iterator. * - * If the iterator is not valid, returns NULL. + * If the iterator is not valid, returns nullptr. * This is just an alias to current(). * \return T * */ T * operator*() { - return m_pNode ? (T *)(m_pNode->m_pData) : NULL; + return m_pNode ? (T *)(m_pNode->m_pData) : nullptr; } /** @@ -323,7 +318,7 @@ public: */ bool isValid() { - return m_pNode != NULL; + return m_pNode != nullptr; } }; @@ -379,7 +374,7 @@ class KviPointerList protected: bool m_bAutoDelete; //< do we automatically delete items when they are removed ? - KviPointerListNode * m_pHead; //< our list head pointer (NULL if there are no items in the list) + KviPointerListNode * m_pHead; //< our list head pointer (nullptr if there are no items in the list) KviPointerListNode * m_pTail; //< our list tail KviPointerListNode * m_pAux; //< our iteration pointer @@ -428,12 +423,12 @@ protected: if(pNewHead->m_pNext) { src->m_pHead = pNewHead->m_pNext; - src->m_pHead->m_pPrev = NULL; + src->m_pHead->m_pPrev = nullptr; } else { - src->m_pHead = NULL; - src->m_pTail = NULL; + src->m_pHead = nullptr; + src->m_pTail = nullptr; } if(m_pHead) @@ -446,7 +441,7 @@ protected: { m_pHead = pNewHead; m_pTail = pNewHead; - m_pHead->m_pNext = NULL; + m_pHead->m_pNext = nullptr; } m_uCount++; src->m_uCount--; @@ -468,7 +463,7 @@ protected: m_pTail = m_pAux->m_pPrev; const T * pAuxData = (const T *)(m_pAux->m_pData); delete m_pAux; - m_pAux = NULL; + m_pAux = nullptr; m_uCount--; if(m_bAutoDelete) delete pAuxData; // this can cause recursion, so do it at the end @@ -521,13 +516,13 @@ public: { m_pHead = n; m_pTail = n; - n->m_pPrev = NULL; + n->m_pPrev = nullptr; } m_pTail = src->m_pTail; } - src->m_pHead = NULL; - src->m_pTail = NULL; + src->m_pHead = nullptr; + src->m_pTail = nullptr; src->m_uCount = 0; } @@ -615,7 +610,7 @@ public: */ bool isEmpty() const { - return (m_pHead == NULL); + return (m_pHead == nullptr); } /** @@ -638,8 +633,8 @@ public: { if(!m_pHead) { - m_pAux = NULL; - return NULL; + m_pAux = nullptr; + return nullptr; } m_pAux = m_pHead; return (T *)(m_pAux->m_pData); @@ -655,21 +650,21 @@ public: T * takeFirst() { if(!m_pHead) - return NULL; + return nullptr; T * pData = (T *)m_pHead->m_pData; if(m_pHead->m_pNext) { m_pHead = m_pHead->m_pNext; delete m_pHead->m_pPrev; - m_pHead->m_pPrev = NULL; + m_pHead->m_pPrev = nullptr; } else { delete m_pHead; - m_pHead = NULL; - m_pTail = NULL; + m_pHead = nullptr; + m_pTail = nullptr; } - m_pAux = NULL; + m_pAux = nullptr; m_uCount--; return pData; } @@ -681,21 +676,21 @@ public: T * takeLast() { if(!m_pTail) - return NULL; + return nullptr; T * pData = (T *)m_pTail->m_pData; if(m_pTail->m_pPrev) { m_pTail = m_pTail->m_pPrev; delete m_pTail->m_pNext; - m_pTail->m_pNext = NULL; + m_pTail->m_pNext = nullptr; } else { delete m_pTail; - m_pHead = NULL; - m_pTail = NULL; + m_pHead = nullptr; + m_pTail = nullptr; } - m_pAux = NULL; + m_pAux = nullptr; m_uCount--; return pData; } @@ -720,8 +715,8 @@ public: { if(!m_pTail) { - m_pAux = NULL; - return NULL; + m_pAux = nullptr; + return nullptr; } m_pAux = m_pTail; return (T *)(m_pAux->m_pData); @@ -753,13 +748,13 @@ public: * * A call to this function should be preceded by a call to * first(),last(),at() or findRef(). - * This function will return a NULL pointer if the current item has + * This function will return a nullptr if the current item has * been invalidated due to a remove operation. * \return T * */ T * safeCurrent() { - return m_pAux ? (T *)(m_pAux->m_pData) : NULL; + return m_pAux ? (T *)(m_pAux->m_pData) : nullptr; } /** @@ -778,7 +773,7 @@ public: * \brief Returns the next item in the list * * Sets the iteration pointer to the next item in the list and - * returns that item (or 0 if the end of the list has been reached) + * returns that item (or nullptr if the end of the list has been reached) * A call to this function MUST be preceded by a _successfull_ call * to first(),last(),at() or findRef(). * \return T * @@ -786,11 +781,11 @@ public: T * next() { if(!m_pAux) - return NULL; + return nullptr; m_pAux = m_pAux->m_pNext; if(m_pAux) return (T *)(m_pAux->m_pData); - return NULL; + return nullptr; } /** @@ -806,11 +801,11 @@ public: T * prev() { if(!m_pAux) - return NULL; + return nullptr; m_pAux = m_pAux->m_pPrev; if(m_pAux) return (T *)(m_pAux->m_pData); - return NULL; + return nullptr; } /** @@ -832,7 +827,7 @@ public: t = next(); cnt++; } - return 0; + return nullptr; } /** @@ -851,7 +846,7 @@ public: n = n->m_pNext; cnt++; } - return KviPointerListIterator(*this, NULL); + return KviPointerListIterator(*this, nullptr); } /** @@ -889,7 +884,7 @@ public: return KviPointerListIterator(*this, n); n = n->m_pNext; } - return KviPointerListIterator(*this, NULL); + return KviPointerListIterator(*this, nullptr); } /** @@ -902,8 +897,8 @@ public: if(!m_pHead) { m_pHead = new KviPointerListNode; - m_pHead->m_pPrev = NULL; - m_pHead->m_pNext = NULL; + m_pHead->m_pPrev = nullptr; + m_pHead->m_pNext = nullptr; m_pHead->m_pData = (void *)d; m_pTail = m_pHead; } @@ -911,7 +906,7 @@ public: { m_pTail->m_pNext = new KviPointerListNode; m_pTail->m_pNext->m_pPrev = m_pTail; - m_pTail->m_pNext->m_pNext = NULL; + m_pTail->m_pNext->m_pNext = nullptr; m_pTail->m_pNext->m_pData = (void *)d; m_pTail = m_pTail->m_pNext; } @@ -950,8 +945,8 @@ public: if(!m_pHead) { m_pHead = new KviPointerListNode; - m_pHead->m_pPrev = NULL; - m_pHead->m_pNext = NULL; + m_pHead->m_pPrev = nullptr; + m_pHead->m_pNext = nullptr; m_pHead->m_pData = (void *)d; m_pTail = m_pHead; } @@ -959,7 +954,7 @@ public: { m_pHead->m_pPrev = new KviPointerListNode; m_pHead->m_pPrev->m_pNext = m_pHead; - m_pHead->m_pPrev->m_pPrev = NULL; + m_pHead->m_pPrev->m_pPrev = nullptr; m_pHead->m_pPrev->m_pData = (void *)d; m_pHead = m_pHead->m_pPrev; m_uCount++; @@ -1008,16 +1003,16 @@ public: m_pHead = m_pHead->m_pNext; pAuxData = (const T *)(m_pHead->m_pPrev->m_pData); delete m_pHead->m_pPrev; - m_pHead->m_pPrev = NULL; + m_pHead->m_pPrev = nullptr; } else { pAuxData = (const T *)(m_pHead->m_pData); delete m_pHead; - m_pHead = NULL; - m_pTail = NULL; + m_pHead = nullptr; + m_pTail = nullptr; } - m_pAux = NULL; + m_pAux = nullptr; m_uCount--; if(m_bAutoDelete) delete pAuxData; @@ -1040,16 +1035,16 @@ public: m_pTail = m_pTail->m_pPrev; pAuxData = (const T *)(m_pTail->m_pNext->m_pData); delete m_pTail->m_pNext; - m_pTail->m_pNext = NULL; + m_pTail->m_pNext = nullptr; } else { pAuxData = (const T *)(m_pTail->m_pData); delete m_pTail; - m_pHead = NULL; - m_pTail = NULL; + m_pHead = nullptr; + m_pTail = nullptr; } - m_pAux = NULL; + m_pAux = nullptr; m_uCount--; if(m_bAutoDelete) delete pAuxData; @@ -1258,10 +1253,10 @@ public: KviPointerList(bool bAutoDelete = true) { m_bAutoDelete = bAutoDelete; - m_pHead = NULL; - m_pTail = NULL; + m_pHead = nullptr; + m_pTail = nullptr; m_uCount = 0; - m_pAux = NULL; + m_pAux = nullptr; }; /** diff --git a/src/kvilib/core/KviShortcut.h b/src/kvilib/core/KviShortcut.h index 4f7b0eac3..4de4fd309 100644 --- a/src/kvilib/core/KviShortcut.h +++ b/src/kvilib/core/KviShortcut.h @@ -40,9 +40,9 @@ private: ~KviShortcut(); public: - static QShortcut * create(const char * key, QWidget * parent, const char * member = 0, const char * ambiguousMember = 0, Qt::ShortcutContext context = Qt::WindowShortcut); - static QShortcut * create(const QKeySequence & key, QWidget * parent, const char * member = 0, const char * ambiguousMember = 0, Qt::ShortcutContext context = Qt::WindowShortcut); - static void create(QKeySequence::StandardKey key, QWidget * parent, const char * member = 0, const char * ambiguousMember = 0, Qt::ShortcutContext context = Qt::WindowShortcut, KviPointerList * pBufferList = nullptr); + static QShortcut * create(const char * key, QWidget * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut); + static QShortcut * create(const QKeySequence & key, QWidget * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut); + static void create(QKeySequence::StandardKey key, QWidget * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut, KviPointerList * pBufferList = nullptr); }; #endif //_KVI_SHORTCUT_CLASSFILE_H_ diff --git a/src/kvilib/ext/KviDataBuffer.h b/src/kvilib/ext/KviDataBuffer.h index 52d02d160..137fa2527 100644 --- a/src/kvilib/ext/KviDataBuffer.h +++ b/src/kvilib/ext/KviDataBuffer.h @@ -33,7 +33,7 @@ public: // uSize MUST be greater than 0 // if data is non-zero, it MUST point to a buffer at least uSize bytes long // and the data is COPIED from that buffer! - KviDataBuffer(int uSize, const unsigned char * data = 0); + KviDataBuffer(int uSize, const unsigned char * data = nullptr); KviDataBuffer(); ~KviDataBuffer(); diff --git a/src/kvilib/ext/KviOggTheoraDecoder.cpp b/src/kvilib/ext/KviOggTheoraDecoder.cpp index 116477e43..82e1a047d 100644 --- a/src/kvilib/ext/KviOggTheoraDecoder.cpp +++ b/src/kvilib/ext/KviOggTheoraDecoder.cpp @@ -55,7 +55,7 @@ KviOggTheoraDecoder::KviOggTheoraDecoder(KviDataBuffer * videoSignal, KviDataBuf m_pTextSignal = textSignal; theora_p = 0; stateflag = 0; - ts = NULL; + ts = nullptr; thda = false; thtic = false; @@ -249,7 +249,7 @@ void KviOggTheoraDecoder::addData(KviDataBuffer * stream) { if(ogg_stream_packetout(&zo, &op) > 0) { - char * textPkt = 0; + char * textPkt = nullptr; int textSize = 0; if(irct_decode_packetin(&textPkt, &textSize, &op) == 0) { diff --git a/src/kvilib/ext/KviOggTheoraEncoder.cpp b/src/kvilib/ext/KviOggTheoraEncoder.cpp index ca0ced24d..e36685891 100644 --- a/src/kvilib/ext/KviOggTheoraEncoder.cpp +++ b/src/kvilib/ext/KviOggTheoraEncoder.cpp @@ -88,7 +88,7 @@ KviOggTheoraEncoder::KviOggTheoraEncoder(KviDataBuffer * stream, int iWidth, int y4m_dst_buf_sz = geometry.pic_w * geometry.pic_h * 3; // Set up Ogg output stream - srand(time(NULL)); + srand(time(nullptr)); ogg_stream_init(&to, rand()); ogg_stream_init(&zo, rand()); diff --git a/src/kvilib/ext/KviRuntimeInfo.cpp b/src/kvilib/ext/KviRuntimeInfo.cpp index 4537590a6..77e9ac274 100644 --- a/src/kvilib/ext/KviRuntimeInfo.cpp +++ b/src/kvilib/ext/KviRuntimeInfo.cpp @@ -222,7 +222,7 @@ static QString queryWinInfo(QueryInfo info) pGNSI = (PGNSI)GetProcAddress( GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); - if(NULL != pGNSI) + if(nullptr != pGNSI) pGNSI(&si); else GetSystemInfo(&si); @@ -299,7 +299,7 @@ static QString queryWinInfo(QueryInfo info) if(bOsVersionInfoEx) { DWORD dwPlatformInfo; - if(NULL != pGetProductInfo) + if(nullptr != pGetProductInfo) if(pGetProductInfo(osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.wServicePackMajor, osvi.wServicePackMinor, &dwPlatformInfo)) { diff --git a/src/kvilib/net/KviDnsResolver.cpp b/src/kvilib/net/KviDnsResolver.cpp index 476692084..116504e20 100644 --- a/src/kvilib/net/KviDnsResolver.cpp +++ b/src/kvilib/net/KviDnsResolver.cpp @@ -180,7 +180,7 @@ void KviDnsResolverThread::run() // gethostbyaddr and gethostbyname are thread-safe on Windoze struct in_addr inAddr; - struct hostent * pHostEntry = 0; + struct hostent * pHostEntry = nullptr; // DIE DIE!....I hope that this stuff will disappear sooner or later :) diff --git a/src/kvilib/net/KviHttpRequest.cpp b/src/kvilib/net/KviHttpRequest.cpp index 011437399..390b686b5 100644 --- a/src/kvilib/net/KviHttpRequest.cpp +++ b/src/kvilib/net/KviHttpRequest.cpp @@ -1055,7 +1055,7 @@ void KviHttpRequest::dnsLookupDone(KviDnsResolver *d) { m_szIp = d->firstIpAddress(); delete m_pDns; - m_pDns = 0; + m_pDns = nullptr; QString tmp; tmp = QString(__tr2qs("Host %1 resolved to %2")).arg(m_connectionUrl.host(),m_szIp); emit status(tmp); diff --git a/src/kvilib/net/KviNetworkAccessManager.h b/src/kvilib/net/KviNetworkAccessManager.h index f52c6a753..8226778dd 100644 --- a/src/kvilib/net/KviNetworkAccessManager.h +++ b/src/kvilib/net/KviNetworkAccessManager.h @@ -40,7 +40,7 @@ private: public: static QNetworkAccessManager * getInstance() { - static QNetworkAccessManager * pInstance = NULL; + static QNetworkAccessManager * pInstance = nullptr; if(!pInstance) pInstance = new QNetworkAccessManager(); return pInstance; diff --git a/src/kvilib/system/KviEnvironment.h b/src/kvilib/system/KviEnvironment.h index 196bc39e5..49b978739 100644 --- a/src/kvilib/system/KviEnvironment.h +++ b/src/kvilib/system/KviEnvironment.h @@ -63,7 +63,7 @@ namespace KviEnvironment inline void unsetVariable(const QString & szName) { - SetEnvironmentVariable(szName.toStdWString().c_str(), NULL); + SetEnvironmentVariable(szName.toStdWString().c_str(), nullptr); } #else /** diff --git a/src/kvilib/system/KviSignalHandler.h b/src/kvilib/system/KviSignalHandler.h index b5be82547..a0cb7d721 100644 --- a/src/kvilib/system/KviSignalHandler.h +++ b/src/kvilib/system/KviSignalHandler.h @@ -39,7 +39,7 @@ class KviSignalHandler : public QObject Q_OBJECT public: - KviSignalHandler(QObject *parent = 0); + KviSignalHandler(QObject *parent = nullptr); static void unixSignalHandler(int unused); diff --git a/src/kvilib/system/KviThread.h b/src/kvilib/system/KviThread.h index 48a04db76..fd0ae971c 100644 --- a/src/kvilib/system/KviThread.h +++ b/src/kvilib/system/KviThread.h @@ -280,7 +280,7 @@ protected: KviThread * m_pSender; public: - KviThreadEvent(int evId, KviThread * sender = 0) + KviThreadEvent(int evId, KviThread * sender = nullptr) : QEvent((QEvent::Type)KVI_THREAD_EVENT), m_eventId(evId), m_pSender(sender){}; ~KviThreadEvent(){}; @@ -298,7 +298,7 @@ protected: TData * m_pData; public: - KviThreadDataEvent(int evId, TData * pData = 0, KviThread * sender = 0) + KviThreadDataEvent(int evId, TData * pData = nullptr, KviThread * sender = nullptr) : KviThreadEvent(evId, sender) { m_pData = pData; }; ~KviThreadDataEvent() { @@ -316,7 +316,7 @@ public: TData * getData() { TData * aux = m_pData; - m_pData = 0; + m_pData = nullptr; return aux; }; TData * data() { return m_pData; }; diff --git a/src/kvilib/tal/KviTalFileDialog.h b/src/kvilib/tal/KviTalFileDialog.h index 0c91ea03d..a99fcafa4 100644 --- a/src/kvilib/tal/KviTalFileDialog.h +++ b/src/kvilib/tal/KviTalFileDialog.h @@ -66,7 +66,7 @@ public: * \param bModal Whether the dialog is modal * \return KviTalFileDialog */ - KviTalFileDialog(const QString & szDirName, const QString & szFilter = QString(), QWidget * pParent = 0, const char * pcName = 0, bool bModal = false); + KviTalFileDialog(const QString & szDirName, const QString & szFilter = QString(), QWidget * pParent = nullptr, const char * pcName = nullptr, bool bModal = false); /** * \brief Destroys the filedialog object diff --git a/src/kvilib/tal/KviTalGroupBox.h b/src/kvilib/tal/KviTalGroupBox.h index 15554d65f..8ad1f22b5 100644 --- a/src/kvilib/tal/KviTalGroupBox.h +++ b/src/kvilib/tal/KviTalGroupBox.h @@ -51,14 +51,14 @@ public: * \param pcName the name of the groupbox * \return KviTalGroupBox */ - KviTalGroupBox(QWidget * pParent, char * pcName = 0); + KviTalGroupBox(QWidget * pParent, char * pcName = nullptr); /** * \brief Constructs the groupbox object * \param pParent The parent object * \return KviTalGroupBox */ - KviTalGroupBox(QWidget * pParent = 0); + KviTalGroupBox(QWidget * pParent = nullptr); /** * \brief Constructs the groupbox object @@ -66,7 +66,7 @@ public: * \param pParent The parent object * \return KviTalGroupBox */ - KviTalGroupBox(const QString & szTitle, QWidget * pParent = 0); + KviTalGroupBox(const QString & szTitle, QWidget * pParent = nullptr); /** * \brief Constructs the groupbox object @@ -74,7 +74,7 @@ public: * \param pParent The parent object * \return KviTalGroupBox */ - KviTalGroupBox(Qt::Orientation orientation, QWidget * pParent = 0); + KviTalGroupBox(Qt::Orientation orientation, QWidget * pParent = nullptr); /** * \brief Constructs the groupbox object @@ -83,7 +83,7 @@ public: * \param pParent The parent object * \return KviTalGroupBox */ - KviTalGroupBox(Qt::Orientation orientation, const QString & szTitle, QWidget * pParent = 0); + KviTalGroupBox(Qt::Orientation orientation, const QString & szTitle, QWidget * pParent = nullptr); /** * \brief Destroys the groupbox object diff --git a/src/kvilib/tal/KviTalHBox.h b/src/kvilib/tal/KviTalHBox.h index 5352d3940..2d837454b 100644 --- a/src/kvilib/tal/KviTalHBox.h +++ b/src/kvilib/tal/KviTalHBox.h @@ -50,7 +50,7 @@ public: * \param pcName The name of the box * \return KviTalHBox */ - KviTalHBox(QWidget * pParent, char * pcName = 0); + KviTalHBox(QWidget * pParent, char * pcName = nullptr); /** * \brief Destroys an horizontal box object diff --git a/src/kvilib/tal/KviTalIconAndRichTextItemDelegate.h b/src/kvilib/tal/KviTalIconAndRichTextItemDelegate.h index b4215802a..e53f4d70e 100644 --- a/src/kvilib/tal/KviTalIconAndRichTextItemDelegate.h +++ b/src/kvilib/tal/KviTalIconAndRichTextItemDelegate.h @@ -58,7 +58,7 @@ public: * \param pWidget The item which we have to delegate for the paint * \return KviTalIconAndRichTextItemDelegate */ - KviTalIconAndRichTextItemDelegate(QAbstractItemView * pWidget = 0); + KviTalIconAndRichTextItemDelegate(QAbstractItemView * pWidget = nullptr); /** * \brief Destroys the icon and rich text item delegate object diff --git a/src/kvilib/tal/KviTalTabDialog.h b/src/kvilib/tal/KviTalTabDialog.h index 349403234..c85959b7f 100644 --- a/src/kvilib/tal/KviTalTabDialog.h +++ b/src/kvilib/tal/KviTalTabDialog.h @@ -36,7 +36,7 @@ class KVILIB_API KviTalTabDialog : public QDialog { Q_OBJECT public: - KviTalTabDialog(QWidget * pParent = 0, const char * name = 0, bool bModal = false); + KviTalTabDialog(QWidget * pParent = nullptr, const char * name = nullptr, bool bModal = false); ~KviTalTabDialog(); protected: diff --git a/src/kvilib/tal/KviTalVBox.h b/src/kvilib/tal/KviTalVBox.h index 06f2e2411..296bd40d7 100644 --- a/src/kvilib/tal/KviTalVBox.h +++ b/src/kvilib/tal/KviTalVBox.h @@ -50,7 +50,7 @@ public: * \param pcName The name of the box * \return KviTalVBox */ - KviTalVBox(QWidget * pParent, char * pcName = 0); + KviTalVBox(QWidget * pParent, char * pcName = nullptr); /** * \brief Destroys a vertical box object diff --git a/src/kvirc/kernel/KviApplication_setup.cpp b/src/kvirc/kernel/KviApplication_setup.cpp index 9797f50d1..0c030c2b0 100644 --- a/src/kvirc/kernel/KviApplication_setup.cpp +++ b/src/kvirc/kernel/KviApplication_setup.cpp @@ -115,22 +115,22 @@ void KviApplication::setupUriAssociations(const QString & szProto) tmp = QString("Software\\Classes\\" + szProto).toStdWString(); SHDeleteKey(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str()); - RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL); + RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, nullptr, 0, KEY_WRITE, nullptr, &hKey, nullptr); RegSetValueEx(hKey, 0, 0, REG_SZ, (LPBYTE)TEXT("URL:IRC Protocol"), 16 * 2 + 1); RegSetValueEx(hKey, TEXT("URL Protocol"), 0, REG_SZ, (LPBYTE)"", 0); tmp = QString("Software\\Classes\\" + szProto + "\\DefaultIcon").toStdWString(); - RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL); + RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, nullptr, 0, KEY_WRITE, nullptr, &hKey, nullptr); tmp = QString(szAppPath + ",0").toStdWString(); RegSetValueEx(hKey, 0, 0, REG_SZ, (LPBYTE)tmp.c_str(), tmp.length() * 2 + 1); tmp = QString("Software\\Classes\\" + szProto + "\\Shell\\open").toStdWString(); - RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL); + RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, nullptr, 0, KEY_WRITE, nullptr, &hKey, nullptr); tmp = __tr2qs("Open with KVIrc").toStdWString(); RegSetValueEx(hKey, 0, 0, REG_SZ, (LPBYTE)tmp.c_str(), tmp.length() * 2 + 1); tmp = QString("Software\\Classes\\" + szProto + "\\Shell\\open\\command").toStdWString(); - RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL); + RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, nullptr, 0, KEY_WRITE, nullptr, &hKey, nullptr); tmp = QString(szAppPath + " --external \"%1\"").toStdWString(); RegSetValueEx(hKey, 0, 0, REG_SZ, (LPBYTE)tmp.c_str(), tmp.length() * 2 + 1); @@ -150,7 +150,7 @@ void KviApplication::setFileAssociation(const QString & szExtension, const QStri tmp = QString("Software\\Classes\\." + szExtension).toStdWString(); SHDeleteKey(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str()); - RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL); + RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, nullptr, 0, KEY_WRITE, nullptr, &hKey, nullptr); tmp = szClassName.toStdWString(); RegSetValueEx(hKey, 0, 0, REG_SZ, (LPBYTE)tmp.c_str(), tmp.length() * 2 + 1); diff --git a/src/kvirc/kernel/KviIrcConnection.h b/src/kvirc/kernel/KviIrcConnection.h index c363367da..dc1bb6fde 100644 --- a/src/kvirc/kernel/KviIrcConnection.h +++ b/src/kvirc/kernel/KviIrcConnection.h @@ -106,14 +106,14 @@ protected: * * This is actually used only by KviConsoleWindow. * - * pContext must not be NULL and is kept as shallow pointer (that is, it's + * pContext must not be nullptr and is kept as shallow pointer (that is, it's * not owned and must persists for the entire life of KviIrcConnection: * caller is responsable for that). * - * pTarget must not be NULL and must be allocated with new as this class + * pTarget must not be nullptr and must be allocated with new as this class * takes the ownership. * - * pIdentity must not be NULL and must be allocated with new as this class + * pIdentity must not be nullptr and must be allocated with new as this class * takes the ownership. * \param pContext The KviIrcContext we're attacched to * \param pTarget The server data @@ -186,7 +186,7 @@ public: /** * \brief Returns a pointer to the owning console * - * The pointer is never NULL + * The pointer is never nullptr * \return KviConsoleWindow * */ KviConsoleWindow * console() const { return m_pConsole; } @@ -194,7 +194,7 @@ public: /** * \brief Returns a pointer to the owning KviIrcContext. * - * The returned value is never NULL + * The returned value is never nullptr * \return KviIrcContext * */ KviIrcContext * context() const { return m_pContext; } @@ -204,7 +204,7 @@ public: * * Please note that the target doesn't necessairly contain up-to-date data. * You might want to look at serverInfo() instead. - * The returned pointer is never NULL. + * The returned pointer is never nullptr. * \return KviIrcConnectionTarget * */ KviIrcConnectionTarget * target() const { return m_pTarget; } @@ -212,7 +212,7 @@ public: /** * \brief Returns the underlying KviIrcLink object * - * The returned pointer is never NULL. + * The returned pointer is never nullptr. * \return KviIrcLink * */ KviIrcLink * link() const { return m_pLink; } @@ -227,7 +227,7 @@ public: * \brief Returns a pointer to the big connection user database. * * The database contains ALL the users KVIrc can "see" in this connection. - * The returned pointer is never NULL. + * The returned pointer is never nullptr. * \return KviIrcUserDataBase * */ KviIrcUserDataBase * userDataBase() const { return m_pUserDataBase; } @@ -238,7 +238,7 @@ public: * It contains runtime information about the user. This includes the * current nickname, username, flags and other stuff that KviUserIdentity * actually doesn't contain (or has only "default" values for). - * The returned pointer is never NULL. + * The returned pointer is never nullptr. * Include "KviIrcConnectionUserInfo.h" as the class is only * forwarded here. * \return KviIrcConnectionUserInfo * @@ -252,7 +252,7 @@ public: * the current servername, the server capabilities and other stuff that * KviConnectionTarget actually doesn't contain (or has only "default" * values for). - * The returned pointer is never NULL. + * The returned pointer is never nullptr. * Include "KviIrcConnectionServerInfo.h" as the class is only * forwarded here. * \return KviIrcConnectionServerInfo * @@ -266,7 +266,7 @@ public: * nickname index at login time, flags that signal "micro-states" etc... * This data *could* be part of KviIrcConnection itself but we prefer to * keep it in a separate class in order to cleanup the implementation. - * The returned pointer is never NULL. + * The returned pointer is never nullptr. * Include "KviIrcConnectionStateData.h" as the class is only * forwarded here. * \return KviIrcConnectionStateData * @@ -278,7 +278,7 @@ public: * * It contains data private to the Anti CTCP Flood engine. Very similar * to KviIrcConnectionStateData but dedicated to Ctcp flood. - * The returned pointer is never NULL. + * The returned pointer is never nullptr. * Include "KviIrcConnectionAntiCtcpFloodData.h" as the class is * only forwarded here. * \return KviIrcConnectionAntiCtcpFloodData * @@ -293,7 +293,7 @@ public: * * It contains data private to the netsplit detector engine. Very similar * to KviIrcConnectionStateData but dedicated to netsplit detection. - * The returned pointer is never NULL. + * The returned pointer is never nullptr. * Include "KviIrcConnectionNetsplitDetectorData.h" as the class is * only forwarded here. * \return KviIrcConnectionNetsplitDetectorData * @@ -308,7 +308,7 @@ public: * * It contains data private to the async whois engine. Very similar to * KviIrcConnectionStateData but dedicated to async whois. - * The returned pointer is never NULL. + * The returned pointer is never nullptr. * Include "KviIrcConnectionAsyncWhoisData.h" as the class is only * forwarded here. * \return KviIrcConnectionAsyncWhoisData * @@ -323,7 +323,7 @@ public: * * It contains runtime statistics about the connection. Very similar to * KviIrcConnectionStateData but dedicated to statistics. - * The returned pointer is never NULL. + * The returned pointer is never nullptr. * Include "KviIrcConnectionStatistics.h" as the class is only * forwarded here. * \return KviIrcConnectionStatistics * @@ -333,7 +333,7 @@ public: /** * \brief Returns a pointer to the current KviNotifyListManager. * - * The returned pointer is NULL if notify list management is disabled for + * The returned pointer is nullptr if notify list management is disabled for * the current connection. * \return KviNotifyListManager * */ @@ -345,7 +345,7 @@ public: /** * \brief Returns a pointer to the current KviLagMeter. * - * The returned pointer is NULL if lag measurement is disabled for the + * The returned pointer is nullptr if lag measurement is disabled for the * current connection. * \return KviLagMeter * */ @@ -398,7 +398,7 @@ public: /** * \brief Finds the channel with the specified unicode name. * - * Returns the pointer to the channel found or NULL if there is no such + * Returns the pointer to the channel found or nullptr if there is no such * channel. * \param szName The name of the channel * \return KviChannelWindow * @@ -428,7 +428,7 @@ public: * This should be called in response to a JOIN message. * This function _assumes_ that such a channel doesn't exist yet (or if it * exists then it's actually in DEAD state). You can assume that channel - * creation never fails: if the returned pointer is NULL then we're screwed + * creation never fails: if the returned pointer is nullptr then we're screwed * anyway as virtual memory is exausted. * \param szName The name of the channel * \return KviChannelWindow * @@ -481,7 +481,7 @@ public: /** * \brief Finds the query with the specified nick. * - * Returns the pointer to the query found or NULL if there is no such + * Returns the pointer to the query found or nullptr if there is no such * query. * \param szNick The nickname of the user * \return KviQueryWindow * @@ -491,7 +491,7 @@ public: /** * \brief Returns the list of the currently open queries. * - * The returned pointer is never NULL (the list may be empty though). + * The returned pointer is never nullptr (the list may be empty though). * \return std::vector & */ std::vector & queryList() { return m_pQueryList; } diff --git a/src/kvirc/kernel/KviIrcSocket.cpp b/src/kvirc/kernel/KviIrcSocket.cpp index fe99411be..00b317145 100644 --- a/src/kvirc/kernel/KviIrcSocket.cpp +++ b/src/kvirc/kernel/KviIrcSocket.cpp @@ -746,7 +746,7 @@ void KviIrcSocket::proxyLoginV4() KviMemory::move((void *)(pcBufToSend + 4), (void *)&host, 4); KviMemory::move((void *)(pcBufToSend + 8), (void *)(szUserAndPass.ptr()), szUserAndPass.len()); - pcBufToSend[iLen - 1] = 0; //NULL + pcBufToSend[iLen - 1] = '\0'; // send it into hyperspace... setState(ProxyFinalV4); diff --git a/src/kvirc/kernel/KviSSLMaster.h b/src/kvirc/kernel/KviSSLMaster.h index afed0cd8c..7c451c790 100644 --- a/src/kvirc/kernel/KviSSLMaster.h +++ b/src/kvirc/kernel/KviSSLMaster.h @@ -41,7 +41,7 @@ namespace KviSSLMaster extern KVIRC_API void printSSLConnectionInfo(KviWindow * wnd, KviSSL * s); - extern KVIRC_API KviSSL * allocSSL(KviWindow * wnd, kvi_socket_t sock, KviSSL::Method m, const char * contextString = 0); + extern KVIRC_API KviSSL * allocSSL(KviWindow * wnd, kvi_socket_t sock, KviSSL::Method m, const char * contextString = nullptr); extern KVIRC_API void freeSSL(KviSSL * s); extern KVIRC_API bool getSSLCertInfo(KviSSLCertificate * pCert, QString szQuery, QString szOptionalParam, KviKvsVariant * pRetBuffer); diff --git a/src/kvirc/kvs/KviKvsAction.h b/src/kvirc/kvs/KviKvsAction.h index 3db570e82..f10ef1569 100644 --- a/src/kvirc/kvs/KviKvsAction.h +++ b/src/kvirc/kvs/KviKvsAction.h @@ -67,7 +67,7 @@ public: const QString & szScriptCode, const QString & szVisibleName, const QString & szDescription, - KviActionCategory * pCategory = NULL, + KviActionCategory * pCategory = nullptr, const QString & szBigIconId = QString(), const QString & szSmallIconId = QString(), unsigned int uFlags = 0, @@ -93,7 +93,7 @@ public: const QString & szScriptCode, const QString & szVisibleName, const QString & szDescription, - KviActionCategory * pCategory = NULL, + KviActionCategory * pCategory = nullptr, const QString & szBigIconId = QString(), KviIconManager::SmallIcon eSmallIcon = KviIconManager::None, unsigned int uFlags = 0, diff --git a/src/kvirc/kvs/KviKvsAsyncDnsOperation.h b/src/kvirc/kvs/KviKvsAsyncDnsOperation.h index fcebd4111..068a3c9ef 100644 --- a/src/kvirc/kvs/KviKvsAsyncDnsOperation.h +++ b/src/kvirc/kvs/KviKvsAsyncDnsOperation.h @@ -37,7 +37,7 @@ class KVIRC_API KviKvsAsyncDnsOperation : public KviKvsAsyncOperation { Q_OBJECT public: - KviKvsAsyncDnsOperation(KviWindow * pWnd, QString & szQuery, KviDnsResolver::QueryType eType, KviKvsScript * pCallback = 0, KviKvsVariant * pMagic = 0); + KviKvsAsyncDnsOperation(KviWindow * pWnd, QString & szQuery, KviDnsResolver::QueryType eType, KviKvsScript * pCallback = nullptr, KviKvsVariant * pMagic = nullptr); virtual ~KviKvsAsyncDnsOperation(); protected: diff --git a/src/kvirc/kvs/KviKvsCallbackObject.h b/src/kvirc/kvs/KviKvsCallbackObject.h index 5092a1a24..38bd9d7d3 100644 --- a/src/kvirc/kvs/KviKvsCallbackObject.h +++ b/src/kvirc/kvs/KviKvsCallbackObject.h @@ -80,7 +80,7 @@ protected: protected: // the parameter list is always shallow! - CallbackStatus execute(KviKvsVariantList * pParams = 0, KviKvsVariant * pRetVal = 0); + CallbackStatus execute(KviKvsVariantList * pParams = nullptr, KviKvsVariant * pRetVal = nullptr); }; #endif //!_KVI_KVS_CALLBACKOBJECT_H_ diff --git a/src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp b/src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp index c71992301..bbeca3d90 100644 --- a/src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp +++ b/src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp @@ -402,7 +402,7 @@ namespace KviKvsCoreSimpleCommands #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) if(KVI_OPTION_BOOL(KviOption_boolUseSystemUrlHandlers)) { - intptr_t iRet = (intptr_t)::ShellExecute(NULL, TEXT("open"), szUrl.toStdWString().c_str(), NULL, NULL, SW_SHOWNORMAL); + intptr_t iRet = (intptr_t)::ShellExecute(nullptr, TEXT("open"), szUrl.toStdWString().c_str(), nullptr, nullptr, SW_SHOWNORMAL); if(iRet <= 32) { /* diff --git a/src/kvirc/kvs/KviKvsDnsManager.h b/src/kvirc/kvs/KviKvsDnsManager.h index 341fe0bf0..1154ecd5d 100644 --- a/src/kvirc/kvs/KviKvsDnsManager.h +++ b/src/kvirc/kvs/KviKvsDnsManager.h @@ -42,8 +42,8 @@ public: KviWindow * pWnd, const QString & szQuery, bool bRebindOnWindowClose = true, - KviKvsScript * pCallback = 0, - KviKvsVariantList * pParameterList = 0); + KviKvsScript * pCallback = nullptr, + KviKvsVariantList * pParameterList = nullptr); ~KviKvsDnsObject(); protected: diff --git a/src/kvirc/kvs/KviKvsModuleInterface.h b/src/kvirc/kvs/KviKvsModuleInterface.h index 0d04b195e..45e2a940b 100644 --- a/src/kvirc/kvs/KviKvsModuleInterface.h +++ b/src/kvirc/kvs/KviKvsModuleInterface.h @@ -103,7 +103,7 @@ public: ~KviKvsModuleCallbackCommandCall(){}; public: - // Never NULL, but may have empty code + // Never nullptr, but may have empty code const KviKvsScript * callback() { return m_pCallback; }; virtual bool getParameterCode(unsigned int uParamIdx, QString & szParamBuffer); }; diff --git a/src/kvirc/kvs/KviKvsParameterProcessor.h b/src/kvirc/kvs/KviKvsParameterProcessor.h index 4ab74d7d0..551a01c77 100644 --- a/src/kvirc/kvs/KviKvsParameterProcessor.h +++ b/src/kvirc/kvs/KviKvsParameterProcessor.h @@ -211,11 +211,11 @@ namespace KviKvsParameterProcessor // KVS_PT_IGNORE ParameterFormat(const char * name) - : szName(name), uType(KVS_PT_IGNORE), uFlags(0), pContainer(NULL) {} + : szName(name), uType(KVS_PT_IGNORE), uFlags(0), pContainer(nullptr) {} // terminator ParameterFormat() - : szName(NULL), uType(KVS_PT_IGNORE), uFlags(0), pContainer(NULL){}; + : szName(nullptr), uType(KVS_PT_IGNORE), uFlags(0), pContainer(nullptr){}; //ParameterFormat(const char * n,unsigned char t,unsigned char f,void * p) //: szName(n), uType(t), uFlags(f), pContainer(p) {}; @@ -227,9 +227,9 @@ namespace KviKvsParameterProcessor #define KVS_PARAMETERS_BEGIN(__name) \ KviKvsParameterProcessor::ParameterFormat __name[] = { -#define KVS_PARAMETERS_END \ - KviKvsParameterProcessor::ParameterFormat(0) \ - } \ +#define KVS_PARAMETERS_END \ + KviKvsParameterProcessor::ParameterFormat(nullptr) \ + } \ ; //#define KVS_PARAMETER(__name,__type,__flags,__void) diff --git a/src/kvirc/kvs/KviKvsProcessManager.cpp b/src/kvirc/kvs/KviKvsProcessManager.cpp index 48e51e8b2..dcaad4ec6 100644 --- a/src/kvirc/kvs/KviKvsProcessManager.cpp +++ b/src/kvirc/kvs/KviKvsProcessManager.cpp @@ -385,7 +385,7 @@ void KviKvsProcessManager::done() { if(!m_pInstance)return; delete m_pInstance; - m_pInstance = 0; + m_pInstance = nullptr; } bool KviKvsProcessManager::execute(KviKvsProcessAsyncOperationData * d) diff --git a/src/kvirc/kvs/KviKvsRunTimeContext.h b/src/kvirc/kvs/KviKvsRunTimeContext.h index 09c8c89a7..f2c20494e 100644 --- a/src/kvirc/kvs/KviKvsRunTimeContext.h +++ b/src/kvirc/kvs/KviKvsRunTimeContext.h @@ -113,7 +113,7 @@ protected: KviWindow * pWnd, KviKvsVariantList * pParams, KviKvsVariant * pRetVal, - KviKvsExtendedRunTimeData * pExtData = 0); + KviKvsExtendedRunTimeData * pExtData = nullptr); public: ~KviKvsRunTimeContext(); diff --git a/src/kvirc/kvs/KviKvsScript.h b/src/kvirc/kvs/KviKvsScript.h index 8e68ce309..f8639a0ab 100644 --- a/src/kvirc/kvs/KviKvsScript.h +++ b/src/kvirc/kvs/KviKvsScript.h @@ -181,7 +181,7 @@ public: * \param pExtData Extended data (usually 0) * \return int */ - int run(KviWindow * pWnd, KviKvsVariantList * pParams = 0, KviKvsVariant * pRetVal = 0, int iRunFlags = 0, KviKvsExtendedRunTimeData * pExtData = 0); + int run(KviWindow * pWnd, KviKvsVariantList * pParams = nullptr, KviKvsVariant * pRetVal = nullptr, int iRunFlags = 0, KviKvsExtendedRunTimeData * pExtData = nullptr); /** * \brief Runs the script @@ -199,7 +199,7 @@ public: * \param pExtData Extended data (usually 0) * \return int */ - int run(KviWindow * pWnd, KviKvsVariantList * pParams, QString & szRetVal, int iRunFlags = 0, KviKvsExtendedRunTimeData * pExtData = 0); + int run(KviWindow * pWnd, KviKvsVariantList * pParams, QString & szRetVal, int iRunFlags = 0, KviKvsExtendedRunTimeData * pExtData = nullptr); /** * \brief Runs the script @@ -225,7 +225,7 @@ public: * \param pRetVal Return value buffer (0 if you ignore it) * \return int */ - static int run(const QString & szCode, KviWindow * pWindow, KviKvsVariantList * pParams = 0, KviKvsVariant * pRetVal = 0); + static int run(const QString & szCode, KviWindow * pWindow, KviKvsVariantList * pParams = nullptr, KviKvsVariant * pRetVal = nullptr); /** * \brief Static helper for quick evaluating parameters @@ -271,7 +271,7 @@ protected: * \param iRunFlags A combination of run flags (usually default) * \return bool */ - bool parse(KviWindow * pOutput = 0, int iRunFlags = 0); + bool parse(KviWindow * pOutput = nullptr, int iRunFlags = 0); /** * \brief Runs the script @@ -285,7 +285,7 @@ protected: * \param pExtData Extended data (usually 0) * \return int */ - int execute(KviWindow * pWnd, KviKvsVariantList * pParams = 0, KviKvsVariant * pRetVal = 0, int iRunFlags = 0, KviKvsExtendedRunTimeData * pExtData = 0); + int execute(KviWindow * pWnd, KviKvsVariantList * pParams = nullptr, KviKvsVariant * pRetVal = nullptr, int iRunFlags = 0, KviKvsExtendedRunTimeData * pExtData = nullptr); /** * \brief Runs the script diff --git a/src/kvirc/kvs/object/KviKvsObject.h b/src/kvirc/kvs/object/KviKvsObject.h index fdef5e20c..4b52a76de 100644 --- a/src/kvirc/kvs/object/KviKvsObject.h +++ b/src/kvirc/kvs/object/KviKvsObject.h @@ -109,7 +109,7 @@ public: // this is intended to be called from other function calls (the parameters are copied from pOuterCall) // since we should NEVER emit totally spontaneous signals: all of them // should be generated inside object functions (either from scripting or by core calls) - int emitSignal(const QString & sigName, KviKvsObjectFunctionCall * pOuterCall, KviKvsVariantList * pParams = 0); + int emitSignal(const QString & sigName, KviKvsObjectFunctionCall * pOuterCall, KviKvsVariantList * pParams = nullptr); void setSignalSender(kvs_hobject_t hObject) { m_hSignalSender = hObject; } kvs_hobject_t signalSender() { return m_hSignalSender; } @@ -144,9 +144,9 @@ public: KviKvsVariant * pRetVal, // the return value KviKvsVariantList * pParams); // the parameters for the call // a nice and simple wrapper: it accepts a parameter list only (eventually 0) - bool callFunction(KviKvsObject * pCaller, const QString & fncName, KviKvsVariantList * pParams = 0); + bool callFunction(KviKvsObject * pCaller, const QString & fncName, KviKvsVariantList * pParams = nullptr); // this one gets a non null ret val too - bool callFunction(KviKvsObject * pCaller, const QString & fncName, KviKvsVariant * pRetVal, KviKvsVariantList * pParams = 0); + bool callFunction(KviKvsObject * pCaller, const QString & fncName, KviKvsVariant * pRetVal, KviKvsVariantList * pParams = nullptr); KviKvsObject * findChild(const QString & szClass, const QString & szName); void killAllChildrenWithClass(KviKvsObjectClass * cl); diff --git a/src/kvirc/kvs/parser/KviKvsParser.cpp b/src/kvirc/kvs/parser/KviKvsParser.cpp index 55b0a8e9f..556a510f7 100644 --- a/src/kvirc/kvs/parser/KviKvsParser.cpp +++ b/src/kvirc/kvs/parser/KviKvsParser.cpp @@ -3013,7 +3013,7 @@ KviKvsTreeNodeDataList * KviKvsParser::parseCommaSeparatedParameterList() } \ } \ KVSP_ASSERT(false); \ - return 0; \ + return nullptr; \ } LITERAL_PARAM_PARSING_FUNCTION_BEGIN(parseCommandLiteralParameter) @@ -3131,13 +3131,13 @@ KviKvsTreeNodeData * KviKvsParser::parseArrayIndex() delete l; warning(pBegin,__tr2qs_ctx("Unterminated array index","kvs")); error(KVSP_curCharPointer,__tr2qs_ctx("Unexpected end of script in array index (missing ']' character?)","kvs")); - return 0; + return nullptr; break; case '\n': delete l; warning(pBegin,__tr2qs_ctx("Unterminated array index","kvs")); error(KVSP_curCharPointer,__tr2qs_ctx("Unexpected end of line in array index (missing ']' character or unescaped newline)","kvs")); - return 0; + return nullptr; break; case ' ': case '\t': @@ -3158,7 +3158,7 @@ KviKvsTreeNodeData * KviKvsParser::parseArrayIndex() error(KVSP_curCharPointer,__tr2qs_ctx("Unexpected character '%q' (Unicode %x) in array index: it should be already terminated","kvs"),KVSP_curCharPointer,KVSP_curCharUnicode); break; } - return 0; + return nullptr; } goto end_of_the_array_index; break; @@ -3171,7 +3171,7 @@ KviKvsTreeNodeData * KviKvsParser::parseArrayIndex() { // this is an error delete l; - return 0; + return nullptr; } l->append(p); } @@ -3190,7 +3190,7 @@ KviKvsTreeNodeData * KviKvsParser::parseArrayIndex() { // error delete l; - return 0; + return nullptr; } l->append(p); } diff --git a/src/kvirc/kvs/parser/KviKvsParser.h b/src/kvirc/kvs/parser/KviKvsParser.h index 0033d2936..e379d6af7 100644 --- a/src/kvirc/kvs/parser/KviKvsParser.h +++ b/src/kvirc/kvs/parser/KviKvsParser.h @@ -103,31 +103,31 @@ protected: static void init(); private: - // returns 0 only in case of error + // returns nullptr only in case of error // starts on the first char of a buffer // stops at the first null char encountered KviKvsTreeNodeInstruction * parseInstructionList(); - // may return 0 (empty instruction), check error() for error conditions + // may return nullptr (empty instruction), check error() for error conditions // starts on the first character of an instruction - // if the first char is ';' '\n' or null it just returns 0 without error + // if the first char is ';' '\n' or null it just returns nullptr without error // stops after the ending char of the instruction KviKvsTreeNodeInstruction * parseInstruction(); - // may return 0 (empty block), check error() for error conditions + // may return nullptr (empty block), check error() for error conditions // starts at the leading '{' of the block // stops after the trailing '}' of the block KviKvsTreeNodeInstruction * parseInstructionBlock(); - // returns 0 only in case of error + // returns nullptr only in case of error // starts on the first character of the parameters // ends after the end of the command KviKvsTreeNodeDataList * parseCommandParameterList(); - // returns 0 only in case of error + // returns nullptr only in case of error // starts on the leading '(' or a ',' in the middle of the list // ends after the trailing ')' // if started in the middle of the list returns only the remaining // parameters. KviKvsTreeNodeDataList * parseCommaSeparatedParameterList(); KviPointerList * parseCommaSeparatedParameterListNoTree(); - // returns 0 in case of error or if it starts on a terminating character (null parameter) + // returns nullptr in case of error or if it starts on a terminating character (null parameter) // check error() to see if there was an error condition (unless you already know that // there was a valid first character) // start on the first character of the parameter @@ -136,105 +136,105 @@ private: // is extracted an attempt to convert it to a numeric format is made. // This optimizes assignments, self-sums etc... KviKvsTreeNodeData * parseCommandParameter(bool bPreferNumeric = false); - // returns 0 only in case of error + // returns nullptr only in case of error // start on the first character of the parameter // ends after the first character not included in the param (')','\n','\0',',') KviKvsTreeNodeData * parseCommaSeparatedParameter(); - // returns 0 only in case of error + // returns nullptr only in case of error // start on the first character of the parameter // ends after the first character not included in the param (')','\n','\0') KviKvsTreeNodeData * parseSingleParameterInParenthesis(); - // never returns 0 + // never returns nullptr KviKvsTreeNodeConstantData * parseCommandLiteralParameter(); - // never returns 0 + // never returns nullptr KviKvsTreeNodeConstantData * parseCommaSeparatedLiteralParameter(); - // never returns 0 + // never returns nullptr KviKvsTreeNodeConstantData * parseSingleLiteralParameterInParenthesis(); - // returns 0 only in case of error + // returns nullptr only in case of error // starts at the leading '"' // ends after the trailing '"' KviKvsTreeNodeData * parseStringParameter(); - // never returns 0 + // never returns nullptr KviKvsTreeNodeConstantData * parseStringLiteralParameter(); - // returns 0 in case of error or of an empty switch list (check the error code!) + // returns nullptr in case of error or of an empty switch list (check the error code!) // starts at the leading '-' of the first switch // ends after the last switch KviKvsTreeNodeSwitchList * parseCommandSwitchList(); - // returns 0 only in case of error + // returns nullptr only in case of error // starts at '%' or '$' // and ends after the end of the data reference // or just after the '%' or '$' if this was only a ConstandData (not a var or func) KviKvsTreeNodeData * parseParameterPercentOrDollar(); - // returns 0 only in case of error + // returns nullptr only in case of error // starts at '%' or '$' // ends after the end of the complete data reference (including scope operators!) KviKvsTreeNodeData * parsePercentOrDollar(bool bInObjScope = false); - // returns 0 only in case of error + // returns nullptr only in case of error // starts at '%' // ends after the end of the structured data KviKvsTreeNodeVariable * parsePercent(bool bInObjectScope = false); - // returns 0 only in case of error + // returns nullptr only in case of error KviKvsTreeNodeData * parseHashKey(); - // never returns 0 + // never returns nullptr KviKvsTreeNodeConstantData * parseHashKeyLiteralParameter(); // // KviKvsParser_specialCommands.cpp // - // return 0 only in case of error + // return nullptr only in case of error // starts at the leading '(' of the if command (after the switches) // and stops after the end of the else block // if the first character is not '(' then this function fails with an error KviKvsTreeNodeCommand * parseSpecialCommandIf(); - // always returns 0 + // always returns nullptr // check error() for error conditions // starts after the switches of the "global" keyword // and stops at the end of the command // if the first character is not '%' of a variable then this function fails with an error KviKvsTreeNodeCommand * parseSpecialCommandGlobal(); - // returns 0 only in case of error + // returns nullptr only in case of error // starts at the leading '(' of the while command (after the switches) // and stops after the end of the command block // if the first character is not '(' then this function fails with an error KviKvsTreeNodeCommand * parseSpecialCommandWhile(); - // returns 0 only in case of error + // returns nullptr only in case of error // starts at the leading '(' of the while command (after the switches) // and stops after the end of the command block // if the first character is not '(' then this function fails with an error KviKvsTreeNodeCommand * parseSpecialCommandDo(); - // returns 0 only in case of error + // returns nullptr only in case of error // and stops after the end of the break command KviKvsTreeNodeCommand * parseSpecialCommandBreak(); - // returns 0 only in case of error + // returns nullptr only in case of error // and jumps to the next iteration after the end of the continue command KviKvsTreeNodeCommand * parseSpecialCommandContinue(); - // returns 0 only in case of error + // returns nullptr only in case of error // and stops after the end of the for command block KviKvsTreeNodeCommand * parseSpecialCommandFor(); - // returns 0 only in case of error + // returns nullptr only in case of error // and stops after the end of the foreach command block KviKvsTreeNodeCommand * parseSpecialCommandForeach(); - // returns 0 only in case of error + // returns nullptr only in case of error // and stops after the end of the switch command block KviKvsTreeNodeCommand * parseSpecialCommandSwitch(); - // returns 0 only in case of error + // returns nullptr only in case of error // and stops after the end of the defpopup command block KviKvsTreeNodeCommand * parseSpecialCommandUnset(); - // returns 0 only in case of error + // returns nullptr only in case of error // and stops after the end of the defpopup command block KviKvsTreeNodeCommand * parseSpecialCommandDefpopup(); KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * parseSpecialCommandDefpopupLabelPopup(); - // returns 0 only in case of error + // returns nullptr only in case of error // stops after the class command block KviKvsTreeNodeCommand * parseSpecialCommandClass(); - // returns 0 only in case of error + // returns nullptr only in case of error // stops after the perl.end statement KviKvsTreeNodeCommand * parseSpecialCommandPerlBegin(); - // returns 0 only in case of error + // returns nullptr only in case of error // stops after the perl.end statement KviKvsTreeNodeCommand * parseSpecialCommandPythonBegin(); - // returns 0 only in case of error + // returns nullptr only in case of error // and stops after the end of the help command KviKvsTreeNodeCommand * parseSpecialCommandHelp(); @@ -242,7 +242,7 @@ private: // KviKvsParser_command.cpp // - // may return 0 (empty command), check error() for error conditions + // may return nullptr (empty command), check error() for error conditions // starts at the beginning of a command (can be non valid) // ends after the ending char of the command KviKvsTreeNodeCommand * parseCommand(); @@ -251,7 +251,7 @@ private: // KviKvsParser_comment.cpp // - // always returns 0, and it CAN be an error! + // always returns nullptr, and it CAN be an error! // starts at the beginning of a comment (must be '#' or '/') // ends after the ending char of the comment KviKvsTreeNode * parseComment(); @@ -260,12 +260,12 @@ private: // KviKvsParser_dollar.cpp // - // returns 0 only in case of error + // returns nullptr only in case of error // starts at '$' // ends after the end of the function call KviKvsTreeNodeData * parseDollar(bool bInObjScope = false); - // returns 0 only in case of error + // returns nullptr only in case of error // starts at '@' // ends after the end of the function call KviKvsTreeNodeData * parseAt(bool bInObjScope = false); @@ -274,17 +274,17 @@ private: // KviKvsParser_lside.cpp // - // returns 0 only in case of error + // returns nullptr only in case of error // returns after the command terminator KviKvsTreeNodeInstruction * parseVoidFunctionCallOrOperation(); - // returns 0 only in case of error + // returns nullptr only in case of error // returns after the command terminator KviKvsTreeNodeOperation * parseOperation(); - // returns 0 only in case of error + // returns nullptr only in case of error // returns after the command terminator // If bPreferNumeric is propagated to parseCommandParameter() function KviKvsTreeNodeData * parseOperationRightSide(bool bPreferNumeric = false); - // return 0 only in case of error + // return nullptr only in case of error // returns after the command terminator KviKvsTreeNodeOperation * parseBindingOperation(); KviKvsTreeNodeConstantData * parseBindingOperationLiteralParameter(); @@ -294,7 +294,7 @@ private: // KviKvsParser_expression.cpp // - // returns 0 only in case of error + // returns nullptr only in case of error // starts AFTER the leading char of the expression // ends after the first terminator found KviKvsTreeNodeExpression * parseExpression(char terminator); diff --git a/src/kvirc/kvs/parser/KviKvsParser_command.cpp b/src/kvirc/kvs/parser/KviKvsParser_command.cpp index 34668ce21..74dc761a6 100644 --- a/src/kvirc/kvs/parser/KviKvsParser_command.cpp +++ b/src/kvirc/kvs/parser/KviKvsParser_command.cpp @@ -177,7 +177,7 @@ KviKvsTreeNodeCommand * KviKvsParser::parseCommand() // might be an error, but might be not... // it is an error only if error() returns true // but since the caller will take care of it - // we just return 0 + // we just return nullptr if(sw) delete sw; if(pRebindData) @@ -218,7 +218,7 @@ KviKvsTreeNodeCommand * KviKvsParser::parseCommand() // might be an error, but might be not... // it is an error only if error() returns true // but since the caller will take care of it - // we just return 0 + // we just return nullptr if(sw) delete sw; if(pRebindData) diff --git a/src/kvirc/kvs/parser/KviKvsParser_lside.cpp b/src/kvirc/kvs/parser/KviKvsParser_lside.cpp index 1c9c9d500..78459f170 100644 --- a/src/kvirc/kvs/parser/KviKvsParser_lside.cpp +++ b/src/kvirc/kvs/parser/KviKvsParser_lside.cpp @@ -899,11 +899,11 @@ KviKvsTreeNodeOperation * KviKvsParser::parseOperation() if(KVSP_curCharIsEndOfCommand) \ { \ error(KVSP_curCharPointer, __tr2qs_ctx("Missing right operand for operator '" __opstr "='", "kvs")); \ - return 0; \ + return nullptr; \ } \ KviKvsTreeNodeData * d = parseOperationRightSide(true); \ if(!d) \ - return 0; \ + return nullptr; \ return new __class(pBegin, d); \ break; \ } \ diff --git a/src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp b/src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp index 06a36a19f..609ac1b11 100644 --- a/src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp +++ b/src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp @@ -54,7 +54,7 @@ python.begin python.end { \ dl = parseCommaSeparatedParameterList(); \ if(!dl) \ - return 0; \ + return nullptr; \ } \ else \ { \ @@ -67,7 +67,7 @@ python.begin python.end if(!skipSpacesAndNewlines()) \ { \ delete dl; \ - return 0; \ + return nullptr; \ } \ \ /* allow a ';' after [interpreter].begin */ \ @@ -77,7 +77,7 @@ python.begin python.end if(!skipSpacesAndNewlines()) \ { \ delete dl; \ - return 0; \ + return nullptr; \ } \ } \ \ @@ -102,7 +102,7 @@ python.begin python.end szErr += " statement"; \ \ error(KVSP_curCharPointer, __tr2qs_ctx(szErr.toUtf8().data(), "kvs")); \ - return 0; \ + return nullptr; \ } \ pInterpreterEnd = KVSP_curCharPointer; \ \ diff --git a/src/kvirc/module/KviModuleExtension.h b/src/kvirc/module/KviModuleExtension.h index 2beec376e..026e7da47 100644 --- a/src/kvirc/module/KviModuleExtension.h +++ b/src/kvirc/module/KviModuleExtension.h @@ -73,7 +73,7 @@ private: KviModule * m_pModule; // module pointer public: // pParams ownership is NOT taken - KviModuleExtension * allocate(KviWindow * pWnd = 0, KviPointerHashTable * pParams = 0, void * pSpecial = 0); + KviModuleExtension * allocate(KviWindow * pWnd = nullptr, KviPointerHashTable * pParams = nullptr, void * pSpecial = nullptr); int id() { return m_iId; }; KviModule * module() { return m_pModule; }; @@ -122,8 +122,8 @@ public: KviModuleExtensionDescriptor * findExtensionDescriptor(const KviCString & szType, const KviCString & szName); static KviModuleExtensionManager * instance() { return g_pModuleExtensionManager; }; KviModuleExtensionDescriptorList * getExtensionList(const KviCString & szType); - KviModuleExtension * allocateExtension(const KviCString & szType, const KviCString & szName, KviWindow * pWnd = 0, KviPointerHashTable * pParams = 0, void * pSpecial = 0, const QString & preloadModule = QString()); - KviModuleExtension * allocateExtension(const KviCString & szType, int id, KviWindow * pWnd = 0, KviPointerHashTable * pParams = 0, void * pSpecial = 0, const QString & preloadModule = QString()); + KviModuleExtension * allocateExtension(const KviCString & szType, const KviCString & szName, KviWindow * pWnd = nullptr, KviPointerHashTable * pParams = nullptr, void * pSpecial = nullptr, const QString & preloadModule = QString()); + KviModuleExtension * allocateExtension(const KviCString & szType, int id, KviWindow * pWnd = nullptr, KviPointerHashTable * pParams = nullptr, void * pSpecial = nullptr, const QString & preloadModule = QString()); private: KviModuleExtensionDescriptorList * allocateExtensionGetDescriptorList(const KviCString & szType, const QString & preloadModule); diff --git a/src/kvirc/module/KviModuleManager.cpp b/src/kvirc/module/KviModuleManager.cpp index bf984685f..37cee0b83 100644 --- a/src/kvirc/module/KviModuleManager.cpp +++ b/src/kvirc/module/KviModuleManager.cpp @@ -265,7 +265,7 @@ bool KviModuleManager::loadModule(const QString & modName) if(g_pMainWindow) { KviConsoleWindow * pWnd = g_pMainWindow->firstConsole(); - if(pWnd) // this may be NULL when the app is starting up + if(pWnd) // this may be nullptr when the app is starting up pWnd->output( KVI_OUT_VERBOSE, __tr2qs("Loaded module '%s' (%s)"), diff --git a/src/kvirc/sparser/KviIrcNumericCodes.h b/src/kvirc/sparser/KviIrcNumericCodes.h index e88b428fc..2641ebb1d 100644 --- a/src/kvirc/sparser/KviIrcNumericCodes.h +++ b/src/kvirc/sparser/KviIrcNumericCodes.h @@ -389,7 +389,7 @@ #define RPL_SPAMFILTERLIST 941 // ///* 303 */ RPL_ISON, ":", -///* 304 */ RPL_TEXT, (char *)NULL, +///* 304 */ RPL_TEXT, (char *)nullptr, ///* 305 */ RPL_UNAWAY, ":You are no longer marked as being away", ///* 306 */ RPL_NOWAWAY, ":You have been marked as being away", @@ -398,11 +398,11 @@ ///* 323 */ RPL_LISTEND, ":End of /LIST", ///* 324 */ RPL_CHANNELMODEIS, "%???" -///* 334 */ 0, (char *)NULL, +///* 334 */ 0, (char *)nullptr, ///* 341 */ RPL_INVITING, "%s %s", ///* 342 */ RPL_SUMMONING, "%s :User summoned to irc", ///* 352 */ RPL_WHOREPLY, , -///* 361 */ RPL_KILLDONE, (char *)NULL, +///* 361 */ RPL_KILLDONE, (char *)nullptr, ///* 362 */ RPL_CLOSING, "%s :Closed. Status = %d", ///* 363 */ RPL_CLOSEEND, "%d: Connections Closed", ///* 364 */ RPL_LINKS, "%s %s :%d %s", @@ -413,9 +413,9 @@ ///* 369 */ RPL_ENDOFWHOWAS, "%s :End of WHOWAS", ///* 381 */ RPL_YOUREOPER, ":You have entered... the Twilight Zone!.", ///* 382 */ RPL_REHASHING, "%s :Rehashing", -///* 383 */ 0, (char *)NULL, +///* 383 */ 0, (char *)nullptr, ///* 384 */ RPL_MYPORTIS, "%d :Port to local server is\r\n", -///* 385 */ RPL_NOTOPERANYMORE, (char *)NULL, +///* 385 */ RPL_NOTOPERANYMORE, (char *)nullptr, ///* 391 */ RPL_TIME, "%s :%s", ///* 392 */ RPL_USERSSTART, ":UserID Terminal Host", ///* 393 */ RPL_USERS, ":%-8s %-9s %-8s", @@ -431,11 +431,11 @@ ///* 223 */ RPL_STATSELINE, "%c %s * %s %d %d", ///* 224 */ RPL_STATSFLINE, "%c %s * %s %d %d", ///* 225 */ RPL_STATSDLINE, "%c %s %s", -///* 231 */ 0, (char *)NULL, -///* 232 */ 0, (char *)NULL, -///* 233 */ 0, (char *)NULL, -///* 234 */ RPL_SERVLIST, (char *)NULL, -///* 235 */ RPL_SERVLISTEND, (char *)NULL, +///* 231 */ 0, (char *)nullptr, +///* 232 */ 0, (char *)nullptr, +///* 233 */ 0, (char *)nullptr, +///* 234 */ RPL_SERVLIST, (char *)nullptr, +///* 235 */ RPL_SERVLISTEND, (char *)nullptr, ///* 241 */ RPL_STATSLLINE, "%c %s * %s %d %d", ///* 242 */ RPL_STATSUPTIME, ":Server Up %d days, %d:%02d:%02d", ///* 243 */ RPL_STATSOLINE, "%c %s * %s %d %d", diff --git a/src/kvirc/ui/KviConsoleWindow.h b/src/kvirc/ui/KviConsoleWindow.h index 58e64b9c7..7f1b5c4fb 100644 --- a/src/kvirc/ui/KviConsoleWindow.h +++ b/src/kvirc/ui/KviConsoleWindow.h @@ -179,7 +179,7 @@ public: // when no longer needed. KviAvatar * defaultAvatarFromOptions(); - void terminateConnectionRequest(bool bForce = false, const char * quitMsg = 0); + void terminateConnectionRequest(bool bForce = false, const char * quitMsg = nullptr); // Status string (usermode + nick) (connection related too) const QString & statusString() const { return m_szStatusString; } diff --git a/src/kvirc/ui/KviDynamicToolTip.h b/src/kvirc/ui/KviDynamicToolTip.h index 9c0bd1748..2d39419d7 100644 --- a/src/kvirc/ui/KviDynamicToolTip.h +++ b/src/kvirc/ui/KviDynamicToolTip.h @@ -51,7 +51,7 @@ class KVIRC_API KviDynamicToolTip : public QObject friend class KviDynamicToolTipHelper; Q_OBJECT public: - KviDynamicToolTip(QWidget * parent, const char * name = 0); + KviDynamicToolTip(QWidget * parent, const char * name = nullptr); virtual ~KviDynamicToolTip(); protected: diff --git a/src/kvirc/ui/KviFileDialog.h b/src/kvirc/ui/KviFileDialog.h index ad22bce18..ad01e2f6a 100644 --- a/src/kvirc/ui/KviFileDialog.h +++ b/src/kvirc/ui/KviFileDialog.h @@ -57,7 +57,7 @@ public: * \param bModal Whether to have a modal behaviour * \return KviFileDialog */ - KviFileDialog(const QString & szDirName, const QString & szFilter = QString(), QWidget * pParent = 0, const char * name = 0, bool bModal = false); + KviFileDialog(const QString & szDirName, const QString & szFilter = QString(), QWidget * pParent = nullptr, const char * name = nullptr, bool bModal = false); /** * \brief Destroys the file dialog object @@ -75,7 +75,7 @@ public: * \param pParent The parent widget * \return bool */ - static bool askForOpenFileName(QString & szBuffer, const QString & szCaption, const QString & szInitial = QString(), const QString & szFilter = QString(), bool bShowHidden = false, bool bShowNative = true, QWidget * pParent = 0); + static bool askForOpenFileName(QString & szBuffer, const QString & szCaption, const QString & szInitial = QString(), const QString & szFilter = QString(), bool bShowHidden = false, bool bShowNative = true, QWidget * pParent = nullptr); /** * \param szBuffer The buffer where to store the data @@ -88,7 +88,7 @@ public: * \param pParent The parent widget * \return bool */ - static bool askForSaveFileName(QString & szBuffer, const QString & szCaption, const QString & szInitial = QString(), const QString & szFilter = QString(), bool bShowHidden = false, bool bConfirmOverwrite = false, bool bShowNative = true, QWidget * pParent = 0); + static bool askForSaveFileName(QString & szBuffer, const QString & szCaption, const QString & szInitial = QString(), const QString & szFilter = QString(), bool bShowHidden = false, bool bConfirmOverwrite = false, bool bShowNative = true, QWidget * pParent = nullptr); /** * \param szBuffer The buffer where to store the data @@ -100,7 +100,7 @@ public: * \param pParent The parent widget * \return bool */ - static bool askForDirectoryName(QString & szBuffer, const QString & szCaption, const QString & szInitial, const QString & szFilter = QString(), bool bShowHidden = false, bool bShowNative = true, QWidget * pParent = 0); + static bool askForDirectoryName(QString & szBuffer, const QString & szCaption, const QString & szInitial, const QString & szFilter = QString(), bool bShowHidden = false, bool bShowNative = true, QWidget * pParent = nullptr); /** * \param szBuffer The buffer where to store the data @@ -112,7 +112,7 @@ public: * \param pParent The parent widget * \return bool */ - static bool askForOpenFileNames(QStringList & szBuffer, const QString & szCaption, const QString & szInitial, const QString & szFilter = QString(), bool bShowHidden = false, bool bShowNative = true, QWidget * pParent = 0); + static bool askForOpenFileNames(QStringList & szBuffer, const QString & szCaption, const QString & szInitial, const QString & szFilter = QString(), bool bShowHidden = false, bool bShowNative = true, QWidget * pParent = nullptr); }; #endif //_KVI_FILEDIALOG_H_ diff --git a/src/kvirc/ui/KviInput.h b/src/kvirc/ui/KviInput.h index 6beb4b69d..3c4061642 100644 --- a/src/kvirc/ui/KviInput.h +++ b/src/kvirc/ui/KviInput.h @@ -61,7 +61,7 @@ public: * \param pView The userlist * \return KviInput */ - KviInput(KviWindow * pPar, KviUserListView * pView = 0); + KviInput(KviWindow * pPar, KviUserListView * pView = nullptr); /** * \brief Destroys the input object diff --git a/src/kvirc/ui/KviIrcToolBar.h b/src/kvirc/ui/KviIrcToolBar.h index d833b1737..fdbd742c9 100644 --- a/src/kvirc/ui/KviIrcToolBar.h +++ b/src/kvirc/ui/KviIrcToolBar.h @@ -48,7 +48,7 @@ class KVIRC_API KviToolBarGraphicalApplet : public QWidget { Q_OBJECT public: - KviToolBarGraphicalApplet(QWidget * par, const char * name = 0); + KviToolBarGraphicalApplet(QWidget * par, const char * name = nullptr); ~KviToolBarGraphicalApplet(); private: @@ -72,7 +72,7 @@ class KVIRC_API KviIrcContextDisplay : public KviToolBarGraphicalApplet { Q_OBJECT public: - KviIrcContextDisplay(QWidget * par, const char * name = 0); + KviIrcContextDisplay(QWidget * par, const char * name = nullptr); ~KviIrcContextDisplay(); protected: diff --git a/src/kvirc/ui/KviIrcView.h b/src/kvirc/ui/KviIrcView.h index db14dba09..5c85453ef 100644 --- a/src/kvirc/ui/KviIrcView.h +++ b/src/kvirc/ui/KviIrcView.h @@ -178,13 +178,13 @@ public: // A null pixmap passed here unsets the private backgrdound. void setPrivateBackgroundPixmap(const QPixmap & pixmap, bool bRepaint = true); QPixmap * getPrivateBackgroundPixmap() const { return m_pPrivateBackgroundPixmap; }; - bool hasPrivateBackgroundPixmap() { return (m_pPrivateBackgroundPixmap != 0); }; + bool hasPrivateBackgroundPixmap() { return (m_pPrivateBackgroundPixmap != nullptr); }; // Logging // Stops previous logging session too... bool startLogging(const QString & fname = QString(), bool bPrependCurBuffer = false); void stopLogging(); - bool isLogging() { return (m_pLogFile != 0); }; + bool isLogging() { return (m_pLogFile != nullptr); }; void getLogFileName(QString & buffer); void add2Log(const QString & szBuffer, const QDateTime & date, int iMsgType, bool bPrependDate); @@ -242,7 +242,7 @@ private: void calculateLineWraps(KviIrcViewLine * ptr, int maxWidth); void recalcFontVariables(const QFont & font, const QFontInfo & fi); bool checkSelectionBlock(KviIrcViewLine * line, int bufIndex); - KviIrcViewWrappedBlock * getLinkUnderMouse(int xPos, int yPos, QRect * pRect = 0, QString * linkCmd = 0, QString * linkText = 0); + KviIrcViewWrappedBlock * getLinkUnderMouse(int xPos, int yPos, QRect * pRect = nullptr, QString * linkCmd = nullptr, QString * linkText = nullptr); void doLinkToolTip(const QRect & rct, QString & linkCmd, QString & linkText); void doMarkerToolTip(); bool checkMarkerArea(const QPoint & mousePos); diff --git a/src/kvirc/ui/KviMainWindow.h b/src/kvirc/ui/KviMainWindow.h index 76d70b2ea..ceecbaf8f 100644 --- a/src/kvirc/ui/KviMainWindow.h +++ b/src/kvirc/ui/KviMainWindow.h @@ -96,7 +96,7 @@ public: // well.. the menu bar :D KviMenuBar * mainMenuBar() { return m_pMenuBar; }; KviStatusBar * mainStatusBar() { return m_pStatusBar; }; - // this function may return 0 if the active window has no irc context + // this function may return nullptr if the active window has no irc context KviIrcContext * activeContext() { return m_pActiveContext; }; // shortcut to a = activeContext(); return a ? a->connection() : 0 KviIrcConnection * activeConnection(); @@ -127,7 +127,7 @@ public: // Exceptions are the startup and the shutdown (see activeWindow()) KviConsoleWindow * firstConsole(); // Returns the first console that has no connection in progress - // This function CAN return 0 if all the consoles are connected + // This function CAN return nullptr if all the consoles are connected KviConsoleWindow * firstNotConnectedConsole(); // this is explicitly dedicated to the TrayIcon module void setTrayIcon(KviTrayIcon * e) { m_pTrayIcon = e; }; diff --git a/src/kvirc/ui/KviMaskEditor.h b/src/kvirc/ui/KviMaskEditor.h index 41cc3bb80..65e57aa06 100644 --- a/src/kvirc/ui/KviMaskEditor.h +++ b/src/kvirc/ui/KviMaskEditor.h @@ -71,7 +71,7 @@ protected: return m_Mask.uSetAt < ((KviMaskItem *)&other)->mask()->uSetAt; break; } - return 0; //make compiler happy + return false; //make compiler happy } }; diff --git a/src/kvirc/ui/KviOptionsWidget.h b/src/kvirc/ui/KviOptionsWidget.h index 50b350793..d0ff568df 100644 --- a/src/kvirc/ui/KviOptionsWidget.h +++ b/src/kvirc/ui/KviOptionsWidget.h @@ -40,7 +40,7 @@ class KVIRC_API KviOptionsWidget : public QFrame, public KviSelectorInterface { Q_OBJECT public: - KviOptionsWidget(QWidget * parent, const char * name = 0, bool bSunken = true); + KviOptionsWidget(QWidget * parent, const char * name = nullptr, bool bSunken = true); ~KviOptionsWidget(); private: diff --git a/src/kvirc/ui/KviSelectors.h b/src/kvirc/ui/KviSelectors.h index 961f5448e..00a7f8191 100644 --- a/src/kvirc/ui/KviSelectors.h +++ b/src/kvirc/ui/KviSelectors.h @@ -52,7 +52,7 @@ public: public: virtual void commit(){}; virtual QString textForSearch() { return QString(); }; - virtual QWidget * widgetToHighlight() { return 0; }; + virtual QWidget * widgetToHighlight() { return nullptr; }; }; class KVIRC_API KviBoolSelector : public QCheckBox, public KviSelectorInterface diff --git a/src/kvirc/ui/KviTopicWidget.h b/src/kvirc/ui/KviTopicWidget.h index 85410612a..178a878cf 100644 --- a/src/kvirc/ui/KviTopicWidget.h +++ b/src/kvirc/ui/KviTopicWidget.h @@ -44,7 +44,7 @@ class KVIRC_API KviTopicListBoxItemDelegate : public KviTalIconAndRichTextItemDe { Q_OBJECT public: - KviTopicListBoxItemDelegate(QAbstractItemView * pWidget = 0); + KviTopicListBoxItemDelegate(QAbstractItemView * pWidget = nullptr); ~KviTopicListBoxItemDelegate(); public: @@ -55,7 +55,7 @@ public: class KVIRC_API KviTopicListBoxItem : public KviTalListWidgetText { public: - KviTopicListBoxItem(KviTalListWidget * pListBox = 0, const QString & text = QString()); + KviTopicListBoxItem(KviTalListWidget * pListBox = nullptr, const QString & text = QString()); ~KviTopicListBoxItem(); public: diff --git a/src/kvirc/ui/KviTreeWindowList.h b/src/kvirc/ui/KviTreeWindowList.h index 5b5d6d509..e869b3949 100644 --- a/src/kvirc/ui/KviTreeWindowList.h +++ b/src/kvirc/ui/KviTreeWindowList.h @@ -123,7 +123,7 @@ class KVIRC_API KviTreeWindowListItemDelegate : public QStyledItemDelegate { Q_OBJECT public: - KviTreeWindowListItemDelegate(QAbstractItemView * pWidget = 0) + KviTreeWindowListItemDelegate(QAbstractItemView * pWidget = nullptr) : QStyledItemDelegate(pWidget){}; ~KviTreeWindowListItemDelegate(){}; QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const; diff --git a/src/kvirc/ui/KviUserListView.h b/src/kvirc/ui/KviUserListView.h index 9ec71daf0..219bdd72c 100644 --- a/src/kvirc/ui/KviUserListView.h +++ b/src/kvirc/ui/KviUserListView.h @@ -320,7 +320,7 @@ public: * \param pRect The rectangle where to search * \return KviUserListEntry * */ - KviUserListEntry * itemAt(const QPoint & pnt, QRect * pRect = 0); + KviUserListEntry * itemAt(const QPoint & pnt, QRect * pRect = nullptr); /** * \brief Returns true if the item in the entry is visible diff --git a/src/kvirc/ui/KviWebPackageManagementDialog.h b/src/kvirc/ui/KviWebPackageManagementDialog.h index 7659a41ed..af2804daa 100644 --- a/src/kvirc/ui/KviWebPackageManagementDialog.h +++ b/src/kvirc/ui/KviWebPackageManagementDialog.h @@ -52,7 +52,7 @@ public: /// /// Creates an instance of KviWebPackageManagementDialog /// - KviWebPackageManagementDialog(QWidget * pParent = NULL); + KviWebPackageManagementDialog(QWidget * pParent = nullptr); /// /// Destroys the instance of KviWebPackageManagementDialog diff --git a/src/kvirc/ui/KviWindow.h b/src/kvirc/ui/KviWindow.h index 8e3766869..b1cc107a2 100644 --- a/src/kvirc/ui/KviWindow.h +++ b/src/kvirc/ui/KviWindow.h @@ -276,7 +276,7 @@ public: /** * \brief Returns the KviIrcView of this window * - * May be NULL if the window has no KviIrcView (and thus supports no direct output) + * May be nullptr if the window has no KviIrcView (and thus supports no direct output) * \return KviIrcView * */ KviIrcView * view() const { return m_pIrcView; } @@ -356,7 +356,7 @@ public: virtual void getWindowListTipText(QString & szBuffer) { szBuffer = m_szPlainTextCaption; } - // This is meaningful only if view() is non NULL + // This is meaningful only if view() is non nullptr const QString & lastLineOfText(); const QString & lastMessageText(); @@ -531,7 +531,7 @@ signals: // This is almost always non null // The exception is the startup (when there are no windows at all) // and the last phase of the destructor. -// You usually shouldn't care of checking this pointer for NULL unless +// You usually shouldn't care of checking this pointer for nullptr unless // you're running very early at startup or very late at shutdown extern KVIRC_API KviWindow * g_pActiveWindow; #endif diff --git a/src/kvirc/ui/KviWindowListBase.h b/src/kvirc/ui/KviWindowListBase.h index a2a025832..ed0a19f63 100644 --- a/src/kvirc/ui/KviWindowListBase.h +++ b/src/kvirc/ui/KviWindowListBase.h @@ -88,13 +88,13 @@ protected: Qt::DockWidgetArea currentArea; public: - virtual KviWindowListItem * addItem(KviWindow *) { return 0; }; + virtual KviWindowListItem * addItem(KviWindow *) { return nullptr; } virtual bool removeItem(KviWindowListItem *) { return false; }; virtual void setActiveItem(KviWindowListItem *){}; - virtual KviWindowListItem * firstItem() { return 0; }; - virtual KviWindowListItem * lastItem(void) { return 0; } - virtual KviWindowListItem * nextItem() { return 0; }; - virtual KviWindowListItem * prevItem(void) { return 0; } + virtual KviWindowListItem * firstItem() { return nullptr; } + virtual KviWindowListItem * lastItem(void) { return nullptr; } + virtual KviWindowListItem * nextItem() { return nullptr; } + virtual KviWindowListItem * prevItem(void) { return nullptr; } virtual KviWindowListItem * item(int number); virtual bool setIterationPointer(KviWindowListItem *) { return false; }; virtual void switchWindow(bool bNext, bool bInContextOnly, bool bHighlightedOnly = false); diff --git a/src/modules/addon/AddonFunctions.h b/src/modules/addon/AddonFunctions.h index 6d4d9cae2..27071dc56 100644 --- a/src/modules/addon/AddonFunctions.h +++ b/src/modules/addon/AddonFunctions.h @@ -50,7 +50,7 @@ namespace AddonFunctions bool checkDirTree(const QString & szDirPath, QString * pszError); bool pack(AddonInfo & info, QString & szError); bool notAValidAddonPackage(QString & szError); - bool installAddonPackage(const QString & szAddonPackageFileName, QString & szError, QWidget * pDialogParent = 0); + bool installAddonPackage(const QString & szAddonPackageFileName, QString & szError, QWidget * pDialogParent = nullptr); QString createRandomDir(); } diff --git a/src/modules/context/libkvicontext.cpp b/src/modules/context/libkvicontext.cpp index ef575d681..11eaaf93c 100644 --- a/src/modules/context/libkvicontext.cpp +++ b/src/modules/context/libkvicontext.cpp @@ -51,16 +51,16 @@ KVSM_PARAMETERS_BEGIN(c) \ KVSM_PARAMETER("irc_context_id", KVS_PT_UINT, KVS_PF_OPTIONAL, iContextId) \ KVSM_PARAMETERS_END(c) \ - KviConsoleWindow * pConsole = NULL; \ + KviConsoleWindow * pConsole = nullptr; \ if(c->parameterCount() > 0) \ pConsole = g_pApp->findConsole(iContextId); \ else \ pConsole = c->window()->console(); #define GET_CONNECTION_FROM_STANDARD_PARAMS \ - GET_CONSOLE_FROM_STANDARD_PARAMS \ - KviIrcConnection * pConnection = NULL; \ - if(pConsole) \ + GET_CONSOLE_FROM_STANDARD_PARAMS \ + KviIrcConnection * pConnection = nullptr; \ + if(pConsole) \ pConnection = pConsole->context()->connection(); #define STANDARD_IRC_CONNECTION_TARGET_PARAMETER(_fncName, _setCall) \ diff --git a/src/modules/dcc/DccCanvasWindow.cpp b/src/modules/dcc/DccCanvasWindow.cpp index 89c71f55b..e2adee2a4 100644 --- a/src/modules/dcc/DccCanvasWindow.cpp +++ b/src/modules/dcc/DccCanvasWindow.cpp @@ -114,7 +114,7 @@ DccCanvasWindow::DccCanvasWindow(DccDescriptor * dcc, const char * name) output(KVI_OUT_DCCMSG, __tr2qs_ctx("Contacting host %Q on port %Q", "dcc"), &(dcc->szIp), &(dcc->szPort)); } - // m_pSlaveThread = 0; + // m_pSlaveThread = nullptr; } DccCanvasWindow::~DccCanvasWindow() @@ -124,7 +124,7 @@ DccCanvasWindow::~DccCanvasWindow() // { // m_pSlaveThread->terminate(); // delete m_pSlaveThread; - // m_pSlaveThread = 0; + // m_pSlaveThread = nullptr; // } KviThreadManager::killPendingEvents(this); // delete m_pDescriptor; diff --git a/src/modules/dcc/DccVideoWindow.cpp b/src/modules/dcc/DccVideoWindow.cpp index 3497843ba..963a30b36 100644 --- a/src/modules/dcc/DccVideoWindow.cpp +++ b/src/modules/dcc/DccVideoWindow.cpp @@ -258,7 +258,7 @@ bool DccVideoThread::handleIncomingData(KviDccThreadIncomingData * data, bool bC // no more data in the buffer KVI_ASSERT(data->iLen == 0); KviMemory::free(data->buffer); - data->buffer = end = aux = 0; + data->buffer = end = aux = nullptr; } postEvent(parent(), e); } @@ -280,7 +280,7 @@ bool DccVideoThread::handleIncomingData(KviDccThreadIncomingData * data, bool bC e->setData(s); data->iLen = 0; KviMemory::free(data->buffer); - data->buffer = 0; + data->buffer = nullptr; postEvent(parent(), e); } } @@ -395,8 +395,8 @@ DccVideoWindow::DccVideoWindow(DccDescriptor * dcc, const char * name) : DccWindow(KviWindow::DccVideo, name, dcc) { m_pDescriptor = dcc; - m_pSlaveThread = 0; - m_pszTarget = 0; + m_pSlaveThread = nullptr; + m_pszTarget = nullptr; m_pButtonBox = new KviTalHBox(this); @@ -500,51 +500,51 @@ DccVideoWindow::~DccVideoWindow() if(m_pInVideoLabel) { delete m_pInVideoLabel; - m_pInVideoLabel = 0; + m_pInVideoLabel = nullptr; } if(m_pCameraView) { delete m_pCameraView; - m_pCameraView = 0; + m_pCameraView = nullptr; } if(m_pCameraImage) { delete m_pCameraImage; - m_pCameraImage = 0; + m_pCameraImage = nullptr; } if(m_pCamera) { delete m_pCamera; - m_pCamera = 0; + m_pCamera = nullptr; } if(m_pCDevices) { delete m_pCDevices; - m_pCDevices = 0; + m_pCDevices = nullptr; } if(m_pCInputs) { delete m_pCInputs; - m_pCInputs = 0; + m_pCInputs = nullptr; } if(m_pCStandards) { delete m_pCStandards; - m_pCStandards = 0; + m_pCStandards = nullptr; } if(m_pVideoLabel[0]) { delete m_pVideoLabel[2]; delete m_pVideoLabel[1]; delete m_pVideoLabel[0]; - m_pVideoLabel[2] = 0; - m_pVideoLabel[1] = 0; - m_pVideoLabel[0] = 0; + m_pVideoLabel[2] = nullptr; + m_pVideoLabel[1] = nullptr; + m_pVideoLabel[0] = nullptr; } if(m_pLayout) { delete m_pLayout; - m_pLayout = 0; + m_pLayout = nullptr; } g_pDccBroker->unregisterDccWindow(this); @@ -553,7 +553,7 @@ DccVideoWindow::~DccVideoWindow() { m_pSlaveThread->terminate(); delete m_pSlaveThread; - m_pSlaveThread = 0; + m_pSlaveThread = nullptr; } KviThreadManager::killPendingEvents(this); @@ -561,7 +561,7 @@ DccVideoWindow::~DccVideoWindow() if(m_pszTarget) { delete m_pszTarget; - m_pszTarget = 0; + m_pszTarget = nullptr; } } diff --git a/src/modules/dcc/DccVoiceCodec.cpp b/src/modules/dcc/DccVoiceCodec.cpp index 1028e7c72..5e70d176c 100644 --- a/src/modules/dcc/DccVoiceCodec.cpp +++ b/src/modules/dcc/DccVoiceCodec.cpp @@ -263,19 +263,19 @@ DccVideoTheoraCodec::DccVideoTheoraCodec() : DccVideoCodec() { m_szName = "theora"; - m_pEncoder = 0; - m_pDecoder = 0; + m_pEncoder = nullptr; + m_pDecoder = nullptr; } DccVideoTheoraCodec::~DccVideoTheoraCodec() { if(m_pEncoder) delete m_pEncoder; - m_pEncoder = 0; + m_pEncoder = nullptr; if(m_pDecoder) delete m_pDecoder; - m_pDecoder = 0; + m_pDecoder = nullptr; } void DccVideoTheoraCodec::encodeVideo(KviDataBuffer * videoSignal, KviDataBuffer * stream) diff --git a/src/modules/dcc/DccVoiceGsmCodec.cpp b/src/modules/dcc/DccVoiceGsmCodec.cpp index e2a23bb4e..3a7929b3d 100644 --- a/src/modules/dcc/DccVoiceGsmCodec.cpp +++ b/src/modules/dcc/DccVoiceGsmCodec.cpp @@ -33,12 +33,12 @@ #define GSM_UNPACKED_FRAME_SIZE_IN_BYTES 320 #define GSM_UNPACKED_FRAME_SIZE_IN_SHORTS 160 -void * (*gsm_session_create)() = 0; -void (*gsm_session_destroy)(void *) = 0; -void (*gsm_session_encode)(void *, short *, unsigned char *) = 0; -int (*gsm_session_decode)(void *, unsigned char *, short *) = 0; +void * (*gsm_session_create)() = nullptr; +void (*gsm_session_destroy)(void *) = nullptr; +void (*gsm_session_encode)(void *, short *, unsigned char *) = nullptr; +int (*gsm_session_decode)(void *, unsigned char *, short *) = nullptr; -void * g_pGSMCodecLibraryHandle = 0; +void * g_pGSMCodecLibraryHandle = nullptr; bool kvi_gsm_codec_init() { @@ -57,7 +57,7 @@ bool kvi_gsm_codec_init() if(!(gsm_session_create && gsm_session_destroy && gsm_session_encode && gsm_session_decode)) { dlclose(g_pGSMCodecLibraryHandle); - g_pGSMCodecLibraryHandle = 0; + g_pGSMCodecLibraryHandle = nullptr; return false; } return true; @@ -68,7 +68,7 @@ void kvi_gsm_codec_done() if(g_pGSMCodecLibraryHandle) { dlclose(g_pGSMCodecLibraryHandle); - g_pGSMCodecLibraryHandle = 0; + g_pGSMCodecLibraryHandle = nullptr; } } diff --git a/src/modules/dcc/DccVoiceWindow.h b/src/modules/dcc/DccVoiceWindow.h index 5c2139245..f0f7dc898 100644 --- a/src/modules/dcc/DccVoiceWindow.h +++ b/src/modules/dcc/DccVoiceWindow.h @@ -188,7 +188,7 @@ public: KviVoiceParty::KviVoiceParty(const QString &szNick,const QString &szIp,unsigned short uPort) : m_szIp(szIp), m_uPort(uPort), m_szNick(szNick) { - m_pChildrenTree = 0; + m_pChildrenTree = nullptr; } KviVoiceParty::~KviVoiceParty() @@ -241,8 +241,8 @@ KviVoiceLink::KviVoiceLink(KviVoiceParty * pRemoteParty) { KviQString::sprintf("%Q:%u",&(pRemoteParty->nick()),pRemoteParty->port()); m_pRemoteParty = pRemoteParty; - m_pAudioEncoder = 0; - m_pAudioDecoder = 0; + m_pAudioEncoder = nullptr; + m_pAudioDecoder = nullptr; } KviVoiceLink::~KviVoiceLink() diff --git a/src/modules/dcc/DccWindow.h b/src/modules/dcc/DccWindow.h index 31a4710fd..483f1ad43 100644 --- a/src/modules/dcc/DccWindow.h +++ b/src/modules/dcc/DccWindow.h @@ -45,7 +45,7 @@ protected: public: DccDescriptor * descriptor() { return m_pDescriptor; }; const DccMarshal * marshal() { return m_pMarshal; }; - virtual DccThread * getSlaveThread() { return 0; }; + virtual DccThread * getSlaveThread() { return nullptr; } virtual KviWindow * dccMarshalOutputWindow(); virtual const char * dccMarshalOutputContextString(); }; diff --git a/src/modules/dcc/canvaswidget.cpp b/src/modules/dcc/canvaswidget.cpp index 8da7a0204..03d69ac58 100644 --- a/src/modules/dcc/canvaswidget.cpp +++ b/src/modules/dcc/canvaswidget.cpp @@ -466,7 +466,7 @@ KviCanvasView::KviCanvasView(QCanvas * c, DccCanvasWidget * cw, QWidget * par) m_pCanvasWidget = cw; m_state = Idle; m_dragMode = None; - m_pSelectedItem = 0; + m_pSelectedItem = nullptr; viewport()->setMouseTracking(true); } @@ -562,7 +562,7 @@ static void calcPolygonPoints(QPointArray & pnts, unsigned int nVertices) void KviCanvasView::insertObjectAt(const QPoint & pnt, ObjectType o) { - QCanvasItem * r = 0; + QCanvasItem * r = nullptr; switch(o) { @@ -655,7 +655,7 @@ void KviCanvasView::clearSelection() if(!m_pSelectedItem) return; m_pSelectedItem->setSelected(false); - m_pSelectedItem = 0; + m_pSelectedItem = nullptr; m_pCanvasWidget->m_pPropertiesWidget->editItem(0); } @@ -1297,7 +1297,7 @@ QWidget * KviVariantTableItem::createEditor() const default: break; } - return 0; + return nullptr; } void KviVariantTableItem::setContentFromEditor(QWidget * w) @@ -1429,7 +1429,7 @@ void KviCanvasItemPropertiesWidget::editItem(QCanvasItem * it) return; } - QMap * m = 0; + QMap * m = nullptr; switch(KVI_CANVAS_RTTI_CONTROL_TYPE(it)) { diff --git a/src/modules/editor/ScriptEditorImplementation.h b/src/modules/editor/ScriptEditorImplementation.h index 91baf4303..35ee28ba9 100644 --- a/src/modules/editor/ScriptEditorImplementation.h +++ b/src/modules/editor/ScriptEditorImplementation.h @@ -202,7 +202,7 @@ class ScriptEditorReplaceDialog final : public QDialog { Q_OBJECT public: - ScriptEditorReplaceDialog(QWidget * parent = 0, const QString & szName = QString()); + ScriptEditorReplaceDialog(QWidget * parent = nullptr, const QString & szName = QString()); public: QLineEdit * m_pFindLineEdit; diff --git a/src/modules/file/libkvifile.cpp b/src/modules/file/libkvifile.cpp index 9025ad33d..2ff800b5f 100644 --- a/src/modules/file/libkvifile.cpp +++ b/src/modules/file/libkvifile.cpp @@ -1489,7 +1489,7 @@ static bool file_kvs_fnc_diskSpace(KviKvsModuleFunctionCall * c) // this for win #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) ULARGE_INTEGER free, total; - if (GetDiskFreeSpaceEx(szPath.toStdWString().c_str(), NULL, &total, &free) == 0) { + if (GetDiskFreeSpaceEx(szPath.toStdWString().c_str(), nullptr, &total, &free) == 0) { c->warning(__tr2qs("An error occurred retrieving the amount of free space in '%Q'"), &szPath); return true; } diff --git a/src/modules/filetransferwindow/FileTransferWindow.cpp b/src/modules/filetransferwindow/FileTransferWindow.cpp index 70dfcd9c3..03328ecd5 100644 --- a/src/modules/filetransferwindow/FileTransferWindow.cpp +++ b/src/modules/filetransferwindow/FileTransferWindow.cpp @@ -666,7 +666,7 @@ void FileTransferWindow::openLocalFile() if(tmp.isEmpty()) return; tmp.replace("/", "\\"); - ShellExecute(0, TEXT("open"), tmp.toStdWString().c_str(), NULL, NULL, SW_SHOWNORMAL); //You have to link the shell32.lib + ShellExecute(0, TEXT("open"), tmp.toStdWString().c_str(), nullptr, nullptr, SW_SHOWNORMAL); //You have to link the shell32.lib #else // G&N end #ifdef COMPILE_KDE4_SUPPORT diff --git a/src/modules/filetransferwindow/FileTransferWindow.h b/src/modules/filetransferwindow/FileTransferWindow.h index 89839c674..9c13d1c0c 100644 --- a/src/modules/filetransferwindow/FileTransferWindow.h +++ b/src/modules/filetransferwindow/FileTransferWindow.h @@ -81,7 +81,7 @@ class FileTransferItemDelegate : public KviTalIconAndRichTextItemDelegate { Q_OBJECT public: - FileTransferItemDelegate(QAbstractItemView * pWidget = 0) + FileTransferItemDelegate(QAbstractItemView * pWidget = nullptr) : KviTalIconAndRichTextItemDelegate(pWidget){}; ~FileTransferItemDelegate(){}; QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const; diff --git a/src/modules/ident/libkviident.h b/src/modules/ident/libkviident.h index 613222ab5..2aa573402 100644 --- a/src/modules/ident/libkviident.h +++ b/src/modules/ident/libkviident.h @@ -85,7 +85,7 @@ public: void run() override; protected: - void postMessage(const char * message, KviIdentRequest * r, const char * szAux = 0); + void postMessage(const char * message, KviIdentRequest * r, const char * szAux = nullptr); }; #endif //_LIBKVIIDENT_H_ diff --git a/src/modules/list/ListWindow.h b/src/modules/list/ListWindow.h index 30da96db0..0eba68571 100644 --- a/src/modules/list/ListWindow.h +++ b/src/modules/list/ListWindow.h @@ -44,7 +44,7 @@ class KviThemedLineEdit; class ChannelTreeWidgetItemDelegate : public QItemDelegate { public: - ChannelTreeWidgetItemDelegate(QTreeWidget * pWidget = 0); + ChannelTreeWidgetItemDelegate(QTreeWidget * pWidget = nullptr); ~ChannelTreeWidgetItemDelegate(); void paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index) const; QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const; diff --git a/src/modules/mediaplayer/MpAmipInterface.cpp b/src/modules/mediaplayer/MpAmipInterface.cpp index 640c9fc8f..2514ba52b 100644 --- a/src/modules/mediaplayer/MpAmipInterface.cpp +++ b/src/modules/mediaplayer/MpAmipInterface.cpp @@ -51,7 +51,7 @@ enum ac_ErrorCode #define AC_BUFFER_SIZE 2048 -static HINSTANCE amip_dll = NULL; +static HINSTANCE amip_dll = nullptr; #define MP_AC_DYNPTR(__rettype, __func, __args) \ typedef __rettype(CALLBACK * lp_##__func)(__args); \ @@ -94,7 +94,7 @@ static bool loadAmipDll() static QTextCodec * mediaplayer_get_codec() { - QTextCodec * pCodec = 0; + QTextCodec * pCodec = nullptr; pCodec = QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toUtf8()); if(!pCodec) @@ -120,7 +120,7 @@ MpAmipInterface::MpAmipInterface() bool res = loadAmipDll(); if(!res) { - amip_dll = NULL; + amip_dll = nullptr; return; } ac_init(AC_START_CLIENT); @@ -133,7 +133,7 @@ MpAmipInterface::~MpAmipInterface() return; ac_uninit(); FreeLibrary(amip_dll); - amip_dll = NULL; + amip_dll = nullptr; } int MpAmipInterface::detect(bool bStart) diff --git a/src/modules/mediaplayer/MpInterface.h b/src/modules/mediaplayer/MpInterface.h index a82016b24..69ec610bb 100644 --- a/src/modules/mediaplayer/MpInterface.h +++ b/src/modules/mediaplayer/MpInterface.h @@ -219,7 +219,7 @@ public: _interfaceclass##Descriptor::_interfaceclass##Descriptor() \ : MpInterfaceDescriptor() \ { \ - m_pInstance = 0; \ + m_pInstance = nullptr; \ m_szName = _name; \ m_szDescription = _description; \ } \ diff --git a/src/modules/mediaplayer/MpWinampInterface.cpp b/src/modules/mediaplayer/MpWinampInterface.cpp index 0d08cc4b5..875fc8838 100644 --- a/src/modules/mediaplayer/MpWinampInterface.cpp +++ b/src/modules/mediaplayer/MpWinampInterface.cpp @@ -83,13 +83,13 @@ // ** (requires Winamp 2.04+, only usable from plug-ins (not external apps)) // ** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTFILE); // ** IPC_GETPLAYLISTFILE gets the filename of the playlist entry [index]. -// ** returns a pointer to it. returns NULL on error. +// ** returns a pointer to it. returns nullptr on error. #define IPC_GETPLAYLISTTITLE 212 // * (requires Winamp 2.04+, only usable from plug-ins (not external apps)) // ** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTTITLE); // ** IPC_GETPLAYLISTTITLE gets the title of the playlist entry [index]. -// ** returns a pointer to it. returns NULL on error. +// ** returns a pointer to it. returns nullptr on error. #define IPC_GET_SHUFFLE 250 // ** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_SHUFFLE); @@ -131,7 +131,7 @@ // ** cds.dwData = IPC_PLAYFILE; // ** cds.lpData = (void *) "file.mp3"; // ** cds.cbData = strlen((char *) cds.lpData)+1; // include space for null char -// ** SendMessage(hwnd_winamp,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cds); +// ** SendMessage(hwnd_winamp,WM_COPYDATA,(WPARAM)nullptr,(LPARAM)&cds); // ** // ** This will play the file "file.mp3". @@ -165,8 +165,7 @@ static QTextCodec * mediaplayer_get_codec() { - QTextCodec * pCodec = 0; - pCodec = QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toUtf8()); + QTextCodec * pCodec = QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toUtf8()); if(!pCodec) pCodec = QTextCodec::codecForLocale(); @@ -175,7 +174,7 @@ static QTextCodec * mediaplayer_get_codec() static HWND find_winamp(KviWinampInterface * i) { - HWND hWnd = FindWindow(TEXT("Winamp v1.x"), NULL); + HWND hWnd = FindWindow(TEXT("Winamp v1.x"), nullptr); if(!hWnd) { // try to start the process ? @@ -385,7 +384,7 @@ bool KviWinampInterface::playMrl(const QString & mrl) cds.dwData = IPC_PLAYFILE; cds.lpData = (void *)szMrl.ptr(); cds.cbData = szMrl.len() + 1; // include space for null char - SendMessage(hWinamp, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&cds); + SendMessage(hWinamp, WM_COPYDATA, (WPARAM)nullptr, (LPARAM)&cds); return true; } return false; @@ -429,11 +428,11 @@ bool KviWinampInterface::jumpTo(kvs_int_t & iPos) bool KviWinampInterface::hide() { HWND hWinamp = find_winamp(this); - HWND hWinampPE = FindWindow(TEXT("Winamp PE"), NULL); /*Playlist*/ - HWND hWinampEQ = FindWindow(TEXT("Winamp EQ"), NULL); /*Equalizer*/ - HWND hWinampMB = FindWindow(TEXT("Winamp MB"), NULL); /*MiniBrowser*/ - HWND hWinampGen = FindWindow(TEXT("Winamp Gen"), NULL); /*Library*/ - HWND hWinampVideo = FindWindow(TEXT("Winamp Video"), NULL); /*Video*/ + HWND hWinampPE = FindWindow(TEXT("Winamp PE"), nullptr); /*Playlist*/ + HWND hWinampEQ = FindWindow(TEXT("Winamp EQ"), nullptr); /*Equalizer*/ + HWND hWinampMB = FindWindow(TEXT("Winamp MB"), nullptr); /*MiniBrowser*/ + HWND hWinampGen = FindWindow(TEXT("Winamp Gen"), nullptr); /*Library*/ + HWND hWinampVideo = FindWindow(TEXT("Winamp Video"), nullptr); /*Video*/ if(hWinamp) { ShowWindow(hWinamp, SW_HIDE); diff --git a/src/modules/mediaplayer/winamp.cpp b/src/modules/mediaplayer/winamp.cpp index 4bb67b8e5..0d701558a 100644 --- a/src/modules/mediaplayer/winamp.cpp +++ b/src/modules/mediaplayer/winamp.cpp @@ -72,7 +72,7 @@ winampGeneralPurposePlugin plugin = { #define KVIRC_WM_USER_CHECK 13123 #define KVIRC_WM_USER_CHECK_REPLY 13124 -void * lpWndProcOld = 0; +void * lpWndProcOld = nullptr; char szBuffer[4096]; diff --git a/src/modules/my/libkvimy.cpp b/src/modules/my/libkvimy.cpp index 43ea72c1c..822559314 100644 --- a/src/modules/my/libkvimy.cpp +++ b/src/modules/my/libkvimy.cpp @@ -37,7 +37,7 @@ Idle * g_pIdle; #define GET_KVS_CONSOLE \ kvs_uint_t uiWnd; \ - KviConsoleWindow * wnd = 0; \ + KviConsoleWindow * wnd = nullptr; \ KVSM_PARAMETERS_BEGIN(c) \ KVSM_PARAMETER("context_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uiWnd) \ KVSM_PARAMETERS_END(c) \ diff --git a/src/modules/objects/KvsObject_painter.cpp b/src/modules/objects/KvsObject_painter.cpp index aa2e7b548..4918253d3 100644 --- a/src/modules/objects/KvsObject_painter.cpp +++ b/src/modules/objects/KvsObject_painter.cpp @@ -2110,7 +2110,7 @@ KVSO_CLASS_FUNCTION(painter, drawPath) CHECK_INTERNAL_POINTER(m_pPainter) m_pPainter->drawPath(*m_pPainterPath); //delete m_pPainterPath; - //m_pPainterPath=0; + //m_pPainterPath=nullptr; return true; } diff --git a/src/modules/objects/KvsObject_pixmap.h b/src/modules/objects/KvsObject_pixmap.h index 35874f1f6..63b4de5c4 100644 --- a/src/modules/objects/KvsObject_pixmap.h +++ b/src/modules/objects/KvsObject_pixmap.h @@ -58,7 +58,7 @@ public: { *m_pImage = m_pPixmap->toImage(); delete m_pPixmap; - m_pPixmap = 0; + m_pPixmap = nullptr; } } m_currentType = Image; @@ -75,7 +75,7 @@ public: { *m_pPixmap = m_pPixmap->fromImage(*m_pImage); delete m_pImage; - m_pImage = 0; + m_pImage = nullptr; } } m_currentType = Pixmap; diff --git a/src/modules/objects/KvsObject_tableWidget.h b/src/modules/objects/KvsObject_tableWidget.h index 559f7f724..416e78f9b 100644 --- a/src/modules/objects/KvsObject_tableWidget.h +++ b/src/modules/objects/KvsObject_tableWidget.h @@ -39,7 +39,7 @@ class KvsObject_tableWidget; class KviCellItemDelegate : public QItemDelegate { public: - KviCellItemDelegate(QAbstractItemView * pWidget = 0, KvsObject_tableWidget * pParent = 0); + KviCellItemDelegate(QAbstractItemView * pWidget = nullptr, KvsObject_tableWidget * pParent = nullptr); ~KviCellItemDelegate(); protected: diff --git a/src/modules/objects/object_macros.h b/src/modules/objects/object_macros.h index c6e92c9dc..28525e7d0 100644 --- a/src/modules/objects/object_macros.h +++ b/src/modules/objects/object_macros.h @@ -58,7 +58,7 @@ g_pKvs##__className##Class->registerStandardFalseReturnFunctionHandler(__szName); #define KVSO_BEGIN_REGISTERCLASS(__className, __stringName, __baseClass) \ - static KviKvsObjectClass * g_pKvs##__className##Class = 0; \ + static KviKvsObjectClass * g_pKvs##__className##Class = nullptr; \ static KviKvsObject * kvs_##__className##_createInstance(KviKvsObjectClass * pClass, KviKvsObject * pParent, const QString & szName) \ { \ return new __className(pClass, pParent, szName); \ @@ -66,7 +66,7 @@ void __className::unregisterSelf() \ { \ delete g_pKvs##__className##Class; \ - g_pKvs##__className##Class = 0; \ + g_pKvs##__className##Class = nullptr; \ } \ void __className::registerSelf() \ { \ diff --git a/src/modules/options/OptionsInstanceManager.cpp b/src/modules/options/OptionsInstanceManager.cpp index 41ed5ae04..36291b24a 100644 --- a/src/modules/options/OptionsInstanceManager.cpp +++ b/src/modules/options/OptionsInstanceManager.cpp @@ -3712,7 +3712,7 @@ KviOptionsWidget * OptionsInstanceManager::getInstance(OptionsWidgetInstanceEntr QWidget * pOldPar = (QWidget *)pEntry->pWidget->parent(); pEntry->pWidget->setParent(pPar); pOldPar->deleteLater(); - pEntry->pWidget = 0; + pEntry->pWidget = nullptr; } } #endif diff --git a/src/modules/options/OptionsWidget_message.h b/src/modules/options/OptionsWidget_message.h index fb65be65d..9652a7b0c 100644 --- a/src/modules/options/OptionsWidget_message.h +++ b/src/modules/options/OptionsWidget_message.h @@ -113,7 +113,7 @@ class MessageListWidgetItemDelegate : public QItemDelegate { Q_OBJECT public: - MessageListWidgetItemDelegate(QAbstractItemView * pWidget = 0) + MessageListWidgetItemDelegate(QAbstractItemView * pWidget = nullptr) : QItemDelegate(pWidget){}; ~MessageListWidgetItemDelegate(){}; void paint(QPainter * p, const QStyleOptionViewItem & opt, const QModelIndex & index) const; @@ -151,7 +151,7 @@ class MessageColorListWidgetItemDelegate : public QItemDelegate { Q_OBJECT public: - MessageColorListWidgetItemDelegate(QAbstractItemView * pWidget = 0) + MessageColorListWidgetItemDelegate(QAbstractItemView * pWidget = nullptr) : QItemDelegate(pWidget){}; ~MessageColorListWidgetItemDelegate(){}; void paint(QPainter * p, const QStyleOptionViewItem & opt, const QModelIndex & index) const; diff --git a/src/modules/options/mkcreateinstanceproc.sh b/src/modules/options/mkcreateinstanceproc.sh index 858f6cd63..d1c33c518 100755 --- a/src/modules/options/mkcreateinstanceproc.sh +++ b/src/modules/options/mkcreateinstanceproc.sh @@ -229,7 +229,7 @@ printclass() echo "$3 e$1 = new OptionsWidgetInstanceEntry;" >> $TARGET echo -n "$3 e$1->createProc = &class$2" >> $TARGET echo "_createInstanceProc;" >> $TARGET - echo "$3 e$1->pWidget = 0;" >> $TARGET + echo "$3 e$1->pWidget = nullptr;" >> $TARGET echo "$3 e$1->szClassName = g_szClassName_$2;" >> $TARGET echo "$3 e$1->eIcon = KVI_OPTIONS_WIDGET_ICON_$2;" >> $TARGET @@ -288,7 +288,7 @@ addchildren() NEXTLEVEL=`expr $1 + 1` addchildren $NEXTLEVEL $achild "$3 " else - echo "$3 e$1->pChildList = 0;" >> $TARGET + echo "$3 e$1->pChildList = nullptr;" >> $TARGET fi done fi @@ -316,7 +316,7 @@ void OptionsInstanceManager::deleteInstanceTree(KviPointerListpWidget,SIGNAL(destroyed()),this,SLOT(widgetDestroyed())); delete pEntry->pWidget->parent(); - pEntry->pWidget = 0; + pEntry->pWidget = nullptr; } else { qDebug("Ops...i have deleted the options dialog ?"); } @@ -337,14 +337,14 @@ OptionsInstanceManager::~OptionsInstanceManager() void OptionsInstanceManager::cleanup(KviModule *) { deleteInstanceTree(m_pInstanceTree); - m_pInstanceTree = 0; + m_pInstanceTree = nullptr; } void OptionsInstanceManager::widgetDestroyed() { OptionsWidgetInstanceEntry * pEntry = findInstanceEntry(sender(),m_pInstanceTree); if(pEntry) - pEntry->pWidget = 0; + pEntry->pWidget = nullptr; if(g_iOptionWidgetInstances > 0) g_iOptionWidgetInstances--; @@ -353,7 +353,7 @@ void OptionsInstanceManager::widgetDestroyed() KviOptionsWidget * OptionsInstanceManager::getInstance(OptionsWidgetInstanceEntry * pEntry, QWidget * pPar) { if(!pEntry) - return NULL; + return nullptr; #if 0 if(pEntry->pWidget) @@ -363,7 +363,7 @@ KviOptionsWidget * OptionsInstanceManager::getInstance(OptionsWidgetInstanceEntr QWidget * pOldPar = (QWidget *)pEntry->pWidget->parent(); pEntry->pWidget->setParent(pPar); pOldPar->deleteLater(); - pEntry->pWidget = 0; + pEntry->pWidget = nullptr; } } #endif diff --git a/src/modules/popupeditor/PopupEditorWindow.h b/src/modules/popupeditor/PopupEditorWindow.h index 9384e9e72..62228bdec 100644 --- a/src/modules/popupeditor/PopupEditorWindow.h +++ b/src/modules/popupeditor/PopupEditorWindow.h @@ -104,7 +104,7 @@ public: protected: // theItem is the item above the first item that has to be inserted - void populateMenu(KviKvsPopupMenu * pop, PopupTreeWidgetItem * par, PopupTreeWidgetItem * theItem = 0); + void populateMenu(KviKvsPopupMenu * pop, PopupTreeWidgetItem * par, PopupTreeWidgetItem * theItem = nullptr); void saveLastSelectedItem(); void addItemToMenu(KviKvsPopupMenu * pop, PopupTreeWidgetItem * par); PopupTreeWidgetItem * newItem(PopupTreeWidgetItem * par, PopupTreeWidgetItem * after, PopupTreeWidgetItem::Type t); diff --git a/src/modules/reguser/RegisteredUsersDialog.h b/src/modules/reguser/RegisteredUsersDialog.h index f066a21f5..a949ae16d 100644 --- a/src/modules/reguser/RegisteredUsersDialog.h +++ b/src/modules/reguser/RegisteredUsersDialog.h @@ -54,7 +54,7 @@ signals: class RegisteredUsersDialogItemDelegate : public QStyledItemDelegate { public: - RegisteredUsersDialogItemDelegate(KviRegisteredUsersListView * pWidget = 0) + RegisteredUsersDialogItemDelegate(KviRegisteredUsersListView * pWidget = nullptr) : QStyledItemDelegate(pWidget){}; ~RegisteredUsersDialogItemDelegate(){}; QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const override; @@ -123,7 +123,7 @@ class RegisteredUsersDialog : public QWidget { Q_OBJECT public: - RegisteredUsersDialog(QWidget * par = 0); + RegisteredUsersDialog(QWidget * par = nullptr); ~RegisteredUsersDialog(); public: diff --git a/src/modules/reguser/RegistrationWizard.h b/src/modules/reguser/RegistrationWizard.h index bfbd380c9..a3cd710ed 100644 --- a/src/modules/reguser/RegistrationWizard.h +++ b/src/modules/reguser/RegistrationWizard.h @@ -43,7 +43,7 @@ class RegistrationWizard : public KviTalWizard { Q_OBJECT public: - RegistrationWizard(const QString & startMask, KviRegisteredUserDataBase * db = 0, QWidget * par = 0, bool bModal = false); + RegistrationWizard(const QString & startMask, KviRegisteredUserDataBase * db = nullptr, QWidget * par = nullptr, bool bModal = false); ~RegistrationWizard(); KviRegisteredUserDataBase * m_pDb; diff --git a/src/modules/rijndael/Rijndael.h b/src/modules/rijndael/Rijndael.h index 6905397e9..95331c07a 100644 --- a/src/modules/rijndael/Rijndael.h +++ b/src/modules/rijndael/Rijndael.h @@ -145,31 +145,31 @@ protected: public: // Initializes the crypt session // Returns RIJNDAEL_SUCCESS or an error code - int init(Mode mode, Direction dir, const UINT8 * key, KeyLength keyLen, UINT8 * initVector = 0); + int init(Mode mode, Direction dir, const UINT8 * key, KeyLength keyLen, UINT8 * initVector = nullptr); // Input len is in BITS! // Encrypts inputLen / 128 blocks of input and puts it in outBuffer // outBuffer must be at least inputLen / 8 bytes long. // Returns the encrypted buffer length in BITS or an error code < 0 in case of error - int blockEncrypt(const UINT8 * input, int inputLen, UINT8 * outBuffer, UINT8 * initVector = 0); + int blockEncrypt(const UINT8 * input, int inputLen, UINT8 * outBuffer, UINT8 * initVector = nullptr); // Input len is in BYTES! // outBuffer must be at least inputLen + 16 bytes long // Returns the encrypted buffer length in BYTES or an error code < 0 in case of error - int padEncrypt(const UINT8 * input, int inputOctets, UINT8 * outBuffer, UINT8 * initVector = 0); + int padEncrypt(const UINT8 * input, int inputOctets, UINT8 * outBuffer, UINT8 * initVector = nullptr); // Input len is in BITS! // outBuffer must be at least inputLen / 8 bytes long // Returns the decrypted buffer length in BITS and an error code < 0 in case of error - int blockDecrypt(const UINT8 * input, int inputLen, UINT8 * outBuffer, UINT8 * initVector = 0); + int blockDecrypt(const UINT8 * input, int inputLen, UINT8 * outBuffer, UINT8 * initVector = nullptr); // Input len is in BYTES! // outBuffer must be at least inputLen bytes long // Returns the decrypted buffer length in BYTES and an error code < 0 in case of error - int padDecrypt(const UINT8 * input, int inputOctets, UINT8 * outBuffer, UINT8 * initVector = 0); + int padDecrypt(const UINT8 * input, int inputOctets, UINT8 * outBuffer, UINT8 * initVector = nullptr); protected: void keySched(UINT8 key[_MAX_KEY_COLUMNS][4]); void keyEncToDec(); void encrypt(const UINT8 a[16], UINT8 b[16]); void decrypt(const UINT8 a[16], UINT8 b[16]); - void updateInitVector(UINT8 * initVector = 0); + void updateInitVector(UINT8 * initVector = nullptr); }; #endif // COMPILE_CRYPT_SUPPORT diff --git a/src/modules/setup/SetupWizard.cpp b/src/modules/setup/SetupWizard.cpp index 00519dfe2..8cef633e1 100644 --- a/src/modules/setup/SetupWizard.cpp +++ b/src/modules/setup/SetupWizard.cpp @@ -806,7 +806,7 @@ void SetupWizard::makeLink() 0, KEY_QUERY_VALUE, &hCU) == ERROR_SUCCESS) { - RegQueryValueEx(hCU, TEXT("Desktop"), NULL, &lpType, + RegQueryValueEx(hCU, TEXT("Desktop"), nullptr, &lpType, (unsigned char *)&szLink, &ulSize); RegCloseKey(hCU); } @@ -819,13 +819,13 @@ void SetupWizard::makeLink() szKvircExec.append("\\kvirc.exe"); // Trigger a horrible machinery - CoInitialize(NULL); // we need COM+OLE + CoInitialize(nullptr); // we need COM+OLE // Fiddle with an obscure shell interface IShellLink * psl; // Get a pointer to the IShellLink interface: this is kinda ugly :) - if(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, + if(CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&psl) == S_OK) { diff --git a/src/modules/sharedfileswindow/SharedFilesWindow.h b/src/modules/sharedfileswindow/SharedFilesWindow.h index fd9fd6dee..96de53ef3 100644 --- a/src/modules/sharedfileswindow/SharedFilesWindow.h +++ b/src/modules/sharedfileswindow/SharedFilesWindow.h @@ -57,7 +57,7 @@ class SharedFileEditDialog : public QDialog { Q_OBJECT public: - SharedFileEditDialog(QWidget * par, KviSharedFile * f = 0); + SharedFileEditDialog(QWidget * par, KviSharedFile * f = nullptr); virtual ~SharedFileEditDialog(); QDateTimeEdit * m_pExpireDateTimeEdit; diff --git a/src/modules/snd/libkvisnd.cpp b/src/modules/snd/libkvisnd.cpp index 18f0c599b..4c56ab380 100644 --- a/src/modules/snd/libkvisnd.cpp +++ b/src/modules/snd/libkvisnd.cpp @@ -215,7 +215,7 @@ void KviSoundPlayer::detectSoundSystem() #else #ifdef COMPILE_ESD_SUPPORT esd_format_t format = ESD_BITS16 | ESD_STREAM | ESD_PLAY | ESD_MONO; - int esd_fd = esd_play_stream(format, 8012, NULL, "kvirc"); + int esd_fd = esd_play_stream(format, 8012, nullptr, "kvirc"); if(esd_fd >= 0) { KVI_OPTION_STRING(KviOption_stringSoundSystem) = "esd"; @@ -645,7 +645,7 @@ KviEsdSoundThread::~KviEsdSoundThread() void KviEsdSoundThread::play() { // ESD has a really nice API - if(!esd_play_file(NULL, m_szFileName.toUtf8().data(), 1)) // this is sync.. FIXME: it can't be stopped! + if(!esd_play_file(nullptr, m_szFileName.toUtf8().data(), 1)) // this is sync.. FIXME: it can't be stopped! qDebug("Could not play sound %s! [ESD]", m_szFileName.toUtf8().data()); } diff --git a/src/modules/term/TermWidget.cpp b/src/modules/term/TermWidget.cpp index 57ff5b65b..304daea00 100644 --- a/src/modules/term/TermWidget.cpp +++ b/src/modules/term/TermWidget.cpp @@ -55,8 +55,8 @@ TermWidget::TermWidget(QWidget * par, bool bIsStandalone) g_pTermWidgetList.insert(this); m_bIsStandalone = bIsStandalone; - m_pKonsolePart = 0; - m_pKonsoleWidget = 0; + m_pKonsolePart = nullptr; + m_pKonsoleWidget = nullptr; if(bIsStandalone) { @@ -71,9 +71,9 @@ TermWidget::TermWidget(QWidget * par, bool bIsStandalone) } else { - m_pHBox = 0; - m_pTitleLabel = 0; - m_pCloseButton = 0; + m_pHBox = nullptr; + m_pTitleLabel = nullptr; + m_pCloseButton = nullptr; } setFrameStyle(QFrame::Sunken | QFrame::Panel); @@ -138,8 +138,8 @@ void TermWidget::closeClicked() void TermWidget::konsoleDestroyed() { - m_pKonsoleWidget = 0; - m_pKonsolePart = 0; + m_pKonsoleWidget = nullptr; + m_pKonsolePart = nullptr; hide(); QTimer::singleShot(0, this, SLOT(autoClose())); } diff --git a/src/modules/term/TermWindow.cpp b/src/modules/term/TermWindow.cpp index 93f17852d..9ee745226 100644 --- a/src/modules/term/TermWindow.cpp +++ b/src/modules/term/TermWindow.cpp @@ -42,7 +42,7 @@ TermWindow::TermWindow(const char * name) : KviWindow(KviWindow::Terminal, name) { g_pTermWindowList.insert(this); - m_pTermWidget = 0; + m_pTermWidget = nullptr; m_pTermWidget = new TermWidget(this); } diff --git a/src/modules/theme/ThemeFunctions.h b/src/modules/theme/ThemeFunctions.h index f4b68fdf9..af6ef10de 100644 --- a/src/modules/theme/ThemeFunctions.h +++ b/src/modules/theme/ThemeFunctions.h @@ -35,7 +35,7 @@ namespace ThemeFunctions { - bool installThemePackage(const QString & szThemePackageFileName, QString & szError, QWidget * pDialogParent = 0); + bool installThemePackage(const QString & szThemePackageFileName, QString & szError, QWidget * pDialogParent = nullptr); void getThemeHtmlDescription( QString & szBuffer, @@ -49,7 +49,7 @@ namespace ThemeFunctions const QString & szThemeThemeEngineVersion, const QPixmap & pixScreenshot, int iUniqueIndexInDocument = 0, - KviHtmlDialogData * hd = 0); + KviHtmlDialogData * hd = nullptr); bool makeKVIrcScreenshot(const QString & szSavePngFilePath, bool bMaximizeFrame = false); diff --git a/src/modules/theme/WebThemeInterfaceDialog.h b/src/modules/theme/WebThemeInterfaceDialog.h index 42c906540..3e840daee 100644 --- a/src/modules/theme/WebThemeInterfaceDialog.h +++ b/src/modules/theme/WebThemeInterfaceDialog.h @@ -34,7 +34,7 @@ class WebThemeInterfaceDialog : public KviWebPackageManagementDialog { Q_OBJECT public: - WebThemeInterfaceDialog(QWidget * par = 0); + WebThemeInterfaceDialog(QWidget * par = nullptr); ~WebThemeInterfaceDialog(); private: diff --git a/src/modules/torrent/TorrentInterface.h b/src/modules/torrent/TorrentInterface.h index 276fd46d6..31329b0b0 100644 --- a/src/modules/torrent/TorrentInterface.h +++ b/src/modules/torrent/TorrentInterface.h @@ -136,7 +136,7 @@ public: _interfaceclass##Descriptor::_interfaceclass##Descriptor() \ : TorrentInterfaceDescriptor() \ { \ - m_pInstance = 0; \ + m_pInstance = nullptr; \ m_szName = _name; \ m_szDescription = _description; \ } \ diff --git a/src/modules/url/libkviurl.h b/src/modules/url/libkviurl.h index 59220f27b..cb14edac7 100644 --- a/src/modules/url/libkviurl.h +++ b/src/modules/url/libkviurl.h @@ -109,7 +109,7 @@ class BanFrame : public QFrame { Q_OBJECT public: - BanFrame(QWidget * parent = 0, const char * name = 0, bool banEnable = false); + BanFrame(QWidget * parent = nullptr, const char * name = nullptr, bool banEnable = false); ~BanFrame(); void saveBans(KviConfigurationFile * cfg); diff --git a/src/modules/window/UserWindow.h b/src/modules/window/UserWindow.h index ab8901db8..a7a8cd597 100644 --- a/src/modules/window/UserWindow.h +++ b/src/modules/window/UserWindow.h @@ -37,7 +37,7 @@ public: }; public: - UserWindow(const char * pcName, QString & szIcon, KviConsoleWindow * pConsole = 0, int iCreationFlags = 0); + UserWindow(const char * pcName, QString & szIcon, KviConsoleWindow * pConsole = nullptr, int iCreationFlags = 0); ~UserWindow(); protected: -- cgit v1.3.1-10-gc9f91