X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8414a40c52191d4c7cfeea74df22d9d64cbec415..06a32e049c1bad9249079ad2e91659303424a774:/src/tiff/tools/tiffcmp.c diff --git a/src/tiff/tools/tiffcmp.c b/src/tiff/tools/tiffcmp.c index 3f13ca023f..508a461a8d 100644 --- a/src/tiff/tools/tiffcmp.c +++ b/src/tiff/tools/tiffcmp.c @@ -29,11 +29,16 @@ #include #include #include +#include #ifdef HAVE_UNISTD_H # include #endif +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + #include "tiffio.h" #ifndef HAVE_GETOPT @@ -51,7 +56,7 @@ static uint32 imagelength; static void usage(void); static int tiffcmp(TIFF*, TIFF*); static int cmptags(TIFF*, TIFF*); -static int ContigCompare(int, uint32, unsigned char*, unsigned char*, int); +static int ContigCompare(int, uint32, unsigned char*, unsigned char*, tsize_t); static int SeparateCompare(int, int, uint32, unsigned char*, unsigned char*); static void PrintIntDiff(uint32, int, uint32, uint32, uint32); static void PrintFloatDiff(uint32, int, uint32, double, double); @@ -308,7 +313,7 @@ cmptags(TIFF* tif1, TIFF* tif2) static int ContigCompare(int sample, uint32 row, - unsigned char* p1, unsigned char* p2, int size) + unsigned char* p1, unsigned char* p2, tsize_t size) { uint32 pix; int ppb = 8 / bitspersample; @@ -383,7 +388,7 @@ ContigCompare(int sample, uint32 row, int s; for(s = 0; s < samples_to_test; s++) { - if (*pix1 != *pix2) { + if (fabs(*pix1 - *pix2) < 0.000000000001) { PrintFloatDiff(row, sample, pix, *pix1, *pix2); } @@ -630,3 +635,10 @@ leof(const char* name, uint32 row, int s) } /* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */