From 8ae15719dede915e81215d66017a02a6d0201de1 Mon Sep 17 00:00:00 2001 From: Andrey Kiselev Date: Thu, 2 Sep 2004 14:51:04 +0000 Subject: [PATCH] Avoid warnings. --- tools/ppm2tiff.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/ppm2tiff.c b/tools/ppm2tiff.c index 46e2b266..10ca13d8 100644 --- a/tools/ppm2tiff.c +++ b/tools/ppm2tiff.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/tools/ppm2tiff.c,v 1.6 2003-05-05 10:40:04 dron Exp $ */ +/* $Id: ppm2tiff.c,v 1.7 2004-09-02 14:51:04 dron Exp $ */ /* * Copyright (c) 1991-1997 Sam Leffler @@ -24,11 +24,17 @@ * OF THIS SOFTWARE. */ +#include "tif_config.h" + #include #include #include #include +#ifdef HAVE_UNISTD_H +# include +#endif + #include "tiffio.h" #if defined(_WINDOWS) || defined(MSDOS) @@ -58,13 +64,13 @@ BadPPM(char* file) int main(int argc, char* argv[]) { - uint16 photometric; + uint16 photometric = 0; uint32 rowsperstrip = (uint32) -1; double resolution = -1; unsigned char *buf = NULL; uint32 row; tsize_t linebytes; - uint16 spp; + uint16 spp = 1; TIFF *out; FILE *in; uint32 w, h; @@ -154,7 +160,7 @@ main(int argc, char* argv[]) ungetc(c, in); break; } - if (fscanf(in, " %ld %ld %d", &w, &h, &prec) != 3) + if (fscanf(in, " %lu %lu %d", &w, &h, &prec) != 3) BadPPM(infile); if (fgetc(in) != '\n' || w <= 0 || h <= 0 || prec != 255) BadPPM(infile); @@ -270,3 +276,5 @@ usage(void) fprintf(stderr, "%s\n", stuff[i]); exit(-1); } + +/* vim: set ts=8 sts=8 sw=8 noet: */