add casts for tiff seek

To make our meaning clearer.

libtiff uses uint64 for toff_t, with -1 cast to uint64 for an error
indication, see:

https://gitlab.com/libtiff/libtiff/blob/master/libtiff/tif_unix.c#L123

See also:

https://github.com/kleisauke/net-vips/issues/53
This commit is contained in:
John Cupitt 2020-01-14 14:50:46 +00:00
parent 8c1c8b6c9f
commit 285f6c7418
1 changed files with 6 additions and 2 deletions

View File

@ -156,7 +156,9 @@ openin_source_seek( thandle_t st, toff_t position, int whence )
{
VipsSource *source = VIPS_SOURCE( st );
return( vips_source_seek( source, position, whence ) );
/* toff_t is usually uint64, with -1 cast to uint64 to indicate error.
*/
return( (toff_t) vips_source_seek( source, position, whence ) );
}
static int
@ -176,8 +178,10 @@ openin_source_length( thandle_t st )
/* libtiff will use this to get file size if tags like StripByteCounts
* are missing.
*
* toff_t is usually uint64, with -1 cast to uint64 to indicate error.
*/
return( vips_source_length( source ) );
return( (toff_t) vips_source_length( source ) );
}
static int