Avoid warnings.

This commit is contained in:
Andrey Kiselev 2005-11-23 22:38:30 +00:00
parent 165f748dc8
commit 8ec770819c
4 changed files with 27 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $Id: tif_fax3.c,v 1.34 2005-10-20 14:23:49 fwarmerdam Exp $ */ /* $Id: tif_fax3.c,v 1.35 2005-11-23 22:38:30 dron Exp $ */
/* /*
* Copyright (c) 1990-1997 Sam Leffler * Copyright (c) 1990-1997 Sam Leffler
@ -462,10 +462,9 @@ Fax3SetupState(TIFF* tif)
{ {
TIFFDirectory* td = &tif->tif_dir; TIFFDirectory* td = &tif->tif_dir;
Fax3BaseState* sp = Fax3State(tif); Fax3BaseState* sp = Fax3State(tif);
long rowbytes, rowpixels;
int needsRefLine; int needsRefLine;
Fax3CodecState* dsp = (Fax3CodecState*) Fax3State(tif); Fax3CodecState* dsp = (Fax3CodecState*) Fax3State(tif);
uint32 nruns; uint32 rowbytes, rowpixels, nruns;
if (td->td_bitspersample != 1) { if (td->td_bitspersample != 1) {
TIFFError(tif->tif_name, TIFFError(tif->tif_name,
@ -796,7 +795,7 @@ find0span(unsigned char* bp, int32 bs, int32 be)
bp++; bp++;
} else } else
span = 0; span = 0;
if (bits >= 2*8*sizeof (long)) { if (bits >= (int32)(2 * 8 * sizeof(long))) {
long* lp; long* lp;
/* /*
* Align to longword boundary and check longwords. * Align to longword boundary and check longwords.
@ -808,7 +807,7 @@ find0span(unsigned char* bp, int32 bs, int32 be)
bp++; bp++;
} }
lp = (long*) bp; lp = (long*) bp;
while (bits >= 8*sizeof (long) && *lp == 0) { while ((bits >= (int32)(8 * sizeof(long))) && (0 == *lp)) {
span += 8*sizeof (long), bits -= 8*sizeof (long); span += 8*sizeof (long), bits -= 8*sizeof (long);
lp++; lp++;
} }
@ -855,7 +854,7 @@ find1span(unsigned char* bp, int32 bs, int32 be)
bp++; bp++;
} else } else
span = 0; span = 0;
if (bits >= 2*8*sizeof (long)) { if (bits >= (int32)(2 * 8 * sizeof(long))) {
long* lp; long* lp;
/* /*
* Align to longword boundary and check longwords. * Align to longword boundary and check longwords.
@ -867,7 +866,7 @@ find1span(unsigned char* bp, int32 bs, int32 be)
bp++; bp++;
} }
lp = (long*) bp; lp = (long*) bp;
while (bits >= 8*sizeof (long) && *lp == ~0) { while ((bits >= (int32)(8 * sizeof(long))) && (~0 == *lp)) {
span += 8*sizeof (long), bits -= 8*sizeof (long); span += 8*sizeof (long), bits -= 8*sizeof (long);
lp++; lp++;
} }
@ -942,17 +941,17 @@ Fax3Encode1DRow(TIFF* tif, unsigned char* bp, uint32 bits)
} }
static const tableentry horizcode = static const tableentry horizcode =
{ 3, 0x1 }; /* 001 */ { 3, 0x1, 0 }; /* 001 */
static const tableentry passcode = static const tableentry passcode =
{ 4, 0x1 }; /* 0001 */ { 4, 0x1, 0 }; /* 0001 */
static const tableentry vcodes[7] = { static const tableentry vcodes[7] = {
{ 7, 0x03 }, /* 0000 011 */ { 7, 0x03, 0 }, /* 0000 011 */
{ 6, 0x03 }, /* 0000 11 */ { 6, 0x03, 0 }, /* 0000 11 */
{ 3, 0x03 }, /* 011 */ { 3, 0x03, 0 }, /* 011 */
{ 1, 0x1 }, /* 1 */ { 1, 0x1, 0 }, /* 1 */
{ 3, 0x2 }, /* 010 */ { 3, 0x2, 0 }, /* 010 */
{ 6, 0x02 }, /* 0000 10 */ { 6, 0x02, 0 }, /* 0000 10 */
{ 7, 0x02 } /* 0000 010 */ { 7, 0x02, 0 } /* 0000 010 */
}; };
/* /*
@ -1346,6 +1345,7 @@ InitCCITTFax3(TIFF* tif)
int int
TIFFInitCCITTFax3(TIFF* tif, int scheme) TIFFInitCCITTFax3(TIFF* tif, int scheme)
{ {
(void) scheme;
if (InitCCITTFax3(tif)) { if (InitCCITTFax3(tif)) {
_TIFFMergeFieldInfo(tif, fax3FieldInfo, N(fax3FieldInfo)); _TIFFMergeFieldInfo(tif, fax3FieldInfo, N(fax3FieldInfo));
@ -1447,6 +1447,7 @@ Fax4PostEncode(TIFF* tif)
int int
TIFFInitCCITTFax4(TIFF* tif, int scheme) TIFFInitCCITTFax4(TIFF* tif, int scheme)
{ {
(void) scheme;
if (InitCCITTFax3(tif)) { /* reuse G3 support */ if (InitCCITTFax3(tif)) { /* reuse G3 support */
_TIFFMergeFieldInfo(tif, fax4FieldInfo, N(fax4FieldInfo)); _TIFFMergeFieldInfo(tif, fax4FieldInfo, N(fax4FieldInfo));
@ -1522,6 +1523,7 @@ Fax3DecodeRLE(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
int int
TIFFInitCCITTRLE(TIFF* tif, int scheme) TIFFInitCCITTRLE(TIFF* tif, int scheme)
{ {
(void) scheme;
if (InitCCITTFax3(tif)) { /* reuse G3 support */ if (InitCCITTFax3(tif)) { /* reuse G3 support */
tif->tif_decoderow = Fax3DecodeRLE; tif->tif_decoderow = Fax3DecodeRLE;
tif->tif_decodestrip = Fax3DecodeRLE; tif->tif_decodestrip = Fax3DecodeRLE;
@ -1538,6 +1540,7 @@ TIFFInitCCITTRLE(TIFF* tif, int scheme)
int int
TIFFInitCCITTRLEW(TIFF* tif, int scheme) TIFFInitCCITTRLEW(TIFF* tif, int scheme)
{ {
(void) scheme;
if (InitCCITTFax3(tif)) { /* reuse G3 support */ if (InitCCITTFax3(tif)) { /* reuse G3 support */
tif->tif_decoderow = Fax3DecodeRLE; tif->tif_decoderow = Fax3DecodeRLE;
tif->tif_decodestrip = Fax3DecodeRLE; tif->tif_decodestrip = Fax3DecodeRLE;

View File

@ -1,4 +1,4 @@
/* $Id: tif_jpeg.c,v 1.36 2005-06-01 09:41:30 dron Exp $ */ /* $Id: tif_jpeg.c,v 1.37 2005-11-23 22:38:30 dron Exp $ */
/* /*
* Copyright (c) 1994-1997 Sam Leffler * Copyright (c) 1994-1997 Sam Leffler
@ -836,6 +836,7 @@ JPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
{ {
JPEGState *sp = JState(tif); JPEGState *sp = JState(tif);
tsize_t nrows; tsize_t nrows;
(void) s;
nrows = cc / sp->bytesperline; nrows = cc / sp->bytesperline;
if (cc % sp->bytesperline) if (cc % sp->bytesperline)
@ -939,6 +940,7 @@ JPEGDecodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
{ {
JPEGState *sp = JState(tif); JPEGState *sp = JState(tif);
tsize_t nrows; tsize_t nrows;
(void) s;
/* data is expected to be read in multiples of a scanline */ /* data is expected to be read in multiples of a scanline */
if ( (nrows = sp->cinfo.d.image_height) ) { if ( (nrows = sp->cinfo.d.image_height) ) {

View File

@ -1,4 +1,4 @@
/* $Id: tif_open.c,v 1.28 2005-11-21 03:35:05 fwarmerdam Exp $ */ /* $Id: tif_open.c,v 1.29 2005-11-23 22:38:30 dron Exp $ */
/* /*
* Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1988-1997 Sam Leffler
@ -83,12 +83,14 @@ static const int litTypeshift[13] = {
static int static int
_tiffDummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) _tiffDummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
{ {
(void) fd; (void) pbase; (void) psize;
return (0); return (0);
} }
static void static void
_tiffDummyUnmapProc(thandle_t fd, tdata_t base, toff_t size) _tiffDummyUnmapProc(thandle_t fd, tdata_t base, toff_t size)
{ {
(void) fd; (void) base; (void) size;
} }
/* /*

View File

@ -1,4 +1,4 @@
/* $Id: tif_pixarlog.c,v 1.9 2005-01-15 15:44:05 dron Exp $ */ /* $Id: tif_pixarlog.c,v 1.10 2005-11-23 22:38:30 dron Exp $ */
/* /*
* Copyright (c) 1996-1997 Sam Leffler * Copyright (c) 1996-1997 Sam Leffler
@ -1126,7 +1126,7 @@ PixarLogPostEncode(TIFF* tif)
switch (state) { switch (state) {
case Z_STREAM_END: case Z_STREAM_END:
case Z_OK: case Z_OK:
if (sp->stream.avail_out != tif->tif_rawdatasize) { if (sp->stream.avail_out != (uint32)tif->tif_rawdatasize) {
tif->tif_rawcc = tif->tif_rawcc =
tif->tif_rawdatasize - sp->stream.avail_out; tif->tif_rawdatasize - sp->stream.avail_out;
TIFFFlushData1(tif); TIFFFlushData1(tif);