diff --git a/ChangeLog b/ChangeLog index 2647d443..078ffc6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2016-09-03 Even Rouault + + * libtiff/tif_dirwrite.c: fix warnings raised by GCC 5 -Wfloat-conversion + 2016-08-16 Even Rouault * tools/tiffcrop.c: fix C99'ism. diff --git a/libtiff/tif_dirwrite.c b/libtiff/tif_dirwrite.c index 33befd45..837fdd0f 100644 --- a/libtiff/tif_dirwrite.c +++ b/libtiff/tif_dirwrite.c @@ -1,4 +1,4 @@ -/* $Id: tif_dirwrite.c,v 1.81 2015-12-18 11:11:00 erouault Exp $ */ +/* $Id: tif_dirwrite.c,v 1.82 2016-09-02 22:42:00 erouault Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -2143,13 +2143,13 @@ TIFFWriteDirectoryTagCheckedRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* } else if (*na<1.0) { - nb[0]=(uint32)((*na)*0xFFFFFFFF); + nb[0]=(uint32)((double)(*na)*0xFFFFFFFF); nb[1]=0xFFFFFFFF; } else { nb[0]=0xFFFFFFFF; - nb[1]=(uint32)(0xFFFFFFFF/(*na)); + nb[1]=(uint32)((double)0xFFFFFFFF/(*na)); } } if (tif->tif_flags&TIFF_SWAB) @@ -2186,13 +2186,13 @@ TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry } else if (*na>-1.0) { - nb[0]=-(int32)((-*na)*0x7FFFFFFF); + nb[0]=-(int32)((double)(-*na)*0x7FFFFFFF); nb[1]=0x7FFFFFFF; } else { nb[0]=-0x7FFFFFFF; - nb[1]=(int32)(0x7FFFFFFF/(-*na)); + nb[1]=(int32)((double)0x7FFFFFFF/(-*na)); } } else @@ -2204,13 +2204,13 @@ TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry } else if (*na<1.0) { - nb[0]=(int32)((*na)*0x7FFFFFFF); + nb[0]=(int32)((double)(*na)*0x7FFFFFFF); nb[1]=0x7FFFFFFF; } else { nb[0]=0x7FFFFFFF; - nb[1]=(int32)(0x7FFFFFFF/(*na)); + nb[1]=(int32)((double)0x7FFFFFFF/(*na)); } } }