summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-06-30 11:51:54 +0200
committerLiang Qi <liang.qi@qt.io>2016-06-30 11:51:54 +0200
commit69b6a9a19a37b990e43e0f9660b9ef687b5dafb3 (patch)
treed2653d124f4d1f2eea594d7e53c682ef7a293628
parent5fbb69b1cad02d58d48e4753e6d246e68fcc6fab (diff)
parent9df15226d3e7cbf8e601432d706c199f6ec3d112 (diff)
downloadqtserialport-69b6a9a19a37b990e43e0f9660b9ef687b5dafb3.tar.gz
Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I576cf803037a823eb4dcbdf5eb0d209735871326
-rw-r--r--dist/changes-5.7.023
-rw-r--r--examples/serialport/blockingmaster/dialog.cpp2
-rw-r--r--examples/serialport/blockingmaster/dialog.h2
-rw-r--r--examples/serialport/blockingmaster/masterthread.h4
-rw-r--r--examples/serialport/blockingslave/dialog.cpp2
-rw-r--r--examples/serialport/blockingslave/dialog.h2
-rw-r--r--examples/serialport/blockingslave/slavethread.h4
-rw-r--r--examples/serialport/creaderasync/serialportreader.h2
-rw-r--r--examples/serialport/cwriterasync/serialportwriter.h2
-rw-r--r--examples/serialport/enumerator/main.cpp6
-rw-r--r--examples/serialport/master/dialog.cpp5
-rw-r--r--examples/serialport/master/dialog.h2
-rw-r--r--examples/serialport/slave/dialog.cpp5
-rw-r--r--examples/serialport/slave/dialog.h2
-rw-r--r--examples/serialport/terminal/console.h10
-rw-r--r--examples/serialport/terminal/mainwindow.h2
-rw-r--r--examples/serialport/terminal/settingsdialog.h2
-rw-r--r--src/serialport/qserialport.h6
-rw-r--r--src/serialport/qserialport_unix.cpp6
-rw-r--r--src/serialport/qserialport_win.cpp18
-rw-r--r--src/serialport/qserialportinfo.cpp2
-rw-r--r--src/serialport/qserialportinfo_freebsd.cpp18
-rw-r--r--src/serialport/qserialportinfo_win.cpp12
-rw-r--r--src/serialport/qtudev_p.h2
-rw-r--r--tests/auto/qserialport/tst_qserialport.cpp2
25 files changed, 80 insertions, 63 deletions
diff --git a/dist/changes-5.7.0 b/dist/changes-5.7.0
index 27e9ddb..efe98ab 100644
--- a/dist/changes-5.7.0
+++ b/dist/changes-5.7.0
@@ -1,7 +1,7 @@
-QtSerialPort 5.7 introduces a few new features and improvements as well as
-bugfixes over the 5.6.x series. For more details, refer to the online
-documentation included in this distribution. The documentation is also available
-online:
+Qt 5.7 introduces many new features and improvements as well as bugfixes
+over the 5.6.x series. Also, there is a change in the licensing terms.
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
http://doc.qt.io/qt-5/index.html
@@ -17,6 +17,21 @@ Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change.
****************************************************************************
+* Important License Changes *
+****************************************************************************
+
+ This module is no longer available under LGPLv2.1. The libraries are
+ now available under the following licenses:
+ * Commercial License
+ * GNU General Public License v2.0 (LICENSE.GPL2) and later
+ * GNU Lesser General Public License v3.0 (LICENSE.LGPL3)
+
+ The tools are now available under the following licenses:
+ * Commercial License
+ * GNU General Public License 3.0 (LICENSE.GPL3) with exceptions
+ described in The Qt Company GPL Exception 1.0 (LICENSE.GPL3-EXCEPT)
+
+****************************************************************************
* Library *
****************************************************************************
diff --git a/examples/serialport/blockingmaster/dialog.cpp b/examples/serialport/blockingmaster/dialog.cpp
index c1ca850..08403c3 100644
--- a/examples/serialport/blockingmaster/dialog.cpp
+++ b/examples/serialport/blockingmaster/dialog.cpp
@@ -81,7 +81,7 @@ Dialog::Dialog(QWidget *parent)
waitResponseSpinBox->setRange(0, 10000);
waitResponseSpinBox->setValue(1000);
- QGridLayout *mainLayout = new QGridLayout;
+ auto mainLayout = new QGridLayout;
mainLayout->addWidget(serialPortLabel, 0, 0);
mainLayout->addWidget(serialPortComboBox, 0, 1);
mainLayout->addWidget(waitResponseLabel, 1, 0);
diff --git a/examples/serialport/blockingmaster/dialog.h b/examples/serialport/blockingmaster/dialog.h
index 4f0e331..aff8177 100644
--- a/examples/serialport/blockingmaster/dialog.h
+++ b/examples/serialport/blockingmaster/dialog.h
@@ -70,7 +70,7 @@ class Dialog : public QDialog
Q_OBJECT
public:
- Dialog(QWidget *parent = 0);
+ explicit Dialog(QWidget *parent = nullptr);
private slots:
void transaction();
diff --git a/examples/serialport/blockingmaster/masterthread.h b/examples/serialport/blockingmaster/masterthread.h
index ffb6602..f23559f 100644
--- a/examples/serialport/blockingmaster/masterthread.h
+++ b/examples/serialport/blockingmaster/masterthread.h
@@ -61,11 +61,11 @@ class MasterThread : public QThread
Q_OBJECT
public:
- MasterThread(QObject *parent = 0);
+ explicit MasterThread(QObject *parent = nullptr);
~MasterThread();
void transaction(const QString &portName, int waitTimeout, const QString &request);
- void run();
+ void run() Q_DECL_OVERRIDE;
signals:
void response(const QString &s);
diff --git a/examples/serialport/blockingslave/dialog.cpp b/examples/serialport/blockingslave/dialog.cpp
index 8550773..3bfd419 100644
--- a/examples/serialport/blockingslave/dialog.cpp
+++ b/examples/serialport/blockingslave/dialog.cpp
@@ -81,7 +81,7 @@ Dialog::Dialog(QWidget *parent)
for (const QSerialPortInfo &info : infos)
serialPortComboBox->addItem(info.portName());
- QGridLayout *mainLayout = new QGridLayout;
+ auto mainLayout = new QGridLayout;
mainLayout->addWidget(serialPortLabel, 0, 0);
mainLayout->addWidget(serialPortComboBox, 0, 1);
mainLayout->addWidget(waitRequestLabel, 1, 0);
diff --git a/examples/serialport/blockingslave/dialog.h b/examples/serialport/blockingslave/dialog.h
index 4e01656..0e59410 100644
--- a/examples/serialport/blockingslave/dialog.h
+++ b/examples/serialport/blockingslave/dialog.h
@@ -70,7 +70,7 @@ class Dialog : public QDialog
Q_OBJECT
public:
- Dialog(QWidget *parent = 0);
+ explicit Dialog(QWidget *parent = nullptr);
private slots:
void startSlave();
diff --git a/examples/serialport/blockingslave/slavethread.h b/examples/serialport/blockingslave/slavethread.h
index d678a7b..9a15e24 100644
--- a/examples/serialport/blockingslave/slavethread.h
+++ b/examples/serialport/blockingslave/slavethread.h
@@ -61,11 +61,11 @@ class SlaveThread : public QThread
Q_OBJECT
public:
- SlaveThread(QObject *parent = 0);
+ explicit SlaveThread(QObject *parent = nullptr);
~SlaveThread();
void startSlave(const QString &portName, int waitTimeout, const QString &response);
- void run();
+ void run() Q_DECL_OVERRIDE;
signals:
void request(const QString &s);
diff --git a/examples/serialport/creaderasync/serialportreader.h b/examples/serialport/creaderasync/serialportreader.h
index 6c0a2c5..6698087 100644
--- a/examples/serialport/creaderasync/serialportreader.h
+++ b/examples/serialport/creaderasync/serialportreader.h
@@ -69,7 +69,7 @@ class SerialPortReader : public QObject
Q_OBJECT
public:
- SerialPortReader(QSerialPort *serialPort, QObject *parent = 0);
+ explicit SerialPortReader(QSerialPort *serialPort, QObject *parent = nullptr);
~SerialPortReader();
private slots:
diff --git a/examples/serialport/cwriterasync/serialportwriter.h b/examples/serialport/cwriterasync/serialportwriter.h
index a4bc32e..9fd305f 100644
--- a/examples/serialport/cwriterasync/serialportwriter.h
+++ b/examples/serialport/cwriterasync/serialportwriter.h
@@ -69,7 +69,7 @@ class SerialPortWriter : public QObject
Q_OBJECT
public:
- SerialPortWriter(QSerialPort *serialPort, QObject *parent = 0);
+ explicit SerialPortWriter(QSerialPort *serialPort, QObject *parent = nullptr);
~SerialPortWriter();
void write(const QByteArray &writeData);
diff --git a/examples/serialport/enumerator/main.cpp b/examples/serialport/enumerator/main.cpp
index fa925da..d7622a2 100644
--- a/examples/serialport/enumerator/main.cpp
+++ b/examples/serialport/enumerator/main.cpp
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
{
QApplication a(argc, argv);
- QVBoxLayout *layout = new QVBoxLayout;
+ auto layout = new QVBoxLayout;
const auto infos = QSerialPortInfo::availablePorts();
for (const QSerialPortInfo &info : infos) {
@@ -75,11 +75,11 @@ int main(int argc, char *argv[])
+ QObject::tr("Product Identifier: ") + (info.hasProductIdentifier() ? QString::number(info.productIdentifier(), 16) : QString()) + "\n"
+ QObject::tr("Busy: ") + (info.isBusy() ? QObject::tr("Yes") : QObject::tr("No")) + "\n";
- QLabel *label = new QLabel(s);
+ auto label = new QLabel(s);
layout->addWidget(label);
}
- QWidget *workPage = new QWidget;
+ auto workPage = new QWidget;
workPage->setLayout(layout);
QScrollArea area;
diff --git a/examples/serialport/master/dialog.cpp b/examples/serialport/master/dialog.cpp
index 2c92404..4bed08b 100644
--- a/examples/serialport/master/dialog.cpp
+++ b/examples/serialport/master/dialog.cpp
@@ -74,13 +74,14 @@ Dialog::Dialog(QWidget *parent)
, statusLabel(new QLabel(tr("Status: Not running.")))
, runButton(new QPushButton(tr("Start")))
{
- foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
+ const auto infos = QSerialPortInfo::availablePorts();
+ for (const QSerialPortInfo &info : infos)
serialPortComboBox->addItem(info.portName());
waitResponseSpinBox->setRange(0, 10000);
waitResponseSpinBox->setValue(100);
- QGridLayout *mainLayout = new QGridLayout;
+ auto mainLayout = new QGridLayout;
mainLayout->addWidget(serialPortLabel, 0, 0);
mainLayout->addWidget(serialPortComboBox, 0, 1);
mainLayout->addWidget(waitResponseLabel, 1, 0);
diff --git a/examples/serialport/master/dialog.h b/examples/serialport/master/dialog.h
index b981943..0bc1241 100644
--- a/examples/serialport/master/dialog.h
+++ b/examples/serialport/master/dialog.h
@@ -73,7 +73,7 @@ class Dialog : public QDialog
Q_OBJECT
public:
- Dialog(QWidget *parent = 0);
+ explicit Dialog(QWidget *parent = nullptr);
private slots:
void sendRequest();
diff --git a/examples/serialport/slave/dialog.cpp b/examples/serialport/slave/dialog.cpp
index 5bc0561..d801052 100644
--- a/examples/serialport/slave/dialog.cpp
+++ b/examples/serialport/slave/dialog.cpp
@@ -77,10 +77,11 @@ Dialog::Dialog(QWidget *parent)
waitRequestSpinBox->setRange(0, 10000);
waitRequestSpinBox->setValue(20);
- foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
+ const auto infos = QSerialPortInfo::availablePorts();
+ for (const QSerialPortInfo &info : infos)
serialPortComboBox->addItem(info.portName());
- QGridLayout *mainLayout = new QGridLayout;
+ auto mainLayout = new QGridLayout;
mainLayout->addWidget(serialPortLabel, 0, 0);
mainLayout->addWidget(serialPortComboBox, 0, 1);
mainLayout->addWidget(waitRequestLabel, 1, 0);
diff --git a/examples/serialport/slave/dialog.h b/examples/serialport/slave/dialog.h
index d03c123..0405cf8 100644
--- a/examples/serialport/slave/dialog.h
+++ b/examples/serialport/slave/dialog.h
@@ -73,7 +73,7 @@ class Dialog : public QDialog
Q_OBJECT
public:
- Dialog(QWidget *parent = 0);
+ explicit Dialog(QWidget *parent = nullptr);
private slots:
void startSlave();
diff --git a/examples/serialport/terminal/console.h b/examples/serialport/terminal/console.h
index 03b0fb1..0674ded 100644
--- a/examples/serialport/terminal/console.h
+++ b/examples/serialport/terminal/console.h
@@ -62,17 +62,17 @@ signals:
void getData(const QByteArray &data);
public:
- explicit Console(QWidget *parent = 0);
+ explicit Console(QWidget *parent = nullptr);
void putData(const QByteArray &data);
void setLocalEchoEnabled(bool set);
protected:
- virtual void keyPressEvent(QKeyEvent *e);
- virtual void mousePressEvent(QMouseEvent *e);
- virtual void mouseDoubleClickEvent(QMouseEvent *e);
- virtual void contextMenuEvent(QContextMenuEvent *e);
+ void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void mouseDoubleClickEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *e) Q_DECL_OVERRIDE;
private:
bool localEchoEnabled;
diff --git a/examples/serialport/terminal/mainwindow.h b/examples/serialport/terminal/mainwindow.h
index 9e8c1c1..b792895 100644
--- a/examples/serialport/terminal/mainwindow.h
+++ b/examples/serialport/terminal/mainwindow.h
@@ -76,7 +76,7 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
- explicit MainWindow(QWidget *parent = 0);
+ explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
diff --git a/examples/serialport/terminal/settingsdialog.h b/examples/serialport/terminal/settingsdialog.h
index da17565..ea249c1 100644
--- a/examples/serialport/terminal/settingsdialog.h
+++ b/examples/serialport/terminal/settingsdialog.h
@@ -87,7 +87,7 @@ public:
bool localEchoEnabled;
};
- explicit SettingsDialog(QWidget *parent = 0);
+ explicit SettingsDialog(QWidget *parent = nullptr);
~SettingsDialog();
Settings settings() const;
diff --git a/src/serialport/qserialport.h b/src/serialport/qserialport.h
index 4772724..3289ca1 100644
--- a/src/serialport/qserialport.h
+++ b/src/serialport/qserialport.h
@@ -200,9 +200,9 @@ public:
#endif
#endif
- explicit QSerialPort(QObject *parent = Q_NULLPTR);
- explicit QSerialPort(const QString &name, QObject *parent = Q_NULLPTR);
- explicit QSerialPort(const QSerialPortInfo &info, QObject *parent = Q_NULLPTR);
+ explicit QSerialPort(QObject *parent = nullptr);
+ explicit QSerialPort(const QString &name, QObject *parent = nullptr);
+ explicit QSerialPort(const QSerialPortInfo &info, QObject *parent = nullptr);
virtual ~QSerialPort();
void setPortName(const QString &name);
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp
index 7078040..acc53c8 100644
--- a/src/serialport/qserialport_unix.cpp
+++ b/src/serialport/qserialport_unix.cpp
@@ -251,14 +251,14 @@ void QSerialPortPrivate::close()
#endif
delete readNotifier;
- readNotifier = Q_NULLPTR;
+ readNotifier = nullptr;
delete writeNotifier;
- writeNotifier = Q_NULLPTR;
+ writeNotifier = nullptr;
qt_safe_close(descriptor);
- lockFileScopedPointer.reset(Q_NULLPTR);
+ lockFileScopedPointer.reset(nullptr);
descriptor = -1;
pendingBytesWritten = 0;
diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp
index b41af02..7cbb81d 100644
--- a/src/serialport/qserialport_win.cpp
+++ b/src/serialport/qserialport_win.cpp
@@ -94,7 +94,7 @@ bool QSerialPortPrivate::open(QIODevice::OpenMode mode)
desiredAccess |= GENERIC_WRITE;
handle = ::CreateFile(reinterpret_cast<const wchar_t*>(systemLocation.utf16()),
- desiredAccess, 0, Q_NULLPTR, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, Q_NULLPTR);
+ desiredAccess, 0, nullptr, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, nullptr);
if (handle == INVALID_HANDLE_VALUE) {
setError(getSystemError());
@@ -113,10 +113,10 @@ void QSerialPortPrivate::close()
::CancelIo(handle);
delete notifier;
- notifier = Q_NULLPTR;
+ notifier = nullptr;
delete startAsyncWriteTimer;
- startAsyncWriteTimer = Q_NULLPTR;
+ startAsyncWriteTimer = nullptr;
communicationStarted = false;
readStarted = false;
@@ -154,9 +154,9 @@ QSerialPort::PinoutSignals QSerialPortPrivate::pinoutSignals()
ret |= QSerialPort::DataCarrierDetectSignal;
DWORD bytesReturned = 0;
- if (!::DeviceIoControl(handle, IOCTL_SERIAL_GET_DTRRTS, Q_NULLPTR, 0,
+ if (!::DeviceIoControl(handle, IOCTL_SERIAL_GET_DTRRTS, nullptr, 0,
&modemStat, sizeof(modemStat),
- &bytesReturned, Q_NULLPTR)) {
+ &bytesReturned, nullptr)) {
setError(getSystemError());
return ret;
}
@@ -507,7 +507,7 @@ bool QSerialPortPrivate::startAsyncRead()
}
::ZeroMemory(&readCompletionOverlapped, sizeof(readCompletionOverlapped));
- if (::ReadFile(handle, readChunkBuffer.data(), bytesToRead, Q_NULLPTR, &readCompletionOverlapped)) {
+ if (::ReadFile(handle, readChunkBuffer.data(), bytesToRead, nullptr, &readCompletionOverlapped)) {
readStarted = true;
return true;
}
@@ -534,7 +534,7 @@ bool QSerialPortPrivate::_q_startAsyncWrite()
const int writeBytes = writeBuffer.nextDataBlockSize();
::ZeroMemory(&writeCompletionOverlapped, sizeof(writeCompletionOverlapped));
if (!::WriteFile(handle, writeBuffer.readPointer(),
- writeBytes, Q_NULLPTR, &writeCompletionOverlapped)) {
+ writeBytes, nullptr, &writeCompletionOverlapped)) {
QSerialPortErrorInfo error = getSystemError();
if (error.errorCode != QSerialPort::NoError) {
@@ -598,7 +598,7 @@ OVERLAPPED *QSerialPortPrivate::waitForNotified(int msecs)
OVERLAPPED *overlapped = notifier->waitForAnyNotified(msecs);
if (!overlapped) {
setError(getSystemError(WAIT_TIMEOUT));
- return Q_NULLPTR;
+ return nullptr;
}
return overlapped;
}
@@ -606,7 +606,7 @@ OVERLAPPED *QSerialPortPrivate::waitForNotified(int msecs)
qint64 QSerialPortPrivate::queuedBytesCount(QSerialPort::Direction direction) const
{
COMSTAT comstat;
- if (::ClearCommError(handle, Q_NULLPTR, &comstat) == 0)
+ if (::ClearCommError(handle, nullptr, &comstat) == 0)
return -1;
return (direction == QSerialPort::Input)
? comstat.cbInQue
diff --git a/src/serialport/qserialportinfo.cpp b/src/serialport/qserialportinfo.cpp
index acd0179..2b69966 100644
--- a/src/serialport/qserialportinfo.cpp
+++ b/src/serialport/qserialportinfo.cpp
@@ -79,7 +79,7 @@ QSerialPortInfo::QSerialPortInfo()
Constructs a copy of \a other.
*/
QSerialPortInfo::QSerialPortInfo(const QSerialPortInfo &other)
- : d_ptr(other.d_ptr ? new QSerialPortInfoPrivate(*other.d_ptr) : Q_NULLPTR)
+ : d_ptr(other.d_ptr ? new QSerialPortInfoPrivate(*other.d_ptr) : nullptr)
{
}
diff --git a/src/serialport/qserialportinfo_freebsd.cpp b/src/serialport/qserialportinfo_freebsd.cpp
index 291cfac..066290d 100644
--- a/src/serialport/qserialportinfo_freebsd.cpp
+++ b/src/serialport/qserialportinfo_freebsd.cpp
@@ -106,7 +106,7 @@ struct NodeInfo
static QVector<int> mibFromName(const QString &name)
{
size_t mibsize = 0;
- if (::sysctlnametomib(name.toLocal8Bit().constData(), Q_NULLPTR, &mibsize) < 0
+ if (::sysctlnametomib(name.toLocal8Bit().constData(), nullptr, &mibsize) < 0
|| mibsize == 0) {
return QVector<int>();
}
@@ -126,11 +126,11 @@ static QVector<int> nextOid(const QVector<int> &previousOid)
mib.append(code);
size_t requiredLength = 0;
- if (::sysctl(&mib[0], mib.count(), Q_NULLPTR, &requiredLength, Q_NULLPTR, 0) < 0)
+ if (::sysctl(&mib[0], mib.count(), nullptr, &requiredLength, nullptr, 0) < 0)
return QVector<int>();
const size_t oidLength = requiredLength / sizeof(int);
QVector<int> oid(oidLength, 0);
- if (::sysctl(&mib[0], mib.count(), &oid[0], &requiredLength, Q_NULLPTR, 0) < 0)
+ if (::sysctl(&mib[0], mib.count(), &oid[0], &requiredLength, nullptr, 0) < 0)
return QVector<int>();
if (previousOid.first() != oid.first())
@@ -149,27 +149,27 @@ static NodeInfo nodeForOid(const QVector<int> &oid)
// query node name
size_t requiredLength = 0;
- if (::sysctl(&mib[0], mib.count(), Q_NULLPTR, &requiredLength, Q_NULLPTR, 0) < 0)
+ if (::sysctl(&mib[0], mib.count(), nullptr, &requiredLength, nullptr, 0) < 0)
return NodeInfo();
QByteArray name(requiredLength, 0);
- if (::sysctl(&mib[0], mib.count(), name.data(), &requiredLength, Q_NULLPTR, 0) < 0)
+ if (::sysctl(&mib[0], mib.count(), name.data(), &requiredLength, nullptr, 0) < 0)
return NodeInfo();
// query node value
requiredLength = 0;
- if (::sysctl(&oid[0], oid.count(), Q_NULLPTR, &requiredLength, Q_NULLPTR, 0) < 0)
+ if (::sysctl(&oid[0], oid.count(), nullptr, &requiredLength, nullptr, 0) < 0)
return NodeInfo();
QByteArray value(requiredLength, 0);
- if (::sysctl(&oid[0], oid.count(), value.data(), &requiredLength, Q_NULLPTR, 0) < 0)
+ if (::sysctl(&oid[0], oid.count(), value.data(), &requiredLength, nullptr, 0) < 0)
return NodeInfo();
// query value format
mib[1] = 4; // Magic undocumented code
requiredLength = 0;
- if (::sysctl(&mib[0], mib.count(), Q_NULLPTR, &requiredLength, Q_NULLPTR, 0) < 0)
+ if (::sysctl(&mib[0], mib.count(), nullptr, &requiredLength, nullptr, 0) < 0)
return NodeInfo();
QByteArray buf(requiredLength, 0);
- if (::sysctl(&mib[0], mib.count(), buf.data(), &requiredLength, Q_NULLPTR, 0) < 0)
+ if (::sysctl(&mib[0], mib.count(), buf.data(), &requiredLength, nullptr, 0) < 0)
return NodeInfo();
QDataStream in(buf);
diff --git a/src/serialport/qserialportinfo_win.cpp b/src/serialport/qserialportinfo_win.cpp
index 4a80325..398666e 100644
--- a/src/serialport/qserialportinfo_win.cpp
+++ b/src/serialport/qserialportinfo_win.cpp
@@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
static QStringList portNamesFromHardwareDeviceMap()
{
- HKEY hKey = Q_NULLPTR;
+ HKEY hKey = nullptr;
if (::RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"HARDWARE\\DEVICEMAP\\SERIALCOMM", 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
return QStringList();
@@ -82,7 +82,7 @@ static QStringList portNamesFromHardwareDeviceMap()
for (;;) {
DWORD requiredValueNameChars = MaximumValueNameInChars;
const LONG ret = ::RegEnumValue(hKey, index, &outputValueName[0], &requiredValueNameChars,
- Q_NULLPTR, Q_NULLPTR, reinterpret_cast<PBYTE>(&outputBuffer[0]), &bytesRequired);
+ nullptr, nullptr, reinterpret_cast<PBYTE>(&outputBuffer[0]), &bytesRequired);
if (ret == ERROR_MORE_DATA) {
outputBuffer.resize(bytesRequired / sizeof(wchar_t) + 2, 0);
} else if (ret == ERROR_SUCCESS) {
@@ -166,7 +166,7 @@ static QString devicePortName(HDEVINFO deviceInfoSet, PSP_DEVINFO_DATA deviceInf
std::vector<wchar_t> outputBuffer(MAX_PATH + 1, 0);
DWORD bytesRequired = MAX_PATH;
for (;;) {
- const LONG ret = ::RegQueryValueEx(key, keyTokens[i], Q_NULLPTR, &dataType,
+ const LONG ret = ::RegQueryValueEx(key, keyTokens[i], nullptr, &dataType,
reinterpret_cast<PBYTE>(&outputBuffer[0]), &bytesRequired);
if (ret == ERROR_MORE_DATA) {
outputBuffer.resize(bytesRequired / sizeof(wchar_t) + 2, 0);
@@ -304,7 +304,7 @@ QList<QSerialPortInfo> QSerialPortInfo::availablePorts()
QList<QSerialPortInfo> serialPortInfoList;
for (int i = 0; i < SetupTokensCount; ++i) {
- const HDEVINFO deviceInfoSet = ::SetupDiGetClassDevs(&setupTokens[i].guid, Q_NULLPTR, Q_NULLPTR, setupTokens[i].flags);
+ const HDEVINFO deviceInfoSet = ::SetupDiGetClassDevs(&setupTokens[i].guid, nullptr, nullptr, setupTokens[i].flags);
if (deviceInfoSet == INVALID_HANDLE_VALUE)
return serialPortInfoList;
@@ -362,7 +362,7 @@ QList<QSerialPortInfo> QSerialPortInfo::availablePorts()
bool QSerialPortInfo::isBusy() const
{
const HANDLE handle = ::CreateFile(reinterpret_cast<const wchar_t*>(systemLocation().utf16()),
- GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, Q_NULLPTR);
+ GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr);
if (handle == INVALID_HANDLE_VALUE) {
if (::GetLastError() == ERROR_ACCESS_DENIED)
@@ -378,7 +378,7 @@ bool QSerialPortInfo::isBusy() const
bool QSerialPortInfo::isValid() const
{
const HANDLE handle = ::CreateFile(reinterpret_cast<const wchar_t*>(systemLocation().utf16()),
- GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, Q_NULLPTR);
+ GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr);
if (handle == INVALID_HANDLE_VALUE) {
if (::GetLastError() != ERROR_ACCESS_DENIED)
diff --git a/src/serialport/qtudev_p.h b/src/serialport/qtudev_p.h
index aad2dfe..af2dab2 100644
--- a/src/serialport/qtudev_p.h
+++ b/src/serialport/qtudev_p.h
@@ -74,7 +74,7 @@ struct udev;
#define udev_list_entry_foreach(list_entry, first_entry) \
for (list_entry = first_entry; \
- list_entry != NULL; \
+ list_entry != nullptr; \
list_entry = udev_list_entry_get_next(list_entry))
struct udev_device;
diff --git a/tests/auto/qserialport/tst_qserialport.cpp b/tests/auto/qserialport/tst_qserialport.cpp
index b9d41b8..24c0134 100644
--- a/tests/auto/qserialport/tst_qserialport.cpp
+++ b/tests/auto/qserialport/tst_qserialport.cpp
@@ -995,7 +995,7 @@ private:
void tst_QSerialPort::synchronousReadWriteAfterAsynchronousReadWrite()
{
MasterTransactor master(m_senderPortName);
- SlaveTransactor *slave = new SlaveTransactor(m_receiverPortName);
+ auto slave = new SlaveTransactor(m_receiverPortName);
QThread thread;
slave->moveToThread(&thread);