diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2009-01-27 20:59:03 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2009-01-27 20:59:03 (GMT) |
commit | bea031e44cb539bd76255b1dbbc2f633d0c41adc (patch) | |
tree | 6b77b8af738a34610906a4a2776fcc8176fbabed | |
parent | 4cd5a378c473faefd822beabbeccbb6e4f2f873e (diff) | |
download | hdf5-bea031e44cb539bd76255b1dbbc2f633d0c41adc.zip hdf5-bea031e44cb539bd76255b1dbbc2f633d0c41adc.tar.gz hdf5-bea031e44cb539bd76255b1dbbc2f633d0c41adc.tar.bz2 |
[svn-r16363] Description:
Merged changes from the trunk into the branch. Used the command:
svn merge -r 16197:16362 http://svn.hdfgroup.uiuc.edu/hdf5/trunk/fortran
Platforms tested: smirom, liberty
-rw-r--r-- | fortran/src/H5Pf.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index befb1cd..ef38b31 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -1537,23 +1537,27 @@ nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters) * Programmer: Xiangyang Su * Friday, February 25, 2000 * Modifications: + * Since cd_nelmts has IN/OUT attributes, fixed the input and + * returned value of cd_nelmnts to satisfy this specification. + * MSB January 27, 2009 *---------------------------------------------------------------------------*/ int_f nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name, int_f* filter_id) { unsigned int c_flags; size_t c_cd_nelmts; - size_t c_cd_nelmts_in = (size_t)*cd_nelmts; H5Z_filter_t c_filter; unsigned int *c_cd_values = NULL; char *c_name = NULL; unsigned i; int ret_value = -1; + c_cd_nelmts = (size_t)*cd_nelmts; + if(NULL == (c_name = (char *)malloc((size_t)*namelen + 1))) goto DONE; - if(NULL == (c_cd_values = (unsigned int *)malloc(sizeof(unsigned int) * c_cd_nelmts_in))) + if(NULL == (c_cd_values = (unsigned int *)malloc(sizeof(unsigned int) * c_cd_nelmts))) goto DONE; /* @@ -1567,7 +1571,7 @@ nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* *flags = (int_f)c_flags; HD5packFstring(c_name, _fcdtocp(name), strlen(c_name)); - for(i = 0; i < c_cd_nelmts_in; i++) + for(i = 0; i < c_cd_nelmts; i++) cd_values[i] = (int_f)c_cd_values[i]; ret_value = 0; @@ -1694,13 +1698,17 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, */ c_prp_id = (hid_t)*prp_id; c_idx = (unsigned)*idx; - status = H5Pget_external(c_prp_id, c_idx, c_namelen, c_name, &c_offset, &size ); + status = H5Pget_external(c_prp_id, c_idx, c_namelen+1, c_name, &c_offset, &size ); if (status < 0) goto DONE; *offset = (int_f)c_offset; *bytes = (hsize_t_f)size; - HD5packFstring(c_name, _fcdtocp(name), strlen(c_name)); + /* Note: if the size of the fortran buffer is larger then the returned string + * from the function then we need to give HD5packFstring the fortran buffer size so + * that it fills the remaining unused characters with blanks. MSB + */ + HD5packFstring(c_name, _fcdtocp(name), c_namelen+1); ret_value = 0; DONE: |