diff options
author | Popkornium18 <mail@popkornium18.de> | 2020-07-02 00:58:10 +0300 |
---|---|---|
committer | Popkornium18 <mail@popkornium18.de> | 2020-07-02 01:55:41 +0300 |
commit | e098a038b6242b4d2dd752753d2b18fe88fb59af (patch) | |
tree | 3bcad944810e8f42782d16bc68e05745293484c8 | |
parent | 410837526c940f5ad1c84d60960cdbcb40d97019 (diff) |
REFAC(tests): replace NULL with nullptr
This changes all occurances of NULL in the tests source
dir to nullptr. Additionally explicit comparisons with NULL were
removed.
-rw-r--r-- | src/tests/Emit.cpp | 2 | ||||
-rw-r--r-- | src/tests/Lock.cpp | 2 | ||||
-rw-r--r-- | src/tests/OverlayTest.cpp | 12 | ||||
-rw-r--r-- | src/tests/Resample.cpp | 2 | ||||
-rw-r--r-- | src/tests/TestCrypt/TestCrypt.cpp | 2 | ||||
-rw-r--r-- | src/tests/TestLink.cpp | 14 |
6 files changed, 17 insertions, 17 deletions
diff --git a/src/tests/Emit.cpp b/src/tests/Emit.cpp index 6d0e7660f..533c31fda 100644 --- a/src/tests/Emit.cpp +++ b/src/tests/Emit.cpp @@ -6,7 +6,7 @@ class Slotter : public QObject { Q_OBJECT; public: - Slotter(QObject *p = NULL) : QObject(p) {}; + Slotter(QObject *p = nullptr) : QObject(p) {}; public Q_SLOTS: virtual void slottest(int &res) { res+= 1; diff --git a/src/tests/Lock.cpp b/src/tests/Lock.cpp index 6f25c1a56..22b83d0ea 100644 --- a/src/tests/Lock.cpp +++ b/src/tests/Lock.cpp @@ -49,7 +49,7 @@ class PosixLock { }; PosixLock::PosixLock() { - pthread_mutex_init(&m, NULL); + pthread_mutex_init(&m, nullptr); } void PosixLock::lock() { diff --git a/src/tests/OverlayTest.cpp b/src/tests/OverlayTest.cpp index 1665da844..f909af245 100644 --- a/src/tests/OverlayTest.cpp +++ b/src/tests/OverlayTest.cpp @@ -47,12 +47,12 @@ class OverlayWidget : public QWidget { void error(QLocalSocket::LocalSocketError); void update(); public: - OverlayWidget(QWidget *p = NULL); + OverlayWidget(QWidget *p = nullptr); }; OverlayWidget::OverlayWidget(QWidget *p) : QWidget(p) { - qlsSocket = NULL; - smMem = NULL; + qlsSocket = nullptr; + smMem = nullptr; uiWidth = uiHeight = 0; setFocusPolicy(Qt::StrongFocus); @@ -123,10 +123,10 @@ void OverlayWidget::detach() { if (qlsSocket) { qlsSocket->abort(); qlsSocket->deleteLater(); - qlsSocket = NULL; + qlsSocket = nullptr; } if (smMem) { - smMem = NULL; + smMem = nullptr; } } @@ -230,7 +230,7 @@ void OverlayWidget::readyRead() { if (! smMem->data()) { qWarning() << "SHMEM FAIL"; delete smMem; - smMem = NULL; + smMem = nullptr; } else { qWarning() << "SHMEM" << smMem->size(); } diff --git a/src/tests/Resample.cpp b/src/tests/Resample.cpp index 7cc693ebc..56a9d7f82 100644 --- a/src/tests/Resample.cpp +++ b/src/tests/Resample.cpp @@ -94,7 +94,7 @@ int main(int argc, char **argv) { pfOutput[i] = 0; - IppsResamplingPolyphaseFixed_32f *pSpec = NULL; + IppsResamplingPolyphaseFixed_32f *pSpec = nullptr; ippsResamplePolyphaseFixedInitAlloc_32f(&pSpec, iMicFreq, iSampleRate, 2*history, 0.90f, 8.0f, ippAlgHintFast); t.restart(); diff --git a/src/tests/TestCrypt/TestCrypt.cpp b/src/tests/TestCrypt/TestCrypt.cpp index 1021f8aec..2eb9e3e8c 100644 --- a/src/tests/TestCrypt/TestCrypt.cpp +++ b/src/tests/TestCrypt/TestCrypt.cpp @@ -153,7 +153,7 @@ void TestCrypt::testvectors() { cs.setKey(rawkey_str, rawkey_str, rawkey_str); unsigned char tag[16]; - QVERIFY(cs.ocb_encrypt(NULL, NULL, 0, rawkey, tag)); + QVERIFY(cs.ocb_encrypt(nullptr, nullptr, 0, rawkey, tag)); const unsigned char blanktag[AES_BLOCK_SIZE] = {0xBF,0x31,0x08,0x13,0x07,0x73,0xAD,0x5E,0xC7,0x0E,0xC6,0x9E,0x78,0x75,0xA7,0xB0}; for (int i=0;i<AES_BLOCK_SIZE;i++) diff --git a/src/tests/TestLink.cpp b/src/tests/TestLink.cpp index 9249f9315..09996bdf8 100644 --- a/src/tests/TestLink.cpp +++ b/src/tests/TestLink.cpp @@ -40,20 +40,20 @@ struct LinkedMem { wchar_t description[2048]; }; -LinkedMem *lm = NULL; +LinkedMem *lm = nullptr; void initMumble() { #ifdef WIN32 HANDLE hMapObject = OpenFileMappingW(FILE_MAP_ALL_ACCESS, FALSE, L"MumbleLink"); - if (hMapObject == NULL) + if (!hMapObject) return; lm = (LinkedMem *) MapViewOfFile(hMapObject, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(LinkedMem)); - if (lm == NULL) { + if (!lm) { CloseHandle(hMapObject); - hMapObject = NULL; + hMapObject = nullptr; return; } #else @@ -66,10 +66,10 @@ void initMumble() { return; } - lm = (LinkedMem *)(mmap(NULL, sizeof(struct LinkedMem), PROT_READ | PROT_WRITE, MAP_SHARED, shmfd,0)); + lm = (LinkedMem *)(mmap(nullptr, sizeof(struct LinkedMem), PROT_READ | PROT_WRITE, MAP_SHARED, shmfd,0)); if (lm == (void *)(-1)) { - lm = NULL; + lm = nullptr; return; } #endif @@ -133,7 +133,7 @@ int main(int argc, char **argv) { QCoreApplication a(argc, argv); initMumble(); - if (lm == NULL) + if (!lm) qFatal("No Link!"); lm->fAvatarPosition[0]; |