summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Ff.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2008-09-26 18:55:32 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2008-09-26 18:55:32 (GMT)
commit6f5d0e22f344efc95167f6eee34c788a791bc1bb (patch)
tree294301199f01015d4aab27e9f1e28c1df48ea56c /fortran/src/H5Ff.c
parentf9f71a001ba65fbc515b440bf5cbace452947800 (diff)
downloadhdf5-6f5d0e22f344efc95167f6eee34c788a791bc1bb.zip
hdf5-6f5d0e22f344efc95167f6eee34c788a791bc1bb.tar.gz
hdf5-6f5d0e22f344efc95167f6eee34c788a791bc1bb.tar.bz2
[svn-r15704] I changed the return values of H5Fget_obj_ids and H5Fget_obj_count to ssize_t and modified
C++ and Fortran API functions. This is for bug #1245. Tested on smirom, linew, and kagiso.
Diffstat (limited to 'fortran/src/H5Ff.c')
-rw-r--r--fortran/src/H5Ff.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c
index 2190d05..674d702 100644
--- a/fortran/src/H5Ff.c
+++ b/fortran/src/H5Ff.c
@@ -411,21 +411,23 @@ nh5fclose_c ( hid_t_f *file_id )
* Programmer: Elena Pourmal
* Monday, September 30, 2002
* Modifications:
+ * Changed type of obj_count to size_t_f
+ * Thursday, September 25, 2008
*---------------------------------------------------------------------------*/
int_f
-nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, int_f * obj_count)
+nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, size_t_f * obj_count)
{
int ret_value = 0;
hid_t c_file_id;
unsigned c_obj_type;
- int c_obj_count;
+ ssize_t c_obj_count;
c_file_id = (hid_t)*file_id;
c_obj_type = (unsigned) *obj_type;
if ( (c_obj_count=H5Fget_obj_count(c_file_id, c_obj_type)) < 0 ) ret_value = -1;
- *obj_count = (int_f)c_obj_count;
+ *obj_count = (size_t_f)c_obj_count;
return ret_value;
}
/*----------------------------------------------------------------------------
@@ -438,24 +440,34 @@ nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, int_f * obj_count)
* Programmer: Elena Pourmal
* Monday, September 30, 2002
* Modifications:
+ * Changed type of max_obj to size_t_f; added parameter for the
+ * number of open objects
+ * Thursday, September 25, 2008 EIP
*---------------------------------------------------------------------------*/
int_f
-nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, int_f *max_objs, hid_t_f *obj_ids)
+nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs, hid_t_f *obj_ids, size_t_f *num_objs)
{
int ret_value = 0;
hid_t c_file_id;
unsigned c_obj_type;
- int c_max_objs, i;
+ int i;
+ size_t c_max_objs;
+ ssize_t c_num_objs;
hid_t *c_obj_ids;
c_file_id = (hid_t)*file_id;
c_obj_type = (unsigned) *obj_type;
- c_max_objs = (int)*max_objs;
+ c_max_objs = (size_t)*max_objs;
c_obj_ids = (hid_t *)HDmalloc(sizeof(hid_t)*c_max_objs);
- if ( H5Fget_obj_ids(c_file_id, c_obj_type, c_max_objs, c_obj_ids) < 0 ) ret_value = -1;
+
+ c_num_objs = H5Fget_obj_ids(c_file_id, c_obj_type, c_max_objs, c_obj_ids);
+ if ( c_num_objs < 0 ) ret_value = -1;
for (i=0; i< c_max_objs; i++) obj_ids[i] = (hid_t_f)c_obj_ids[i];
+
HDfree(c_obj_ids);
+ *num_objs = (size_t_f)c_num_objs;
+
return ret_value;
}
/*----------------------------------------------------------------------------