mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
[svn-r15432] bug fix
the compression ratio was being printed for cases where a layout was requested and not a filter tested: windows, linux
This commit is contained in:
parent
422ac99509
commit
8ee8a3fde6
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user