fix some gcc 4 warnings in xpcom. patch by Christian Haberstroh.
b=382753 r=bent sr=bsmedberg
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -2741,17 +2741,17 @@ nsComponentManagerImpl::GetLoaderType(co
if (!strcmp(typeStr, staticComponentType))
return NS_LOADER_TYPE_STATIC;
if (!strcmp(typeStr, nativeComponentType))
return NS_LOADER_TYPE_NATIVE;
const nsDependentCString type(typeStr);
- for (int i=0; i < mLoaderData.Length(); ++i) {
+ for (unsigned int i = 0; i < mLoaderData.Length(); ++i) {
if (mLoaderData[i].type == type)
return i;
}
return NS_LOADER_TYPE_INVALID;
}
// Add a loader type if not already known. Out the typeIndex
@@ -3095,17 +3095,17 @@ nsComponentManagerImpl::LoadLeftoverComp
void
nsComponentManagerImpl::LoadDeferredModules(nsTArray<DeferredModule> &aDeferred)
{
// We keep looping through deferred components until one of
// 1) they're all gone
// 2) we loop through and none of them succeed
- PRInt32 lastCount = PR_INT32_MAX;
+ PRUint32 lastCount = PR_UINT32_MAX;
while (aDeferred.Length() > 0 &&
lastCount > aDeferred.Length()) {
lastCount = aDeferred.Length();
for (PRInt32 i = aDeferred.Length() - 1; i >= 0; --i) {
DeferredModule &d = aDeferred[i];
nsresult rv = d.module->RegisterSelf(this,
--- a/xpcom/io/nsLocalFileOSX.cpp
+++ b/xpcom/io/nsLocalFileOSX.cpp
@@ -2257,17 +2257,17 @@ void nsLocalFile::NSPRtoHFSPlusTime(PRIn
nsresult nsLocalFile::CFStringReftoUTF8(CFStringRef aInStrRef, nsACString& aOutStr)
{
nsresult rv = NS_ERROR_FAILURE;
CFIndex usedBufLen, inStrLen = ::CFStringGetLength(aInStrRef);
CFIndex charsConverted = ::CFStringGetBytes(aInStrRef, CFRangeMake(0, inStrLen),
kCFStringEncodingUTF8, 0, PR_FALSE, nsnull, 0, &usedBufLen);
if (charsConverted == inStrLen) {
aOutStr.SetLength(usedBufLen);
- if (aOutStr.Length() != usedBufLen)
+ if (aOutStr.Length() != (unsigned int)usedBufLen)
return NS_ERROR_OUT_OF_MEMORY;
UInt8 *buffer = (UInt8*) aOutStr.BeginWriting();
::CFStringGetBytes(aInStrRef, CFRangeMake(0, inStrLen),
kCFStringEncodingUTF8, 0, false, buffer, usedBufLen, &usedBufLen);
rv = NS_OK;
}
return rv;