summaryrefslogtreecommitdiffstats
path: root/fec_create.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-24 04:36:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-24 04:36:43 +0000
commitab77d16ba47322aab30703e251efbffb680ce0bb (patch)
tree5d2146c01e938fa6cac7c349192088cb2e962ac5 /fec_create.cc
parentAdding upstream version 1.25~pre1. (diff)
downloadlziprecover-ab77d16ba47322aab30703e251efbffb680ce0bb.tar.xz
lziprecover-ab77d16ba47322aab30703e251efbffb680ce0bb.zip
Adding upstream version 1.25~rc1.upstream/1.25_rc1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--fec_create.cc16
1 files changed, 5 insertions, 11 deletions
diff --git a/fec_create.cc b/fec_create.cc
index e5c2a6c..90b79e1 100644
--- a/fec_create.cc
+++ b/fec_create.cc
@@ -241,7 +241,7 @@ Coded_fbs compute_fbs( const unsigned long prodata_size,
{
const unsigned unit_fbs = isvalid_fbs( cl_block_size ) ? cl_block_size :
compute_unit_fbs( prodata_size );
- const unsigned long max_k = ( fec_level == 0 ) ? max_k8 : max_k16;
+ const unsigned long max_k = (fec_level == 0) ? max_k8 : max_k16;
const unsigned k9 = std::min( ceil_divide( prodata_size, unit_fbs ), max_k );
const unsigned long fbsu9 = divide_fbs( prodata_size, k9, unit_fbs );
const unsigned long fbsu0 = divide_fbs( prodata_size, max_k8, unit_fbs );
@@ -258,9 +258,9 @@ unsigned compute_fec_blocks( const unsigned long prodata_size,
{
const unsigned long fbs = coded_fbs.val();
const unsigned prodata_blocks = ceil_divide( prodata_size, fbs );
- const unsigned long max_k = ( fec_level == 0 ) ? max_k8 : max_k16;
+ const unsigned long max_k = (fec_level == 0) ? max_k8 : max_k16;
if( !isvalid_fbs( fbs ) || prodata_blocks > max_k ) return 0;
- const unsigned long max_nk = ( fec_level == 0 ) ? max_k8 : max_nk16;
+ const unsigned long max_nk = (fec_level == 0) ? max_k8 : max_nk16;
unsigned fec_blocks;
if( fctype == fc_blocks ) fec_blocks = std::min( max_nk, fb_or_pct );
else
@@ -387,7 +387,8 @@ bool write_fec( const char * const input_filename,
return true;
}
fail:
- show_file_error( input_filename, "Write error", errno ); return false;
+ show_file_error( printable_name( output_filename, false ), write_error_msg,
+ errno ); return false;
}
@@ -523,13 +524,6 @@ bool has_fec_extension( const std::string & name )
}
-const char * printable_name( const std::string & filename, const bool in )
- {
- if( filename.empty() || filename == "-" ) return in ? "(stdin)" : "(stdout)";
- return filename.c_str();
- }
-
-
int fec_create( const std::vector< std::string > & filenames,
const std::string & default_output_filename,
const unsigned long fb_or_pct, const unsigned cl_block_size,