diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-15 09:04:56 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-15 09:04:56 +0100 |
commit | ac37cb32df769c669d51639b12e6a45dc3962cf7 (patch) | |
tree | c9e563af79826da05545849f8e66bdd62289290d /i18nutil/source | |
parent | e99d632b10ac1ba46ee6e7a0723f331a25ec9184 (diff) |
More loplugin:cstylecast: i18nutil
Change-Id: Ibdfec3e35c6424fdd4d9b15ff4f4d7441a5f7e36
Diffstat (limited to 'i18nutil/source')
-rw-r--r-- | i18nutil/source/utility/casefolding.cxx | 10 | ||||
-rw-r--r-- | i18nutil/source/utility/paper.cxx | 2 | ||||
-rw-r--r-- | i18nutil/source/utility/unicode.cxx | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/i18nutil/source/utility/casefolding.cxx b/i18nutil/source/utility/casefolding.cxx index cc5eda68e8ee..0d957c0a91b6 100644 --- a/i18nutil/source/utility/casefolding.cxx +++ b/i18nutil/source/utility/casefolding.cxx @@ -50,7 +50,7 @@ static bool cased_letter(sal_Unicode ch) if (cmi < 0) return false; int cmv_idx = (cmi << 8) + (ch & 0xff); - return bool(((MappingType)CaseMappingValue[cmv_idx].type) & MappingType::CasedLetterMask); + return bool(static_cast<MappingType>(CaseMappingValue[cmv_idx].type) & MappingType::CasedLetterMask); } // for Lithuanian, condition to make explicit dot above when lowercasing capital I's and J's @@ -95,16 +95,16 @@ Mapping& casefolding::getValue(const sal_Unicode* str, sal_Int32 pos, sal_Int32 if (address >= 0) { address = (address << 8) + (str[pos] & 0xFF); - if ((MappingType)CaseMappingValue[address].type & nMappingType) { - MappingType type = (MappingType) CaseMappingValue[address].type; + if (static_cast<MappingType>(CaseMappingValue[address].type) & nMappingType) { + MappingType type = static_cast<MappingType>(CaseMappingValue[address].type); if (type & MappingType::NotValue) { if (CaseMappingValue[address].value == 0) return getConditionalValue(str, pos, len, aLocale, nMappingType); else { for (int map = CaseMappingValue[address].value; map < CaseMappingValue[address].value + MaxCaseMappingExtras; map++) { - if ((MappingType)CaseMappingExtra[map].type & nMappingType) { - if ((MappingType)CaseMappingExtra[map].type & MappingType::NotValue) + if (static_cast<MappingType>(CaseMappingExtra[map].type) & nMappingType) { + if (static_cast<MappingType>(CaseMappingExtra[map].type) & MappingType::NotValue) return getConditionalValue(str, pos, len, aLocale, nMappingType); else return CaseMappingExtra[map]; diff --git a/i18nutil/source/utility/paper.cxx b/i18nutil/source/utility/paper.cxx index 46034b15ae67..b052ad54de2c 100644 --- a/i18nutil/source/utility/paper.cxx +++ b/i18nutil/source/utility/paper.cxx @@ -173,7 +173,7 @@ bool PaperInfo::doSloppyFit() { m_nPaperWidth = aDinTab[i].m_nWidth; m_nPaperHeight = aDinTab[i].m_nHeight; - m_eType = (Paper)i; + m_eType = static_cast<Paper>(i); return true; } } diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx index e32fa1318bcb..6d90b15ca42e 100644 --- a/i18nutil/source/utility/unicode.cxx +++ b/i18nutil/source/utility/unicode.cxx @@ -41,7 +41,7 @@ T getScriptType( const sal_Unicode ch, const L* typeList, T unknownType ) { sal_Int16 i = 0; css::i18n::UnicodeScript type = typeList[0].to; - while (type < UnicodeScript_kScriptCount && ch > UnicodeScriptType[(int)type][UnicodeScriptTypeTo]) { + while (type < UnicodeScript_kScriptCount && ch > UnicodeScriptType[static_cast<int>(type)][UnicodeScriptTypeTo]) { type = typeList[++i].to; } @@ -57,12 +57,12 @@ unicode::getUnicodeScriptType( const sal_Unicode ch, const ScriptTypeList* typeL sal_Unicode unicode::getUnicodeScriptStart( UnicodeScript type) { - return UnicodeScriptType[(int)type][UnicodeScriptTypeFrom]; + return UnicodeScriptType[static_cast<int>(type)][UnicodeScriptTypeFrom]; } sal_Unicode unicode::getUnicodeScriptEnd( UnicodeScript type) { - return UnicodeScriptType[(int)type][UnicodeScriptTypeTo]; + return UnicodeScriptType[static_cast<int>(type)][UnicodeScriptTypeTo]; } sal_Int16 |