summaryrefslogtreecommitdiffstats
path: root/src/H5Dseq.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-08-08 16:52:55 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-08-08 16:52:55 (GMT)
commitd8397a6f426227d09d20e647ce8b12b8c6295b2d (patch)
tree2943fbfd2bfb66cf167eb642835fdb4deb3afd3c /src/H5Dseq.c
parent573307786a1f5f7ce597e5191ea08c3bbd95b66c (diff)
downloadhdf5-d8397a6f426227d09d20e647ce8b12b8c6295b2d.zip
hdf5-d8397a6f426227d09d20e647ce8b12b8c6295b2d.tar.gz
hdf5-d8397a6f426227d09d20e647ce8b12b8c6295b2d.tar.bz2
[svn-r5842] Purpose:
Code cleanup Description: Change most (all?) HRETURN_ERROR macros to HGOTO_ERROR macros, along with HRETURN macros to HGOTO_DONE macros. This unifies the error return path from functions and reduces the size of the library by up to 10% on some platforms. Additionally, I improved a lot of the error cleanup code in many routines. Platforms tested: FreeBSD 4.6 (sleipnir) serial & parallel and IRIX64 6.5 (modi4) serial & parallel.
Diffstat (limited to 'src/H5Dseq.c')
-rw-r--r--src/H5Dseq.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/H5Dseq.c b/src/H5Dseq.c
index 8f988ff..d753dba 100644
--- a/src/H5Dseq.c
+++ b/src/H5Dseq.c
@@ -63,6 +63,8 @@ H5F_seq_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
const H5S_t *file_space, size_t elmt_size,
size_t seq_len, hsize_t file_offset, void *buf/*out*/)
{
+ herr_t ret_value=SUCCEED; /* Return value */
+
FUNC_ENTER_NOAPI(H5F_seq_read, FAIL);
/* Check args */
@@ -71,9 +73,10 @@ H5F_seq_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
assert(buf);
if (H5F_seq_readv(f, dxpl_id, layout, dc_plist, file_space, elmt_size, 1, &seq_len, &file_offset, buf)<0)
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "vector read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "vector read failed");
- FUNC_LEAVE(SUCCEED);
+done:
+ FUNC_LEAVE(ret_value);
} /* H5F_seq_read() */
@@ -104,6 +107,8 @@ H5F_seq_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
const H5S_t *file_space, size_t elmt_size,
size_t seq_len, hsize_t file_offset, const void *buf)
{
+ herr_t ret_value=SUCCEED; /* Return value */
+
FUNC_ENTER_NOAPI(H5F_seq_write, FAIL);
/* Check args */
@@ -112,9 +117,10 @@ H5F_seq_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
assert(buf);
if (H5F_seq_writev(f, dxpl_id, layout, dc_plist, file_space, elmt_size, 1, &seq_len, &file_offset, buf)<0)
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vector write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vector write failed");
- FUNC_LEAVE(SUCCEED);
+done:
+ FUNC_LEAVE(ret_value);
} /* H5F_seq_write() */
@@ -594,10 +600,8 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
}
/* Collective MPIO access is unsupported for non-contiguous datasets */
- if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode) {
- HGOTO_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL,
- "collective access on non-contiguous datasets not supported yet");
- }
+ if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode)
+ HGOTO_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
#endif /* H5_HAVE_PARALLEL */
/* Get necessary properties from property list */