Bug 505385 - Part 4: Fix some warnings. r=joe
authorBobby Holley <bobbyholley@gmail.com>
Thu, 11 Oct 2012 21:34:22 -0400
changeset 110148 5c2493ac96c73111b0d1372b70828ebd26b3f2b1
parent 110147 9a20e6883f785961b02cdd461e35e5c88b3e998c
child 110149 09090d1ae8a028dbec397f80dc049c8071dd5285
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersjoe
bugs505385
milestone19.0a1
Bug 505385 - Part 4: Fix some warnings. r=joe
image/decoders/nsICODecoder.cpp
image/encoders/ico/nsICOEncoder.cpp
--- a/image/decoders/nsICODecoder.cpp
+++ b/image/decoders/nsICODecoder.cpp
@@ -453,20 +453,20 @@ nsICODecoder::WriteInternal(const char* 
   // If we have a BMP
   if (!mIsPNG && mContainedDecoder && mPos >= mImageOffset + BITMAPINFOSIZE) {
     uint16_t numColors = GetNumColors();
     if (numColors == (uint16_t)-1) {
       PostDataError();
       return;
     }
     // Feed the actual image data (not including headers) into the BMP decoder
-    int32_t bmpDataOffset = mDirEntry.mImageOffset + BITMAPINFOSIZE;
-    int32_t bmpDataEnd = mDirEntry.mImageOffset + BITMAPINFOSIZE + 
-                         static_cast<nsBMPDecoder*>(mContainedDecoder.get())->GetCompressedImageSize() +
-                         4 * numColors;
+    uint32_t bmpDataOffset = mDirEntry.mImageOffset + BITMAPINFOSIZE;
+    uint32_t bmpDataEnd = mDirEntry.mImageOffset + BITMAPINFOSIZE + 
+                          static_cast<nsBMPDecoder*>(mContainedDecoder.get())->GetCompressedImageSize() +
+                          4 * numColors;
 
     // If we are feeding in the core image data, but we have not yet
     // reached the ICO's 'AND buffer mask'
     if (mPos >= bmpDataOffset && mPos < bmpDataEnd) {
 
       // Figure out how much data the BMP decoder wants
       uint32_t toFeed = bmpDataEnd - mPos;
       if (toFeed > aCount) {
--- a/image/encoders/ico/nsICOEncoder.cpp
+++ b/image/encoders/ico/nsICOEncoder.cpp
@@ -273,17 +273,17 @@ nsICOEncoder::ParseOptions(const nsAStri
   // From format: format=<png|bmp>;bpp=<bpp_value>
   // to format: [0] = format=<png|bmp>, [1] = bpp=<bpp_value>
   nsTArray<nsCString> nameValuePairs;
   if (!ParseString(NS_ConvertUTF16toUTF8(aOptions), ';', nameValuePairs)) {
     return NS_ERROR_INVALID_ARG;
   }
 
   // For each name/value pair in the set
-  for (int i = 0; i < nameValuePairs.Length(); ++i) {
+  for (unsigned i = 0; i < nameValuePairs.Length(); ++i) {
 
     // Split the name value pair [0] = name, [1] = value
     nsTArray<nsCString> nameValuePair;
     if (!ParseString(nameValuePairs[i], '=', nameValuePair)) {
       return NS_ERROR_INVALID_ARG;
     }
     if (nameValuePair.Length() != 2) {
       return NS_ERROR_INVALID_ARG;