summaryrefslogtreecommitdiffstats
path: root/dec_stdout.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-02-13 07:06:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-02-13 07:06:25 +0000
commitaeab49c877a93051065ab41625d9b13a6017c1d6 (patch)
treecd8f68d5ee0caebf508f6d4f1595d8656f0bff55 /dec_stdout.cc
parentReleasing debian version 1.6-5. (diff)
downloadplzip-aeab49c877a93051065ab41625d9b13a6017c1d6.tar.xz
plzip-aeab49c877a93051065ab41625d9b13a6017c1d6.zip
Merging upstream version 1.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dec_stdout.cc')
-rw-r--r--dec_stdout.cc30
1 files changed, 18 insertions, 12 deletions
diff --git a/dec_stdout.cc b/dec_stdout.cc
index a1a9d61..27b9f31 100644
--- a/dec_stdout.cc
+++ b/dec_stdout.cc
@@ -1,6 +1,6 @@
/* Plzip - Parallel compressor compatible with lzip
Copyright (C) 2009 Laszlo Ersek.
- Copyright (C) 2009-2017 Antonio Diaz Diaz.
+ Copyright (C) 2009-2018 Antonio Diaz Diaz.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -229,6 +229,7 @@ extern "C" void * dworker_o( void * arg )
if( rd == 0 ) break;
}
}
+ show_progress( file_index.mblock( i ).size() );
}
delete[] ibuffer; delete[] new_data;
@@ -298,17 +299,22 @@ int dec_stdout( const int num_workers, const int infd, const int outfd,
delete[] worker_threads;
delete[] worker_args;
- const unsigned long long in_size = file_index.cdata_size();
- const unsigned long long out_size = file_index.udata_size();
- if( verbosity >= 2 && out_size > 0 && in_size > 0 )
- std::fprintf( stderr, "%6.3f:1, %6.3f bits/byte, %5.2f%% saved. ",
- (double)out_size / in_size,
- ( 8.0 * in_size ) / out_size,
- 100.0 * ( 1.0 - ( (double)in_size / out_size ) ) );
- if( verbosity >= 4 )
- std::fprintf( stderr, "decompressed %9llu, compressed %9llu. ",
- out_size, in_size );
-
+ if( verbosity >= 2 )
+ {
+ if( verbosity >= 4 ) show_header( file_index.dictionary_size( 0 ) );
+ const unsigned long long in_size = file_index.cdata_size();
+ const unsigned long long out_size = file_index.udata_size();
+ if( out_size == 0 || in_size == 0 )
+ std::fputs( "no data compressed. ", stderr );
+ else
+ std::fprintf( stderr, "%6.3f:1, %5.2f%% ratio, %5.2f%% saved. ",
+ (double)out_size / in_size,
+ ( 100.0 * in_size ) / out_size,
+ 100.0 - ( ( 100.0 * in_size ) / out_size ) );
+ if( verbosity >= 3 )
+ std::fprintf( stderr, "decompressed %9llu, compressed %8llu. ",
+ out_size, in_size );
+ }
if( verbosity >= 1 ) std::fputs( "done\n", stderr );
if( debug_level & 1 )