summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-10-27 07:40:38 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-10-27 07:40:38 (GMT)
commite4feb707118947feea8568a82d57a8db6ae59410 (patch)
treeecf77b7d677f174b59e1c5110dd7aebee877f02d /src/corelib
parent85f3f3ac74a2e7fe6a0874a46f9358a15f0dab34 (diff)
parent2925995de32f76a72fcdd7d577e609a68a517fa1 (diff)
downloadQt-e4feb707118947feea8568a82d57a8db6ae59410.zip
Qt-e4feb707118947feea8568a82d57a8db6ae59410.tar.gz
Qt-e4feb707118947feea8568a82d57a8db6ae59410.tar.bz2
Merge remote branch 'qt/master' into lighthouse-master
Conflicts: src/corelib/global/qglobal.h
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/global.pri2
-rw-r--r--src/corelib/global/qglobal.h2
-rw-r--r--src/corelib/tools/qstring.cpp30
3 files changed, 10 insertions, 24 deletions
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index ce43ea3..47b82ef 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -23,7 +23,7 @@ INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
# Only used on platforms with CONFIG += precompile_header
PRECOMPILED_HEADER = global/qt_pch.h
-linux*:!static:!linux-armcc:!linux-gcce {
+linux*:!static:!symbian-armcc:!symbian-gcce {
QMAKE_LFLAGS += -Wl,-e,qt_core_boilerplate
prog=$$quote(if (/program interpreter: (.*)]/) { print $1; })
DEFINES += ELF_INTERPRETER=\\\"$$system(readelf -l /bin/ls | perl -n -e \'$$prog\')\\\"
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 8cd56dd..e71e3b6 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -286,7 +286,7 @@ namespace QT_NAMESPACE {}
# endif
#endif
-#if defined(Q_WS_MAC64) && !defined(QT_MAC_USE_COCOA) && !defined(QT_BUILD_QMAKE)
+#if defined(Q_WS_MAC64) && !defined(QT_MAC_USE_COCOA) && !defined(QT_BUILD_QMAKE) && !defined(QT_BOOTSTRAPPED)
#error "You are building a 64-bit application, but using a 32-bit version of Qt. Check your build configuration."
#endif
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 30ef9de..2737574 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -7460,31 +7460,17 @@ QDataStream &operator<<(QDataStream &out, const QString &str)
out << str.toLatin1();
} else {
if (!str.isNull() || out.version() < 3) {
- int byteOrder = out.byteOrder();
- const QChar* ub = str.unicode();
- static const uint auto_size = 1024;
- char t[auto_size];
- char *b;
- if (str.length()*sizeof(QChar) > auto_size) {
- b = new char[str.length()*sizeof(QChar)];
+ if ((out.byteOrder() == QDataStream::BigEndian) == (QSysInfo::ByteOrder == QSysInfo::BigEndian)) {
+ out.writeBytes(reinterpret_cast<const char *>(str.unicode()), sizeof(QChar) * str.length());
} else {
- b = t;
- }
- int l = str.length();
- char *c=b;
- while (l--) {
- if (byteOrder == QDataStream::BigEndian) {
- *c++ = (char)ub->row();
- *c++ = (char)ub->cell();
- } else {
- *c++ = (char)ub->cell();
- *c++ = (char)ub->row();
+ QVarLengthArray<ushort> buffer(str.length());
+ const ushort *data = reinterpret_cast<const ushort *>(str.constData());
+ for (int i = 0; i < str.length(); i++) {
+ buffer[i] = qbswap(*data);
+ ++data;
}
- ub++;
+ out.writeBytes(reinterpret_cast<const char *>(buffer.data()), sizeof(ushort) * buffer.size());
}
- out.writeBytes(b, sizeof(QChar)*str.length());
- if (str.length()*sizeof(QChar) > auto_size)
- delete [] b;
} else {
// write null marker
out << (quint32)0xffffffff;