fix some gcc 4 warnings in xpcom. patch by Christian Haberstroh. b=382753 r=bent sr=bsmedberg
authorjoshmoz@gmail.com
Mon, 04 Jun 2007 08:44:43 -0700
changeset 2096 cc44992a2850d199aa04d7ea1d5e8dac5c80d938
parent 2095 d4e9ee67cb77ba3e6f1b5eff48bd40ec4b8b71f3
child 2097 9d42060483fa426417b03ce7c17632ac6a642bc6
push idunknown
push userunknown
push dateunknown
reviewersbent, bsmedberg
bugs382753
milestone1.9a6pre
fix some gcc 4 warnings in xpcom. patch by Christian Haberstroh. b=382753 r=bent sr=bsmedberg
xpcom/components/nsComponentManager.cpp
xpcom/io/nsLocalFileOSX.cpp
--- 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;