Fix compilation on ARM with C++11: narrowing conversion
authorThiago Macieira <thiago.macieira@intel.com>
Thu, 29 Dec 2011 19:59:01 +0000 (17:59 -0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 22 Mar 2012 17:59:45 +0000 (18:59 +0100)
Cannot have double-to-float conversions inside { } in C++11.

Change-Id: I13c27307efd703420b6667d919bb42c2ee82e6cc
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/gui/painting/qpaintengineex.cpp
src/gui/painting/qpainterpath.cpp
src/gui/painting/qpainterpath_p.h

index 36414f4..7f9f82d 100644 (file)
@@ -870,7 +870,7 @@ void QPaintEngineEx::drawPoints(const QPointF *points, int pointCount)
         }
     } else {
         for (int i=0; i<pointCount; ++i) {
-            qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + 1/63., points[i].y() };
+            qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + qreal(1/63.), points[i].y() };
             QVectorPath path(pts, 2, 0);
             stroke(path, pen);
         }
index eb67709..e098e7c 100644 (file)
@@ -2399,7 +2399,7 @@ QDataStream &operator>>(QDataStream &s, QPainterPath &p)
 #endif
             continue;
         }
-        QPainterPath::Element elm = { x, y, QPainterPath::ElementType(type) };
+        QPainterPath::Element elm = { qreal(x), qreal(y), QPainterPath::ElementType(type) };
         p.d_func()->elements.append(elm);
     }
     s >> p.d_func()->cStart;
index 23e8332..a9068f3 100644 (file)
@@ -268,7 +268,7 @@ inline void QPainterPathData::maybeMoveTo()
     }
 }
 
-#define KAPPA 0.5522847498
+#define KAPPA qreal(0.5522847498)
 
 
 QT_END_NAMESPACE