diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2013-05-29 00:16:59 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2013-05-29 00:16:59 (GMT) |
commit | cf0c06c96228f2b04305bb05d582f42741e81268 (patch) | |
tree | d66c4511d795b73e96ca303c40bb35dac33faadf /src/H5F.c | |
parent | 530208b86c520b663efcc05835baa273b1991ccb (diff) | |
download | hdf5-cf0c06c96228f2b04305bb05d582f42741e81268.zip hdf5-cf0c06c96228f2b04305bb05d582f42741e81268.tar.gz hdf5-cf0c06c96228f2b04305bb05d582f42741e81268.tar.bz2 |
[svn-r23719] Description:
Bring r23713 and r23717 from trunk to 1.8 branch:
Clean up warnings, switch library code to use Standard C/POSIX wrapper
macros, remove internal calls to API routines, update checkapi and checkposix
scripts.
Tested on:
Mac OSX/64 10.8.3 (amazon) w/C++ & FORTRAN
Big-Endian Linux/64 (ostrich)
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -2367,8 +2367,10 @@ H5F_build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *na } /* end else */ done: - if(new_fapl_id > 0 && H5Pclose(new_fapl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close duplicated FAPL") + /* Close the property list */ + if(new_fapl_id > 0) + if(H5I_dec_app_ref(new_fapl_id) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close duplicated FAPL") FUNC_LEAVE_NOAPI(ret_value) } /* H5F_build_actual_name() */ @@ -2595,16 +2597,15 @@ done: * david.pitt@bigpond.com * Apr 27, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5Fget_filesize(hid_t file_id, hsize_t *size) { - H5F_t *file; /* File object for file ID */ - haddr_t eof; /* End of file address */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *file; /* File object for file ID */ + haddr_t eof; /* End of file address */ + haddr_t base_addr; /* Base address for the file */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", file_id, size); @@ -2614,10 +2615,12 @@ H5Fget_filesize(hid_t file_id, hsize_t *size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* Go get the actual file size */ - if(HADDR_UNDEF == (eof = H5FDget_eof(file->shared->lf))) + if(HADDR_UNDEF == (eof = H5FD_get_eof(file->shared->lf))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size") + base_addr = H5FD_get_base_addr(file->shared->lf); - *size = (hsize_t)eof; + if(size) + *size = (hsize_t)(eof + base_addr); /* Convert relative base address for file to absolute address */ done: FUNC_LEAVE_API(ret_value) |