summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qiodevice.cpp
diff options
context:
space:
mode:
authorNick Ratelle <nratelle@qnx.com>2012-01-06 17:19:27 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-02-14 00:36:45 (GMT)
commit385ee6704d1465c7cc02f518da828231cd8e4dfe (patch)
tree0f2aed0d206b12590c871e2011a264ea688a22d3 /src/corelib/io/qiodevice.cpp
parent2515d7abb9312ed26a8b6577f63177361e31cf88 (diff)
downloadQt-385ee6704d1465c7cc02f518da828231cd8e4dfe.zip
Qt-385ee6704d1465c7cc02f518da828231cd8e4dfe.tar.gz
Qt-385ee6704d1465c7cc02f518da828231cd8e4dfe.tar.bz2
Initializes seqDumpPos on qiodevice.cpp
This was spotted by RIM static code checking team. seqDumpPos is a dummy variable which is only used on sequential mode. It is used as a simultaneous storage area of both pPos and pDevicePos when in sequential mode, to keep both in sync. They just suggested that it would be a good practice to initialize the variable, since it does not have any side effect, and there's not much value on not doing it. cherry-picked from qt5/qtbase: e7e87993042ac9a4fd899da5ea0340322b47d9ff Change-Id: Ib0d3299b03de9df539567c92bda5e6fe9f95ba7a Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Diffstat (limited to 'src/corelib/io/qiodevice.cpp')
-rw-r--r--src/corelib/io/qiodevice.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index dce2ba3..f5cad1a 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -118,7 +118,7 @@ void debugBinaryString(const char *data, qint64 maxlen)
*/
QIODevicePrivate::QIODevicePrivate()
: openMode(QIODevice::NotOpen), buffer(QIODEVICE_BUFFERSIZE),
- pos(0), devicePos(0)
+ pos(0), devicePos(0), seqDumpPos(0)
, pPos(&pos), pDevicePos(&devicePos)
, baseReadLineDataCalled(false)
, firstRead(true)
@@ -579,6 +579,7 @@ void QIODevice::close()
d->openMode = NotOpen;
d->errorString.clear();
d->pos = 0;
+ d->seqDumpPos = 0;
d->buffer.clear();
d->firstRead = true;
}