Fix integer overflow (1 << 31)

On platforms where integer by default is int32(max is 2147483647) and
(1 << 31) will be 2147483648

Change-Id: I59ccb5344d5ad7d085f01bbc7cebdf6152ff7755
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Mikhail Svetkin 2018-04-05 15:08:15 +02:00
parent 1c92bb87fe
commit f5a624c9b9

View File

@ -2889,7 +2889,7 @@ Q_GUI_EXPORT QStringList qt_sort_families_by_writing_system(QChar::Script script
uint order = i;
if (testFamily == nullptr
|| (testFamily->writingSystems[writingSystem] & QtFontFamily::Supported) == 0) {
order |= 1 << 31;
order |= 1u << 31;
}
supported.insert(order, family);