summaryrefslogtreecommitdiffstats
path: root/fortran/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-09-27 20:28:27 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-09-27 20:28:27 (GMT)
commit2c93a80648a72fd19d13c3c014ef998dc1f88f8f (patch)
tree545dda6a2ce07309b440397baa189bb10e70bc3f /fortran/src
parent0ee1ca5c204516f07f71476906218850a67425a3 (diff)
downloadhdf5-2c93a80648a72fd19d13c3c014ef998dc1f88f8f.zip
hdf5-2c93a80648a72fd19d13c3c014ef998dc1f88f8f.tar.gz
hdf5-2c93a80648a72fd19d13c3c014ef998dc1f88f8f.tar.bz2
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1. 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 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'fortran/src')
-rw-r--r--fortran/src/H5Tf.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c
index 044da79..1bd5212 100644
--- a/fortran/src/H5Tf.c
+++ b/fortran/src/H5Tf.c
@@ -20,7 +20,7 @@
/*----------------------------------------------------------------------------
* Name: h5topen_c
- * Purpose: Call H5Topen to open a datatype
+ * Purpose: Call H5Topen2 to open a datatype
* Inputs: loc_id - file or group identifier
* name - name of the datatype within file or group
* namelen - name length
@@ -33,30 +33,30 @@
int_f
nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id)
{
- int ret_value = -1;
- char *c_name;
- size_t c_namelen;
- hid_t c_type_id;
- hid_t c_loc_id;
+ char *c_name = NULL;
+ hid_t c_type_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;
+ /*
+ * Convert FORTRAN name to C name
+ */
+ if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
+ goto done;
- /*
- * Call H5Topen function.
- */
- c_loc_id = *loc_id;
- c_type_id = H5Topen(c_loc_id, c_name);
+ /*
+ * Call H5Topen2 function.
+ */
+ if((c_type_id = H5Topen2((hid_t)*loc_id, c_name, H5P_DEFAULT)) < 0)
+ goto done;
+ *type_id = (hid_t_f)c_type_id;
- if (c_type_id < 0) return ret_value;
- *type_id = (hid_t_f)c_type_id;
- HDfree(c_name);
- ret_value = 0;
- return ret_value;
+ ret_value = 0;
+
+done:
+ if(c_name)
+ HDfree(c_name);
+
+ return ret_value;
}