From e098a038b6242b4d2dd752753d2b18fe88fb59af Mon Sep 17 00:00:00 2001 From: Popkornium18 Date: Wed, 1 Jul 2020 23:58:10 +0200 Subject: 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. --- src/tests/Emit.cpp | 2 +- src/tests/Lock.cpp | 2 +- src/tests/OverlayTest.cpp | 12 ++++++------ src/tests/Resample.cpp | 2 +- src/tests/TestCrypt/TestCrypt.cpp | 2 +- src/tests/TestLink.cpp | 14 +++++++------- 6 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src/tests') 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;ifAvatarPosition[0]; -- cgit v1.2.3