summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2004-07-07 18:04:16 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2004-07-07 18:04:16 (GMT)
commit2afbcb2f0e536dfdd00c405278154ea4464d866b (patch)
tree289c75ed09e8adee11474db2bf39698c4ccc16bb /src
parentc889f67f9c3650e0b3008e0c3ab98bf01c078500 (diff)
downloadhdf5-2afbcb2f0e536dfdd00c405278154ea4464d866b.zip
hdf5-2afbcb2f0e536dfdd00c405278154ea4464d866b.tar.gz
hdf5-2afbcb2f0e536dfdd00c405278154ea4464d866b.tar.bz2
[svn-r8819] Purpose: Potential bug fix
Description: In H5Fget_filesize, file size was returned as haddr_t. Solution: Return file size as hsize_t and parameter for Fortran. Platforms tested: eirene
Diffstat (limited to 'src')
-rw-r--r--src/H5F.c19
-rw-r--r--src/H5Fpublic.h2
2 files changed, 12 insertions, 9 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 33e89bc..d220933 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -4679,22 +4679,25 @@ done:
*
*-------------------------------------------------------------------------
*/
-haddr_t
-H5Fget_filesize(hid_t file_id)
+herr_t
+H5Fget_filesize(hid_t file_id, hsize_t *size)
{
H5F_t *file=NULL; /* File object for file ID */
- haddr_t ret_value; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
+ haddr_t eof;
- FUNC_ENTER_API(H5Fget_filesize, HADDR_UNDEF)
- H5TRACE1("a","i",file_id);
+ FUNC_ENTER_API(H5Fget_filesize, FAIL)
+ H5TRACE2("e","i*h",file_id,size);
/* Check args */
if(NULL==(file=H5I_object_verify(file_id, H5I_FILE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "not a file ID")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
/* Go get the actual file size */
- if((ret_value = H5FDget_eof(file->shared->lf))==HADDR_UNDEF)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, HADDR_UNDEF, "unable to get file size")
+ if((eof = H5FDget_eof(file->shared->lf))==HADDR_UNDEF)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size")
+
+ *size = (hsize_t)eof;
done:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h
index c372130..c83f12e 100644
--- a/src/H5Fpublic.h
+++ b/src/H5Fpublic.h
@@ -113,7 +113,7 @@ H5_DLL herr_t H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void** file_handle);
H5_DLL herr_t H5Fmount(hid_t loc, const char *name, hid_t child, hid_t plist);
H5_DLL herr_t H5Funmount(hid_t loc, const char *name);
H5_DLL hssize_t H5Fget_freespace(hid_t file_id);
-H5_DLL haddr_t H5Fget_filesize(hid_t file_id);
+H5_DLL herr_t H5Fget_filesize(hid_t file_id, hsize_t *size);
H5_DLL ssize_t H5Fget_name(hid_t obj_id, char *name, size_t size);
#ifdef __cplusplus