summaryrefslogtreecommitdiffstats
path: root/src/H5FDdirect.c
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2023-08-03 12:57:29 (GMT)
committerGitHub <noreply@github.com>2023-08-03 12:57:29 (GMT)
commit7fc8531b767855e69fb4016783a1131ba581fd5b (patch)
treea243310b99da59c858ae4eaeed8c452e0177bba4 /src/H5FDdirect.c
parenta77d8bfcd7d066c6759b0346c02cbd612f90b7c2 (diff)
downloadhdf5-7fc8531b767855e69fb4016783a1131ba581fd5b.zip
hdf5-7fc8531b767855e69fb4016783a1131ba581fd5b.tar.gz
hdf5-7fc8531b767855e69fb4016783a1131ba581fd5b.tar.bz2
Merge Made HGOTO_ERROR a do-while loop changes from develop (#3334)
Diffstat (limited to 'src/H5FDdirect.c')
-rw-r--r--src/H5FDdirect.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index d3332c8..30a3c90 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -266,10 +266,10 @@ H5Pset_fapl_direct(hid_t fapl_id, size_t boundary, size_t block_size, size_t cbu
H5TRACE4("e", "izzz", fapl_id, boundary, block_size, cbuf_size);
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5FD__direct_populate_config(boundary, block_size, cbuf_size, &fa) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't initialize driver configuration info")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't initialize driver configuration info");
ret_value = H5P_set_driver(plist, H5FD_DIRECT, &fa, NULL);
@@ -301,11 +301,11 @@ H5Pget_fapl_direct(hid_t fapl_id, size_t *boundary /*out*/, size_t *block_size /
H5TRACE4("e", "ixxx", fapl_id, boundary, block_size, cbuf_size);
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list");
if (H5FD_DIRECT != H5P_peek_driver(plist))
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
if (NULL == (fa = H5P_peek_driver_info(plist)))
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info");
if (boundary)
*boundary = fa->mboundary;
if (block_size)
@@ -358,7 +358,7 @@ H5FD__direct_populate_config(size_t boundary, size_t block_size, size_t cbuf_siz
/* Copy buffer size must be a multiple of file block size */
if (fa_out->cbsize % fa_out->fbsize != 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "copy buffer size must be a multiple of block size")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "copy buffer size must be a multiple of block size");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -456,11 +456,11 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad
/* Check arguments */
if (!name || !*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name");
if (0 == maxaddr || HADDR_UNDEF == maxaddr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr");
if (ADDR_OVERFLOW(maxaddr))
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr")
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr");
/* Build the open flags */
o_flags = (H5F_ACC_RDWR & flags) ? O_RDWR : O_RDONLY;
@@ -483,14 +483,14 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad
/* Create the new file struct */
if (NULL == (file = H5FL_CALLOC(H5FD_direct_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct");
/* Get the driver specific information */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");
if (NULL == (fa = (const H5FD_direct_fapl_t *)H5P_peek_driver_info(plist))) {
if (H5FD__direct_populate_config(0, 0, 0, &default_fa) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTSET, NULL, "can't initialize driver configuration info")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTSET, NULL, "can't initialize driver configuration info");
fa = &default_fa;
}
@@ -518,7 +518,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad
else {
/* Use the value in the property list */
if (H5P_get(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, &file->ignore_disabled_file_locks) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get ignore disabled file locks property")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get ignore disabled file locks property");
}
/* Try to decide if data alignment is required. The reason to check it here
@@ -530,12 +530,12 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad
*/
buf1 = malloc(sizeof(int));
if (posix_memalign(&buf2, file->fa.mboundary, file->fa.fbsize) != 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "posix_memalign failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "posix_memalign failed");
if (o_flags & O_CREAT) {
if (HDwrite(file->fd, buf1, sizeof(int)) < 0) {
if (HDwrite(file->fd, buf2, file->fa.fbsize) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, NULL, "file system may not support Direct I/O")
+ HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, NULL, "file system may not support Direct I/O");
else
file->fa.must_align = TRUE;
}
@@ -548,7 +548,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad
else {
if (HDread(file->fd, buf1, sizeof(int)) < 0) {
if (HDread(file->fd, buf2, file->fa.fbsize) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "file system may not support Direct I/O")
+ HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "file system may not support Direct I/O");
else
file->fa.must_align = TRUE;
}
@@ -794,7 +794,7 @@ H5FD__direct_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_ha
FUNC_ENTER_PACKAGE
if (!file_handle)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid");
*file_handle = &(file->fd);
done:
@@ -839,9 +839,9 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U
/* Check for overflow conditions */
if (HADDR_UNDEF == addr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined");
if (REGION_OVERFLOW(addr, size))
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow")
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow");
/* If the system doesn't require data to be aligned, read the data in
* the same way as sec2 driver.
@@ -897,7 +897,7 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U
alloc_size = _cbsize;
assert(!(alloc_size % _fbsize));
if (posix_memalign(&copy_buf, _boundary, alloc_size) != 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "posix_memalign failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "posix_memalign failed");
/* look for the aligned position for reading the data */
assert(!(((addr / _fbsize) * _fbsize) % _fbsize));
@@ -1019,9 +1019,9 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_
/* Check for overflow conditions */
if (HADDR_UNDEF == addr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined");
if (REGION_OVERFLOW(addr, size))
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow")
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow");
/* If the system doesn't require data to be aligned, read the data in
* the same way as sec2 driver.
@@ -1075,7 +1075,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_
assert(!(alloc_size % _fbsize));
if (posix_memalign(&copy_buf, _boundary, alloc_size) != 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "posix_memalign failed")
+ 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)
@@ -1241,7 +1241,7 @@ H5FD__direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_AT
li.QuadPart = (LONGLONG)file->eoa;
(void)SetFilePointer((HANDLE)filehandle, li.LowPart, &li.HighPart, FILE_BEGIN);
if (SetEndOfFile((HANDLE)filehandle) == 0)
- HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
+ 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))
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")