summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-08-05 15:34:12 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-08-05 15:34:12 (GMT)
commit8ee8a3fde6e9052de594c7409656af90cba8ea8a (patch)
treef075d3ad219a14180e9857b75be3d2557b9dd68f
parent422ac995093909b86a95abe5a348521e230b9362 (diff)
downloadhdf5-8ee8a3fde6e9052de594c7409656af90cba8ea8a.zip
hdf5-8ee8a3fde6e9052de594c7409656af90cba8ea8a.tar.gz
hdf5-8ee8a3fde6e9052de594c7409656af90cba8ea8a.tar.bz2
[svn-r15432] bug fix
the compression ratio was being printed for cases where a layout was requested and not a filter tested: windows, linux
-rw-r--r--tools/h5repack/h5repack_copy.c14
1 files 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
{