summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2004-07-07 17:03:02 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2004-07-07 17:03:02 (GMT)
commitc949e7c391fe606bf8a680bbc41848d2cd7cc627 (patch)
tree3aa06572baed0dc3037756cbdf77ffa960ed553c /src/H5F.c
parentfaa845f84b89eea5dd527de8f79adf151dd2f92d (diff)
downloadhdf5-c949e7c391fe606bf8a680bbc41848d2cd7cc627.zip
hdf5-c949e7c391fe606bf8a680bbc41848d2cd7cc627.tar.gz
hdf5-c949e7c391fe606bf8a680bbc41848d2cd7cc627.tar.bz2
[svn-r8818]
Purpose: Potential bug fix Description: In H5Fget_filesize, file size was returned as haddr_t. Change it to hsize_t and return it as parameter to make fortran interface easier. Platforms tested: fuss(simple change).
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 03aa5a2..1755e5d 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -4714,7 +4714,7 @@ done:
* is called after an existing file is opened in order
* to learn the true size of the underlying file.
*
- * Return: Success: File size
+ * Return: Success: Non-negative
* Failure: Negative
*
* Programmer: David Pitt
@@ -4725,22 +4725,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)