diff options
author | bfriesen <bfriesen> | 2015-08-23 15:40:45 +0000 |
---|---|---|
committer | bfriesen <bfriesen> | 2015-08-23 15:40:45 +0000 |
commit | 824e798509af940ee3fd36f9176354ad9e0e3671 (patch) | |
tree | cb23183f9c5832b782b7c8cc7bb1d1904afe0f7f | |
parent | aa1e6ea3dc6e85b039deb7bdddc36359ad76a406 (diff) | |
download | libtiff-824e798509af940ee3fd36f9176354ad9e0e3671.tar.gz |
fax2tiff eliminate warning about cast to thandle_t.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | tools/fax2tiff.c | 22 |
2 files changed, 22 insertions, 3 deletions
@@ -1,5 +1,8 @@ 2015-08-23 Bob Friesenhahn <bfriesen@simple.dallas.tx.us> + * tools/fax2tiff.c (main): Eliminate a compiler warning in 64-bit + builds about cast to thandle_t. + * test/rewrite_tag.c (main): Does not require any arguments. 2015-08-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us> diff --git a/tools/fax2tiff.c b/tools/fax2tiff.c index 38e8229f..9bbcb63e 100644 --- a/tools/fax2tiff.c +++ b/tools/fax2tiff.c @@ -1,4 +1,4 @@ -/* $Id: fax2tiff.c,v 1.23 2015-06-21 01:09:10 bfriesen Exp $ */ +/* $Id: fax2tiff.c,v 1.24 2015-08-23 15:40:45 bfriesen Exp $ */ /* * Copyright (c) 1990-1997 Sam Leffler @@ -72,11 +72,26 @@ uint32 badfaxlines; int copyFaxFile(TIFF* tifin, TIFF* tifout); static void usage(void); +/* + Struct to carry client data. Note that it does not appear that the client + data is actually used in this program. +*/ +typedef struct _FAX_Client_Data +{ +#if defined(_WIN32) && defined(USE_WIN32_FILEIO) + intptr_t fh; /* Operating system file handle */ +#else + int fd; /* Integer file descriptor */ +#endif + +} FAX_Client_Data; + int main(int argc, char* argv[]) { FILE *in; TIFF *out = NULL; + FAX_Client_Data client_data; TIFFErrorHandler whandler = NULL; int compression_in = COMPRESSION_CCITTFAX3; int compression_out = COMPRESSION_CCITTFAX3; @@ -267,10 +282,11 @@ main(int argc, char* argv[]) continue; } #if defined(_WIN32) && defined(USE_WIN32_FILEIO) - TIFFSetClientdata(faxTIFF, (thandle_t)_get_osfhandle(fileno(in))); + client_data.fh = _get_osfhandle(fileno(in)); #else - TIFFSetClientdata(faxTIFF, (thandle_t)fileno(in)); + client_data.fd = fileno(in); #endif + TIFFSetClientdata(faxTIFF, (thandle_t) &client_data); TIFFSetFileName(faxTIFF, (const char*)argv[optind]); TIFFSetField(out, TIFFTAG_IMAGEWIDTH, xsize); TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 1); |