summaryrefslogtreecommitdiffstats
path: root/src/H5FDcore.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2000-08-04 20:49:59 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2000-08-04 20:49:59 (GMT)
commitb1b1b74b383d84e024e3c76ddb79ea2abdf4eebe (patch)
tree9f2432eaf69b0ae26fc0034dfae094770db6454f /src/H5FDcore.c
parent15dfa78cd81226efc9d2e257c71ba121324e4342 (diff)
downloadhdf5-b1b1b74b383d84e024e3c76ddb79ea2abdf4eebe.zip
hdf5-b1b1b74b383d84e024e3c76ddb79ea2abdf4eebe.tar.gz
hdf5-b1b1b74b383d84e024e3c76ddb79ea2abdf4eebe.tar.bz2
[svn-r2465] Changed nbytes to an hsize_t type since that's what it holds. Also, moved
it into the if-then statement to limit it's scope.
Diffstat (limited to 'src/H5FDcore.c')
-rw-r--r--src/H5FDcore.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index 888dabe..5686003 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -573,8 +573,7 @@ static herr_t
H5FD_core_read(H5FD_t *_file, hid_t UNUSED dxpl_id, haddr_t addr,
hsize_t size, void *buf/*out*/)
{
- H5FD_core_t *file = (H5FD_core_t*)_file;
- ssize_t nbytes;
+ H5FD_core_t *file = (H5FD_core_t*)_file;
FUNC_ENTER(H5FD_core_read, FAIL);
@@ -582,24 +581,25 @@ H5FD_core_read(H5FD_t *_file, hid_t UNUSED dxpl_id, haddr_t addr,
assert(buf);
/* Check for overflow conditions */
- if (HADDR_UNDEF==addr)
+ if (HADDR_UNDEF == addr)
HRETURN_ERROR(H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed");
if (REGION_OVERFLOW(addr, size))
HRETURN_ERROR(H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed");
- if (addr+size>file->eoa)
+ if (addr + size > file->eoa)
HRETURN_ERROR(H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed");
/* Read the part which is before the EOF marker */
- if (addr<file->eof) {
- nbytes = MIN(size, file->eof-addr);
- memcpy(buf, file->mem+addr, nbytes);
+ if (addr < file->eof) {
+ hsize_t nbytes = MIN(size, file->eof-addr);
+
+ memcpy(buf, file->mem + addr, nbytes);
size -= nbytes;
addr += nbytes;
- buf = (char*)buf + nbytes;
+ buf = (char *)buf + nbytes;
}
/* Read zeros for the part which is after the EOF markers */
- if (size>0)
+ if (size > 0)
memset(buf, 0, size);
FUNC_LEAVE(SUCCEED);