From faeea29f209f0e9d1fa20f67f952476d52f371f6 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 4 Nov 2024 00:25:01 -0800 Subject: [PATCH] Rename HDoff_t to hoff_t hoff_t is in line with the other typedefs in H5public.h (hsize_t, etc.). --- bin/trace | 2 +- c++/src/C2Cppfunction_map.htm | 4 ++-- c++/src/H5DcreatProp.cpp | 8 ++++---- c++/src/H5DcreatProp.h | 4 ++-- fortran/src/H5Pf.c | 2 +- java/src/jni/h5pDCPLImp.c | 4 ++-- release_docs/RELEASE.txt | 8 ++++---- src/H5Defl.c | 4 ++-- src/H5FDcore.c | 10 +++++----- src/H5FDdirect.c | 24 +++++++++++------------ src/H5FDhdfs.c | 6 +++--- src/H5FDlog.c | 18 ++++++++--------- src/H5FDmirror.c | 4 ++-- src/H5FDonion.c | 2 +- src/H5FDros3.c | 4 ++-- src/H5FDsec2.c | 18 ++++++++--------- src/H5FDsplitter.c | 6 +++--- src/H5FDsubfiling/H5FDioc.c | 6 +++--- src/H5FDsubfiling/H5FDioc_threads.c | 6 +++--- src/H5FDsubfiling/H5FDsubfiling.c | 6 +++--- src/H5Fprivate.h | 4 ++-- src/H5Oefl.c | 2 +- src/H5Oprivate.h | 2 +- src/H5Pdcpl.c | 10 +++++----- src/H5Ppublic.h | 8 ++++---- src/H5private.h | 4 ++-- src/H5public.h | 6 +++--- test/big.c | 4 ++-- test/chunk_info.c | 4 ++-- test/dsets.c | 4 ++-- test/external.c | 16 +++++++-------- test/external_env.c | 2 +- test/file_image.c | 2 +- test/h5test.c | 16 +++++++-------- test/hdfs.c | 2 +- test/ros3.c | 2 +- test/set_extent.c | 2 +- test/twriteorder.c | 4 ++-- testpar/t_subfiling_vfd.c | 2 +- tools/lib/h5tools_dump.c | 2 +- tools/src/h5jam/h5jam.c | 10 +++++----- tools/src/h5jam/h5unjam.c | 12 ++++++------ tools/src/h5ls/h5ls.c | 2 +- tools/src/h5perf/sio_engine.c | 30 ++++++++++++++--------------- tools/src/misc/h5repart.c | 30 ++++++++++++++--------------- tools/test/misc/h5clear_gentest.c | 4 ++-- tools/test/perform/iopipe.c | 2 +- tools/test/perform/overhead.c | 4 ++-- 48 files changed, 169 insertions(+), 169 deletions(-) diff --git a/bin/trace b/bin/trace index fd344a25a2b..101e8c83b36 100755 --- a/bin/trace +++ b/bin/trace @@ -121,7 +121,7 @@ $Source = ""; "H5M_iterate_t" => 'MI', "H5FD_mem_t" => "Mt", "off_t" => "o", - "HDoff_t" => "Ho", + "hoff_t" => "Ho", "H5O_iterate1_t" => "Oi", "H5O_iterate2_t" => "OI", "H5O_mcdt_search_cb_t" => "Os", diff --git a/c++/src/C2Cppfunction_map.htm b/c++/src/C2Cppfunction_map.htm index 4ea67544efe..dc569850b9e 100644 --- a/c++/src/C2Cppfunction_map.htm +++ b/c++/src/C2Cppfunction_map.htm @@ -16851,7 +16851,7 @@ mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>

void DSetCreatPropList::setExternal(const char* name, HDoff_t offset, + normal'>void DSetCreatPropList::setExternal(const char* name, hoff_t offset, hsize_t size)

void DSetCreatPropList::getExternal(unsigned idx, size_t name_size, - char* name, HDoff_t& offset, hsize_t& size)

+ char* name, hoff_t& offset, hsize_t& size)

slot[u].offset + (HDoff_t)skip), SEEK_SET) < 0) + if (HDlseek(fd, (hoff_t)(efl->slot[u].offset + (hoff_t)skip), SEEK_SET) < 0) HGOTO_ERROR(H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file"); #ifndef NDEBUG tempto_read = MIN((size_t)(efl->slot[u].size - skip), (hsize_t)size); @@ -434,7 +434,7 @@ H5D__efl_write(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t siz else HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file"); } /* end if */ - if (HDlseek(fd, (HDoff_t)(efl->slot[u].offset + (HDoff_t)skip), SEEK_SET) < 0) + if (HDlseek(fd, (hoff_t)(efl->slot[u].offset + (hoff_t)skip), SEEK_SET) < 0) HGOTO_ERROR(H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file"); #ifndef NDEBUG tempto_write = MIN(efl->slot[u].size - skip, (hsize_t)size); diff --git a/src/H5FDcore.c b/src/H5FDcore.c index b1aeef9032d..cbd39e14b5b 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -349,8 +349,8 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) unsigned char *ptr = file->mem + addr; /* mutable pointer into the * buffer (can't change mem) */ - HDoff_t offset = (HDoff_t)addr; /* Offset to write at */ - herr_t ret_value = SUCCEED; /* Return value */ + hoff_t offset = (hoff_t)addr; /* Offset to write at */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -358,7 +358,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) #ifndef H5_HAVE_PREADWRITE /* Seek to the correct location (if we don't have pwrite) */ - if ((HDoff_t)addr != HDlseek(file->fd, (HDoff_t)addr, SEEK_SET)) + if ((hoff_t)addr != HDlseek(file->fd, (hoff_t)addr, SEEK_SET)) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "error seeking in backing store"); #endif /* H5_HAVE_PREADWRITE */ @@ -853,7 +853,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr */ uint8_t *mem = file->mem; /* memory pointer for writes */ - HDoff_t offset = 0; /* offset for reading */ + hoff_t offset = 0; /* offset for reading */ while (size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to read */ @@ -1547,7 +1547,7 @@ H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool closing) if (0 == bError) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #else /* H5_HAVE_WIN32_API */ - if (-1 == HDftruncate(file->fd, (HDoff_t)new_eof)) + if (-1 == HDftruncate(file->fd, (hoff_t)new_eof)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #endif /* H5_HAVE_WIN32_API */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 147013f7c95..8a40288a08a 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -92,7 +92,7 @@ typedef struct H5FD_direct_t { /* * These macros check for overflow of various quantities. These macros - * assume that HDoff_t is signed and haddr_t and size_t are unsigned. + * assume that hoff_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument @@ -105,11 +105,11 @@ typedef struct H5FD_direct_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(hoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A, Z) \ - (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (HDoff_t)((A) + (Z)) < (HDoff_t)(A)) + (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (hoff_t)((A) + (Z)) < (hoff_t)(A)) /* Prototypes */ static herr_t H5FD__direct_populate_config(size_t boundary, size_t block_size, size_t cbuf_size, @@ -429,7 +429,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad FUNC_ENTER_PACKAGE /* Sanity check on file offsets */ - assert(sizeof(HDoff_t) >= sizeof(size_t)); + assert(sizeof(hoff_t) >= sizeof(size_t)); /* Check arguments */ if (!name || !*name) @@ -839,7 +839,7 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U */ if (!_must_align || ((addr % _fbsize == 0) && (size % _fbsize == 0) && ((size_t)buf % _boundary == 0))) { /* Seek to the correct location */ - if ((addr != file->pos || OP_READ != file->op) && HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) + if ((addr != file->pos || OP_READ != file->op) && HDlseek(file->fd, (hoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); /* Read the aligned data in file first, being careful of interrupted * system calls and partial results. */ @@ -879,7 +879,7 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U /* look for the aligned position for reading the data */ assert(!(((addr / _fbsize) * _fbsize) % _fbsize)); - if (HDlseek(file->fd, (HDoff_t)((addr / _fbsize) * _fbsize), SEEK_SET) < 0) + if (HDlseek(file->fd, (hoff_t)((addr / _fbsize) * _fbsize), SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); /* @@ -1019,7 +1019,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ */ if (!_must_align || ((addr % _fbsize == 0) && (size % _fbsize == 0) && ((size_t)buf % _boundary == 0))) { /* Seek to the correct location */ - if ((addr != file->pos || OP_WRITE != file->op) && HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) + if ((addr != file->pos || OP_WRITE != file->op) && HDlseek(file->fd, (hoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); while (size > 0) { @@ -1056,7 +1056,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "posix_memalign failed"); /* look for the right position for reading or writing the data */ - if (HDlseek(file->fd, (HDoff_t)write_addr, SEEK_SET) < 0) + if (HDlseek(file->fd, (hoff_t)write_addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); p3 = buf; @@ -1097,7 +1097,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ /* Seek to the last block, for reading */ assert(!((write_addr + write_size - _fbsize) % _fbsize)); - if (HDlseek(file->fd, (HDoff_t)(write_addr + write_size - _fbsize), SEEK_SET) < 0) + if (HDlseek(file->fd, (hoff_t)(write_addr + write_size - _fbsize), SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); } /* end if */ else @@ -1133,7 +1133,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ /*look for the aligned position for writing the data*/ assert(!(write_addr % _fbsize)); - if (HDlseek(file->fd, (HDoff_t)write_addr, SEEK_SET) < 0) + if (HDlseek(file->fd, (hoff_t)write_addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); /* @@ -1221,7 +1221,7 @@ H5FD__direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_ if (SetEndOfFile((HANDLE)filehandle) == 0) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #else /* H5_HAVE_WIN32_API */ - if (-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) + if (-1 == HDftruncate(file->fd, (hoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #endif /* H5_HAVE_WIN32_API */ @@ -1236,7 +1236,7 @@ H5FD__direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_ /*Even though eof is equal to eoa, file is still truncated because Direct I/O *write introduces some extra data for alignment. */ - if (-1 == HDftruncate(file->fd, (HDoff_t)file->eof)) + if (-1 == HDftruncate(file->fd, (hoff_t)file->eof)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); } diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index e217948137b..c1de366b431 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -232,7 +232,7 @@ typedef struct H5FD_hdfs_t { /* * These macros check for overflow of various quantities. These macros - * assume that HDoff_t is signed and haddr_t and size_t are unsigned. + * assume that hoff_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument @@ -240,7 +240,7 @@ typedef struct H5FD_hdfs_t { * Only included if HDFS code should compile. * */ -#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(hoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) /* Prototypes */ @@ -833,7 +833,7 @@ H5FD__hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr #endif /* HDFS_DEBUG */ /* Sanity check on file offsets */ - HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); + HDcompile_assert(sizeof(hoff_t) >= sizeof(size_t)); /* Check arguments */ if (!path || !*path) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 13e64ef939c..4b83529173c 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -131,7 +131,7 @@ typedef struct H5FD_log_t { /* * These macros check for overflow of various quantities. These macros - * assume that HDoff_t is signed and haddr_t and size_t are unsigned. + * assume that hoff_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument @@ -144,11 +144,11 @@ typedef struct H5FD_log_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(hoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A, Z) \ - (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (HDoff_t)((A) + (Z)) < (HDoff_t)(A)) + (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (hoff_t)((A) + (Z)) < (hoff_t)(A)) /* Prototypes */ static void *H5FD__log_fapl_get(H5FD_t *file); @@ -443,7 +443,7 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) FUNC_ENTER_PACKAGE /* Sanity check on file offsets */ - HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); + HDcompile_assert(sizeof(hoff_t) >= sizeof(size_t)); /* Check arguments */ if (!name || !*name) @@ -1106,7 +1106,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had haddr_t orig_addr = addr; H5_timer_t read_timer; /* Timer for read operation */ H5_timevals_t read_times; /* Elapsed time for read operation */ - HDoff_t offset = (HDoff_t)addr; + hoff_t offset = (hoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1149,7 +1149,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had if (file->fa.flags & H5FD_LOG_TIME_SEEK) H5_timer_start(&seek_timer); - if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) + if (HDlseek(file->fd, (hoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); /* Stop timer for seek() call */ @@ -1321,7 +1321,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha haddr_t orig_addr = addr; H5_timer_t write_timer; /* Timer for write operation */ H5_timevals_t write_times; /* Elapsed time for write operation */ - HDoff_t offset = (HDoff_t)addr; + hoff_t offset = (hoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1372,7 +1372,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha if (file->fa.flags & H5FD_LOG_TIME_SEEK) H5_timer_start(&seek_timer); - if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) + if (HDlseek(file->fd, (hoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); /* Stop timer for seek() call */ @@ -1581,7 +1581,7 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNU } #else /* H5_HAVE_WIN32_API */ /* Truncate/extend the file */ - if (-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) + if (-1 == HDftruncate(file->fd, (hoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #endif /* H5_HAVE_WIN32_API */ diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c index 5e4ccd7cc9b..bebbf8bf88e 100644 --- a/src/H5FDmirror.c +++ b/src/H5FDmirror.c @@ -47,7 +47,7 @@ typedef struct H5FD_mirror_t { /* * These macros check for overflow of various quantities. These macros - * assume that HDoff_t is signed and haddr_t and size_t are unsigned. + * assume that hoff_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument @@ -60,7 +60,7 @@ typedef struct H5FD_mirror_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(hoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #ifndef BSWAP_64 diff --git a/src/H5FDonion.c b/src/H5FDonion.c index c9b2567f25c..e569d10a04d 100644 --- a/src/H5FDonion.c +++ b/src/H5FDonion.c @@ -147,7 +147,7 @@ typedef struct H5FD_onion_t { H5FL_DEFINE_STATIC(H5FD_onion_t); -#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(hoff_t) - 1)) - 1) #define H5FD_CTL_GET_NUM_REVISIONS 20001 diff --git a/src/H5FDros3.c b/src/H5FDros3.c index 253024e0d4a..6d28558bb69 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -130,7 +130,7 @@ typedef struct H5FD_ros3_t { } H5FD_ros3_t; /* These macros check for overflow of various quantities. These macros - * assume that HDoff_t is signed and haddr_t and size_t are unsigned. + * assume that hoff_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument @@ -138,7 +138,7 @@ typedef struct H5FD_ros3_t { * Only included if it may be used -- ROS3 VFD is enabled. * */ -#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(hoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) /* Prototypes */ diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index fa9c8849803..f062575532b 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -96,7 +96,7 @@ typedef struct H5FD_sec2_t { /* * These macros check for overflow of various quantities. These macros - * assume that HDoff_t is signed and haddr_t and size_t are unsigned. + * assume that hoff_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument @@ -109,11 +109,11 @@ typedef struct H5FD_sec2_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(hoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A, Z) \ - (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (HDoff_t)((A) + (Z)) < (HDoff_t)(A)) + (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (hoff_t)((A) + (Z)) < (hoff_t)(A)) /* Prototypes */ static H5FD_t *H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); @@ -281,7 +281,7 @@ H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr FUNC_ENTER_PACKAGE /* Sanity check on file offsets */ - HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); + HDcompile_assert(sizeof(hoff_t) >= sizeof(size_t)); /* Check arguments */ if (!name || !*name) @@ -633,7 +633,7 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU size_t size, void *buf /*out*/) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; - HDoff_t offset = (HDoff_t)addr; + hoff_t offset = (hoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -650,7 +650,7 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU #ifndef H5_HAVE_PREADWRITE /* Seek to the correct location (if we don't have pread) */ if (addr != file->pos || OP_READ != file->op) - if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) + if (HDlseek(file->fd, (hoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); #endif /* H5_HAVE_PREADWRITE */ @@ -743,7 +743,7 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN size_t size, const void *buf) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; - HDoff_t offset = (HDoff_t)addr; + hoff_t offset = (hoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -761,7 +761,7 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN #ifndef H5_HAVE_PREADWRITE /* Seek to the correct location (if we don't have pwrite) */ if (addr != file->pos || OP_WRITE != file->op) - if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) + if (HDlseek(file->fd, (hoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); #endif /* H5_HAVE_PREADWRITE */ @@ -883,7 +883,7 @@ H5FD__sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UN if (0 == bError) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #else /* H5_HAVE_WIN32_API */ - if (-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) + if (-1 == HDftruncate(file->fd, (hoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #endif /* H5_HAVE_WIN32_API */ diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index cee2163fe5b..9a9c1f6152c 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -52,7 +52,7 @@ typedef struct H5FD_splitter_t { /* * These macros check for overflow of various quantities. These macros - * assume that HDoff_t is signed and haddr_t and size_t are unsigned. + * assume that hoff_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument @@ -65,11 +65,11 @@ typedef struct H5FD_splitter_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(hoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A, Z) \ - (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (HDoff_t)((A) + (Z)) < (HDoff_t)(A)) + (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (hoff_t)((A) + (Z)) < (hoff_t)(A)) /* This macro provides a wrapper for shared fail-log-ignore behavior * for errors arising in the splitter's W/O channel. diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c index ae42b3b58a1..ca3f10a8ac0 100644 --- a/src/H5FDsubfiling/H5FDioc.c +++ b/src/H5FDsubfiling/H5FDioc.c @@ -71,7 +71,7 @@ typedef struct H5FD_ioc_t { /* * These macros check for overflow of various quantities. These macros - * assume that HDoff_t is signed and haddr_t and size_t are unsigned. + * assume that hoff_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument @@ -84,11 +84,11 @@ typedef struct H5FD_ioc_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(hoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A, Z) \ - (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (HDoff_t)((A) + (Z)) < (HDoff_t)(A)) + (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (hoff_t)((A) + (Z)) < (hoff_t)(A)) /* Private functions */ /* Prototypes */ diff --git a/src/H5FDsubfiling/H5FDioc_threads.c b/src/H5FDsubfiling/H5FDioc_threads.c index 21999a0ed9b..300d662832e 100644 --- a/src/H5FDsubfiling/H5FDioc_threads.c +++ b/src/H5FDsubfiling/H5FDioc_threads.c @@ -907,7 +907,7 @@ H5FD__ioc_file_write_data(int fd, int64_t file_offset, void *data_buffer, int64_ (void)ioc_idx; #endif - HDcompile_assert(sizeof(HDoff_t) == sizeof(file_offset)); + HDcompile_assert(sizeof(hoff_t) == sizeof(file_offset)); while (bytes_remaining) { errno = 0; @@ -954,7 +954,7 @@ H5FD__ioc_file_read_data(int fd, int64_t file_offset, void *data_buffer, int64_t (void)ioc_idx; #endif - HDcompile_assert(sizeof(HDoff_t) == sizeof(file_offset)); + HDcompile_assert(sizeof(hoff_t) == sizeof(file_offset)); while (bytes_remaining) { errno = 0; @@ -1033,7 +1033,7 @@ H5FD__ioc_file_truncate(sf_work_request_t *msg) fd = sf_context->sf_fids[subfile_idx]; - if (HDftruncate(fd, (HDoff_t)length) != 0) + if (HDftruncate(fd, (hoff_t)length) != 0) HGOTO_DONE(FAIL); /* diff --git a/src/H5FDsubfiling/H5FDsubfiling.c b/src/H5FDsubfiling/H5FDsubfiling.c index 42891bb1bc4..04497c8a2da 100644 --- a/src/H5FDsubfiling/H5FDsubfiling.c +++ b/src/H5FDsubfiling/H5FDsubfiling.c @@ -131,7 +131,7 @@ typedef enum H5FD_subfiling_io_type_t { /* * These macros check for overflow of various quantities. These macros - * assume that HDoff_t is signed and haddr_t and size_t are unsigned. + * assume that hoff_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument @@ -144,11 +144,11 @@ typedef enum H5FD_subfiling_io_type_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(hoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A, Z) \ - (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (HDoff_t)((A) + (Z)) < (HDoff_t)(A)) + (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (hoff_t)((A) + (Z)) < (hoff_t)(A)) /* * NOTE: Must be kept in sync with the private diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 1894a49cd1b..f8db0060d6d 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -176,12 +176,12 @@ typedef struct H5F_t H5F_t; * with. */ #if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T) -#define H5F_OVERFLOW_SIZET2OFFT(X) ((size_t)(X) >= (size_t)((size_t)1 << (8 * sizeof(HDoff_t) - 1))) +#define H5F_OVERFLOW_SIZET2OFFT(X) ((size_t)(X) >= (size_t)((size_t)1 << (8 * sizeof(hoff_t) - 1))) #else #define H5F_OVERFLOW_SIZET2OFFT(X) 0 #endif #if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T) -#define H5F_OVERFLOW_HSIZET2OFFT(X) ((hsize_t)(X) >= (hsize_t)((hsize_t)1 << (8 * sizeof(HDoff_t) - 1))) +#define H5F_OVERFLOW_HSIZET2OFFT(X) ((hsize_t)(X) >= (hsize_t)((hsize_t)1 << (8 * sizeof(hoff_t) - 1))) #else #define H5F_OVERFLOW_HSIZET2OFFT(X) 0 #endif diff --git a/src/H5Oefl.c b/src/H5Oefl.c index ea3c8b2754d..8396d9f9a23 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -164,7 +164,7 @@ H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_size(f), p_end)) HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5F_DECODE_LENGTH(f, p, offset); /* Decode into an hsize_t to avoid sign warnings */ - mesg->slot[u].offset = (HDoff_t)offset; + mesg->slot[u].offset = (hoff_t)offset; /* Size */ if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_size(f), p_end)) diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index b50f7c315be..680cd51e7eb 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -379,7 +379,7 @@ typedef struct H5O_link_t { typedef struct H5O_efl_entry_t { size_t name_offset; /*offset of name within heap */ char *name; /*malloc'd name */ - HDoff_t offset; /*offset of data within file */ + hoff_t offset; /*offset of data within file */ hsize_t size; /*size allocated within file */ } H5O_efl_entry_t; diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 3186e11c041..2340a0c12e1 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1426,7 +1426,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Sanity check */ assert(efl); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - HDcompile_assert(sizeof(HDoff_t) <= sizeof(uint64_t)); + HDcompile_assert(sizeof(hoff_t) <= sizeof(uint64_t)); HDcompile_assert(sizeof(hsize_t) <= sizeof(uint64_t)); assert(size); @@ -1510,7 +1510,7 @@ H5P__dcrt_ext_file_list_dec(const void **_pp, void *_value) assert(*pp); assert(efl); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - HDcompile_assert(sizeof(HDoff_t) <= sizeof(uint64_t)); + HDcompile_assert(sizeof(hoff_t) <= sizeof(uint64_t)); HDcompile_assert(sizeof(hsize_t) <= sizeof(uint64_t)); /* Set property to default value */ @@ -1549,7 +1549,7 @@ H5P__dcrt_ext_file_list_dec(const void **_pp, void *_value) enc_size = *(*pp)++; assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); - efl->slot[u].offset = (HDoff_t)enc_value; + efl->slot[u].offset = (hoff_t)enc_value; /* Decode size */ enc_size = *(*pp)++; @@ -2586,7 +2586,7 @@ H5Pget_chunk_opts(hid_t plist_id, unsigned *options /*out*/) *------------------------------------------------------------------------- */ herr_t -H5Pset_external(hid_t plist_id, const char *name, HDoff_t offset, hsize_t size) +H5Pset_external(hid_t plist_id, const char *name, hoff_t offset, hsize_t size) { size_t idx; hsize_t total, tmp; @@ -2701,7 +2701,7 @@ H5Pget_external_count(hid_t plist_id) *------------------------------------------------------------------------- */ herr_t -H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name /*out*/, HDoff_t *offset /*out*/, +H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name /*out*/, hoff_t *offset /*out*/, hsize_t *size /*out*/) { H5O_efl_t efl; diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index bdb172bf8dc..848af256235 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -6044,13 +6044,13 @@ H5_DLL herr_t H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize); * which is a 32-bit signed long value on Windows, which limited * the valid offset that can be returned to 2 GiB. * - * \version 2.0.0 \p offset parameter type changed to HDoff_t from off_t. + * \version 2.0.0 \p offset parameter type changed to hoff_t from off_t. * \version 1.6.4 \p idx parameter type changed to unsigned. * \since 1.0.0 * */ H5_DLL herr_t H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name /*out*/, - HDoff_t *offset /*out*/, hsize_t *size /*out*/); + hoff_t *offset /*out*/, hsize_t *size /*out*/); /** * \ingroup DCPL * @@ -6541,11 +6541,11 @@ H5_DLL herr_t H5Pset_dset_no_attrs_hint(hid_t dcpl_id, hbool_t minimize); * which is a 32-bit signed long value on Windows, which limited * the valid offset that can be set to 2 GiB. * - * \version 2.0.0 \p offset parameter type changed to HDoff_t from off_t. + * \version 2.0.0 \p offset parameter type changed to hoff_t from off_t. * \since 1.0.0 * */ -H5_DLL herr_t H5Pset_external(hid_t plist_id, const char *name, HDoff_t offset, hsize_t size); +H5_DLL herr_t H5Pset_external(hid_t plist_id, const char *name, hoff_t offset, hsize_t size); /** * \ingroup DCPL * diff --git a/src/H5private.h b/src/H5private.h index e4b526ae1c0..2fcbf36ea3b 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -593,9 +593,9 @@ typedef long double _Complex H5_ldouble_complex; /* __int64 is the correct type for the st_size field of the _stati64 * struct on Windows (MSDN isn't very clear about this). POSIX systems use - * off_t. Both of these are typedef'd to HDoff_t in H5public.h. + * off_t. Both of these are typedef'd to hoff_t in H5public.h. */ -typedef HDoff_t h5_stat_size_t; +typedef hoff_t h5_stat_size_t; /* Redefinions of some POSIX and C functions (mainly to deal with Windows) */ diff --git a/src/H5public.h b/src/H5public.h index 62e0db9764b..11bde575e1b 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -301,19 +301,19 @@ typedef long long ssize_t; typedef uint64_t hsize_t; /* off_t exists on Windows, but is always a 32-bit long, even on 64-bit Windows, - * so on Windows we define HDoff_t to be int64_t, which is equivalent to __int64, + * so on Windows we define hoff_t to be int64_t, which is equivalent to __int64, * the type of the st_size field of the _stati64 struct. */ #ifdef H5_HAVE_WIN32_API /** * Platform-independent offset */ -typedef int64_t HDoff_t; +typedef int64_t hoff_t; #else /** * Platform-independent offset */ -typedef off_t HDoff_t; +typedef off_t hoff_t; #endif #ifdef H5_HAVE_PARALLEL diff --git a/test/big.c b/test/big.c index 7ef0f41d6c6..3827745d441 100644 --- a/test/big.c +++ b/test/big.c @@ -52,7 +52,7 @@ #define WRT_SIZE (4 * 1024) #define FAMILY_SIZE (1024 * 1024 * 1024) -#define GB (HDoff_t)0x40000000L +#define GB (hoff_t)0x40000000L #define MAX_TRIES 100 @@ -268,7 +268,7 @@ enough_room(hid_t fapl) if ((fd[i] = HDopen(name, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) { goto done; } - if ((HDoff_t)size != HDlseek(fd[i], (HDoff_t)size, SEEK_SET)) { + if ((hoff_t)size != HDlseek(fd[i], (hoff_t)size, SEEK_SET)) { goto done; } if (1 != HDwrite(fd[i], "X", (size_t)1)) { diff --git a/test/chunk_info.c b/test/chunk_info.c index 6fd3b9ba09e..4d486720e3b 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -2376,9 +2376,9 @@ test_chunk_address_with_userblock(hid_t fapl_id) int data = -1; int data_ub = -1; - if (HDlseek(fd, (HDoff_t)(od.addresses[i]), SEEK_SET) < 0) + if (HDlseek(fd, (hoff_t)(od.addresses[i]), SEEK_SET) < 0) TEST_ERROR; - if (HDlseek(fd_ub, (HDoff_t)(od_ub.addresses[i]), SEEK_SET) < 0) + if (HDlseek(fd_ub, (hoff_t)(od_ub.addresses[i]), SEEK_SET) < 0) TEST_ERROR; if (HDread(fd, &data, sizeof(int)) != sizeof(int)) diff --git a/test/dsets.c b/test/dsets.c index e64ed4441b7..77a3cc4a018 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -623,7 +623,7 @@ test_simple_io(const char *driver_name, hid_t fapl) file = -1; f = HDopen(filename, O_RDONLY); - HDlseek(f, (HDoff_t)offset, SEEK_SET); + HDlseek(f, (hoff_t)offset, SEEK_SET); if (HDread(f, rdata_bytes, sizeof(int) * DSET_DIM1 * DSET_DIM2) < 0) goto error; @@ -760,7 +760,7 @@ test_userblock_offset(const char *driver_name, hid_t fapl, bool new_format) file = -1; f = HDopen(filename, O_RDONLY); - HDlseek(f, (HDoff_t)offset, SEEK_SET); + HDlseek(f, (hoff_t)offset, SEEK_SET); if (HDread(f, rdata_bytes, sizeof(int) * DSET_DIM1 * DSET_DIM2) < 0) goto error; diff --git a/test/external.c b/test/external.c index c7354f9afa4..60a5cc5c8c5 100644 --- a/test/external.c +++ b/test/external.c @@ -97,7 +97,7 @@ test_non_extendible(hid_t file) hsize_t cur_size[1] = {100}; /* data space current size */ hsize_t max_size[1] = {100}; /* data space maximum size */ int n = 0; /* number of external files */ - HDoff_t file_offset = 0; /* external file offset */ + hoff_t file_offset = 0; /* external file offset */ hsize_t file_size = 0; /* sizeof external file segment */ haddr_t dset_addr = HADDR_UNDEF; /* address of dataset */ @@ -363,7 +363,7 @@ test_unlimited(hid_t file) hsize_t cur_size[1] = {100}; /* data space current size */ hsize_t max_size[1] = {H5S_UNLIMITED}; /* data space maximum size */ int n; /* number of external files */ - HDoff_t file_offset; /* external file offset */ + hoff_t file_offset; /* external file offset */ hsize_t file_size; /* sizeof external file segment */ TESTING("unlimited dataspace, unlimited external storage"); @@ -446,7 +446,7 @@ test_unlimited(hid_t file) *------------------------------------------------------------------------- */ static int -add_external_files(hid_t dcpl_id, unsigned int n_external_files, HDoff_t offset, hsize_t max_ext_size) +add_external_files(hid_t dcpl_id, unsigned int n_external_files, hoff_t offset, hsize_t max_ext_size) { char exname[AEF_EXNAME_MAX_LEN + 1]; unsigned int i = 0; @@ -704,7 +704,7 @@ test_read_file_set(hid_t fapl) FAIL_STACK_ERROR; for (i = 0; i < N_EXT_FILES; i++) { snprintf(filename, sizeof(filename), "extern_%dr.raw", (int)i + 1); - if (H5Pset_external(dcpl, filename, (HDoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) + if (H5Pset_external(dcpl, filename, (hoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) FAIL_STACK_ERROR; } @@ -823,7 +823,7 @@ test_write_file_set(hid_t fapl) else size = H5F_UNLIMITED; - if (H5Pset_external(dcpl, filename, (HDoff_t)(i * GARBAGE_PER_FILE), size) < 0) + if (H5Pset_external(dcpl, filename, (hoff_t)(i * GARBAGE_PER_FILE), size) < 0) FAIL_STACK_ERROR; } /* end for */ @@ -946,7 +946,7 @@ test_path_absolute(hid_t fapl) if (i == 1) snprintf(filename, sizeof(filename), "%s%sextern_%zur.raw", cwdpath + 2, H5_DIR_SEPS, i + 1); #endif - if (H5Pset_external(dcpl, filename, (HDoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) + if (H5Pset_external(dcpl, filename, (hoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) FAIL_STACK_ERROR; } @@ -1036,7 +1036,7 @@ test_path_relative(hid_t fapl) FAIL_STACK_ERROR; for (i = 0; i < N_EXT_FILES; i++) { snprintf(filename, sizeof(filename), "extern_%dr.raw", (int)i + 1); - if (H5Pset_external(dcpl, filename, (HDoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) + if (H5Pset_external(dcpl, filename, (hoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) FAIL_STACK_ERROR; } @@ -1130,7 +1130,7 @@ test_path_relative_cwd(hid_t fapl) FAIL_STACK_ERROR; for (i = 0; i < N_EXT_FILES; i++) { snprintf(filename, sizeof(filename), "..%sextern_%dr.raw", H5_DIR_SEPS, (int)i + 1); - if (H5Pset_external(dcpl, filename, (HDoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) + if (H5Pset_external(dcpl, filename, (hoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) FAIL_STACK_ERROR; } diff --git a/test/external_env.c b/test/external_env.c index 9e0305394e3..6a968cf18f9 100644 --- a/test/external_env.c +++ b/test/external_env.c @@ -68,7 +68,7 @@ test_path_env(hid_t fapl) FAIL_STACK_ERROR; for (i = 0; i < N_EXT_FILES; i++) { snprintf(filename, sizeof(filename), "..%sextern_env_%dr.raw", H5_DIR_SEPS, (int)i + 1); - if (H5Pset_external(dcpl, filename, (HDoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) + if (H5Pset_external(dcpl, filename, (hoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) FAIL_STACK_ERROR; } /* end for */ diff --git a/test/file_image.c b/test/file_image.c index 1d7bdfab215..372404054cc 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -872,7 +872,7 @@ test_get_file_image(const char *test_banner, const int file_name_num, hid_t fapl VERIFY(fd >= 0, "HDopen() failed."); if (user) { - HDoff_t off; + hoff_t off; /* Position at userblock */ off = HDlseek(fd, USERBLOCK_SIZE, SEEK_SET); diff --git a/test/h5test.c b/test/h5test.c index cf89f7afc2f..d377cfed663 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2073,14 +2073,14 @@ h5_get_version_string(H5F_libver_t libver) int h5_compare_file_bytes(char *f1name, char *f2name) { - FILE *f1ptr = NULL; /* two file pointers */ - FILE *f2ptr = NULL; - HDoff_t f1size = 0; /* size of the files */ - HDoff_t f2size = 0; - char f1char = 0; /* one char from each file */ - char f2char = 0; - HDoff_t ii = 0; - int ret_value = 0; /* for error handling */ + FILE *f1ptr = NULL; /* two file pointers */ + FILE *f2ptr = NULL; + hoff_t f1size = 0; /* size of the files */ + hoff_t f2size = 0; + char f1char = 0; /* one char from each file */ + char f2char = 0; + hoff_t ii = 0; + int ret_value = 0; /* for error handling */ /* Open files for reading */ f1ptr = fopen(f1name, "rb"); diff --git a/test/hdfs.c b/test/hdfs.c index c09d75bd33e..db4f03f782c 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -325,7 +325,7 @@ ********************************/ /* copied from src/hdfs.c */ -#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(hoff_t) - 1)) - 1) #define HDFS_NAMENODE_NAME_MAX_SIZE 128 diff --git a/test/ros3.c b/test/ros3.c index b5307a7305f..a9cbfd85d43 100644 --- a/test/ros3.c +++ b/test/ros3.c @@ -29,7 +29,7 @@ #ifdef H5_HAVE_ROS3_VFD -#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(hoff_t) - 1)) - 1) #define S3_TEST_PROFILE_NAME "ros3_vfd_test" diff --git a/test/set_extent.c b/test/set_extent.c index 0127e870174..ce99392179f 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -1839,7 +1839,7 @@ test_external(hid_t fapl, bool use_select_io) { char name[256]; /*external file name */ - HDoff_t file_offset; /*external file offset */ + hoff_t file_offset; /*external file offset */ hsize_t file_size; /*sizeof external file segment */ if (H5Pget_external(dcpl, 0, sizeof(name), name, &file_offset, &file_size) < 0) diff --git a/test/twriteorder.c b/test/twriteorder.c index e4fb3c8313b..312c46fa0e4 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -272,7 +272,7 @@ write_wo_file(void) memset(&buffer[4], i & 0xff, (size_t)(BLOCKSIZE_DFT - 4)); /* write the block */ - HDlseek(write_fd_g, (HDoff_t)blkaddr, SEEK_SET); + HDlseek(write_fd_g, (hoff_t)blkaddr, SEEK_SET); if ((bytes_wrote = HDwrite(write_fd_g, buffer, (size_t)blocksize_g)) != blocksize_g) { printf("blkaddr write failed in partition %d\n", i); return -1; @@ -319,7 +319,7 @@ read_wo_file(void) /* got a non-zero blkaddr. Proceed down the linked blocks. */ while (blkaddr != 0) { - HDlseek(read_fd, (HDoff_t)blkaddr, SEEK_SET); + HDlseek(read_fd, (hoff_t)blkaddr, SEEK_SET); if ((bytes_read = HDread(read_fd, buffer, (size_t)blocksize_g)) != blocksize_g) { printf("blkaddr read failed in partition %d\n", 0); return -1; diff --git a/testpar/t_subfiling_vfd.c b/testpar/t_subfiling_vfd.c index a79bc04a130..6f1fcb03a9a 100644 --- a/testpar/t_subfiling_vfd.c +++ b/testpar/t_subfiling_vfd.c @@ -325,7 +325,7 @@ test_config_file(void) FILE *config_file; char *config_filename = NULL; char *config_buf = NULL; - HDoff_t config_file_len; + hoff_t config_file_len; hid_t file_id = H5I_INVALID_HID; hid_t fapl_id = H5I_INVALID_HID; int read_stripe_count; diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 6c9a1cfd0ef..42016898557 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -3190,7 +3190,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * H5D_layout_t stl = H5D_LAYOUT_ERROR; size_t ncols = 80; /* available output width */ size_t cd_nelmts; /* filter client number of values */ - HDoff_t offset; /* offset of external file */ + hoff_t offset; /* offset of external file */ char f_name[256]; /* filter name */ char name[256]; /* external or virtual file name */ hsize_t chsize[64]; /* chunk size in elements */ diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 04ca13d51b0..8473519f286 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -162,7 +162,7 @@ main(int argc, char *argv[]) hsize_t startub; hsize_t where; hsize_t newubsize; - HDoff_t fsize; + hoff_t fsize; h5_stat_t sbuf; h5_stat_t sbuf2; int res; @@ -253,7 +253,7 @@ main(int argc, char *argv[]) goto done; } - fsize = (HDoff_t)sbuf.st_size; + fsize = (hoff_t)sbuf.st_size; h5fid = HDopen(input_file, O_RDONLY); if (h5fid < 0) { @@ -423,8 +423,8 @@ copy_some_to_file(int infid, int outfid, hsize_t starting, hsize_t startout, ssi } /* end if */ while (howmuch > 0) { - HDlseek(outfid, (HDoff_t)to, SEEK_SET); - HDlseek(infid, (HDoff_t)from, SEEK_SET); + HDlseek(outfid, (hoff_t)to, SEEK_SET); + HDlseek(infid, (hoff_t)from, SEEK_SET); if (howmuch > 512) { nchars = HDread(infid, buf, (unsigned)512); @@ -502,7 +502,7 @@ write_pad(int ofile, hsize_t old_where, hsize_t *new_where) buf[0] = '\0'; - HDlseek(ofile, (HDoff_t)old_where, SEEK_SET); + HDlseek(ofile, (hoff_t)old_where, SEEK_SET); psize = compute_user_block_size(old_where); psize -= old_where; diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index 5a99fe45b08..472b06867ec 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -173,7 +173,7 @@ main(int argc, char *argv[]) { hid_t ifile = H5I_INVALID_HID; hid_t plist = H5I_INVALID_HID; - HDoff_t fsize; + hoff_t fsize; hsize_t usize; htri_t testval; herr_t status; @@ -306,9 +306,9 @@ copy_to_file(FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much) { static char buf[COPY_BUF_SIZE]; size_t how_much; - HDoff_t where = (HDoff_t)_where; - HDoff_t to; - HDoff_t from; + hoff_t where = (hoff_t)_where; + hoff_t to; + hoff_t from; herr_t ret_value = 0; /* nothing to copy */ @@ -349,8 +349,8 @@ copy_to_file(FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much) /* Update positions/size */ how_much -= bytes_read; - from += (HDoff_t)bytes_read; - to += (HDoff_t)bytes_read; + from += (hoff_t)bytes_read; + to += (hoff_t)bytes_read; /* Write nchars bytes to output file */ bytes_wrote = fwrite(buf, (size_t)1, bytes_read, ofid); diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 992d412f368..8089f3c3e78 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -1911,7 +1911,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) size_t cd_num; /* filter client data counter */ char f_name[256]; /* filter/file name */ char s[64]; /* temporary string buffer */ - HDoff_t f_offset; /* offset in external file */ + hoff_t f_offset; /* offset in external file */ hsize_t f_size; /* bytes used in external file */ hsize_t total, used; /* total size or offset */ int ndims; /* dimensionality */ diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c index 07abe94d4be..00af0577a38 100644 --- a/tools/src/h5perf/sio_engine.c +++ b/tools/src/h5perf/sio_engine.c @@ -88,11 +88,11 @@ static herr_t do_fclose(iotype iot, file_descr *fd); static void do_cleanupfile(iotype iot, char *fname); /* global variables */ -static HDoff_t offset[MAX_DIMS]; /* dataset size in bytes */ -static size_t buf_offset[MAX_DIMS]; /* dataset size in bytes */ -static int order[MAX_DIMS]; /* dimension access order */ -static size_t linear_buf_size; /* linear buffer size */ -static int cont_dim; /* lowest dimension for contiguous POSIX +static hoff_t offset[MAX_DIMS]; /* dataset size in bytes */ +static size_t buf_offset[MAX_DIMS]; /* dataset size in bytes */ +static int order[MAX_DIMS]; /* dimension access order */ +static size_t linear_buf_size; /* linear buffer size */ +static int cont_dim; /* lowest dimension for contiguous POSIX access */ static size_t cont_size; /* size of contiguous POSIX access */ static hid_t fapl; /* file access list */ @@ -620,7 +620,7 @@ dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer) for (i = 0; i < parms->dset_size[cur_dim]; i += parms->buf_size[cur_dim]) { h5offset[cur_dim] = (hssize_t)i; - offset[cur_dim] = (HDoff_t)i; + offset[cur_dim] = (hoff_t)i; if (local_dim > 0) { @@ -709,8 +709,8 @@ posix_buffer_write(int local_dim, file_descr *fd, parameters *parms, void *buffe /* otherwise, perform contiguous POSIX access */ } else { - HDoff_t d_offset; - HDoff_t linear_dset_offset = 0; + hoff_t d_offset; + hoff_t linear_dset_offset = 0; int i, j, rc; buf_offset[local_dim] = 0; @@ -720,9 +720,9 @@ posix_buffer_write(int local_dim, file_descr *fd, parameters *parms, void *buffe d_offset = 1; for (j = i + 1; j < parms->rank; j++) - d_offset *= (HDoff_t)parms->dset_size[j]; + d_offset *= (hoff_t)parms->dset_size[j]; - linear_dset_offset += (offset[i] + (HDoff_t)buf_offset[i]) * d_offset; + linear_dset_offset += (offset[i] + (hoff_t)buf_offset[i]) * d_offset; } /* only care if seek returns error */ @@ -935,7 +935,7 @@ dset_read(int local_dim, file_descr *fd, parameters *parms, void *buffer, const for (i = 0; i < parms->dset_size[cur_dim]; i += parms->buf_size[cur_dim]) { h5offset[cur_dim] = (hssize_t)i; - offset[cur_dim] = (HDoff_t)i; + offset[cur_dim] = (hoff_t)i; /* if traverse in order array is incomplete, recurse */ if (local_dim > 0) { @@ -1000,8 +1000,8 @@ posix_buffer_read(int local_dim, file_descr *fd, parameters *parms, void *buffer /* otherwise, perform contiguous POSIX access */ } else { - HDoff_t d_offset; - HDoff_t linear_dset_offset = 0; + hoff_t d_offset; + hoff_t linear_dset_offset = 0; int i, j, rc; buf_offset[local_dim] = 0; @@ -1010,9 +1010,9 @@ posix_buffer_read(int local_dim, file_descr *fd, parameters *parms, void *buffer d_offset = 1; for (j = i + 1; j < parms->rank; j++) - d_offset *= (HDoff_t)parms->dset_size[j]; + d_offset *= (hoff_t)parms->dset_size[j]; - linear_dset_offset += (offset[i] + (HDoff_t)buf_offset[i]) * d_offset; + linear_dset_offset += (offset[i] + (hoff_t)buf_offset[i]) * d_offset; } /* only care if seek returns error */ diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index 4f1aa20fbf9..9b90d0dc4b7 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -82,10 +82,10 @@ usage(const char *progname) * *------------------------------------------------------------------------- */ -static HDoff_t +static hoff_t get_size(const char *progname, int *argno, int argc, char *argv[]) { - HDoff_t retval = -1; + hoff_t retval = -1; char *suffix = NULL; if (isdigit((int)(argv[*argno][2]))) { @@ -156,12 +156,12 @@ main(int argc, char *argv[]) int dst_is_family; /*is dst name a family name? */ int dst_membno = 0; /*destination member number */ - HDoff_t left_overs = 0; /*amount of zeros left over */ - HDoff_t src_offset = 0; /*offset in source member */ - HDoff_t dst_offset = 0; /*offset in destination member */ - HDoff_t src_size; /*source logical member size */ - HDoff_t src_act_size; /*source actual member size */ - HDoff_t dst_size = 1 GB; /*destination logical memb size */ + hoff_t left_overs = 0; /*amount of zeros left over */ + hoff_t src_offset = 0; /*offset in source member */ + hoff_t dst_offset = 0; /*offset in destination member */ + hoff_t src_size; /*source logical member size */ + hoff_t src_act_size; /*source actual member size */ + hoff_t dst_size = 1 GB; /*destination logical memb size */ hid_t fapl; /*file access property list */ hid_t file; hsize_t hdsize; /*destination logical memb size */ @@ -276,14 +276,14 @@ main(int argc, char *argv[]) */ n = blk_size; if (dst_is_family) - n = (size_t)MIN((HDoff_t)n, dst_size - dst_offset); + n = (size_t)MIN((hoff_t)n, dst_size - dst_offset); if (left_overs) { - n = (size_t)MIN((HDoff_t)n, left_overs); - left_overs = left_overs - (HDoff_t)n; + n = (size_t)MIN((hoff_t)n, left_overs); + left_overs = left_overs - (hoff_t)n; need_write = false; } else if (src_offset < src_act_size) { - n = (size_t)MIN((HDoff_t)n, src_act_size - src_offset); + n = (size_t)MIN((hoff_t)n, src_act_size - src_offset); if ((nio = HDread(src, buf, n)) < 0) { perror("read"); exit(EXIT_FAILURE); @@ -336,16 +336,16 @@ main(int argc, char *argv[]) * loop. The destination offset must be updated so we can fix * trailing holes. */ - src_offset = src_offset + (HDoff_t)n; + src_offset = src_offset + (hoff_t)n; if (src_offset == src_act_size) { HDclose(src); if (!src_is_family) { - dst_offset = dst_offset + (HDoff_t)n; + dst_offset = dst_offset + (hoff_t)n; break; } snprintf(src_name, NAMELEN, src_gen_name, ++src_membno); if ((src = HDopen(src_name, O_RDONLY)) < 0 && ENOENT == errno) { - dst_offset = dst_offset + (HDoff_t)n; + dst_offset = dst_offset + (hoff_t)n; break; } else if (src < 0) { diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index ba4db9a1ec3..29f5311942f 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -274,7 +274,7 @@ gen_enhance_files(bool user) } /* location of "end of file address" */ - if (lseek(fd, (HDoff_t)(28 + (user ? USERBLOCK : 0)), SEEK_SET) < 0) + if (lseek(fd, (hoff_t)(28 + (user ? USERBLOCK : 0)), SEEK_SET) < 0) goto error; /* Write the bad eoa value to the file */ @@ -282,7 +282,7 @@ gen_enhance_files(bool user) goto error; /* location of "superblock checksum" */ - if (lseek(fd, (HDoff_t)(44 + (user ? USERBLOCK : 0)), SEEK_SET) < 0) + if (lseek(fd, (hoff_t)(44 + (user ? USERBLOCK : 0)), SEEK_SET) < 0) goto error; /* Write the chksum value to the file */ diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index eed64924999..43649105d31 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -123,7 +123,7 @@ main(void) unsigned u; herr_t H5_ATTR_NDEBUG_UNUSED status; hssize_t H5_ATTR_NDEBUG_UNUSED n; - HDoff_t H5_ATTR_NDEBUG_UNUSED offset; + hoff_t H5_ATTR_NDEBUG_UNUSED offset; hsize_t start[2]; hsize_t count[2]; diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c index 4dd8da9293e..3721f638e40 100644 --- a/tools/test/perform/overhead.c +++ b/tools/test/perform/overhead.c @@ -234,7 +234,7 @@ test(fill_t fill_style, const double splits[], bool verbose, bool use_rdcc) if (HDfstat(fd, &sb) < 0) goto error; printf("%4lu %8.3f ***\n", (unsigned long)i, - (double)(sb.st_size - (HDoff_t)(i * sizeof(int))) / (double)i); + (double)(sb.st_size - (hoff_t)(i * sizeof(int))) / (double)i); } } @@ -280,7 +280,7 @@ test(fill_t fill_style, const double splits[], bool verbose, bool use_rdcc) if (HDfstat(fd, &sb) < 0) goto error; printf("%-7s %8.3f\n", sname, - (double)(sb.st_size - (HDoff_t)(cur_size[0] * sizeof(int))) / (double)cur_size[0]); + (double)(sb.st_size - (hoff_t)(cur_size[0] * sizeof(int))) / (double)cur_size[0]); } HDclose(fd);