diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-08 19:59:36 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-08 19:59:36 (GMT) |
commit | 16683943c6edb42f9129cc5d6c8f340c74014dad (patch) | |
tree | d1ed13b0b7677e56d4253b4fe5e0640f851e27ca /tools/h5repack/h5repack_copy.c | |
parent | d3ee3988b68292524b3a893b9db55c074f4b9e87 (diff) | |
download | hdf5-16683943c6edb42f9129cc5d6c8f340c74014dad.zip hdf5-16683943c6edb42f9129cc5d6c8f340c74014dad.tar.gz hdf5-16683943c6edb42f9129cc5d6c8f340c74014dad.tar.bz2 |
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'tools/h5repack/h5repack_copy.c')
-rw-r--r-- | tools/h5repack/h5repack_copy.c | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 4a84ea6..fcb0854 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -417,16 +417,16 @@ int do_copy_objects(hid_t fidin, * copy attrs *------------------------------------------------------------------------- */ - if (copy_attr(grp_in,grp_out,options) < 0) + if(copy_attr(grp_in,grp_out,options) < 0) goto error; - if (gcpl_id>0) { - if (H5Pclose(gcpl_id) < 0) + if(gcpl_id > 0) { + if(H5Pclose(gcpl_id) < 0) goto error; } - if (H5Gclose(grp_out) < 0) + if(H5Gclose(grp_out) < 0) goto error; - if (H5Gclose(grp_in) < 0) + if(H5Gclose(grp_in) < 0) goto error; break; @@ -440,15 +440,15 @@ int do_copy_objects(hid_t fidin, has_filter = 0; /* early detection of references */ - if ((dset_in=H5Dopen(fidin,travt->objs[i].name)) < 0) + if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) goto error; - if ((ftype_id=H5Dget_type (dset_in)) < 0) + if((ftype_id = H5Dget_type(dset_in)) < 0) goto error; - if (H5T_REFERENCE==H5Tget_class(ftype_id)) - is_ref=1; - if (H5Tclose(ftype_id) < 0) + if(H5T_REFERENCE == H5Tget_class(ftype_id)) + is_ref = 1; + if(H5Tclose(ftype_id) < 0) goto error; - if (H5Dclose(dset_in) < 0) + if(H5Dclose(dset_in) < 0) goto error; @@ -458,39 +458,35 @@ int do_copy_objects(hid_t fidin, * otherwise we do a copy using H5Ocopy *------------------------------------------------------------------------- */ - if (options->op_tbl->nelems - || - options->all_filter==1 || options->all_layout==1 - || is_ref - ) - { + if(options->op_tbl->nelems || options->all_filter == 1 + || options->all_layout == 1 || is_ref) { int j; - if ((dset_in=H5Dopen(fidin,travt->objs[i].name)) < 0) + if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) goto error; - if ((f_space_id=H5Dget_space(dset_in)) < 0) + if((f_space_id = H5Dget_space(dset_in)) < 0) goto error; - if ((ftype_id=H5Dget_type (dset_in)) < 0) + if((ftype_id = H5Dget_type(dset_in)) < 0) goto error; - if ((dcpl_id=H5Dget_create_plist(dset_in)) < 0) + if((dcpl_id = H5Dget_create_plist(dset_in)) < 0) goto error; - if ((dcpl_out = H5Pcopy (dcpl_id)) < 0) + if((dcpl_out = H5Pcopy(dcpl_id)) < 0) goto error; - if ( (rank=H5Sget_simple_extent_ndims(f_space_id)) < 0) + if((rank = H5Sget_simple_extent_ndims(f_space_id)) < 0) goto error; HDmemset(dims, 0, sizeof dims); - if ( H5Sget_simple_extent_dims(f_space_id,dims,NULL) < 0) + if(H5Sget_simple_extent_dims(f_space_id, dims, NULL) < 0) goto error; - nelmts=1; - for (j=0; j<rank; j++) - nelmts*=dims[j]; + nelmts = 1; + for(j = 0; j < rank; j++) + nelmts *= dims[j]; - if (options->use_native==1) + if(options->use_native == 1) wtype_id = h5tools_get_native_type(ftype_id); else wtype_id = H5Tcopy(ftype_id); - if ((msize=H5Tget_size(wtype_id))==0) + if((msize = H5Tget_size(wtype_id)) == 0) goto error; /*------------------------------------------------------------------------- @@ -743,7 +739,7 @@ int do_copy_objects(hid_t fidin, *------------------------------------------------------------------------- */ - if (H5Ocopy(fidin, /* Source file or group identifier */ + if(H5Ocopy(fidin, /* Source file or group identifier */ travt->objs[i].name, /* Name of the source object to be copied */ fidout, /* Destination file or group identifier */ travt->objs[i].name, /* Name of the destination object */ @@ -752,7 +748,7 @@ int do_copy_objects(hid_t fidin, goto error; /* close property */ - if (H5Pclose(pid) < 0) + if(H5Pclose(pid) < 0) goto error; @@ -760,15 +756,15 @@ int do_copy_objects(hid_t fidin, * copy attrs manually *------------------------------------------------------------------------- */ - if ((dset_in=H5Dopen(fidin,travt->objs[i].name)) < 0) + if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) goto error; - if ((dset_out=H5Dopen(fidout,travt->objs[i].name)) < 0) + if((dset_out = H5Dopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0) goto error; - if (copy_attr(dset_in,dset_out,options) < 0) + if(copy_attr(dset_in, dset_out, options) < 0) goto error; - if (H5Dclose(dset_in) < 0) + if(H5Dclose(dset_in) < 0) goto error; - if (H5Dclose(dset_out) < 0) + if(H5Dclose(dset_out) < 0) goto error; } /* end do we have request for filter/chunking */ |