QColor: write signed 64-bit integer in a platform-independent way
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 <gabriel.dedietrich@qt.io>
bb10
parent
29104c85db
commit
b8a6e2b6e8
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue