Bug 742565: Cast known-to-be-nonnegative integer val to unsigned, to fix build warnings in nsRange.cpp. r=smaug

This commit is contained in:
Daniel Holbert 2012-04-10 00:45:59 -07:00
Родитель 2fa1f20bc9
Коммит 8efa51b227
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -665,7 +665,7 @@ nsRange::ComparePoint(nsIDOMNode* aParent, PRInt32 aOffset, PRInt16* aResult)
return NS_ERROR_DOM_INVALID_NODE_TYPE_ERR; return NS_ERROR_DOM_INVALID_NODE_TYPE_ERR;
} }
if (aOffset < 0 || aOffset > parent->Length()) { if (aOffset < 0 || PRUint32(aOffset) > parent->Length()) {
return NS_ERROR_DOM_INDEX_SIZE_ERR; return NS_ERROR_DOM_INDEX_SIZE_ERR;
} }
@ -929,7 +929,7 @@ nsRange::SetStart(nsINode* aParent, PRInt32 aOffset)
nsINode* newRoot = IsValidBoundary(aParent); nsINode* newRoot = IsValidBoundary(aParent);
NS_ENSURE_TRUE(newRoot, NS_ERROR_DOM_INVALID_NODE_TYPE_ERR); NS_ENSURE_TRUE(newRoot, NS_ERROR_DOM_INVALID_NODE_TYPE_ERR);
if (aOffset < 0 || aOffset > aParent->Length()) { if (aOffset < 0 || PRUint32(aOffset) > aParent->Length()) {
return NS_ERROR_DOM_INDEX_SIZE_ERR; return NS_ERROR_DOM_INDEX_SIZE_ERR;
} }
@ -993,7 +993,7 @@ nsRange::SetEnd(nsINode* aParent, PRInt32 aOffset)
nsINode* newRoot = IsValidBoundary(aParent); nsINode* newRoot = IsValidBoundary(aParent);
NS_ENSURE_TRUE(newRoot, NS_ERROR_DOM_INVALID_NODE_TYPE_ERR); NS_ENSURE_TRUE(newRoot, NS_ERROR_DOM_INVALID_NODE_TYPE_ERR);
if (aOffset < 0 || aOffset > aParent->Length()) { if (aOffset < 0 || PRUint32(aOffset) > aParent->Length()) {
return NS_ERROR_DOM_INDEX_SIZE_ERR; return NS_ERROR_DOM_INDEX_SIZE_ERR;
} }