diff options
Diffstat (limited to 'src/corelib/serialization/qtextstream.cpp')
-rw-r--r-- | src/corelib/serialization/qtextstream.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp index c02effb165..e9d650b3e2 100644 --- a/src/corelib/serialization/qtextstream.cpp +++ b/src/corelib/serialization/qtextstream.cpp @@ -196,6 +196,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; #include "qnumeric.h" #include "qvarlengtharray.h" #include <private/qdebug_p.h> +#include <private/qnumeric_p.h> #include <private/qtools_p.h> #include <locale.h> @@ -359,6 +360,7 @@ bool QTextStreamPrivate::fillReadBuffer(qint64 maxBytes) if (bytesRead <= 0) return false; +#ifndef QT_BOOTSTRAPPED if (autoDetectUnicode) { autoDetectUnicode = false; @@ -373,6 +375,7 @@ bool QTextStreamPrivate::fillReadBuffer(qint64 maxBytes) #if defined (QTEXTSTREAM_DEBUG) qDebug("QTextStreamPrivate::fillReadBuffer(), using %s encoding", QStringConverter::nameForEncoding(encoding)); #endif +#endif #if defined (QTEXTSTREAM_DEBUG) qDebug("QTextStreamPrivate::fillReadBuffer(), device->read(\"%s\", %d) == %d", @@ -999,7 +1002,10 @@ QTextStream::QTextStream(FILE *fileHandle, OpenMode openMode) fileHandle, int(openMode)); #endif QFile *file = new QFile; - file->open(fileHandle, openMode); + // Discarding the return value of open; even if it failed + // (and the file is not open), QTextStream still reports `Ok` + // for closed QIODevices, so there's nothing really to do here. + (void)file->open(fileHandle, openMode); Q_D(QTextStream); d->device = file; @@ -1911,13 +1917,13 @@ bool QTextStreamPrivate::getReal(double *f) // nan/+inf/-inf, so here we also check for uppercase and mixed // case versions. if (!qstricmp(buf, "nan") || !qstricmp(buf, "+nan") || !qstricmp(buf, "-nan")) { - *f = qQNaN(); + *f = qt_qnan(); return true; } else if (!qstricmp(buf, "+inf") || !qstricmp(buf, "inf")) { - *f = qInf(); + *f = qt_inf(); return true; } else if (!qstricmp(buf, "-inf")) { - *f = -qInf(); + *f = -qt_inf(); return true; } bool ok; @@ -1949,7 +1955,7 @@ QTextStream &QTextStream::operator>>(QChar &c) \overload Reads a character from the stream and stores it in \a c. The - character from the stream is converted to ISO-5589-1 before it is + character from the stream is converted to ISO-8859-1 before it is stored. \sa QChar::toLatin1() |