Skip to content

Commit

Permalink
Merge branch 'fix_type_related_warnings_in_error' into 'master'
Browse files Browse the repository at this point in the history
TIFFAdvanceDirectory()/TIFFUnlinkDirectory(): fix build warnings/errors on OSX...

See merge request libtiff/libtiff!444
  • Loading branch information
rouault committed Dec 13, 2022
2 parents 91db3f8 + 768f0af commit f0dae5d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions libtiff/tif_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1982,8 +1982,8 @@ static int TIFFAdvanceDirectory(TIFF *tif, uint64_t *nextdiroff, uint64_t *off,
{
TIFFWarningExtR(
tif, module,
"the next directory %" PRIu16 " at offset 0x%" PRIx64
" (%" PRIu64 ") might be an IFD loop. Treating directory %d as "
"the next directory %u at offset 0x%" PRIx64 " (%" PRIu64
") might be an IFD loop. Treating directory %d as "
"last directory",
*nextdirnum, *nextdiroff, *nextdiroff, (int)(*nextdirnum) - 1);
*nextdiroff = 0;
Expand Down Expand Up @@ -2160,8 +2160,7 @@ int TIFFUnlinkDirectory(TIFF *tif, tdir_t dirn)
{
if (nextdir == 0)
{
TIFFErrorExtR(tif, module, "Directory %" PRIu16 " does not exist",
dirn);
TIFFErrorExtR(tif, module, "Directory %u does not exist", dirn);
return (0);
}
if (!TIFFAdvanceDirectory(tif, &nextdir, &off, &nextdirnum))
Expand Down
4 changes: 2 additions & 2 deletions tools/tiffgt.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ int main(int argc, char *argv[])
*/
glutInitWindowSize(width, height);
snprintf(title, TITLE_LENGTH - 1, "%s [%u]", filelist[fileindex],
(unsigned int)TIFFCurrentDirectory(tif));
TIFFCurrentDirectory(tif));
glutCreateWindow(title);
glutDisplayFunc(raster_draw);
glutReshapeFunc(raster_reshape);
Expand Down Expand Up @@ -322,7 +322,7 @@ static void raster_reshape(int win_w, int win_h)
glPixelZoom(xratio, yratio);
glViewport(0, 0, win_w, win_h);
snprintf(title, 1024, "%s [%u] %d%%", filelist[fileindex],
(unsigned int)TIFFCurrentDirectory(tif), ratio);
TIFFCurrentDirectory(tif), ratio);
glutSetWindowTitle(title);
}

Expand Down
8 changes: 4 additions & 4 deletions tools/tiffinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ int main(int argc, char *argv[])
{
toff_t offset = 0;
tdir_t curdir = TIFFCurrentDirectory(tif);
printf("=== TIFF directory %d ===\n", curdir);
printf("=== TIFF directory %u ===\n", curdir);
tiffinfo(tif, order, flags, 1);
if (TIFFGetField(tif, TIFFTAG_EXIFIFD, &offset))
{
printf("--- EXIF directory within directory %d \n",
printf("--- EXIF directory within directory %u \n",
curdir);
if (TIFFReadEXIFDirectory(tif, offset))
{
Expand All @@ -201,7 +201,7 @@ int main(int argc, char *argv[])
}
if (TIFFGetField(tif, TIFFTAG_GPSIFD, &offset))
{
printf("--- GPS directory within directory %d \n",
printf("--- GPS directory within directory %u \n",
curdir);
if (TIFFReadGPSDirectory(tif, offset))
{
Expand All @@ -223,7 +223,7 @@ int main(int argc, char *argv[])
memcpy(subIFDoffsets, vPtr,
nCount * sizeof(subIFDoffsets[0]));
printf("--- SubIFD image descriptor tag within "
"TIFF directory %d with array of %d "
"TIFF directory %u with array of %d "
"SubIFD chains ---\n",
curdir, nCount);
for (int i = 0; i < nCount; i++)
Expand Down

0 comments on commit f0dae5d

Please sign in to comment.