Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up off_t usage #4095

Merged
merged 1 commit into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion HDF5Examples/FORTRAN/H5D/h5ex_d_extern.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ PROGRAM main
INTEGER :: i, j
! This change was introduced in the 1.8.12 release
#if H5_VERSION_GE(1,8,12)
INTEGER(OFF_T) :: offset = 0 ! Offset, in bytes, from thebeginning of the file to the
INTEGER(OFF_T) :: offset = 0 ! Offset, in bytes, from the beginning of the file to the
! location in the file where the data starts.
#else
INTEGER :: offset = 0
Expand Down
4 changes: 4 additions & 0 deletions c++/src/H5DcreatProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,8 @@ DSetCreatPropList::setFletcher32() const
/// the total size is larger than the size of a dataset then the
/// dataset can be extended (provided the data space also allows
/// the extending).
///\note On Windows, off_t is typically a 32-bit signed long value, which
/// limits the valid offset that can be set to 2 GiB.
//--------------------------------------------------------------------------
void
DSetCreatPropList::setExternal(const char *name, off_t offset, hsize_t size) const
Expand Down Expand Up @@ -693,6 +695,8 @@ DSetCreatPropList::getExternalCount() const
/// external file name will not be returned. If \a offset or
/// \a size are null pointers then the corresponding information
/// will not be returned.
///\note On Windows, off_t is typically a 32-bit signed long value, which
/// limits the valid offset that can be returned to 2 GiB.
//--------------------------------------------------------------------------
void
DSetCreatPropList::getExternal(unsigned idx, size_t name_size, char *name, off_t &offset, hsize_t &size) const
Expand Down
8 changes: 7 additions & 1 deletion fortran/src/H5Pff.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1615,6 +1615,9 @@ END SUBROUTINE h5pget_filter_f
!! \param bytes Size of the external file data.
!! \param hdferr \fortran_error
!!
!! \note On Windows, off_t is typically a 32-bit signed long value, which
!! limits the valid offset that can be set to 2 GiB.
!!
!! See C API: @ref H5Pset_external()
!!
SUBROUTINE h5pset_external_f(prp_id, name, offset, bytes, hdferr)
Expand Down Expand Up @@ -1686,9 +1689,12 @@ END SUBROUTINE h5pget_external_count_f
!! \param bytes Size of the external file data.
!! \param hdferr \fortran_error
!!
!! \note On Windows, off_t is typically a 32-bit signed long value, which
!! limits the valid offset that can be returned to 2 GiB.
!!
!! See C API: @ref H5Pget_external()
!!
SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset,bytes, hdferr)
SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset, bytes, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: prp_id
INTEGER, INTENT(IN) :: idx
Expand Down
8 changes: 4 additions & 4 deletions src/H5FDcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, "
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/H5FDdirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/H5FDlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/H5FDsec2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, "
Expand Down Expand Up @@ -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, "
Expand Down
2 changes: 1 addition & 1 deletion test/big.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ is_sparse(void)

if ((fd = HDopen("x.h5", O_RDWR | O_TRUNC | O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0)
return 0;
if (HDlseek(fd, (HDoff_t)(1024 * 1024), SEEK_SET) != 1024 * 1024)
if (HDlseek(fd, (1024 * 1024), SEEK_SET) != 1024 * 1024)
return 0;
if (5 != HDwrite(fd, "hello", (size_t)5))
return 0;
Expand Down
8 changes: 4 additions & 4 deletions test/enc_dec_plist.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ main(void)
FAIL_STACK_ERROR;

max_size[0] = 100;
if ((H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
if ((H5Pset_external(dcpl, "ext1.data", 0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
FAIL_STACK_ERROR;
if ((H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
if ((H5Pset_external(dcpl, "ext2.data", 0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
FAIL_STACK_ERROR;
if ((H5Pset_external(dcpl, "ext3.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
if ((H5Pset_external(dcpl, "ext3.data", 0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
FAIL_STACK_ERROR;
if ((H5Pset_external(dcpl, "ext4.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
if ((H5Pset_external(dcpl, "ext4.data", 0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
FAIL_STACK_ERROR;

/* Test encoding & decoding property list */
Expand Down
8 changes: 4 additions & 4 deletions test/enc_dec_plist_cross_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ test_plists(const char *filename_prefix)
testfile = H5_get_srcdir_filename(filename);
if ((fd_1 = HDopen(testfile, O_RDONLY)) < 0)
TEST_ERROR;
size_1 = (size_t)HDlseek(fd_1, (HDoff_t)0, SEEK_END);
HDlseek(fd_1, (HDoff_t)0, SEEK_SET);
size_1 = (size_t)HDlseek(fd_1, 0, SEEK_END);
HDlseek(fd_1, 0, SEEK_SET);
buf_1 = (void *)malloc(size_1);
if (HDread(fd_1, buf_1, size_1) < 0)
TEST_ERROR;
Expand All @@ -194,8 +194,8 @@ test_plists(const char *filename_prefix)
testfile = H5_get_srcdir_filename(filename);
if ((fd_2 = HDopen(testfile, O_RDONLY)) < 0)
TEST_ERROR;
size_2 = (size_t)HDlseek(fd_2, (HDoff_t)0, SEEK_END);
HDlseek(fd_2, (HDoff_t)0, SEEK_SET);
size_2 = (size_t)HDlseek(fd_2, 0, SEEK_END);
HDlseek(fd_2, 0, SEEK_SET);
buf_2 = (void *)malloc(size_2);
if (HDread(fd_2, buf_2, size_2) < 0)
TEST_ERROR;
Expand Down
22 changes: 10 additions & 12 deletions test/external.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test_non_extendible(hid_t file)
/* Create the dataset and close */
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if (H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int))) < 0)
if (H5Pset_external(dcpl, "ext1.data", 0, (hsize_t)(max_size[0] * sizeof(int))) < 0)
FAIL_STACK_ERROR;
if ((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR;
Expand Down Expand Up @@ -203,8 +203,7 @@ test_too_small(hid_t file)

if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if (H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) - 1)) <
0) /* note -1 */
if (H5Pset_external(dcpl, "ext1.data", 0, (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0) /* note -1 */
FAIL_STACK_ERROR;
if ((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR;
Expand Down Expand Up @@ -260,7 +259,7 @@ test_large_enough_current_eventual(hid_t file)

if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if (H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int))) < 0)
if (H5Pset_external(dcpl, "ext1.data", 0, (hsize_t)(max_size[0] * sizeof(int))) < 0)
FAIL_STACK_ERROR;
if ((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR;
Expand Down Expand Up @@ -312,8 +311,7 @@ test_large_enough_current_not_eventual(hid_t file)

if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if (H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) - 1)) <
0) /* note -1 */
if (H5Pset_external(dcpl, "ext1.data", 0, (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0) /* note -1 */
FAIL_STACK_ERROR;
if ((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR;
Expand Down Expand Up @@ -373,7 +371,7 @@ test_unlimited(hid_t file)
/* Create dataset */
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED) < 0)
if (H5Pset_external(dcpl, "ext1.data", 0, H5F_UNLIMITED) < 0)
FAIL_STACK_ERROR;
if ((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR;
Expand Down Expand Up @@ -576,12 +574,12 @@ test_add_to_unlimited(void)

if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED) < 0)
if (H5Pset_external(dcpl, "ext1.data", 0, H5F_UNLIMITED) < 0)
FAIL_STACK_ERROR;

H5E_BEGIN_TRY
{
status = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)100);
status = H5Pset_external(dcpl, "ext2.data", 0, 100);
}
H5E_END_TRY
if (status >= 0)
Expand Down Expand Up @@ -627,12 +625,12 @@ test_overflow(void)

if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED - 1) < 0)
if (H5Pset_external(dcpl, "ext1.data", 0, H5F_UNLIMITED - 1) < 0)
FAIL_STACK_ERROR;

H5E_BEGIN_TRY
{
status = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)100);
status = H5Pset_external(dcpl, "ext2.data", 0, 100);
}
H5E_END_TRY
if (status >= 0)
Expand Down Expand Up @@ -1286,7 +1284,7 @@ test_h5d_get_access_plist(hid_t fapl_id)
/* Create the dcpl and set external storage */
if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if (H5Pset_external(dcpl_id, "extern_1r.raw", (off_t)0, (hsize_t)0) < 0)
if (H5Pset_external(dcpl_id, "extern_1r.raw", 0, 0) < 0)
FAIL_STACK_ERROR;

/* Create the dapl and set the prefix */
Expand Down
2 changes: 1 addition & 1 deletion test/file_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ test_get_file_image(const char *test_banner, const int file_name_num, hid_t fapl
HDoff_t off;

/* Position at userblock */
off = HDlseek(fd, (HDoff_t)USERBLOCK_SIZE, SEEK_SET);
off = HDlseek(fd, USERBLOCK_SIZE, SEEK_SET);
VERIFY(off >= 0, "HDlseek() failed.");
}

Expand Down
2 changes: 1 addition & 1 deletion test/fillval.c
Original file line number Diff line number Diff line change
Expand Up @@ -2098,7 +2098,7 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
if ((fd = HDopen(FILE_NAME_RAW, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0 ||
HDclose(fd) < 0)
goto error;
if (H5Pset_external(dcpl, FILE_NAME_RAW, (off_t)0, (hsize_t)nelmts * sizeof(int)) < 0)
if (H5Pset_external(dcpl, FILE_NAME_RAW, 0, (hsize_t)nelmts * sizeof(int)) < 0)
goto error;
}
#endif
Expand Down
12 changes: 6 additions & 6 deletions test/gen_bad_offset.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
* (A) Open the file:
* fd = HDopen(TESTFILE, O_RDWR, 0663);
* (B) Position the file at:
* (1) HDlseek(fd, (HDoff_t)880, SEEK_SET);
* (1) HDlseek(fd, 880, SEEK_SET);
* "/group1/group2": replace heap offset "8" by bad offset
* (2) HDlseek(fd, (HDoff_t)1512, SEEK_SET);
* (2) HDlseek(fd, 1512, SEEK_SET);
* "/dsetA": replace name offset into private heap "72" by bad offset
* (3) HDlseek(fd, (HDoff_t)1616, SEEK_SET);
* (3) HDlseek(fd, 1616, SEEK_SET);
* /soft_one: replace link value offset in the scratch pad "32" by bad offset
* (C) Write the bad offset value to the file for (1), (2) and (3):
* write(fd, &val, sizeof(val));
Expand Down Expand Up @@ -104,21 +104,21 @@ main(void)
FAIL_STACK_ERROR;

/* Position the file for /group1/group2: replace heap offset "8" by bad offset */
if (HDlseek(fd, (HDoff_t)880, SEEK_SET) < 0)
if (HDlseek(fd, 880, SEEK_SET) < 0)
FAIL_STACK_ERROR;
/* Write the bad offset value to the file */
if (HDwrite(fd, &val, sizeof(val)) < 0)
FAIL_STACK_ERROR;

/* Position the file for /dsetA: replace name offset into private heap "72" by bad offset */
if (HDlseek(fd, (HDoff_t)1512, SEEK_SET) < 0)
if (HDlseek(fd, 1512, SEEK_SET) < 0)
FAIL_STACK_ERROR;
/* Write the bad offset value to the file */
if (HDwrite(fd, &val, sizeof(val)) < 0)
FAIL_STACK_ERROR;

/* Position the file for /soft_one: replace link value offset in the scratch pad "32" by bad offset */
if (HDlseek(fd, (HDoff_t)1616, SEEK_SET) < 0)
if (HDlseek(fd, 1616, SEEK_SET) < 0)
FAIL_STACK_ERROR;
/* Write the bad offset value to the file */
if (HDwrite(fd, &val, sizeof(val)) < 0)
Expand Down
8 changes: 4 additions & 4 deletions test/gen_plist.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ main(void)
assert(ret > 0);

max_size[0] = 100;
if ((ret = H5Pset_external(dcpl1, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
if ((ret = H5Pset_external(dcpl1, "ext1.data", 0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
assert(ret > 0);
if ((ret = H5Pset_external(dcpl1, "ext2.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
if ((ret = H5Pset_external(dcpl1, "ext2.data", 0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
assert(ret > 0);
if ((ret = H5Pset_external(dcpl1, "ext3.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
if ((ret = H5Pset_external(dcpl1, "ext3.data", 0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
assert(ret > 0);
if ((ret = H5Pset_external(dcpl1, "ext4.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
if ((ret = H5Pset_external(dcpl1, "ext4.data", 0, (hsize_t)(max_size[0] * sizeof(int) / 4))) < 0)
assert(ret > 0);

if ((ret = encode_plist(dcpl1, little_endian, word_length, "plist_files/dcpl_")) < 0)
Expand Down
2 changes: 1 addition & 1 deletion test/istore.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ is_sparse(void)

if ((fd = HDopen("x.h5", O_RDWR | O_TRUNC | O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0)
return 0;
if (HDlseek(fd, (HDoff_t)(1024 * 1024), SEEK_SET) != 1024 * 1024)
if (HDlseek(fd, (1024 * 1024), SEEK_SET) != 1024 * 1024)
return 0;
if (5 != HDwrite(fd, "hello", (size_t)5))
return 0;
Expand Down
2 changes: 1 addition & 1 deletion test/objcopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -5200,7 +5200,7 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
size = DIM_SIZE_1 * sizeof(int);
if ((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0)
TEST_ERROR;
if (H5Pset_external(pid, FILE_EXT, (off_t)0, size) < 0)
if (H5Pset_external(pid, FILE_EXT, 0, size) < 0)
TEST_ERROR;

/* create dataset at SRC file */
Expand Down
4 changes: 2 additions & 2 deletions test/set_extent.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,10 +1831,10 @@ test_external(hid_t fapl, bool use_select_io)
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;

if (H5Pset_external(dcpl, EXT_FILE_NAME1, (off_t)0, size) < 0)
if (H5Pset_external(dcpl, EXT_FILE_NAME1, 0, size) < 0)
FAIL_STACK_ERROR;

if (H5Pset_external(dcpl, EXT_FILE_NAME2, (off_t)0, size) < 0)
if (H5Pset_external(dcpl, EXT_FILE_NAME2, 0, size) < 0)
FAIL_STACK_ERROR;

{
Expand Down
2 changes: 1 addition & 1 deletion test/th5s.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ test_h5s_zero_dim(void)
* space in the external file is the size of the dataset (zero because one dimension size is zero).
* There's no need to clean up the external file since the library doesn't create it
* until the data is written to it. */
ret = H5Pset_external(plist_id, EXTFILE_NAME, (off_t)0, (hsize_t)0);
ret = H5Pset_external(plist_id, EXTFILE_NAME, 0, (hsize_t)0);
CHECK(ret, FAIL, "H5Pset_external");

ret = H5Pset_alloc_time(plist_id, alloc_time);
Expand Down
Loading
Loading