Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-q.b-one.net (mx-q.one.com [91.198.169.248])
	by mail9.b-one.net (Postfix) with ESMTP id EB6E7400F7E
	for <info@awaresystems.be>; Mon, 30 May 2011 09:04:39 +0200 (CEST)
Received: by mx-q.b-one.net (Postfix, from userid 106)
	id DAECE162AD1B; Mon, 30 May 2011 09:03:39 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-q.b-one.net (Postfix) with ESMTP id 64D111544F75 for
 <info@awaresystems.be>; Mon, 30 May 2011 09:03:30 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id 6ED2B86E4D; Mon, 30 May 2011
 02:01:29 -0500 (EST)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64]) by
 lists.maptools.org (Postfix) with ESMTP id 0D92186E20 for
 <tiff@lists.maptools.org>; Mon, 30 May 2011 01:54:41 -0500 (EST)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id
 B65F56009D; Mon, 30 May 2011 08:54:40 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: tiff@lists.maptools.org
Date: Mon, 30 May 2011 08:54:32 +0200
Message-Id: <1306738475-5558-3-git-send-email-jim@meyering.net>
X-Mailer: git-send-email 1.7.5.3
In-Reply-To: <1306738475-5558-1-git-send-email-jim@meyering.net>
References: <1306738475-5558-1-git-send-email-jim@meyering.net>
Subject: [Tiff] [PATCH 2/5] avoid set-but-not-used warning from gcc
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

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

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
