diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2017-09-28 13:22:28 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2017-10-12 08:44:59 +0000 |
commit | 42b0324d3c37d9bde5e06e183ec770c7556341c2 (patch) | |
tree | 21a03b3c8bbcbb8503993915c07104eeb721581a /src/serialport/qserialport_p.h | |
parent | 07e1fc7bb93dc4c306d8e64f4cb88d42177cba2e (diff) | |
download | qtserialport-42b0324d3c37d9bde5e06e183ec770c7556341c2.tar.gz |
Use C++11 member class initialization
Change-Id: I427b993a3a71f199029a8956cdf0dc2c98f0e444
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'src/serialport/qserialport_p.h')
-rw-r--r-- | src/serialport/qserialport_p.h | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/serialport/qserialport_p.h b/src/serialport/qserialport_p.h index 0e4f8bd..b0955ae 100644 --- a/src/serialport/qserialport_p.h +++ b/src/serialport/qserialport_p.h @@ -117,7 +117,7 @@ class QSerialPortErrorInfo public: explicit QSerialPortErrorInfo(QSerialPort::SerialPortError newErrorCode = QSerialPort::UnknownError, const QString &newErrorString = QString()); - QSerialPort::SerialPortError errorCode; + QSerialPort::SerialPortError errorCode = QSerialPort::UnknownError; QString errorString; }; @@ -164,17 +164,17 @@ public: static QList<qint32> standardBaudRates(); - qint64 readBufferMaxSize; - QSerialPort::SerialPortError error; + qint64 readBufferMaxSize = 0; + QSerialPort::SerialPortError error = QSerialPort::NoError; QString systemLocation; - qint32 inputBaudRate; - qint32 outputBaudRate; - QSerialPort::DataBits dataBits; - QSerialPort::Parity parity; - QSerialPort::StopBits stopBits; - QSerialPort::FlowControl flowControl; - bool settingsRestoredOnClose; - bool isBreakEnabled; + qint32 inputBaudRate = QSerialPort::Baud9600; + qint32 outputBaudRate = QSerialPort::Baud9600; + QSerialPort::DataBits dataBits = QSerialPort::Data8; + QSerialPort::Parity parity = QSerialPort::NoParity; + QSerialPort::StopBits stopBits = QSerialPort::OneStop; + QSerialPort::FlowControl flowControl = QSerialPort::NoFlowControl; + bool settingsRestoredOnClose = true; + bool isBreakEnabled = false; bool startAsyncRead(); @@ -199,18 +199,18 @@ public: DCB restoredDcb; COMMTIMEOUTS currentCommTimeouts; COMMTIMEOUTS restoredCommTimeouts; - HANDLE handle; + HANDLE handle = INVALID_HANDLE_VALUE; QByteArray readChunkBuffer; QByteArray writeChunkBuffer; - bool communicationStarted; - bool writeStarted; - bool readStarted; - QWinOverlappedIoNotifier *notifier; - QTimer *startAsyncWriteTimer; + bool communicationStarted = false; + bool writeStarted = false; + bool readStarted = false; + QWinOverlappedIoNotifier *notifier = nullptr; + QTimer *startAsyncWriteTimer = nullptr; OVERLAPPED communicationOverlapped; OVERLAPPED readCompletionOverlapped; OVERLAPPED writeCompletionOverlapped; - DWORD triggeredEventMask; + DWORD triggeredEventMask = 0; #elif defined(Q_OS_UNIX) @@ -243,20 +243,20 @@ public: bool completeAsyncWrite(); struct termios restoredTermios; - int descriptor; + int descriptor = -1; - QSocketNotifier *readNotifier; - QSocketNotifier *writeNotifier; + QSocketNotifier *readNotifier = nullptr; + QSocketNotifier *writeNotifier = nullptr; - bool readPortNotifierCalled; - bool readPortNotifierState; - bool readPortNotifierStateSet; + bool readPortNotifierCalled = false; + bool readPortNotifierState = false; + bool readPortNotifierStateSet = false; - bool emittedReadyRead; - bool emittedBytesWritten; + bool emittedReadyRead = false; + bool emittedBytesWritten = false; - qint64 pendingBytesWritten; - bool writeSequenceStarted; + qint64 pendingBytesWritten = 0; + bool writeSequenceStarted = false; QScopedPointer<QLockFile> lockFileScopedPointer; |