Репозитории ALT
S: | 4.8.7-alt25 |
5.1: | 4.6.3-alt1.M51.1 |
4.1: | 4.4.3-alt1.M41.1 |
4.0: | 4.3.4-alt5.M40.1 |
3.0: | 4.0.1-alt1 |
+updates: | 4.0.1-alt2 |
+backports: | 4.2.3-alt7.1.M30 |
Группа :: Система/Библиотеки
Пакет: qt4
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: 0105-qdatastream_qint64.diff
Скачать
Скачать
qt-bugs@ issue : N84155
applied: yes
author: dfaure
Fix datastream<<qint64 code to actually write to the stream, not read from it (!), in 3-1-compat mode.
qint64 value = 0x1234567887654321LL;
QByteArray data;
QDataStream arg( &data, QIODevice::WriteOnly );
arg.setVersion( QDataStream::Qt_3_1 );
arg << value;
Without the patch, this fails with ""QIODevice::read called on a WriteOnly device".
Index: qdatastream.cpp
===================================================================
--- src/corelib/io/qdatastream.cpp.orig (revision 452002)
+++ src/corelib/io/qdatastream.cpp (working copy)
@@ -985,8 +985,9 @@ QDataStream &QDataStream::operator<<(qin
{
CHECK_STREAM_PRECOND(*this)
if (version() < 6) {
- quint32 i1, i2;
- *this >> i2 >> i1;
+ quint32 i1 = i >> 32;
+ quint32 i2 = i & 0xFFFFFFFF;
+ *this << i2 << i1;
i = ((quint64)i1 << 32) + i2;
} else if (noswap) { // no conversion needed
dev->write((char *)&i, sizeof(qint64));