diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2014-01-10 17:36:35 +0400 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-15 15:16:23 +0100 |
commit | 73823bcace62d8e168c81e9b083fcee5a1ba0ccc (patch) | |
tree | a1161518727645708deb604201040d12d730c8ab /src/serialport/qserialport_wince.cpp | |
parent | f404826e695c3affb684f3185d74cd3a5b31efbc (diff) |
Optimize access to the write buffer
Earlier for writing in writeBuffer was used the
QSerialPortPrivate::writeToBuffer() method which contained
a similar code for each platform.
Therefore it is reasonable to delete this method, and to move
its common functionality to the QSerialPort::writeData(). Also
all platform-dependent code of start of data transfer move to
the QSerialPortPrivate::startWriting() method.
Change-Id: I1423723fd69c05df974f8ba597e3dd71d5a797dd
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src/serialport/qserialport_wince.cpp')
-rw-r--r-- | src/serialport/qserialport_wince.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/serialport/qserialport_wince.cpp b/src/serialport/qserialport_wince.cpp index 26ebf64c..bb76465d 100644 --- a/src/serialport/qserialport_wince.cpp +++ b/src/serialport/qserialport_wince.cpp @@ -253,18 +253,10 @@ bool QSerialPortPrivate::clear(QSerialPort::Directions directions) return ::PurgeComm(descriptor, flags); } -qint64 QSerialPortPrivate::writeToBuffer(const char *data, qint64 maxSize) +void QSerialPortPrivate::startWriting() { - char *ptr = writeBuffer.reserve(maxSize); - if (maxSize == 1) - *ptr = *data; - else - ::memcpy(ptr, data, maxSize); - // trigger write sequence notifyWrite(); - - return maxSize; } bool QSerialPortPrivate::waitForReadyRead(int msec) |