Bug 738581 - fix various warning on mozilla/intl. r=smontagu
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 26 Mar 2012 11:27:52 +0900
changeset 93597 75b2f91a3b8053dbb06d2b796a2d38b3b81f98d1
parent 93596 95c4ed9b56f2d35e296b51691fe93b3f65461f4b
child 93598 9726ff9a8868cdae779348f65d8db1b8e8eec702
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmontagu
bugs738581
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 738581 - fix various warning on mozilla/intl. r=smontagu
intl/locale/src/windows/nsWin32Locale.cpp
intl/uconv/src/nsConverterInputStream.cpp
intl/uconv/util/nsUCSupport.h
--- a/intl/locale/src/windows/nsWin32Locale.cpp
+++ b/intl/locale/src/windows/nsWin32Locale.cpp
@@ -642,17 +642,17 @@ nsWin32Locale::GetPlatformLocale(const n
       *winLCID = lcid;
       return NS_OK;
     }
   }
 
   char    locale_string[9] = {'\0','\0','\0','\0','\0','\0','\0','\0','\0'};
   char*   language_code;
   char*   country_code;
-  int     i,j;
+  size_t  i, j;
 
   // parse the locale
   const PRUnichar* data;
   j = NS_StringGetData(locale, &data);
   for (i = 0; i < 7 && i < j; i++) {
     locale_string[i] = data[i] == '-' ? '\0' : data[i];
   }
 
@@ -695,17 +695,17 @@ nsWin32Locale::GetXPLocale(LCID winLCID,
     if (rv != 0)
     {
       locale.Assign(ret_locale);
       return;
     }
   }
 
   DWORD    lang_id, sublang_id;
-  int      i,j;
+  size_t   i, j;
 
   lang_id = PRIMARYLANGID(LANGIDFROMLCID(winLCID));
   sublang_id = SUBLANGID(LANGIDFROMLCID(winLCID));
 
   /* Special-case Norwegian Bokmal and Norwegian Nynorsk, which have the same
      LANG_ID on Windows, but have separate ISO-639-2 codes */
   if (lang_id == LANG_NORWEGIAN) {
     if (sublang_id == SUBLANG_NORWEGIAN_BOKMAL) {
@@ -749,17 +749,17 @@ nsWin32Locale::GetXPLocale(LCID winLCID,
   locale.AssignLiteral("en-US"); 
   return;
 }
 
 #ifdef DEBUG
 void
 test_internal_tables(void)
 {
-	int	i;
+	size_t i;
 
 	for(i=1;i<LENGTH_MAPPING_LIST;i++) {
 		if (strcmp(dbg_list[i-1].iso_code,dbg_list[i].iso_code)>=0)
 			fprintf(stderr,"nsLocale: language_list %s and %s are not ordered\n",dbg_list[i-1].iso_code,dbg_list[i].iso_code);
 	}
 
 	i=0;
 	while(strlen(dbg_list[i].iso_code)!=0) {
--- a/intl/uconv/src/nsConverterInputStream.cpp
+++ b/intl/uconv/src/nsConverterInputStream.cpp
@@ -250,17 +250,17 @@ nsConverterInputStream::Fill(nsresult * 
       // bug 160784 again
       srcConsumed = NS_MAX<PRUint32>(srcConsumed, 0);
       mConverter->Reset();
     }
     NS_ASSERTION(srcConsumed <= mByteData->GetLength(),
                  "Whoa.  The converter should have returned NS_OK_UDEC_MOREINPUT before this point!");
   } while (mReplacementChar &&
            NS_FAILED(*aErrorCode) &&
-           mUnicharData->GetBufferSize() > mUnicharDataLength);
+           PRUint32(mUnicharData->GetBufferSize()) > mUnicharDataLength);
 
   mLeftOverBytes = mByteData->GetLength() - srcConsumed;
 
   return mUnicharDataLength;
 }
 
 NS_IMETHODIMP
 nsConverterInputStream::ReadLine(nsAString& aLine, bool* aResult)
--- a/intl/uconv/util/nsUCSupport.h
+++ b/intl/uconv/util/nsUCSupport.h
@@ -44,17 +44,17 @@
 #include "uconvutil.h"
 #include "mozilla/Mutex.h"
 
 #define ONE_BYTE_TABLE_SIZE 256
 
 inline bool WillOverrun(PRUnichar* aDest, PRUnichar* aDestEnd, PRUint32 aLength)
 {
   NS_ASSERTION(aDest <= aDestEnd, "Pointer overrun even before check");
-  return ((aDestEnd - aDest) < aLength);
+  return (PRUint32(aDestEnd - aDest) < aLength);
 }
 #define CHECK_OVERRUN(dest, destEnd, length) (WillOverrun(dest, destEnd, length))
 
 #ifdef NS_DEBUG
 // {7AFC9F0A-CFE1-44ea-A755-E3B86AB1226E}
 #define NS_IBASICDECODER_IID \
 { 0x7afc9f0a, 0xcfe1, 0x44ea, { 0xa7, 0x55, 0xe3, 0xb8, 0x6a, 0xb1, 0x22, 0x6e } }