~ubuntu-branches/ubuntu/oneiric/cups/oneiric

« back to all changes in this revision

Viewing changes to filter/rasterbench.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2010-04-09 16:19:16 UTC
  • mto: (25.1.2 lucid) (55.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20100409161916-k0e6prz52ubf4vlg
Tags: upstream-1.4.3
ImportĀ upstreamĀ versionĀ 1.4.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * "$Id: rasterbench.c 7376 2008-03-19 21:07:45Z mike $"
 
2
 * "$Id: rasterbench.c 8938 2009-12-18 23:52:01Z mike $"
3
3
 *
4
4
 *   Raster benchmark program for the Common UNIX Printing System (CUPS).
5
5
 *
26
26
 * Include necessary headers...
27
27
 */
28
28
 
 
29
#include <config.h>
29
30
#include <cups/raster.h>
30
31
#include <stdlib.h>
31
32
#include <sys/time.h>
275
276
  * text with some whitespace.
276
277
  */
277
278
 
278
 
  srand(time(NULL));
 
279
  CUPS_SRAND(time(NULL));
279
280
 
280
281
  memset(data, 0, sizeof(data));
281
282
 
282
283
  for (y = 0; y < 28; y ++)
283
284
  {
284
 
    for (x = rand() & 127, count = (rand() & 15) + 1;
 
285
    for (x = CUPS_RAND() & 127, count = (CUPS_RAND() & 15) + 1;
285
286
         x < sizeof(data[0]);
286
287
         x ++, count --)
287
288
    {
288
289
      if (count <= 0)
289
290
      {
290
 
        x     += (rand() & 15) + 1;
291
 
        count = (rand() & 15) + 1;
 
291
        x     += (CUPS_RAND() & 15) + 1;
 
292
        count = (CUPS_RAND() & 15) + 1;
292
293
 
293
294
        if (x >= sizeof(data[0]))
294
295
          break;
295
296
      }
296
297
 
297
 
      data[y][x] = rand();
 
298
      data[y][x] = CUPS_RAND();
298
299
    }
299
300
  }
300
301
 
350
351
 
351
352
 
352
353
/*
353
 
 * End of "$Id: rasterbench.c 7376 2008-03-19 21:07:45Z mike $".
 
354
 * End of "$Id: rasterbench.c 8938 2009-12-18 23:52:01Z mike $".
354
355
 */