diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2009-09-27 21:44:29 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2009-09-27 21:44:29 +0000 |
commit | 43939e66b1d4eeb2f3799c124f3598756755005a (patch) | |
tree | 15733092de55d52421a6ea02f5a43d5f8ff24393 /editor/pbmreduce.c | |
parent | 49f4336c9bba33650573ba780b70bc501b38643e (diff) | |
download | netpbm-mirror-43939e66b1d4eeb2f3799c124f3598756755005a.tar.gz netpbm-mirror-43939e66b1d4eeb2f3799c124f3598756755005a.tar.xz netpbm-mirror-43939e66b1d4eeb2f3799c124f3598756755005a.zip |
Rebase Stable series to current Advanced: 10.47.04
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@995 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor/pbmreduce.c')
-rw-r--r-- | editor/pbmreduce.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/editor/pbmreduce.c b/editor/pbmreduce.c index 15ec2a1b..f49c8d9a 100644 --- a/editor/pbmreduce.c +++ b/editor/pbmreduce.c @@ -91,21 +91,22 @@ main( argc, argv ) pbm_writepbminit( stdout, newcols, newrows, 0 ); newbitrow = pbm_allocrow( newcols ); - if ( halftone == QT_FS ) { + if (halftone == QT_FS) { + unsigned int col; /* Initialize Floyd-Steinberg. */ MALLOCARRAY(thiserr, newcols + 2); MALLOCARRAY(nexterr, newcols + 2); - if ( thiserr == NULL || nexterr == NULL ) - pm_error( "out of memory" ); + if (thiserr == NULL || nexterr == NULL) + pm_error("out of memory"); - srand( (int) ( time( 0 ) ^ getpid( ) ) ); - for ( col = 0; col < newcols + 2; ++col ) - thiserr[col] = ( rand( ) % SCALE - HALFSCALE ) / 4; + srand(pm_randseed()); + for (col = 0; col < newcols + 2; ++col) + thiserr[col] = (rand() % SCALE - HALFSCALE) / 4; /* (random errors in [-SCALE/8 .. SCALE/8]) */ } else { /* These variables are meaningless in this case, and the values should never be used. - */ + */ thiserr = NULL; nexterr = NULL; } |