diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-04-06 02:57:06 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-04-06 02:57:06 (GMT) |
commit | d5a62239587f7cc5de301fa5c6b0919807689818 (patch) | |
tree | 40a36d60dd8ac2d10a45886869cc53d3fdc9181e /hl/fortran/src/H5LTfc.c | |
parent | ebf3d99b955c705217227fb7f8ae4405e941399a (diff) | |
download | hdf5-d5a62239587f7cc5de301fa5c6b0919807689818.zip hdf5-d5a62239587f7cc5de301fa5c6b0919807689818.tar.gz hdf5-d5a62239587f7cc5de301fa5c6b0919807689818.tar.bz2 |
[svn-r22254] Description:
Bring r22085:22251 from trunk to revise_chunks branch.
Also tackle some testing issues in test/objcopy.c test and clean up
some warnings.
Tested on:
FreeBSD/32 8.2 (loyalty) w/gcc4.6, w/C++ & FORTRAN, in debug mode
FreeBSD/64 8.2 (freedom) w/gcc4.6, w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (koala) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (ostrich) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (ember) w/Intel compilers, w/paralle, C++ & FORTRAN,
in production mode
Mac OS X/32 10.7.3 (amazon) in debug mode
Mac OS X/32 10.7.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.7.3 (amazon) w/parallel, in debug mode
Diffstat (limited to 'hl/fortran/src/H5LTfc.c')
-rw-r--r--[-rwxr-xr-x] | hl/fortran/src/H5LTfc.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index c0b7695..674636d 100755..100644 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -17,8 +17,7 @@ #include "H5LTprivate.h" #include "H5LTf90proto.h" - - +#include "H5Eprivate.h" /*------------------------------------------------------------------------- * Function: H5LTmake_dataset_c @@ -1719,13 +1718,13 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id, _fcd dsetname, int_f *attrnamelen, _fcd attrname, - void *buf) + _fcd buf, size_t_f *buf_size) { int ret_value = -1; herr_t ret; - hid_t c_loc_id; char *c_name = NULL; char *c_attrname = NULL; + char *c_buf = NULL; int c_namelen; int c_attrnamelen; @@ -1741,26 +1740,33 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id, c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) goto done; - /* - * Call H5LTget_attribute_int function. - */ - c_loc_id = (hid_t)*loc_id; - - ret = H5LTget_attribute_string(c_loc_id,c_name,c_attrname,buf); + * Allocate buffer to hold C attribute string + */ + if ((c_buf = HDmalloc((size_t)*buf_size + 1)) == NULL) + goto done; + /* + * Call H5LTget_attribute_int function. + */ + ret = H5LTget_attribute_string((hid_t)*loc_id,c_name,c_attrname,c_buf); if (ret < 0) goto done; - ret_value = 0; + /* + * Convert C name to FORTRAN and place it in the given buffer + */ + HD5packFstring(c_buf, _fcdtocp(buf), (size_t)*buf_size); + ret_value = 0; done: if(c_name!=NULL) free(c_name); if(c_attrname!=NULL) free(c_attrname); - + if(c_buf!=NULL) + free(c_buf); return ret_value; } @@ -2157,7 +2163,7 @@ nh5ltpath_valid_c(hid_t_f *loc_id, /* * convert FORTRAN name to C name */ - if( NULL == (c_path = (char *)HD5f2cstring(path, (int)*pathlen))) + if( NULL == (c_path = (char *)HD5f2cstring(path, (size_t)*pathlen))) goto done; check_object_valid = FALSE; |