From 8ee8a3fde6e9052de594c7409656af90cba8ea8a Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Tue, 5 Aug 2008 10:34:12 -0500 Subject: [svn-r15432] bug fix the compression ratio was being printed for cases where a layout was requested and not a filter tested: windows, linux --- tools/h5repack/h5repack_copy.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index ac2f770..73b201e 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -35,7 +35,7 @@ extern char *progname; * local functions *------------------------------------------------------------------------- */ -static void print_dataset_info(hid_t dcpl_id,char *objname,double per); +static void print_dataset_info(hid_t dcpl_id,char *objname,double per, int pr); static int do_copy_objects(hid_t fidin,hid_t fidout,trav_table_t *travt,pack_opt_t *options); static int copy_attr(hid_t loc_in,hid_t loc_out,pack_opt_t *options); static int copy_user_block(const char *infile, const char *outfile, hsize_t size); @@ -665,7 +665,8 @@ int do_copy_objects(hid_t fidin, { double ratio=0; - if (apply_s && apply_f) + /* only print the compression ration if there was a filter */ + if (apply_s && apply_f && has_filter) { hssize_t a, b; @@ -678,10 +679,10 @@ int do_copy_objects(hid_t fidin, if (b!=0) ratio = (double) a / (double) b; - print_dataset_info(dcpl_out,travt->objs[i].name,ratio); + print_dataset_info(dcpl_out,travt->objs[i].name,ratio,1); } else - print_dataset_info(dcpl_id,travt->objs[i].name,ratio); + print_dataset_info(dcpl_id,travt->objs[i].name,ratio,0); /* print a message that the filter was not applied (in case there was a filter) @@ -1060,7 +1061,8 @@ error: */ static void print_dataset_info(hid_t dcpl_id, char *objname, - double ratio) + double ratio, + int pr) { char strfilter[255]; #if defined (PRINT_DEBUG ) @@ -1141,7 +1143,7 @@ static void print_dataset_info(hid_t dcpl_id, } /* switch */ }/*i*/ - if(*strfilter == '\0') + if(!pr) printf(FORMAT_OBJ,"dset",objname ); else { -- cgit v0.12