AWARE [SYSTEMS]
AWare Systems, , Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
December 2018

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
Archive maintained by AWare Systems



New Datamatrix section



Valid HTML 4.01!



Thread

2018.12.03 04:19 "WIN64 : cast to or from pointer warning", by Vincent Torri
2018.12.03 14:29 "Re: WIN64 : cast to or from pointer warning", by Bob Friesenhahn
2018.12.04 10:43 "Re: WIN64 : cast to or from pointer warning", by Vincent Torri
2018.12.04 11:42 "Re: WIN64 : cast to or from pointer warning", by Roger Leigh
2018.12.04 13:36 "Re: WIN64 : cast to or from pointer warning", by Bob Friesenhahn

2018.12.03 04:19 "WIN64 : cast to or from pointer warning", by Vincent Torri

Hello

in tif_win32.c there are 3 warnings about conversion to or from a pointer

usually, a way to fix this is to cast uintptr_t or intptr_t :

1)
tif = TIFFClientOpen(name, mode, (thandle_t)ifd, /* FIXME: WIN64 cast
to pointer warning */

i would do :
tif = TIFFClientOpen(name, mode, (thandle_t)(uintptr_t)ifd,

2)
tif = TIFFFdOpen((int)fd, name, mode);   /* FIXME: WIN64 cast from
pointer to int warning */

I would do
tif = TIFFFdOpen((int)(intptr_t)fd, name, mode);

3)
tif = TIFFFdOpen((int)fd,    /* FIXME: WIN64 cast from pointer to int
warning */

same cast than 2)

Also, in iptcutil.c there is the same kind of warnings because cast to
long are done, but on WIN64 long has a size of 4 bytes, not 8. Use
ptrdiff_t instead of long in that case as you are doing pointer
arithmetic

regards

Vincent Torri
_______________________________________________
Tiff mailing list
Tiff@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/tiff