diff --git a/editor/libeditor/html/nsWSRunObject.cpp b/editor/libeditor/html/nsWSRunObject.cpp
index 6e7c7fad44e..dc22490e5cd 100644
--- a/editor/libeditor/html/nsWSRunObject.cpp
+++ b/editor/libeditor/html/nsWSRunObject.cpp
@@ -733,7 +733,7 @@ nsWSRunObject::GetWSNodes()
for (pos=mOffset-1; pos>=0; pos--)
{
// sanity bounds check the char position. bug 136165
- if (pos >= textFrag->GetLength())
+ if (PRUint32(pos) >= textFrag->GetLength())
{
NS_NOTREACHED("looking beyond end of text fragment");
continue;
@@ -801,7 +801,7 @@ nsWSRunObject::GetWSNodes()
for (pos=len-1; pos>=0; pos--)
{
// sanity bounds check the char position. bug 136165
- if (pos >= textFrag->GetLength())
+ if (PRUint32(pos) >= textFrag->GetLength())
{
NS_NOTREACHED("looking beyond end of text fragment");
continue;
@@ -860,13 +860,13 @@ nsWSRunObject::GetWSNodes()
const nsTextFragment *textFrag = textNode->GetText();
PRUint32 len = textNode->TextLength();
- if (mOffset=textFrag->GetLength()))
+ if ((pos<0) || (PRUint32(pos)>=textFrag->GetLength()))
{
NS_NOTREACHED("looking beyond end of text fragment");
continue;
@@ -932,10 +932,10 @@ nsWSRunObject::GetWSNodes()
else
{
PRInt32 pos;
- for (pos=0; pos= textFrag->GetLength())
+ if (PRUint32(pos) >= textFrag->GetLength())
{
NS_NOTREACHED("looking beyond end of text fragment");
continue;
@@ -1587,7 +1587,7 @@ nsWSRunObject::DeleteChars(nsIDOMNode *aStartNode, PRInt32 aStartOffset,
textnode = do_QueryInterface(node);
PRUint32 len;
textnode->GetLength(&len);
- if (aStartOffsetDeleteText(textnode, (PRUint32)aStartOffset, len-aStartOffset);
NS_ENSURE_SUCCESS(res, res);
@@ -1695,7 +1695,7 @@ nsWSRunObject::GetCharAfter(WSPoint &aPoint, WSPoint *outPoint)
if (idx == -1) return NS_OK; // can't find point, but it's not an error
PRInt32 numNodes = mNodeArray.Count();
- if (aPoint.mOffset < aPoint.mTextNode->TextLength())
+ if (PRUint16(aPoint.mOffset) < aPoint.mTextNode->TextLength())
{
*outPoint = aPoint;
outPoint->mChar = GetCharAt(aPoint.mTextNode, aPoint.mOffset);
@@ -1941,7 +1941,7 @@ nsWSRunObject::GetCharAt(nsIContent *aTextNode, PRInt32 aOffset)
return 0;
PRUint32 len = aTextNode->TextLength();
- if (aOffset < 0 || aOffset >= len)
+ if (aOffset < 0 || aOffset >= PRUint32(len))
return 0;
return aTextNode->GetText()->CharAt(aOffset);
diff --git a/editor/libeditor/text/nsTextEditRules.cpp b/editor/libeditor/text/nsTextEditRules.cpp
index 4c7673c92ae..02ff60b7fbe 100644
--- a/editor/libeditor/text/nsTextEditRules.cpp
+++ b/editor/libeditor/text/nsTextEditRules.cpp
@@ -534,8 +534,8 @@ GetTextNode(nsISelection *selection, nsEditor *editor) {
#define ASSERT_PASSWORD_LENGTHS_EQUAL() \
if (IsPasswordEditor()) { \
PRInt32 txtLen; \
- mEditor->GetTextLength(&txtLen); \
- NS_ASSERTION(mPasswordText.Length() == txtLen, \
+ mEditor->GetTextLength(&txtLen); \
+ NS_ASSERTION(mPasswordText.Length() == PRUint32(txtLen), \
"password length not equal to number of asterisks"); \
}
#else
diff --git a/editor/txtsvc/src/nsTextServicesDocument.cpp b/editor/txtsvc/src/nsTextServicesDocument.cpp
index 885c13ed9a2..2c86da8c050 100644
--- a/editor/txtsvc/src/nsTextServicesDocument.cpp
+++ b/editor/txtsvc/src/nsTextServicesDocument.cpp
@@ -4028,8 +4028,9 @@ nsTextServicesDocument::FindWordBounds(nsTArray *aOffsetTable,
// character covered by this entry, we will use the next
// entry if there is one.
- if (entry->mStrOffset <= res.mBegin &&
- (res.mBegin < strEndOffset || (res.mBegin == strEndOffset && i == lastIndex)))
+ if (PRUint32(entry->mStrOffset) <= res.mBegin &&
+ (res.mBegin < PRUint32(strEndOffset) ||
+ (res.mBegin == PRUint32(strEndOffset) && i == lastIndex)))
{
if (aWordStartNode)
{
@@ -4052,9 +4053,9 @@ nsTextServicesDocument::FindWordBounds(nsTArray *aOffsetTable,
// Check to see if res.mEnd is within the range covered
// by this entry.
- if (entry->mStrOffset <= res.mEnd && res.mEnd <= strEndOffset)
+ if (PRUint32(entry->mStrOffset) <= res.mEnd && res.mEnd <= PRUint32(strEndOffset))
{
- if (res.mBegin == res.mEnd && res.mEnd == strEndOffset && i != lastIndex)
+ if (res.mBegin == res.mEnd && res.mEnd == PRUint32(strEndOffset) && i != lastIndex)
{
// Wait for the next round so that we use the same entry
// we did for aWordStartNode.