Bug 777292 - Cast NS_ENUMERATOR_FALSE to nsresult and complain in comments; r=ehsan

This commit is contained in:
Aryeh Gregor 2012-07-27 17:03:25 +03:00
parent 96fc9d649c
commit 7644f69a87
2 changed files with 6 additions and 2 deletions

View File

@ -431,7 +431,9 @@ nsSelectionIterator::IsDone()
{
PRInt32 cnt = mDomSelection->mRanges.Length();
if (mIndex >= 0 && mIndex < cnt) {
return NS_ENUMERATOR_FALSE;
// XXX This is completely incompatible with the meaning of nsresult.
// NS_ENUMERATOR_FALSE is defined to be 1. (bug 778111)
return (nsresult)NS_ENUMERATOR_FALSE;
}
return NS_OK;
}

View File

@ -69,8 +69,10 @@ nsSupportsArrayEnumerator::IsDone()
PRUint32 cnt;
nsresult rv = mArray->Count(&cnt);
if (NS_FAILED(rv)) return rv;
// XXX This is completely incompatible with the meaning of nsresult.
// NS_ENUMERATOR_FALSE is defined to be 1. (bug 778111)
return (mCursor >= 0 && mCursor < (PRInt32)cnt)
? NS_ENUMERATOR_FALSE : NS_OK;
? (nsresult)NS_ENUMERATOR_FALSE : NS_OK;
}
////////////////////////////////////////////////////////////////////////////////