diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2009-05-13 19:10:25 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2009-05-13 19:10:25 (GMT) |
commit | 8745d8b7cceee7c72f3d445808a110ad7ba71a30 (patch) | |
tree | a913a4236cab3a0e81b4fb65bc92919a1f4d84d2 /hl/fortran/src/H5LTff.f90 | |
parent | c7741d35374aa20a2bb7e25f2511228e8a8fcfb5 (diff) | |
download | hdf5-8745d8b7cceee7c72f3d445808a110ad7ba71a30.zip hdf5-8745d8b7cceee7c72f3d445808a110ad7ba71a30.tar.gz hdf5-8745d8b7cceee7c72f3d445808a110ad7ba71a30.tar.bz2 |
[svn-r16947] 1. #1522 (B1) h5ltread_dataset_string_f error with g95
ISSUE: h5ltread_dataset_string_f causes library assertion with g95.
SOLUTION: convert the fortran string buffer to a C buffer with HD5f2cstring, and pass this string to the C function
TEST: added a test call in the fortran test lite program
DOCS: added the note in RELEASE.txt "- Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions had memory problems with the g95 fortran compiler. (PVN - 5/13/2009) 1522
Diffstat (limited to 'hl/fortran/src/H5LTff.f90')
-rwxr-xr-x | hl/fortran/src/H5LTff.f90 | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/hl/fortran/src/H5LTff.f90 b/hl/fortran/src/H5LTff.f90 index 45d9a23..c6a6396 100755 --- a/hl/fortran/src/H5LTff.f90 +++ b/hl/fortran/src/H5LTff.f90 @@ -2453,9 +2453,10 @@ subroutine h5ltmake_dataset_string_f(loc_id,& character(len=*), intent(in) :: buf ! data buffer integer :: errcode ! error code integer :: namelen ! name length + integer :: buflen ! buffer length interface - integer function h5ltmake_dataset_string_c(loc_id,namelen,dset_name,buf) + integer function h5ltmake_dataset_string_c(loc_id,namelen,dset_name,buflen,buf) use h5global !DEC$ IF DEFINED(HDF5F90_WINDOWS) !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_STRING_C'::h5ltmake_dataset_string_c @@ -2463,13 +2464,15 @@ subroutine h5ltmake_dataset_string_f(loc_id,& !DEC$ATTRIBUTES reference :: dset_name integer(hid_t), intent(in) :: loc_id ! file or group identifier integer :: namelen ! lenght of name buffer + integer :: buflen ! lenght of data buffer character(len=*), intent(in) :: dset_name ! name of the dataset character(len=*), intent(in) :: buf ! data buffer end function h5ltmake_dataset_string_c end interface namelen = len(dset_name) - errcode = h5ltmake_dataset_string_c(loc_id,namelen,dset_name,buf) + buflen = len(buf) + errcode = h5ltmake_dataset_string_c(loc_id,namelen,dset_name,buflen,buf) end subroutine h5ltmake_dataset_string_f @@ -2775,9 +2778,10 @@ subroutine h5ltset_attribute_string_f(loc_id,& character(len=*), intent(in) :: buf ! data buffer integer :: namelen ! name length integer :: attrlen ! name length + integer :: buflen ! data buffer length interface - integer function h5ltset_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) + integer function h5ltset_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buflen,buf) use h5global !DEC$ IF DEFINED(HDF5F90_WINDOWS) !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LTSET_ATTRIBUTE_STRING_C'::h5ltset_attribute_string_c @@ -2787,6 +2791,7 @@ subroutine h5ltset_attribute_string_f(loc_id,& integer(hid_t), intent(in) :: loc_id ! file or group identifier integer :: namelen ! lenght of name buffer integer :: attrlen ! lenght of attr name buffer + integer :: buflen ! data buffer length character(len=*), intent(in) :: dset_name ! name of the dataset character(len=*), intent(in) :: attr_name ! name of the attribute character(len=*), intent(in) :: buf ! data buffer @@ -2795,7 +2800,8 @@ subroutine h5ltset_attribute_string_f(loc_id,& namelen = len(dset_name) attrlen = len(attr_name) - errcode = h5ltset_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) + buflen = len(buf) + errcode = h5ltset_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buflen,buf) end subroutine h5ltset_attribute_string_f |