]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - filter/rasterbench.c
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / filter / rasterbench.c
index ea0a08be577c5dfa66a4e8d1b55d17a5cb497c01..010fd9dd31f9de145bb5eda324182b9548d993a8 100644 (file)
@@ -1,32 +1,25 @@
 /*
- * "$Id: rasterbench.c 6649 2007-07-11 21:46:42Z mike $"
+ * Raster benchmark program for CUPS.
  *
- *   Raster benchmark program for the Common UNIX Printing System (CUPS).
+ * Copyright 2007-2016 by Apple Inc.
+ * Copyright 1997-2006 by Easy Software Products.
  *
- *   Copyright 2007-2008 by Apple Inc.
- *   Copyright 1997-2006 by Easy Software Products.
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+ * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file.  If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
  *
- *   These coded instructions, statements, and computer programs are the
- *   property of Apple Inc. and are protected by Federal copyright
- *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- *   which should have been included with this file.  If this file is
- *   file is missing or damaged, see the license at "http://www.cups.org/".
- *
- *   This file is subject to the Apple OS-Developed Software exception.
- *
- * Contents:
- *
- *   main()           - Benchmark the raster read/write functions.
- *   compute_median() - Compute the median time for a test.
- *   read_test()      - Benchmark the raster read functions.
- *   write_test()     - Benchmark the raster write functions.
+ * This file is subject to the Apple OS-Developed Software exception.
  */
 
 /*
  * Include necessary headers...
  */
 
+#include <config.h>
 #include <cups/raster.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
 #include <signal.h>
@@ -180,7 +173,7 @@ get_time(void)
 static void
 read_test(int fd)                      /* I - File descriptor to read from */
 {
-  int                  y;              /* Looping var */
+  unsigned             y;              /* Looping var */
   cups_raster_t                *r;             /* Raster stream */
   cups_page_header2_t  header;         /* Page header */
   unsigned char                buffer[8 * TEST_WIDTH];
@@ -262,8 +255,8 @@ static void
 write_test(int         fd,             /* I - File descriptor to write to */
            cups_mode_t mode)           /* I - Write mode */
 {
-  int                  page, x, y;     /* Looping vars */
-  int                  count;          /* Number of bytes to set */
+  unsigned             page, x, y;     /* Looping vars */
+  unsigned             count;          /* Number of bytes to set */
   cups_raster_t                *r;             /* Raster stream */
   cups_page_header2_t  header;         /* Page header */
   unsigned char                data[32][8 * TEST_WIDTH];
@@ -275,26 +268,26 @@ write_test(int         fd,                /* I - File descriptor to write to */
   * text with some whitespace.
   */
 
-  srand(time(NULL));
+  CUPS_SRAND(time(NULL));
 
   memset(data, 0, sizeof(data));
 
   for (y = 0; y < 28; y ++)
   {
-    for (x = rand() & 127, count = (rand() & 15) + 1;
+    for (x = CUPS_RAND() & 127, count = (CUPS_RAND() & 15) + 1;
          x < sizeof(data[0]);
          x ++, count --)
     {
       if (count <= 0)
       {
-       x     += (rand() & 15) + 1;
-       count = (rand() & 15) + 1;
+       x     += (CUPS_RAND() & 15) + 1;
+       count = (CUPS_RAND() & 15) + 1;
 
         if (x >= sizeof(data[0]))
          break;
       }
 
-      data[y][x] = rand();
+      data[y][x] = (unsigned char)CUPS_RAND();
     }
   }
 
@@ -347,8 +340,3 @@ write_test(int         fd,          /* I - File descriptor to write to */
 
   cupsRasterClose(r);
 }
-
-
-/*
- * End of "$Id: rasterbench.c 6649 2007-07-11 21:46:42Z mike $".
- */