summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Ff.c
diff options
context:
space:
mode:
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;
}
/*----------------------------------------------------------------------------