
Thread
2011.05.30 06:54 "[Tiff] [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 @@
+ 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