More -Wwrite-strings cleanup and make sure you can actually play it.
[dragonfly.git] / contrib / bzip2 / spewG.c
blob7934e765818a28db3d30b00298539bc977dea2cf
2 /* spew out a thoroughly gigantic file designed so that bzip2
3 can compress it reasonably rapidly. This is to help test
4 support for large files (> 2GB) in a reasonable amount of time.
5 I suggest you use the undocumented --exponential option to
6 bzip2 when compressing the resulting file; this saves a bit of
7 time. Note: *don't* bother with --exponential when compressing
8 Real Files; it'll just waste a lot of CPU time :-)
9 (but is otherwise harmless).
12 #define _FILE_OFFSET_BITS 64
14 #include <stdio.h>
15 #include <stdlib.h>
17 /* The number of megabytes of junk to spew out (roughly) */
18 #define MEGABYTES 5000
20 #define N_BUF 1000000
21 char buf[N_BUF];
23 int main ( int argc, char** argv )
25 int ii, kk, p;
26 srandom(1);
27 setbuffer ( stdout, buf, N_BUF );
28 for (kk = 0; kk < MEGABYTES * 515; kk+=3) {
29 p = 25+random()%50;
30 for (ii = 0; ii < p; ii++)
31 printf ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" );
32 for (ii = 0; ii < p-1; ii++)
33 printf ( "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" );
34 for (ii = 0; ii < p+1; ii++)
35 printf ( "ccccccccccccccccccccccccccccccccccccc" );
37 fflush(stdout);
38 return 0;