Avoid warnings.

This commit is contained in:
Andrey Kiselev 2004-09-02 14:51:04 +00:00
parent b75684f6ba
commit 8ae15719de

View File

@ -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 * Copyright (c) 1991-1997 Sam Leffler
@ -24,11 +24,17 @@
* OF THIS SOFTWARE. * OF THIS SOFTWARE.
*/ */
#include "tif_config.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "tiffio.h" #include "tiffio.h"
#if defined(_WINDOWS) || defined(MSDOS) #if defined(_WINDOWS) || defined(MSDOS)
@ -58,13 +64,13 @@ BadPPM(char* file)
int int
main(int argc, char* argv[]) main(int argc, char* argv[])
{ {
uint16 photometric; uint16 photometric = 0;
uint32 rowsperstrip = (uint32) -1; uint32 rowsperstrip = (uint32) -1;
double resolution = -1; double resolution = -1;
unsigned char *buf = NULL; unsigned char *buf = NULL;
uint32 row; uint32 row;
tsize_t linebytes; tsize_t linebytes;
uint16 spp; uint16 spp = 1;
TIFF *out; TIFF *out;
FILE *in; FILE *in;
uint32 w, h; uint32 w, h;
@ -154,7 +160,7 @@ main(int argc, char* argv[])
ungetc(c, in); ungetc(c, in);
break; break;
} }
if (fscanf(in, " %ld %ld %d", &w, &h, &prec) != 3) if (fscanf(in, " %lu %lu %d", &w, &h, &prec) != 3)
BadPPM(infile); BadPPM(infile);
if (fgetc(in) != '\n' || w <= 0 || h <= 0 || prec != 255) if (fgetc(in) != '\n' || w <= 0 || h <= 0 || prec != 255)
BadPPM(infile); BadPPM(infile);
@ -270,3 +276,5 @@ usage(void)
fprintf(stderr, "%s\n", stuff[i]); fprintf(stderr, "%s\n", stuff[i]);
exit(-1); exit(-1);
} }
/* vim: set ts=8 sts=8 sw=8 noet: */