summaryrefslogtreecommitdiffstats
path: root/c++/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 /c++/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 'c++/src')
-rw-r--r--c++/src/H5File.cpp10
-rw-r--r--c++/src/H5File.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp
index cced607..f44d6f0 100644
--- a/c++/src/H5File.cpp
+++ b/c++/src/H5File.cpp
@@ -175,14 +175,16 @@ FileAccPropList H5File::getAccessPlist() const
// is called after an existing file is opened in order
// to learn the true size of the underlying file.
// (Raymond Lu)
-haddr_t H5File::getFileSize(void) const
+herr_t H5File::getFileSize(hsize_t *size) const
{
- haddr_t file_size = H5Fget_filesize(id);
- if( file_size < 0 )
+ herr_t ret;
+
+ ret = H5Fget_filesize(id, size);
+ if( ret < 0 )
{
throw FileIException("H5File::getFileSize", "H5Fget_filesize failed");
}
- return file_size;
+ return ret;
}
// Calls the C API H5Fclose to close this file. Used by IdComponent::reset
diff --git a/c++/src/H5File.h b/c++/src/H5File.h
index 82615df..d1fe153 100644
--- a/c++/src/H5File.h
+++ b/c++/src/H5File.h
@@ -51,7 +51,7 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG {
void reopen();
// Retrieves the file size of an opened file.
- haddr_t getFileSize() const;
+ herr_t getFileSize(hsize_t *size) const;
// Gets the creation property list of this file
FileCreatPropList getCreatePlist() const;