diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-03-19 03:51:19 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-03-19 03:51:19 (GMT) |
commit | d812c6fe60fec2451d8d78b8fb51547628307a6c (patch) | |
tree | fb1f02516e6dfe5abce1cdb0155046b5d68a73d5 /src/H5Dio.c | |
parent | c31460c1b76c8d11534b57f025c57bdff9321f44 (diff) | |
download | hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.zip hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.tar.gz hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.tar.bz2 |
Cleanup API context function usage.
Diffstat (limited to 'src/H5Dio.c')
-rw-r--r-- | src/H5Dio.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c index 5b5bb5e..334f18f 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -118,7 +118,6 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; hbool_t direct_read = FALSE; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -159,12 +158,8 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Retrieve the 'direct read' flag */ if(H5CX_get_dcr_flag(&direct_read) < 0) @@ -216,9 +211,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") - FUNC_LEAVE_API(ret_value) } /* end H5Dread() */ @@ -262,7 +254,6 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; hbool_t direct_write = FALSE; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -282,12 +273,8 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Retrieve the 'direct write' flag */ if(H5CX_get_dcw_flag(&direct_write) < 0) @@ -320,9 +307,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't prepare for writing data") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") - FUNC_LEAVE_API(ret_value) } /* end H5Dwrite() */ |