AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
May 2011

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2011.05.30 06:54 "tiff-4.0.0beta7: fix/mark a few minor bugs", by Jim Meyering
2011.05.30 06:54 "[PATCH 1/5] do not dereference NULL upon failed malloc", by Jim Meyering
2011.05.30 06:54 "[PATCH 2/5] avoid set-but-not-used warning from gcc", by Jim Meyering
2011.05.30 06:54 "[PATCH 3/5] tiff2pdf.c: remove decl+set of set-but-not-used local, "written"", by Jim Meyering
2011.05.30 06:54 "[PATCH 4/5] mark NULL-deref and possible overflow", by Jim Meyering
2011.05.30 06:54 "[PATCH 5/5] * rgb2ycbcr.c (cvtRaster): unchecked malloc", by Jim Meyering

2011.05.30 06:54 "[PATCH 2/5] avoid set-but-not-used warning from gcc", by Jim Meyering

From: Jim Meyering <meyering@redhat.com>

* libtiff/tif_jpeg.c (JPEGInitializeLibJPEG): Remove declaration
and set of otherwise unused local, data_is_empty.
Once that and related tests removed, "byte_counts" was unused,
so remove it, too.
---
 ChangeLog          |    6 ++++++
 libtiff/tif_jpeg.c |   20 --------------------
 2 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2a9530b..fa910da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-19  Jim Meyering  <meyering@redhat.com>
+
+	avoid set-but-not-used warning from gcc
+	* libtiff/tif_jpeg.c (JPEGInitializeLibJPEG): Remove declaration
+	and set of otherwise unused local, data_is_empty.
+
 2011-04-18  Jim Meyering  <meyering@redhat.com>

 	do not dereference NULL upon failed malloc
diff --git a/libtiff/tif_jpeg.c b/libtiff/tif_jpeg.c
index fb31f48..681b65b 100644
--- a/libtiff/tif_jpeg.c
+++ b/libtiff/tif_jpeg.c
@@ -2189,8 +2189,6 @@ JPEGDefaultTileSize(TIFF* tif, uint32* tw, uint32* th)
 static int JPEGInitializeLibJPEG( TIFF * tif, int decompress )
 {
     JPEGState* sp = JState(tif);
-    uint64* byte_counts = NULL;
-    int     data_is_empty = TRUE;

     if(sp->cinfo_initialized)
     {
@@ -2205,24 +2203,6 @@ static int JPEGInitializeLibJPEG( TIFF * tif, int decompress )
     }

     /*
-     * Do we have tile data already?  Make sure we initialize the
-     * the state in decompressor mode if we have tile data, even if we
-     * are not in read-only file access mode. 
-     */
-    if( TIFFIsTiled( tif ) 
-        && TIFFGetField( tif, TIFFTAG_TILEBYTECOUNTS, &byte_counts ) 
-        && byte_counts != NULL )
-    {
-        data_is_empty = byte_counts[0] == 0;
-    }
-    if( !TIFFIsTiled( tif ) 
-        && TIFFGetField( tif, TIFFTAG_STRIPBYTECOUNTS, &byte_counts) 
-        && byte_counts != NULL )
-    {
-        data_is_empty = byte_counts[0] == 0;
-    }
-
-    /*
      * Initialize libjpeg.
      */
     if ( decompress ) {
-- 
1.7.5.2.660.g9f46c