From b8a6e2b6e8e4b5ea0734285f485c03c22022c30e Mon Sep 17 00:00:00 2001 From: Dongmei Wang Date: Fri, 18 Aug 2017 11:24:13 -0700 Subject: QColor: write signed 64-bit integer in a platform-independent way MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building Qt 5.6.2 with gcc 4.1.2 on Fedora 8, a compilation error happened when compiling the code below QColor::name() { ... case HexArgb: return QLatin1Char('#') + QString::number(rgba() | 0x100000000, 16).rightRef(8); ... } qtbase/src/gui/painting/qcolor.cpp:527: error: integer constant is too large for ‘long’ type gcc 4.1.2 was unable to handle 0x100000000. The patch is to use Q_INT64_C to append "LL" to 0x100000000 to avoid the compilation error. Change-Id: I000e65a5c897ef2d78fcfe4e212d832eb488a762 Reviewed-by: Gabriel de Dietrich --- src/gui/painting/qcolor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/painting/qcolor.cpp') diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 9e1785c11d..6e0e348a67 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -853,7 +853,7 @@ QString QColor::name(NameFormat format) const return QLatin1Char('#') + QString::number(rgba() | 0x1000000, 16).rightRef(6); case HexArgb: // it's called rgba() but it does return AARRGGBB - return QLatin1Char('#') + QString::number(rgba() | 0x100000000, 16).rightRef(8); + return QLatin1Char('#') + QString::number(rgba() | Q_INT64_C(0x100000000), 16).rightRef(8); } return QString(); } -- cgit v1.2.3