diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2015-02-26 16:07:49 +0200 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2015-03-12 05:33:20 +0000 |
commit | 9dd0bb851b34fcfea5e9be106d8f4209d59d5bf5 (patch) | |
tree | 238e1b1a79919103da6d1d127b8e785767509409 /src/network/socket | |
parent | 2d5210a684b266e71fc6f7efbd81fbfd720b341c (diff) |
Make QRingBuffer a 64-bit safe
According to I/O API, QIODevice and its inherited classes should be
able to process a full 64-bit offsets and lengths. This requires
64-bit parameters in operations with internal buffers. Rework
QRingBuffer to avoid implicit truncation of numbers and fix some
64-bit issues in code.
Change-Id: Iadd6fd5fefd2d64e6c084e2feebb4dc2d6df66de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network/socket')
-rw-r--r-- | src/network/socket/qabstractsocket.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 3b10387b37..f94b1edbff 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -812,7 +812,7 @@ bool QAbstractSocketPrivate::canWriteNotification() #if defined (QABSTRACTSOCKET_DEBUG) qDebug("QAbstractSocketPrivate::canWriteNotification() flushing"); #endif - int tmp = writeBuffer.size(); + qint64 tmp = writeBuffer.size(); flush(); if (socketEngine) { @@ -872,7 +872,7 @@ bool QAbstractSocketPrivate::flush() return false; } - int nextSize = writeBuffer.nextDataBlockSize(); + qint64 nextSize = writeBuffer.nextDataBlockSize(); const char *ptr = writeBuffer.readPointer(); // Attempt to write it all in one chunk. @@ -1707,9 +1707,9 @@ qint64 QAbstractSocket::bytesToWrite() const { Q_D(const QAbstractSocket); #if defined(QABSTRACTSOCKET_DEBUG) - qDebug("QAbstractSocket::bytesToWrite() == %i", d->writeBuffer.size()); + qDebug("QAbstractSocket::bytesToWrite() == %lld", d->writeBuffer.size()); #endif - return (qint64)d->writeBuffer.size(); + return d->writeBuffer.size(); } /*! |