summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAleksandar Sasha Babic <aleksandar.babic@nokia.com>2010-02-05 08:34:48 (GMT)
committerAleksandar Sasha Babic <aleksandar.babic@nokia.com>2010-02-05 08:43:58 (GMT)
commitbd36d753337090a2878fc0ca4117e2250c5ae1b7 (patch)
tree2b5167d71f796f794d0b43e3f0d8cc5d0992ed07 /src
parent96a169ac3f235433906d58ac0e4c613f51c21bf3 (diff)
downloadQt-bd36d753337090a2878fc0ca4117e2250c5ae1b7.zip
Qt-bd36d753337090a2878fc0ca4117e2250c5ae1b7.tar.gz
Qt-bd36d753337090a2878fc0ca4117e2250c5ae1b7.tar.bz2
Fixing 'softvfp+vfpv2' compiling issue for Tb9.2
When compiling with -fpu=softvfp+vfpv2 on Tb9.2 we were getting the segmentattion fault. This seems to be due to the RVCT bug when it comes to using int->float (and reverse) castings. One extra level of indirection (function call) has to be applied. Task-number: QTBUG-4893 Reviewed-by: TrustMe
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qdrawhelper.cpp4
-rw-r--r--src/gui/painting/qmath_p.h6
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 194dda3..660a2a8 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -2408,7 +2408,11 @@ static inline int soft_light_op(int dst, int src, int da, int sa)
else if (4 * dst <= da)
return (dst * sa * 255 + da * (src2 - sa) * ((((16 * dst_np - 12 * 255) * dst_np + 3 * 65025) * dst_np) / 65025) + temp) / 65025;
else {
+# ifdef Q_CC_RVCT // needed to avoid compiler crash in RVCT 2.2
+ return (dst * sa * 255 + da * (src2 - sa) * (qIntSqrtInt(dst_np * 255) - dst_np) + temp) / 65025;
+# else
return (dst * sa * 255 + da * (src2 - sa) * (int(sqrt(qreal(dst_np * 255))) - dst_np) + temp) / 65025;
+# endif
}
}
diff --git a/src/gui/painting/qmath_p.h b/src/gui/painting/qmath_p.h
index cd9f5ea..8a5f5ab 100644
--- a/src/gui/painting/qmath_p.h
+++ b/src/gui/painting/qmath_p.h
@@ -54,6 +54,7 @@
//
#include <math.h>
+#include <qmath.h>
QT_BEGIN_NAMESPACE
@@ -61,6 +62,11 @@ static const qreal Q_PI = qreal(3.14159265358979323846); // pi
static const qreal Q_2PI = qreal(6.28318530717958647693); // 2*pi
static const qreal Q_PI2 = qreal(1.57079632679489661923); // pi/2
+inline int qIntSqrtInt(int v)
+{
+ return static_cast<int>(qSqrt(static_cast<qreal>(v)));
+}
+
QT_END_NAMESPACE
#endif // QMATH_P_H