Avoid warnings.

This commit is contained in:
Andrey Kiselev 2006-10-12 15:00:49 +00:00
parent c92f74ccc1
commit f6c9458485

View File

@ -1,4 +1,4 @@
/* $Id: tif_next.c,v 1.7 2006-09-28 16:26:03 dron Exp $ */ /* $Id: tif_next.c,v 1.8 2006-10-12 15:00:49 dron Exp $ */
/* /*
* Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1988-1997 Sam Leffler
@ -48,11 +48,10 @@
static int static int
NeXTDecode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s) NeXTDecode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
{ {
register unsigned char *bp, *op; unsigned char *bp, *op;
register tsize_t cc; tsize_t cc;
register int n;
tidata_t row; tidata_t row;
tsize_t scanline; tsize_t scanline, n;
(void) s; (void) s;
/* /*
@ -66,7 +65,7 @@ NeXTDecode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
bp = (unsigned char *)tif->tif_rawcp; bp = (unsigned char *)tif->tif_rawcp;
cc = tif->tif_rawcc; cc = tif->tif_rawcc;
scanline = tif->tif_scanlinesize; scanline = tif->tif_scanlinesize;
for (row = buf; (long)occ > 0; occ -= scanline, row += scanline) { for (row = buf; occ > 0; occ -= scanline, row += scanline) {
n = *bp++, cc--; n = *bp++, cc--;
switch (n) { switch (n) {
case LITERALROW: case LITERALROW:
@ -80,10 +79,10 @@ NeXTDecode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
cc -= scanline; cc -= scanline;
break; break;
case LITERALSPAN: { case LITERALSPAN: {
int off; tsize_t off;
/* /*
* The scanline has a literal span * The scanline has a literal span that begins at some
* that begins at some offset. * offset.
*/ */
off = (bp[0] * 256) + bp[1]; off = (bp[0] * 256) + bp[1];
n = (bp[2] * 256) + bp[3]; n = (bp[2] * 256) + bp[3];
@ -95,8 +94,8 @@ NeXTDecode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
break; break;
} }
default: { default: {
register int npixels = 0, grey; uint32 npixels = 0, grey;
unsigned long imagewidth = tif->tif_dir.td_imagewidth; uint32 imagewidth = tif->tif_dir.td_imagewidth;
/* /*
* The scanline is composed of a sequence of constant * The scanline is composed of a sequence of constant
@ -115,7 +114,7 @@ NeXTDecode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
*/ */
while (n-- > 0 && npixels < imagewidth) while (n-- > 0 && npixels < imagewidth)
SETPIXEL(op, grey); SETPIXEL(op, grey);
if (npixels >= (int) imagewidth) if (npixels >= imagewidth)
break; break;
if (cc == 0) if (cc == 0)
goto bad; goto bad;