summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-08 19:59:36 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-08 19:59:36 (GMT)
commit16683943c6edb42f9129cc5d6c8f340c74014dad (patch)
treed1ed13b0b7677e56d4253b4fe5e0640f851e27ca /fortran
parentd3ee3988b68292524b3a893b9db55c074f4b9e87 (diff)
downloadhdf5-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 'fortran')
-rw-r--r--fortran/src/H5Df.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c
index 082bed5..78d484f 100644
--- a/fortran/src/H5Df.c
+++ b/fortran/src/H5Df.c
@@ -74,7 +74,7 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5dopen_c
- * Purpose: Call H5Dopen to open a dataset
+ * Purpose: Call H5Dopen2 to open a dataset
* Inputs: loc_id - file or group identifier
* name - name of the dataset
* namelen - name length
@@ -85,33 +85,30 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id)
+nh5dopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id)
{
- int ret_value = -1;
- char *c_name;
- size_t c_namelen;
- hid_t c_loc_id;
+ char *c_name = NULL;
hid_t c_dset_id;
+ int ret_value = -1;
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
- c_name = (char *)HD5f2cstring(name, c_namelen);
- if (c_name == NULL) return ret_value;
+ if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
+ goto DONE;
/*
- * Call H5Dopen function.
+ * Call H5Dopen2 function.
*/
- c_loc_id = (hid_t)*loc_id;
- c_dset_id = H5Dopen(c_loc_id, c_name);
+ if((c_dset_id = H5Dopen2((hid_t)*loc_id, c_name, H5P_DEFAULT)) < 0)
+ goto DONE;
- if (c_dset_id < 0) goto DONE;
*dset_id = (hid_t_f)c_dset_id;
ret_value = 0;
DONE:
- HDfree(c_name);
+ if(c_name)
+ HDfree(c_name);
return ret_value;
}