Bug 744686 - Comment out unused |alpha_bits| variable to fix a compile warning. r=jmuizelaar.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 17 Oct 2012 15:54:25 -0700
changeset 110611 357a60386b52860f2d96a8903d4e13bd7bb25b7b
parent 110610 c258aeed70916abdc61106c00439ac1778729cf4
child 110612 205475d5c2b77c88cc040fe7ad3a9d6994f48553
push id16634
push usernnethercote@mozilla.com
push dateWed, 17 Oct 2012 22:57:54 +0000
treeherdermozilla-inbound@357a60386b52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmuizelaar
bugs744686
milestone19.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 744686 - Comment out unused |alpha_bits| variable to fix a compile warning. r=jmuizelaar.
image/decoders/nsPNGDecoder.cpp
--- a/image/decoders/nsPNGDecoder.cpp
+++ b/image/decoders/nsPNGDecoder.cpp
@@ -578,16 +578,18 @@ nsPNGDecoder::info_callback(png_structp 
    * members and whatnot, after which we can get channels, rowbytes, etc. */
   png_read_update_info(png_ptr, info_ptr);
   decoder->mChannels = channels = png_get_channels(png_ptr, info_ptr);
 
   /*---------------------------------------------------------------*/
   /* copy PNG info into imagelib structs (formerly png_set_dims()) */
   /*---------------------------------------------------------------*/
 
+  // This code is currently unused, but it will be needed for bug 517713.
+#if 0
   int32_t alpha_bits = 1;
 
   if (channels == 2 || channels == 4) {
     /* check if alpha is coming from a tRNS chunk and is binary */
     if (num_trans) {
       /* if it's not an indexed color image, tRNS means binary */
       if (color_type == PNG_COLOR_TYPE_PALETTE) {
         for (int i=0; i<num_trans; i++) {
@@ -596,16 +598,17 @@ nsPNGDecoder::info_callback(png_structp 
             break;
           }
         }
       }
     } else {
       alpha_bits = 8;
     }
   }
+#endif
 
   if (channels == 1 || channels == 3)
     decoder->format = gfxASurface::ImageFormatRGB24;
   else if (channels == 2 || channels == 4)
     decoder->format = gfxASurface::ImageFormatARGB32;
 
 #ifdef PNG_APNG_SUPPORTED
   if (png_get_valid(png_ptr, info_ptr, PNG_INFO_acTL))