ARM cannot bind references to packed fields.

There is no possible implementation of QChar.unicode() returning a int&.
Replace with unicodep() returning int*. The allows athe code to compile.
To be determined if the reference access ever work on ARM as it cannot make the unaligned access.
This commit is contained in:
michael 2012-11-22 21:40:21 +01:00
parent e3088a4714
commit 97b389bcdb
3 changed files with 70 additions and 26 deletions

View file

@ -30,7 +30,7 @@ sha1sums=('745def6250dc7f337dbb265e20bf38dcb41fd854'
'40c7b8f06a21f809ddeb8b5560e9da63ccac6a17'
'1346320614f6f86fbeb10b9fbad721dea29f5b61'
'd9b83b8f6f9c8bd98d290dc1d0e9913a00b62c3f'
'896ffd1d5d31101a4c60155648dfed419abee3c1')
'f77e1bcd27205ab58a9025db9ddfd0da73979782')
# qt-copy-kde-patches come from http://websvn.kde.org/trunk/qt-copy/patches/
# other qt-patches come from fedora and gentoo

View file

@ -1,25 +0,0 @@
diff -urN qt-x11-free-3.3.8.orig/src/tools/qglobal.h qt-x11-free-3.3.8/src/tools/qglobal.h
--- qt-x11-free-3.3.8.orig/src/tools/qglobal.h 2011-01-20 21:18:42.000000000 -0700
+++ qt-x11-free-3.3.8/src/tools/qglobal.h 2011-01-20 21:20:34.000000000 -0700
@@ -320,6 +320,9 @@
# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4
# define Q_NO_PACKED_REFERENCE
# endif
+# if __GNUC__ == 4 && __GNUC_MINOR__ >= 0
+# define Q_NO_PACKED_POINTERS
+# endif
# endif
# if !defined(__EXCEPTIONS)
# define Q_NO_EXCEPTIONS
diff -urN qt-x11-free-3.3.8.orig/src/tools/qstring.h qt-x11-free-3.3.8/src/tools/qstring.h
--- qt-x11-free-3.3.8.orig/src/tools/qstring.h 2011-01-20 21:18:43.000000000 -0700
+++ qt-x11-free-3.3.8/src/tools/qstring.h 2011-01-20 21:21:48.000000000 -0700
@@ -195,6 +195,8 @@
ushort unicode() const { return ucs; }
#ifdef Q_NO_PACKED_REFERENCE
ushort &unicode() { return *(&ucs); }
+#elif defined Q_NO_PACKED_POINTERS
+ ushort &unicode() { ushort& tmp = ucs; return tmp; }
#else
ushort &unicode() { return ucs; }
#endif

View file

@ -0,0 +1,69 @@
--- a/src/qt-x11-free-3.3.8b/src/tools/qglobal.h
+++ b/src/qt-x11-free-3.3.8b/src/tools/qglobal.h
@@ -323,6 +323,13 @@
# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4
# define Q_NO_PACKED_REFERENCE
# endif
+# if __GNUC__ == 4 && __GNUC_MINOR__ >= 0
+# if __GNUC__ == 4 && __GNUC_MINOR__ >= 7
+# define Q_NO_PACKED_ACCESS
+# else
+# define Q_NO_PACKED_POINTERS
+# endif
+# endif
# endif
# if !defined(__EXCEPTIONS)
# define Q_NO_EXCEPTIONS
--- a/src/qt-x11-free-3.3.8b/src/tools/qlocale.cpp
+++ b/src/qt-x11-free-3.3.8b/src/tools/qlocale.cpp
@@ -3293,7 +3293,11 @@ QString QLocalePrivate::doubleToString(double d,
if (zero().unicode() != '0') {
for (uint i = 0; i < digits.length(); ++i)
+#ifdef Q_NO_PACKED_ACCESS
+ *digits.ref(i).unicodep() += zero().unicode() - '0';
+#else
digits.ref(i).unicode() += zero().unicode() - '0';
+#endif
}
bool always_show_decpt = flags & Alternate;
--- a/src/qt-x11-free-3.3.8b/src/tools/qstring.cpp
+++ b/src/qt-x11-free-3.3.8b/src/tools/qstring.cpp
@@ -1933,7 +1933,11 @@ static QString replaceArgEscapes(const QString &s, const ArgEscapeData &d, int f
if (field_width > 0) { // left padded
for (uint i = 0; i < pad_chars; ++i)
+#ifdef Q_NO_PACKED_ACCESS
+ *(rc++)->unicodep() = ' ';
+#else
(rc++)->unicode() = ' ';
+#endif
}
if (locale_arg) {
@@ -1947,7 +1951,11 @@ static QString replaceArgEscapes(const QString &s, const ArgEscapeData &d, int f
if (field_width < 0) { // right padded
for (uint i = 0; i < pad_chars; ++i)
+#ifdef Q_NO_PACKED_ACCESS
+ *(rc++)->unicodep() = ' ';
+#else
(rc++)->unicode() = ' ';
+#endif
}
if (++repl_cnt == d.occurrences) {
--- a/src/qt-x11-free-3.3.8b/src/tools/qstring.h
+++ b/src/qt-x11-free-3.3.8b/src/tools/qstring.h
@@ -199,6 +199,10 @@ public:
ushort unicode() const { return ucs; }
#ifdef Q_NO_PACKED_REFERENCE
ushort &unicode() { return *(&ucs); }
+#elif defined Q_NO_PACKED_POINTERS
+ ushort &unicode() { ushort& tmp = ucs; return tmp; }
+#elif defined Q_NO_PACKED_ACCESS
+ ushort *unicodep() { return &ucs; }
#else
ushort &unicode() { return ucs; }
#endif