diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2005-06-22 18:23:21 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2005-06-22 18:23:21 (GMT) |
commit | ea66068977639b7b2737bb9db1e59b26db914d1e (patch) | |
tree | bc1ce12c71d0f91dba3c2d0ddccd81862a588c89 /fortran/src/H5Tf.c | |
parent | ec071c6c149c44d9b3a056948502ca2af3b875b9 (diff) | |
download | hdf5-ea66068977639b7b2737bb9db1e59b26db914d1e.zip hdf5-ea66068977639b7b2737bb9db1e59b26db914d1e.tar.gz hdf5-ea66068977639b7b2737bb9db1e59b26db914d1e.tar.bz2 |
[svn-r10970] Purpose: New feature/bug #350 fix
Description:
When compiler flag was used to set the size of Fortran integer
to 8 bytes, library would fail.
Solution:
Cleaned up the code; added detection of Fortran INTEGER type size
and appropriately defined int_f type for C-stubs routines.
Platforms tested:
Solaris 2.8 32 and 64-bit, AIX 5.1 64-bit parallel
PGI Fortran with -i8 flag on heping
Absoft Fortran with -i8 flag on heping
g95 on mir (Fortran integer is 8 bytes by default that cannot be
changed - compiler bug ;-)
AIX Fortran with -qintsize=8 32 and 64-bit modes on copper
Misc. update:
Diffstat (limited to 'fortran/src/H5Tf.c')
-rw-r--r-- | fortran/src/H5Tf.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index 8fbcbef..cd1ccd0 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -1397,7 +1397,7 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) hid_t c_type_id; char* c_name; int c_namelen; - int c_value; + int_f c_value; herr_t error; c_namelen = *namelen; @@ -1437,11 +1437,11 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) char* c_name; size_t c_namelen; herr_t error; - int c_value; + int_f c_value; c_value = *value; c_namelen = ((size_t)*namelen) +1; c_name = (char *)malloc(sizeof(char)*c_namelen); - c_type_id = *type_id; + c_type_id = (hid_t)*type_id; error = H5Tenum_nameof(c_type_id, &c_value, c_name, c_namelen); HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); HDfree(c_name); @@ -1472,17 +1472,16 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) hid_t c_type_id; char* c_name; int c_namelen; - int c_value; herr_t error; c_namelen = *namelen; c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_type_id = *type_id; - error = H5Tenum_valueof(c_type_id, c_name, &c_value); + error = H5Tenum_valueof(c_type_id, c_name, value); HDfree(c_name); + if(error < 0) return ret_value; - *value = (int_f)c_value; ret_value = 0; return ret_value; } |