Bug 660694 - Fix comparisons between signed and unsigned integer expressions in nsDOMBlobBuilder.cpp by using unsigned integers consistently; r=sicking

This commit is contained in:
Ms2ger 2011-06-02 14:56:46 +02:00
parent 4ee45e739a
commit 11f3746889

View File

@ -151,16 +151,16 @@ nsDOMMultipartBlob::MozSlice(PRInt64 aStart, PRInt64 aEnd,
aEnd = (PRInt64)thisLength;
}
// Modifies aStart and aEnd.
ParseSize((PRInt64)thisLength, aStart, aEnd);
// If we clamped to nothing we create an empty blob
nsTArray<nsCOMPtr<nsIDOMBlob> > blobs;
PRInt64 length = aEnd - aStart;
PRUint64 finalLength = length;
PRUint64 length = aEnd - aStart;
PRUint64 skipStart = aStart;
NS_ABORT_IF_FALSE(aStart + length <= thisLength, "Er, what?");
NS_ABORT_IF_FALSE(PRUint64(aStart) + length <= thisLength, "Er, what?");
// Prune the list of blobs if we can
PRUint32 i;
@ -172,7 +172,7 @@ nsDOMMultipartBlob::MozSlice(PRInt64 aStart, PRInt64 aEnd,
NS_ENSURE_SUCCESS(rv, rv);
if (skipStart < l) {
PRInt64 upperBound = NS_MIN<PRInt64>(l - skipStart, length);
PRUint64 upperBound = NS_MIN<PRUint64>(l - skipStart, length);
nsCOMPtr<nsIDOMBlob> firstBlob;
rv = mBlobs.ElementAt(i)->MozSlice(skipStart, skipStart + upperBound,
@ -212,7 +212,7 @@ nsDOMMultipartBlob::MozSlice(PRInt64 aStart, PRInt64 aEnd,
} else {
blobs.AppendElement(blob);
}
length -= NS_MIN<PRInt64>(l, length);
length -= NS_MIN<PRUint64>(l, length);
}
// we can create our blob now