* libtiff/tif_predict.c, libtiff/tif_print.c: fix printf unsigned

vs signed formatting (cppcheck invalidPrintfArgType_uint warnings)
This commit is contained in:
Even Rouault 2016-11-20 22:31:21 +00:00
parent cdc3c9b7e1
commit 58788e4ea1
3 changed files with 9 additions and 7 deletions

View File

@ -2,6 +2,8 @@
* libtiff/tif_getimage.c, libtiff/tif_open.c: add parenthesis to
fix cppcheck clarifyCalculation warnings
* libtiff/tif_predict.c, libtiff/tif_print.c: fix printf unsigned
vs signed formatting (cppcheck invalidPrintfArgType_uint warnings)
2016-11-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

View File

@ -1,4 +1,4 @@
/* $Id: tif_predict.c,v 1.40 2016-11-04 09:19:13 erouault Exp $ */
/* $Id: tif_predict.c,v 1.41 2016-11-20 22:31:22 erouault Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -797,7 +797,7 @@ PredictorPrintDir(TIFF* tif, FILE* fd, long flags)
case 2: fprintf(fd, "horizontal differencing "); break;
case 3: fprintf(fd, "floating point predictor "); break;
}
fprintf(fd, "%u (0x%x)\n", sp->predictor, sp->predictor);
fprintf(fd, "%d (0x%x)\n", sp->predictor, sp->predictor);
}
if (sp->printdir)
(*sp->printdir)(tif, fd, flags);

View File

@ -1,4 +1,4 @@
/* $Id: tif_print.c,v 1.64 2015-12-06 22:19:56 erouault Exp $ */
/* $Id: tif_print.c,v 1.65 2016-11-20 22:31:22 erouault Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -262,7 +262,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
if (td->td_subfiletype & FILETYPE_MASK)
fprintf(fd, "%stransparency mask", sep);
fprintf(fd, " (%lu = 0x%lx)\n",
(long) td->td_subfiletype, (long) td->td_subfiletype);
(unsigned long) td->td_subfiletype, (long) td->td_subfiletype);
}
if (TIFFFieldSet(tif,FIELD_IMAGEDIMENSIONS)) {
fprintf(fd, " Image Width: %lu Image Length: %lu",
@ -521,7 +521,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, "\n");
n = 1L<<td->td_bitspersample;
for (l = 0; l < n; l++)
fprintf(fd, " %5lu: %5u %5u %5u\n",
fprintf(fd, " %5ld: %5u %5u %5u\n",
l,
td->td_colormap[0][l],
td->td_colormap[1][l],
@ -544,7 +544,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
n = 1L<<td->td_bitspersample;
for (l = 0; l < n; l++) {
uint16 i;
fprintf(fd, " %2lu: %5u",
fprintf(fd, " %2ld: %5u",
l, td->td_transferfunction[0][l]);
for (i = 1; i < td->td_samplesperpixel; i++)
fprintf(fd, " %5u",
@ -661,7 +661,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
uint32 s;
fprintf(fd, " %lu %s:\n",
(long) td->td_nstrips,
(unsigned long) td->td_nstrips,
isTiled(tif) ? "Tiles" : "Strips");
for (s = 0; s < td->td_nstrips; s++)
#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))