summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfwarmerdam <fwarmerdam>2012-06-15 21:51:54 +0000
committerfwarmerdam <fwarmerdam>2012-06-15 21:51:54 +0000
commit4ffb112c500fd0fd7dcd718c2d4da3267dc90951 (patch)
tree1190f372432964cd015db798fdf3db0a304c963e
parent2be6a8052e98adf6804990a951e0c0f028edba2b (diff)
downloadlibtiff-4ffb112c500fd0fd7dcd718c2d4da3267dc90951.tar.gz
avoid some clang warnings
-rw-r--r--ChangeLog5
-rw-r--r--tools/tiff2pdf.c6
-rw-r--r--tools/tiffdump.c6
3 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 16711866..344a7a6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-15 Frank Warmerdam <warmerdam@google.com>
+
+ * tools/tif2pdf.c, tools/tifdump.c: avoid unitialized variable
+ warnings with clang.
+
2012-06-15 Tom Lane <tgl@sss.pgh.pa.us>
* tools/tiff2pdf.c: Defend against integer overflows while
diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
index 484d9e5f..81431436 100644
--- a/tools/tiff2pdf.c
+++ b/tools/tiff2pdf.c
@@ -1,4 +1,4 @@
-/* $Id: tiff2pdf.c,v 1.66 2012-06-15 21:44:31 tgl Exp $
+/* $Id: tiff2pdf.c,v 1.67 2012-06-15 21:51:54 fwarmerdam Exp $
*
* tiff2pdf - converts a TIFF image to a PDF document
*
@@ -3433,11 +3433,11 @@ void t2p_tile_collapse_left(
uint32 edgetilewidth,
uint32 tilelength){
- uint32 i=0;
+ uint32 i;
tsize_t edgescanwidth=0;
edgescanwidth = (scanwidth * edgetilewidth + (tilewidth - 1))/ tilewidth;
- for(i=i;i<tilelength;i++){
+ for(i=0;i<tilelength;i++){
_TIFFmemcpy(
&(((char*)buffer)[edgescanwidth*i]),
&(((char*)buffer)[scanwidth*i]),
diff --git a/tools/tiffdump.c b/tools/tiffdump.c
index 86113bbc..c1caafbc 100644
--- a/tools/tiffdump.c
+++ b/tools/tiffdump.c
@@ -1,4 +1,4 @@
-/* $Id: tiffdump.c,v 1.25 2011-04-02 20:54:09 bfriesen Exp $ */
+/* $Id: tiffdump.c,v 1.26 2012-06-15 21:51:54 fwarmerdam Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -266,7 +266,7 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
uint16 dircount;
uint32 direntrysize;
void* dirmem = NULL;
- uint64 nextdiroff;
+ uint64 nextdiroff = 0;
uint32 n;
uint8* dp;
@@ -289,7 +289,7 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
TIFFSwabShort(&dircount);
direntrysize = 12;
} else {
- uint64 dircount64;
+ uint64 dircount64 = 0;
if (read(fd, (char*) &dircount64, sizeof (uint64)) != sizeof (uint64)) {
ReadError("directory count");
goto done;