summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_copy.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2004-01-14 20:09:44 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2004-01-14 20:09:44 (GMT)
commit7f7fbb47183b6d6a95da4071acb2f8fff1e51c0b (patch)
treeb9c0c5b3ecee990ccb0c6e5f69c7c0f2f4567304 /tools/h5repack/h5repack_copy.c
parent62a9b30a6465db12dd9ee552045cca9d95a40bc3 (diff)
downloadhdf5-7f7fbb47183b6d6a95da4071acb2f8fff1e51c0b.zip
hdf5-7f7fbb47183b6d6a95da4071acb2f8fff1e51c0b.tar.gz
hdf5-7f7fbb47183b6d6a95da4071acb2f8fff1e51c0b.tar.bz2
[svn-r8062] Purpose:
bug fix Description: cases of rank 0 were not handled, now a warning is made that the dataset cannot be compressed Solution: Platforms tested: linux solaris AIX Misc. update:
Diffstat (limited to 'tools/h5repack/h5repack_copy.c')
-rw-r--r--tools/h5repack/h5repack_copy.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index be263ae..bbeb289 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -73,10 +73,6 @@ int copy_objects(const char* fnamein,
if (h5trav_gettable(fidin,travt)<0)
goto out;
-#if defined (H5_REPACK_DEBUG)
- h5trav_printtable(travt);
-#endif
-
/*-------------------------------------------------------------------------
* do the copy
*-------------------------------------------------------------------------
@@ -221,6 +217,7 @@ int do_copy_objects(hid_t fidin,
goto error;
if ( (rank=H5Sget_simple_extent_ndims(space_id))<0)
goto error;
+ HDmemset(dims, 0, sizeof dims);
if ( H5Sget_simple_extent_dims(space_id,dims,NULL)<0)
goto error;
nelmts=1;
@@ -282,15 +279,24 @@ int do_copy_objects(hid_t fidin,
*/
if (filter_this(travt->objs[i].name,options,&obj))
{
- /* filters require CHUNK layout; if we do not have one define a default */
- if (obj.chunk.rank==0)
+ if (rank)
{
- obj.chunk.rank=rank;
- for (j=0; j<rank; j++)
- obj.chunk.chunk_lengths[j] = dims[j];
+ /* filters require CHUNK layout; if we do not have one define a default */
+ if (obj.chunk.rank==0)
+ {
+ obj.chunk.rank=rank;
+ for (j=0; j<rank; j++)
+ obj.chunk.chunk_lengths[j] = dims[j];
+ }
+ if (apply_filters(dcpl_id,H5Tget_size(mtype_id),options,&obj)<0)
+ continue;
+ }
+ else
+ {
+ if (options->verbose)
+ printf("Warning: Filter could not be applied to <%s>\n",
+ travt->objs[i].name);
}
- if (apply_filters(dcpl_id,H5Tget_size(mtype_id),options,&obj)<0)
- continue;
}
/*-------------------------------------------------------------------------