From c37a8cafc3aae0197832cd9b249e983bebd5e8aa Mon Sep 17 00:00:00 2001 From: historic_bruno Date: Wed, 7 May 2014 23:33:21 +0000 Subject: [PATCH] Fixes a few building warnings and convention issues from 19ca1e3ebf This was SVN commit r15128. --- source/i18n/L10n.cpp | 16 +++++++--------- source/i18n/L10n.h | 10 ++++++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/source/i18n/L10n.cpp b/source/i18n/L10n.cpp index 2a8234204e..5b5b6be71e 100644 --- a/source/i18n/L10n.cpp +++ b/source/i18n/L10n.cpp @@ -132,11 +132,10 @@ L10n::CheckLangAndCountry::CheckLangAndCountry(const Locale& locale) : m_MatchLo { } -bool L10n::CheckLangAndCountry::operator()(const Locale* const locale) +bool L10n::CheckLangAndCountry::operator()(const Locale* const locale) const { - bool found = false; - found = strcmp(m_MatchLocale.getLanguage(), locale->getLanguage()) == 0; - found &= strcmp(m_MatchLocale.getCountry(), locale->getCountry()) == 0; + bool found = strcmp(m_MatchLocale.getLanguage(), locale->getLanguage()) == 0 + && strcmp(m_MatchLocale.getCountry(), locale->getCountry()) == 0; return found; } @@ -144,10 +143,9 @@ L10n::CheckLang::CheckLang(const Locale& locale) : m_MatchLocale(locale) { } -bool L10n::CheckLang::operator()(const Locale* const locale) +bool L10n::CheckLang::operator()(const Locale* const locale) const { - bool found = false; - found = strcmp(m_MatchLocale.getLanguage(), locale->getLanguage()) == 0; + bool found = strcmp(m_MatchLocale.getLanguage(), locale->getLanguage()) == 0; return found; } @@ -163,7 +161,7 @@ std::wstring L10n::GetFallbackToAvailableDictLocale(const Locale& locale) if (strcmp(locale.getCountry(), "") != 0) { CheckLangAndCountry fun(locale); - std::vector::iterator itr = find_if(availableLocales.begin(), availableLocales.end(), fun); + std::vector::iterator itr = std::find_if(availableLocales.begin(), availableLocales.end(), fun); if (itr != availableLocales.end()) { stream << locale.getLanguage() << L"_" << locale.getCountry(); @@ -172,7 +170,7 @@ std::wstring L10n::GetFallbackToAvailableDictLocale(const Locale& locale) } CheckLang fun(locale); - std::vector::iterator itr = find_if(availableLocales.begin(), availableLocales.end(), fun); + std::vector::iterator itr = std::find_if(availableLocales.begin(), availableLocales.end(), fun); if (itr != availableLocales.end()) { stream << locale.getLanguage(); diff --git a/source/i18n/L10n.h b/source/i18n/L10n.h index 46077e6fa4..4863742d1f 100644 --- a/source/i18n/L10n.h +++ b/source/i18n/L10n.h @@ -261,7 +261,10 @@ public: CheckLangAndCountry(const Locale& locale); const Locale& m_MatchLocale; - bool operator()(const Locale* const locale); + bool operator()(const Locale* const locale) const; + + private: + const CheckLangAndCountry& operator=(const CheckLangAndCountry&); }; struct CheckLang @@ -269,7 +272,10 @@ public: CheckLang(const Locale& locale); const Locale& m_MatchLocale; - bool operator()(const Locale* const locale); + bool operator()(const Locale* const locale) const; + + private: + const CheckLang& operator=(const CheckLang&); }; /**