diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2024-03-09 17:06:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-09 17:06:10 (GMT) |
commit | 0ea1d7280ba93039cad14faf7b0ed65da20ce563 (patch) | |
tree | 5cd59487a3270224e0aec98606a13cf22706cc26 /src | |
parent | d4c84f8d0a60e6eedd7288116d203dccf24a0b3a (diff) | |
download | hdf5-0ea1d7280ba93039cad14faf7b0ed65da20ce563.zip hdf5-0ea1d7280ba93039cad14faf7b0ed65da20ce563.tar.gz hdf5-0ea1d7280ba93039cad14faf7b0ed65da20ce563.tar.bz2 |
Clean up off_t usage (#4095)
* Add comments to C++ and Fortran API calls that use off_t
* Remove noise casts for small integers
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FDcore.c | 8 | ||||
-rw-r--r-- | src/H5FDdirect.c | 4 | ||||
-rw-r--r-- | src/H5FDlog.c | 4 | ||||
-rw-r--r-- | src/H5FDsec2.c | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 3767420..7c48469 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -393,7 +393,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) int myerrno = errno; time_t mytime = HDtime(NULL); - offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + offset = HDlseek(file->fd, 0, SEEK_CUR); HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write to backing store failed: time = %s, filename = '%s', file descriptor = %d, " @@ -871,8 +871,8 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr * partial results, and the end of the file. */ - uint8_t *mem = file->mem; /* memory pointer for writes */ - HDoff_t offset = (HDoff_t)0; /* offset for reading */ + uint8_t *mem = file->mem; /* memory pointer for writes */ + HDoff_t offset = 0; /* offset for reading */ while (size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to read */ @@ -900,7 +900,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr int myerrno = errno; time_t mytime = HDtime(NULL); - offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + offset = HDlseek(file->fd, 0, SEEK_CUR); HGOTO_ERROR( H5E_IO, H5E_READERROR, NULL, diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 08c4a83..49f80d4 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -541,7 +541,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad } else { file->fa.must_align = false; - if (-1 == HDftruncate(file->fd, (HDoff_t)0)) + if (-1 == HDftruncate(file->fd, 0)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to truncate file") } } @@ -554,7 +554,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad } else { if (o_flags & O_RDWR) { - if (HDlseek(file->fd, (HDoff_t)0, SEEK_SET) < 0) + if (HDlseek(file->fd, 0, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to seek to proper position") if (HDwrite(file->fd, buf1, sizeof(int)) < 0) file->fa.must_align = true; diff --git a/src/H5FDlog.c b/src/H5FDlog.c index e35a6a6..64d3662 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -1229,7 +1229,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had int myerrno = errno; time_t mytime = HDtime(NULL); - offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + offset = HDlseek(file->fd, 0, SEEK_CUR); if (file->fa.flags & H5FD_LOG_LOC_READ) fprintf(file->logfp, "Error! Reading: %10" PRIuHADDR "-%10" PRIuHADDR " (%10zu bytes)\n", @@ -1448,7 +1448,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha int myerrno = errno; time_t mytime = HDtime(NULL); - offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + offset = HDlseek(file->fd, 0, SEEK_CUR); if (file->fa.flags & H5FD_LOG_LOC_WRITE) fprintf(file->logfp, "Error! Writing: %10" PRIuHADDR "-%10" PRIuHADDR " (%10zu bytes)\n", diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 15accf7..c4bfbff 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -697,7 +697,7 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU int myerrno = errno; time_t mytime = HDtime(NULL); - offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + offset = HDlseek(file->fd, 0, SEEK_CUR); HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, " @@ -803,7 +803,7 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN int myerrno = errno; time_t mytime = HDtime(NULL); - offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + offset = HDlseek(file->fd, 0, SEEK_CUR); HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, " |