Fixes a few building warnings and convention issues from 19ca1e3ebf

This was SVN commit r15128.
This commit is contained in:
historic_bruno 2014-05-07 23:33:21 +00:00
parent db0376fdc2
commit c37a8cafc3
2 changed files with 15 additions and 11 deletions

View File

@ -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<Locale*>::iterator itr = find_if(availableLocales.begin(), availableLocales.end(), fun);
std::vector<Locale*>::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<Locale*>::iterator itr = find_if(availableLocales.begin(), availableLocales.end(), fun);
std::vector<Locale*>::iterator itr = std::find_if(availableLocales.begin(), availableLocales.end(), fun);
if (itr != availableLocales.end())
{
stream << locale.getLanguage();

View File

@ -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&);
};
/**