summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Ff.c
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2005-09-17 02:49:21 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2005-09-17 02:49:21 (GMT)
commitb6c10b6bbfcf0634354e89fd88691aa54f7bdf26 (patch)
treee753f012d89f7f5e1a21e640664c8f57eba7ac78 /fortran/src/H5Ff.c
parentae2a313b5ba03538120f5ebd6512096e509a3ae0 (diff)
downloadhdf5-b6c10b6bbfcf0634354e89fd88691aa54f7bdf26.zip
hdf5-b6c10b6bbfcf0634354e89fd88691aa54f7bdf26.tar.gz
hdf5-b6c10b6bbfcf0634354e89fd88691aa54f7bdf26.tar.bz2
[svn-r11422] Purpose: Bug fix/ SX6 port
Description: Fortran array was passed directly to a C function. Since size of fortran INTEGER is bigger than size of C int on SX-6 with -ew switch, the passed data was wrong. Solution: Copy Fortran array to the appropriate C array. Platforms tested: SX-6 ; trivial change Misc. update:
Diffstat (limited to 'fortran/src/H5Ff.c')
-rw-r--r--fortran/src/H5Ff.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c
index 4b21b45..50b9839 100644
--- a/fortran/src/H5Ff.c
+++ b/fortran/src/H5Ff.c
@@ -396,7 +396,7 @@ nh5fclose_c ( hid_t_f *file_id )
int ret_value = 0;
hid_t c_file_id;
- c_file_id = *file_id;
+ c_file_id = (hid_t)*file_id;
if ( H5Fclose(c_file_id) < 0 ) ret_value = -1;
return ret_value;
}
@@ -445,12 +445,16 @@ nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, int_f *max_objs, hid_t_f
int ret_value = 0;
hid_t c_file_id;
unsigned c_obj_type;
- int c_max_objs;
+ int c_max_objs, i;
+ hid_t *c_obj_ids;
c_file_id = (hid_t)*file_id;
c_obj_type = (unsigned) *obj_type;
c_max_objs = (int)*max_objs;
- if ( H5Fget_obj_ids(c_file_id, c_obj_type, c_max_objs, (hid_t *)obj_ids) < 0 ) ret_value = -1;
+ 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;
+ for (i=0; i< c_max_objs; i++) obj_ids[i] = (hid_t_f)c_obj_ids[i];
+ HDfree(c_obj_ids);
return ret_value;
}
/*----------------------------------------------------------------------------