X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8414a40c52191d4c7cfeea74df22d9d64cbec415..b736d59eb531794e6b1cef2b4997c517569ff0dd:/src/tiff/tools/tiffcmp.c diff --git a/src/tiff/tools/tiffcmp.c b/src/tiff/tools/tiffcmp.c index 3f13ca023f..ab202335ca 100644 --- a/src/tiff/tools/tiffcmp.c +++ b/src/tiff/tools/tiffcmp.c @@ -1,4 +1,3 @@ -/* $Id$ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -29,11 +28,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 +55,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 +312,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 +387,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 +634,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: + */