Bug 836345: Cast nsCOMArray::Count()'s result to uint32 in nsAutoCompleteController.cpp, to fix signed/unsigned comparison build warnings. r=mounir

This commit is contained in:
Daniel Holbert
2013-01-31 14:40:04 -08:00
parent dae713fc84
commit f05a6453f8

View File

@@ -1071,7 +1071,9 @@ void
nsAutoCompleteController::AfterSearches()
{
mResultCache.Clear();
if (mSearchesFailed == mSearches.Count())
// nsCOMArray::Count() returns a signed value; we have to cast it to unsigned
// when comparing it to unsigned, or compilers will complain.
if (mSearchesFailed == static_cast<uint32_t>(mSearches.Count()))
PostSearchCleanup();
}
@@ -1122,7 +1124,9 @@ nsAutoCompleteController::StartSearches()
return rv;
StartSearch(nsIAutoCompleteSearchDescriptor::SEARCH_TYPE_IMMEDIATE);
if (mSearches.Count() == immediateSearchesCount) {
// nsCOMArray::Count() returns a signed value; we have to cast it to
// unsigned when comparing it to unsigned, or compilers will complain.
if (static_cast<uint32_t>(mSearches.Count()) == immediateSearchesCount) {
// Either all searches are immediate, or the timeout is 0. In the
// latter case we still have to execute the delayed searches, otherwise
// this will be a no-op.