From: Friedemann Kleint Date: Fri, 30 Sep 2011 12:46:12 +0000 (+0200) Subject: Declarative: Compile fix for Windows. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=3176222ad06478b3aae752f59e14d63ffcd952c7;p=konrad%2Fqtdeclarative.git Declarative: Compile fix for Windows. Change-Id: I0e4d61aa400094b3b059c836ee9145c1af989f00 Reviewed-on: http://codereview.qt-project.org/5881 Reviewed-by: Qt Sanity Bot Reviewed-by: Charles Yin --- diff --git a/src/declarative/items/context2d/qsgcontext2d.cpp b/src/declarative/items/context2d/qsgcontext2d.cpp index e9cf65d..cfcfb06 100644 --- a/src/declarative/items/context2d/qsgcontext2d.cpp +++ b/src/declarative/items/context2d/qsgcontext2d.cpp @@ -165,7 +165,13 @@ QColor qt_color_from_string(const QString& name) while (pos < len && !isdigit(data[pos])) pos++; if (pos >= len) return QColor(); - alpha = qRound(strtof(&(data[pos]), 0) * 255); +#ifndef Q_CC_MSVC + const float alphaF = strtof(data + pos, 0); +#else + // MSVC does not have strtof + const double alphaF = strtod(data + pos, 0); +#endif + alpha = qRound(alphaF * 255); } if (isRgb) diff --git a/src/declarative/items/qsgtranslate.cpp b/src/declarative/items/qsgtranslate.cpp index 1de5c6c..577cf4d 100644 --- a/src/declarative/items/qsgtranslate.cpp +++ b/src/declarative/items/qsgtranslate.cpp @@ -296,7 +296,8 @@ void QSGRotation::setAxis(Qt::Axis axis) } } -struct QGraphicsRotation { +class QGraphicsRotation { +public: static inline void projectedRotate(QMatrix4x4 *matrix, qreal angle, qreal x, qreal y, qreal z) { matrix->projectedRotate(angle, x, y, z);