[gs-cvs] rev 7745 - trunk/gs/toolbin/tests

alexcher at ghostscript.com alexcher at ghostscript.com
Sun Feb 25 11:26:45 PST 2007


Author: alexcher
Date: 2007-02-25 11:26:44 -0800 (Sun, 25 Feb 2007)
New Revision: 7745

Modified:
   trunk/gs/toolbin/tests/fuzzy.c
Log:
Fix MSVC-specific code added to fuzzy.c in the rev. 7743.


Modified: trunk/gs/toolbin/tests/fuzzy.c
===================================================================
--- trunk/gs/toolbin/tests/fuzzy.c	2007-02-25 19:13:16 UTC (rev 7744)
+++ trunk/gs/toolbin/tests/fuzzy.c	2007-02-25 19:26:44 UTC (rev 7745)
@@ -6,7 +6,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <memory.h>
-#include <io.h>
+#include <sys/stat.h>
 
 typedef unsigned char uchar;
 typedef int bool;
@@ -52,6 +52,15 @@
   int n_outof_window;
 };
 
+static off_t
+file_length(int file)
+{
+  struct stat st;
+
+  fstat(file, &st);
+  return st.st_size;
+}
+
 int
 image_get_rgb_scan_line (Image *image, uchar *buf)
 {
@@ -339,7 +348,7 @@
   image->super.raster = n_chan * ((width * bpp + 7) >> 3);
   image->super.n_chan = n_chan;
   image->super.bpp = bpp;
-  image->file_length = _filelength(fileno(f));
+  image->file_length = file_length(fileno(f));
   return &image->super;
 punt:;
   fclose (f);
@@ -677,10 +686,10 @@
       printf ("%s: page %d: %d different, %d out of tolerance, %d out of window\n",
  	      fn[0], page, freport.n_diff, freport.n_outof_tolerance,
 	      freport.n_outof_window);
-      rcode = max(rcode, 1);
+      rcode = MAX(rcode, 1);
     }
     if (freport.n_outof_window > 0)
-      rcode = max(rcode, 2);
+      rcode = MAX(rcode, 2);
     page++;
   }
 



More information about the gs-cvs mailing list