From b2cce40b3059e01f95bed8cb2be0059b343b670c Mon Sep 17 00:00:00 2001
From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Date: Tue, 21 May 2013 12:24:18 +0200
Subject: [PATCH] Fix the Mac build on 32bit with c++11

CGFloat is a float on 32bit and qreal is a double. This causes a
narrowing error when building with c++11 support.

Change-Id: Ia73378ff9798d1f547b37f97393564e2c9e3672d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
---
 src/widgets/styles/qmacstyle_mac.mm | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 3131d5d048a..b7f39d45dd5 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -3643,8 +3643,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
                     tti.version = qt_mac_hitheme_version;
                     tti.state = tds;
                     QColor textColor = btn->palette.buttonText().color();
-                    CGFloat colorComp[] = { textColor.redF(), textColor.greenF(),
-                                          textColor.blueF(), textColor.alphaF() };
+                    CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()),
+                                          static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) };
                     CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace());
                     CGContextSetFillColor(cg, colorComp);
                     tti.fontID = themeId;
@@ -3883,8 +3883,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
                 tti.version = qt_mac_hitheme_version;
                 tti.state = tds;
                 QColor textColor = myTab.palette.windowText().color();
-                CGFloat colorComp[] = { textColor.redF(), textColor.greenF(),
-                                        textColor.blueF(), textColor.alphaF() };
+                CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()),
+                                        static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) };
                 CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace());
                 CGContextSetFillColor(cg, colorComp);
                 switch (d->aquaSizeConstrain(opt, w)) {
@@ -4063,8 +4063,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
                 CGContextSetShouldAntialias(cg, true);
                 CGContextSetShouldSmoothFonts(cg, true);
                 QColor textColor = p->pen().color();
-                CGFloat colorComp[] = { textColor.redF(), textColor.greenF(),
-                                      textColor.blueF(), textColor.alphaF() };
+                CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()),
+                                      static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) };
                 CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace());
                 CGContextSetFillColor(cg, colorComp);
                 HIThemeTextInfo tti;
@@ -5379,8 +5379,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
                 tti.version = qt_mac_hitheme_version;
                 tti.state = tds;
                 QColor textColor = groupBox.palette.windowText().color();
-                CGFloat colorComp[] = { textColor.redF(), textColor.greenF(),
-                                      textColor.blueF(), textColor.alphaF() };
+                CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()),
+                                      static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) };
                 CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace());
                 CGContextSetFillColor(cg, colorComp);
                 tti.fontID = flat ? kThemeSystemFont : kThemeSmallSystemFont;
-- 
GitLab