From 18fe7220c20f670147b67c24f127b58b7bede90f Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 17 Dec 2024 17:41:50 -0600 Subject: [PATCH 01/11] Embrace more uses of H5_BEFORE_USER_CB* Signed-off-by: Quincey Koziol --- src/H5Eint.c | 25 ++++--- src/H5FD.c | 69 +++++++++---------- src/H5FDint.c | 8 ++- src/H5Tconv_macros.h | 6 ++ src/H5VLcallback.c | 8 ++- src/H5VLint.c | 17 +++-- src/H5Z.c | 160 +++++++++++++++++++++---------------------- 7 files changed, 152 insertions(+), 141 deletions(-) diff --git a/src/H5Eint.c b/src/H5Eint.c index 80e25ca26c5..82280ce1312 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -1402,24 +1402,26 @@ H5E__walk(const H5E_stack_t *estack, H5E_direction_t direction, const H5E_walk_o if (op->u.func2) { ret_value = SUCCEED; if (H5E_WALK_UPWARD == direction) { - for (i = 0; i < (int)estack->nused && ret_value == H5_ITER_CONT; i++) + for (i = 0; i < (int)estack->nused && ret_value == H5_ITER_CONT; i++) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) { ret_value = (op->u.func2)((unsigned)i, &estack->entries[i].err, client_data); } - H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) + H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) + } } /* end if */ else { H5_CHECK_OVERFLOW(estack->nused - 1, size_t, int); - for (i = (int)(estack->nused - 1); i >= 0 && ret_value == H5_ITER_CONT; i--) + for (i = (int)(estack->nused - 1); i >= 0 && ret_value == H5_ITER_CONT; i--) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) { ret_value = (op->u.func2)((unsigned)(estack->nused - (size_t)(i + 1)), &estack->entries[i].err, client_data); } - H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) + H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) + } } /* end else */ if (ret_value < 0) @@ -1944,31 +1946,34 @@ H5E_dump_api_stack(void) assert(estack); #ifdef H5_NO_DEPRECATED_SYMBOLS - if (estack->auto_op.func2) + if (estack->auto_op.func2) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) { (void)((estack->auto_op.func2)(H5E_DEFAULT, estack->auto_data)); } - H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) + H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) + } #else /* H5_NO_DEPRECATED_SYMBOLS */ if (estack->auto_op.vers == 1) { - if (estack->auto_op.func1) + if (estack->auto_op.func1) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) { (void)((estack->auto_op.func1)(estack->auto_data)); } - H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) + H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) + } } /* end if */ else { - if (estack->auto_op.func2) + if (estack->auto_op.func2) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) { (void)((estack->auto_op.func2)(H5E_DEFAULT, estack->auto_data)); } - H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) + H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) + } } /* end else */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5FD.c b/src/H5FD.c index b50afc2bd9d..0f54bbfe7c8 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -936,7 +936,6 @@ H5FD_open(bool try, H5FD_t **_file, const char *name, unsigned flags, hid_t fapl if (HADDR_UNDEF == maxaddr) maxaddr = driver->maxaddr; - /* clang-format off */ /* Try dispatching to file driver */ if (try) { H5E_PAUSE_ERRORS @@ -964,43 +963,41 @@ H5FD_open(bool try, H5FD_t **_file, const char *name, unsigned flags, hid_t fapl if (NULL == file) HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "can't open file"); } -/* clang-format on */ -/* Set the file access flags */ -file->access_flags = flags; + /* Set the file access flags */ + file->access_flags = flags; -/* Fill in public fields. We must increment the reference count on the - * driver ID to prevent it from being freed while this file is open. - */ -file->driver_id = driver_prop.driver_id; -if (H5I_inc_ref(file->driver_id, false) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); -file->cls = driver; -file->maxaddr = maxaddr; -if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); -if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); - -/* Retrieve the VFL driver feature flags */ -if (H5FD__query(file, &file->feature_flags) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); - -/* Increment the global serial number & assign it to this H5FD_t object */ -if (++H5FD_file_serial_no_g == 0) { - /* (Just error out if we wrap around for now...) */ - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); -} /* end if */ -file->fileno = H5FD_file_serial_no_g; - -/* Start with base address set to 0 */ -/* (This will be changed later, when the superblock is located) */ -file->base_addr = 0; - -/* Set 'out' parameter */ -*_file = file; - -done : + /* Fill in public fields. We must increment the reference count on the + * driver ID to prevent it from being freed while this file is open. + */ + file->driver_id = driver_prop.driver_id; + if (H5I_inc_ref(file->driver_id, false) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); + file->cls = driver; + file->maxaddr = maxaddr; + if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); + if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); + + /* Retrieve the VFL driver feature flags */ + if (H5FD__query(file, &file->feature_flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); + + /* Increment the global serial number & assign it to this H5FD_t object */ + if (++H5FD_file_serial_no_g == 0) + /* (Just error out if we wrap around for now...) */ + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); + file->fileno = H5FD_file_serial_no_g; + + /* Start with base address set to 0 */ + /* (This will be changed later, when the superblock is located) */ + file->base_addr = 0; + + /* Set 'out' parameter */ + *_file = file; + +done: /* Can't cleanup 'file' information, since we don't know what type it is */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_open() */ diff --git a/src/H5FDint.c b/src/H5FDint.c index e3abf584125..a4ff1f1a965 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -2539,14 +2539,16 @@ H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags /*out*/) assert(flags); /* Check for the driver to query and then query it */ - if (driver->query) + if (driver->query) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(FAIL) { ret_value = (driver->query)(NULL, flags); } - H5_AFTER_USER_CB_NOERR(FAIL) - else *flags = 0; + H5_AFTER_USER_CB_NOERR(FAIL) + } + else + *flags = 0; FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_driver_query() */ diff --git a/src/H5Tconv_macros.h b/src/H5Tconv_macros.h index f4d89c5c346..ebb4c256849 100644 --- a/src/H5Tconv_macros.h +++ b/src/H5Tconv_macros.h @@ -291,6 +291,7 @@ typedef struct H5T_conv_hw_t { { \ if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret; \ + \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ { \ @@ -328,6 +329,7 @@ typedef struct H5T_conv_hw_t { { \ if (*(S) < 0) { \ H5T_conv_ret_t except_ret; \ + \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ { \ @@ -396,6 +398,7 @@ typedef struct H5T_conv_hw_t { #define H5T_CONV_uS_CORE_1(S, D, ST, DT, D_MIN, D_MAX) \ if (*(S) > (DT)(D_MAX)) { \ H5T_conv_ret_t except_ret; \ + \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ { \ @@ -532,6 +535,7 @@ typedef struct H5T_conv_hw_t { /* Assumes memory format of unsigned & signed integers is same */ \ if (*(S) < 0) { \ H5T_conv_ret_t except_ret; \ + \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ { \ @@ -570,6 +574,7 @@ typedef struct H5T_conv_hw_t { /* Assumes memory format of unsigned & signed integers is same */ \ if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret; \ + \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ { \ @@ -737,6 +742,7 @@ typedef struct H5T_conv_hw_t { /* Check for more bits of precision in src than available in dst */ \ if ((high_bit_pos - low_bit_pos) >= dprec) { \ H5T_conv_ret_t except_ret; \ + \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ { \ diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index 459cb79c7c0..d73c4711cf0 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -780,14 +780,16 @@ H5VLget_object(void *obj, hid_t connector_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a VOL connector ID"); /* Check for 'get_object' callback in connector */ - if (connector->cls->wrap_cls.get_object) + if (connector->cls->wrap_cls.get_object) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) { ret_value = (connector->cls->wrap_cls.get_object)(obj); } - H5_AFTER_USER_CB(NULL) - else ret_value = obj; + H5_AFTER_USER_CB(NULL) + } + else + ret_value = obj; done: FUNC_LEAVE_API_NOINIT(ret_value) diff --git a/src/H5VLint.c b/src/H5VLint.c index 6f40dfceff4..099419d880b 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -1805,14 +1805,16 @@ H5VL_object_data(const H5VL_object_t *vol_obj) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check for 'get_object' callback in connector */ - if (vol_obj->connector->cls->wrap_cls.get_object) + if (vol_obj->connector->cls->wrap_cls.get_object) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(NULL) { ret_value = (vol_obj->connector->cls->wrap_cls.get_object)(vol_obj->data); } - H5_AFTER_USER_CB_NOERR(NULL) - else ret_value = vol_obj->data; + H5_AFTER_USER_CB_NOERR(NULL) + } + else + ret_value = vol_obj->data; FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_object_data() */ @@ -2243,16 +2245,17 @@ H5VL__free_vol_wrapper(H5VL_wrap_ctx_t *vol_wrap_ctx) assert(vol_wrap_ctx->connector->cls); /* If there is a VOL connector object wrapping context, release it */ - if (vol_wrap_ctx->obj_wrap_ctx) + if (vol_wrap_ctx->obj_wrap_ctx) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) { /* Release the VOL connector's object wrapping context */ ret_value = (*vol_wrap_ctx->connector->cls->wrap_cls.free_wrap_ctx)(vol_wrap_ctx->obj_wrap_ctx); } - H5_AFTER_USER_CB(FAIL) - if (ret_value < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "unable to release connector's object wrapping context"); + H5_AFTER_USER_CB(FAIL) + if (ret_value < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "unable to release connector's object wrapping context"); + } /* Decrement refcount on connector */ if (H5VL_conn_dec_rc(vol_wrap_ctx->connector) < 0) diff --git a/src/H5Z.c b/src/H5Z.c index fb801340c10..d8d72fa2817 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1447,7 +1447,6 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i tmp_flags = flags | (pline->filter[idx].flags); tmp_flags |= (edc_read == H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; - /* clang-format off */ H5E_PAUSE_ERRORS { /* Prepare & restore library for user callback */ @@ -1459,66 +1458,63 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i H5_AFTER_USER_CB(FAIL) } H5E_RESUME_ERRORS - /* clang-format on */ #ifdef H5Z_DEBUG - H5_timer_stop(&timer); - H5_timer_get_times(timer, ×); - fstats->stats[1].times.elapsed += times.elapsed; - fstats->stats[1].times.system += times.system; - fstats->stats[1].times.user += times.user; - - fstats->stats[1].total += MAX(*nbytes, new_nbytes); - if (0 == new_nbytes) - fstats->stats[1].errors += *nbytes; + H5_timer_stop(&timer); + H5_timer_get_times(timer, ×); + fstats->stats[1].times.elapsed += times.elapsed; + fstats->stats[1].times.system += times.system; + fstats->stats[1].times.user += times.user; + + fstats->stats[1].total += MAX(*nbytes, new_nbytes); + if (0 == new_nbytes) + fstats->stats[1].errors += *nbytes; #endif - if (0 == new_nbytes) { - if (cb_struct.func) { - H5Z_cb_return_t status; + if (0 == new_nbytes) { + if (cb_struct.func) { + H5Z_cb_return_t status; + + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); + } + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); + } + else + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); + *nbytes = *buf_size; + failed |= (unsigned)1 << idx; } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); + else + *nbytes = new_nbytes; } - else - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - - *nbytes = *buf_size; - failed |= (unsigned)1 << idx; } - else - *nbytes = new_nbytes; -} -} -else if (pline) -{ /* Write */ - for (idx = 0; idx < pline->nused; idx++) { - if (*filter_mask & ((unsigned)1 << idx)) { - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } - if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { - /* Check if filter is optional -- If it isn't, then error */ - if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } /* end if */ + else if (pline) { /* Write */ + for (idx = 0; idx < pline->nused; idx++) { + if (*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } + if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { + /* Check if filter is optional -- If it isn't, then error */ + if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } /* end if */ - fclass = &H5Z_table_g[fclass_idx]; + fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG - fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_start(&timer); + fstats = &H5Z_stat_table_g[fclass_idx]; + H5_timer_start(&timer); #endif - /* clang-format off */ H5E_PAUSE_ERRORS { /* Prepare & restore library for user callback */ @@ -1530,49 +1526,49 @@ else if (pline) H5_AFTER_USER_CB(FAIL) } H5E_RESUME_ERRORS -/* clang-format on */ #ifdef H5Z_DEBUG -H5_timer_stop(&timer); -H5_timer_get_times(timer, ×); -fstats->stats[0].times.elapsed += times.elapsed; -fstats->stats[0].times.system += times.system; -fstats->stats[0].times.user += times.user; - -fstats->stats[0].total += MAX(*nbytes, new_nbytes); -if (0 == new_nbytes) - fstats->stats[0].errors += *nbytes; + H5_timer_stop(&timer); + H5_timer_get_times(timer, ×); + fstats->stats[0].times.elapsed += times.elapsed; + fstats->stats[0].times.system += times.system; + fstats->stats[0].times.user += times.user; + + fstats->stats[0].total += MAX(*nbytes, new_nbytes); + if (0 == new_nbytes) + fstats->stats[0].errors += *nbytes; #endif -if (0 == new_nbytes) { - if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { - if (cb_struct.func) { - H5Z_cb_return_t status; + if (0 == new_nbytes) { + if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { + if (cb_struct.func) { + H5Z_cb_return_t status; - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); - } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); - } - else - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); + } + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + } + else + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); - *nbytes = *buf_size; + *nbytes = *buf_size; + } + failed |= (unsigned)1 << idx; + } + else + *nbytes = new_nbytes; + } /* end for */ } - failed |= (unsigned)1 << idx; -} -else - *nbytes = new_nbytes; -} /* end for */ -} -*filter_mask = failed; + *filter_mask = failed; -done : FUNC_LEAVE_NOAPI(ret_value) +done: + FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- From 58a2310f4c3b5c1de11e32b29593ba0805e12359 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 23:43:42 +0000 Subject: [PATCH 02/11] Committing clang-format changes --- src/H5FD.c | 109 ++++++++++++++-------------- src/H5VLint.c | 3 +- src/H5Z.c | 194 ++++++++++++++++++++++++-------------------------- 3 files changed, 150 insertions(+), 156 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index 0f54bbfe7c8..84a884515fe 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -938,66 +938,63 @@ H5FD_open(bool try, H5FD_t **_file, const char *name, unsigned flags, hid_t fapl /* Try dispatching to file driver */ if (try) { - H5E_PAUSE_ERRORS - { - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - file = (driver->open)(name, flags, fapl_id, maxaddr); - } - H5_AFTER_USER_CB(FAIL) - } - H5E_RESUME_ERRORS - - /* Check if file was not opened */ - if (NULL == file) - HGOTO_DONE(SUCCEED); - } - else { - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - file = (driver->open)(name, flags, fapl_id, maxaddr); - } - H5_AFTER_USER_CB(FAIL) - if (NULL == file) - HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "can't open file"); + H5E_PAUSE_ERRORS{/* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL){file = (driver->open)(name, flags, fapl_id, maxaddr); } + H5_AFTER_USER_CB(FAIL) +} +H5E_RESUME_ERRORS - /* Set the file access flags */ - file->access_flags = flags; +/* Check if file was not opened */ +if (NULL == file) + HGOTO_DONE(SUCCEED); +} +else +{ + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + file = (driver->open)(name, flags, fapl_id, maxaddr); + } + H5_AFTER_USER_CB(FAIL) + if (NULL == file) + HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "can't open file"); +} - /* Fill in public fields. We must increment the reference count on the - * driver ID to prevent it from being freed while this file is open. - */ - file->driver_id = driver_prop.driver_id; - if (H5I_inc_ref(file->driver_id, false) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); - file->cls = driver; - file->maxaddr = maxaddr; - if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); - if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); - - /* Retrieve the VFL driver feature flags */ - if (H5FD__query(file, &file->feature_flags) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); - - /* Increment the global serial number & assign it to this H5FD_t object */ - if (++H5FD_file_serial_no_g == 0) - /* (Just error out if we wrap around for now...) */ - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); - file->fileno = H5FD_file_serial_no_g; - - /* Start with base address set to 0 */ - /* (This will be changed later, when the superblock is located) */ - file->base_addr = 0; - - /* Set 'out' parameter */ - *_file = file; +/* Set the file access flags */ +file->access_flags = flags; -done: +/* Fill in public fields. We must increment the reference count on the + * driver ID to prevent it from being freed while this file is open. + */ +file->driver_id = driver_prop.driver_id; +if (H5I_inc_ref(file->driver_id, false) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); +file->cls = driver; +file->maxaddr = maxaddr; +if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); +if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); + +/* Retrieve the VFL driver feature flags */ +if (H5FD__query(file, &file->feature_flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); + +/* Increment the global serial number & assign it to this H5FD_t object */ +if (++H5FD_file_serial_no_g == 0) + /* (Just error out if we wrap around for now...) */ + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); +file->fileno = H5FD_file_serial_no_g; + +/* Start with base address set to 0 */ +/* (This will be changed later, when the superblock is located) */ +file->base_addr = 0; + +/* Set 'out' parameter */ +*_file = file; + +done : /* Can't cleanup 'file' information, since we don't know what type it is */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_open() */ diff --git a/src/H5VLint.c b/src/H5VLint.c index 099419d880b..7f332b50b11 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -2254,7 +2254,8 @@ H5VL__free_vol_wrapper(H5VL_wrap_ctx_t *vol_wrap_ctx) } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "unable to release connector's object wrapping context"); + HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, + "unable to release connector's object wrapping context"); } /* Decrement refcount on connector */ diff --git a/src/H5Z.c b/src/H5Z.c index d8d72fa2817..35c1cbf6f16 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1447,128 +1447,124 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i tmp_flags = flags | (pline->filter[idx].flags); tmp_flags |= (edc_read == H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; - H5E_PAUSE_ERRORS - { + H5E_PAUSE_ERRORS{ /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, pline->filter[idx].cd_values, - *nbytes, buf_size, buf); - } - H5_AFTER_USER_CB(FAIL) - } - H5E_RESUME_ERRORS + H5_BEFORE_USER_CB(FAIL){new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, + pline->filter[idx].cd_values, *nbytes, + buf_size, buf); + } + H5_AFTER_USER_CB(FAIL) + } + H5E_RESUME_ERRORS #ifdef H5Z_DEBUG - H5_timer_stop(&timer); - H5_timer_get_times(timer, ×); - fstats->stats[1].times.elapsed += times.elapsed; - fstats->stats[1].times.system += times.system; - fstats->stats[1].times.user += times.user; - - fstats->stats[1].total += MAX(*nbytes, new_nbytes); - if (0 == new_nbytes) - fstats->stats[1].errors += *nbytes; + H5_timer_stop(&timer); + H5_timer_get_times(timer, ×); + fstats->stats[1].times.elapsed += times.elapsed; + fstats->stats[1].times.system += times.system; + fstats->stats[1].times.user += times.user; + + fstats->stats[1].total += MAX(*nbytes, new_nbytes); + if (0 == new_nbytes) + fstats->stats[1].errors += *nbytes; #endif - if (0 == new_nbytes) { - if (cb_struct.func) { - H5Z_cb_return_t status; - - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); - } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - } - else - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); + if (0 == new_nbytes) { + if (cb_struct.func) { + H5Z_cb_return_t status; - *nbytes = *buf_size; - failed |= (unsigned)1 << idx; + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); } - else - *nbytes = new_nbytes; + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); } + else + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); + + *nbytes = *buf_size; + failed |= (unsigned)1 << idx; } - else if (pline) { /* Write */ - for (idx = 0; idx < pline->nused; idx++) { - if (*filter_mask & ((unsigned)1 << idx)) { - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } - if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { - /* Check if filter is optional -- If it isn't, then error */ - if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } /* end if */ + else + *nbytes = new_nbytes; +} +} +else if (pline) +{ /* Write */ + for (idx = 0; idx < pline->nused; idx++) { + if (*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } + if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { + /* Check if filter is optional -- If it isn't, then error */ + if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } /* end if */ - fclass = &H5Z_table_g[fclass_idx]; + fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG - fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_start(&timer); + fstats = &H5Z_stat_table_g[fclass_idx]; + H5_timer_start(&timer); #endif - H5E_PAUSE_ERRORS - { - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - new_nbytes = (fclass->filter)(flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); - } - H5_AFTER_USER_CB(FAIL) - } - H5E_RESUME_ERRORS + H5E_PAUSE_ERRORS{ + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL){new_nbytes = (fclass->filter)( + flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, + pline->filter[idx].cd_values, *nbytes, buf_size, buf); + } + H5_AFTER_USER_CB(FAIL) +} +H5E_RESUME_ERRORS #ifdef H5Z_DEBUG - H5_timer_stop(&timer); - H5_timer_get_times(timer, ×); - fstats->stats[0].times.elapsed += times.elapsed; - fstats->stats[0].times.system += times.system; - fstats->stats[0].times.user += times.user; - - fstats->stats[0].total += MAX(*nbytes, new_nbytes); - if (0 == new_nbytes) - fstats->stats[0].errors += *nbytes; +H5_timer_stop(&timer); +H5_timer_get_times(timer, ×); +fstats->stats[0].times.elapsed += times.elapsed; +fstats->stats[0].times.system += times.system; +fstats->stats[0].times.user += times.user; + +fstats->stats[0].total += MAX(*nbytes, new_nbytes); +if (0 == new_nbytes) + fstats->stats[0].errors += *nbytes; #endif - if (0 == new_nbytes) { - if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { - if (cb_struct.func) { - H5Z_cb_return_t status; - - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); - } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); - } - else - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); +if (0 == new_nbytes) { + if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { + if (cb_struct.func) { + H5Z_cb_return_t status; - *nbytes = *buf_size; - } - failed |= (unsigned)1 << idx; + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); } - else - *nbytes = new_nbytes; - } /* end for */ + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + } + else + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + + *nbytes = *buf_size; } + failed |= (unsigned)1 << idx; +} +else + *nbytes = new_nbytes; +} /* end for */ +} - *filter_mask = failed; +*filter_mask = failed; -done: - FUNC_LEAVE_NOAPI(ret_value) +done : FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- From 45150ef2cba5ef31645954346827d59d168b4c18 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 17 Dec 2024 18:05:16 -0600 Subject: [PATCH 03/11] Try updating clang format options to know about H5_PAUSE/RESUME_ERRORS Signed-off-by: Quincey Koziol --- .clang-format | 8 ++- src/H5FD.c | 103 ++++++++++++++------------- src/H5Z.c | 193 +++++++++++++++++++++++++------------------------- 3 files changed, 157 insertions(+), 147 deletions(-) diff --git a/.clang-format b/.clang-format index 1095ad4bf20..6da69c034d7 100644 --- a/.clang-format +++ b/.clang-format @@ -58,8 +58,12 @@ IndentCaseLabels: true IndentGotoLabels: false #llvm11: IndentExternBlock: AfterExternBlock #llvm11: InsertTrailingCommas: None -MacroBlockBegin: "^_BEFORE_USER_CB" -MacroBlockEnd: "^_AFTER_USER_CB" +MacroBlockBegin: + - "^_BEFORE_USER_CB" + - "^_PAUSE_ERRORS" +MacroBlockEnd: + - "^_AFTER_USER_CB" + - "^_RESUME_ERRORS" ObjCBlockIndentWidth: 4 #llvm11: ObjCBreakBeforeNestedBlockParam: true ReflowComments: true diff --git a/src/H5FD.c b/src/H5FD.c index 84a884515fe..703004f07d5 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -938,61 +938,64 @@ H5FD_open(bool try, H5FD_t **_file, const char *name, unsigned flags, hid_t fapl /* Try dispatching to file driver */ if (try) { - H5E_PAUSE_ERRORS{/* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL){file = (driver->open)(name, flags, fapl_id, maxaddr); - } - H5_AFTER_USER_CB(FAIL) -} -H5E_RESUME_ERRORS + H5E_PAUSE_ERRORS + {/* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + file = (driver->open)(name, flags, fapl_id, maxaddr); + } + H5_AFTER_USER_CB(FAIL) + } + H5E_RESUME_ERRORS -/* Check if file was not opened */ -if (NULL == file) - HGOTO_DONE(SUCCEED); -} -else -{ - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) + /* Check if file was not opened */ + if (NULL == file) + HGOTO_DONE(SUCCEED); + } + else { - file = (driver->open)(name, flags, fapl_id, maxaddr); + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + file = (driver->open)(name, flags, fapl_id, maxaddr); + } + H5_AFTER_USER_CB(FAIL) + if (NULL == file) + HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "can't open file"); } - H5_AFTER_USER_CB(FAIL) - if (NULL == file) - HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "can't open file"); -} -/* Set the file access flags */ -file->access_flags = flags; + /* Set the file access flags */ + file->access_flags = flags; -/* Fill in public fields. We must increment the reference count on the - * driver ID to prevent it from being freed while this file is open. - */ -file->driver_id = driver_prop.driver_id; -if (H5I_inc_ref(file->driver_id, false) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); -file->cls = driver; -file->maxaddr = maxaddr; -if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); -if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); - -/* Retrieve the VFL driver feature flags */ -if (H5FD__query(file, &file->feature_flags) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); - -/* Increment the global serial number & assign it to this H5FD_t object */ -if (++H5FD_file_serial_no_g == 0) - /* (Just error out if we wrap around for now...) */ - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); -file->fileno = H5FD_file_serial_no_g; - -/* Start with base address set to 0 */ -/* (This will be changed later, when the superblock is located) */ -file->base_addr = 0; - -/* Set 'out' parameter */ -*_file = file; + /* Fill in public fields. We must increment the reference count on the + * driver ID to prevent it from being freed while this file is open. + */ + file->driver_id = driver_prop.driver_id; + if (H5I_inc_ref(file->driver_id, false) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); + file->cls = driver; + file->maxaddr = maxaddr; + if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); + if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); + + /* Retrieve the VFL driver feature flags */ + if (H5FD__query(file, &file->feature_flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); + + /* Increment the global serial number & assign it to this H5FD_t object */ + if (++H5FD_file_serial_no_g == 0) + /* (Just error out if we wrap around for now...) */ + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); + file->fileno = H5FD_file_serial_no_g; + + /* Start with base address set to 0 */ + /* (This will be changed later, when the superblock is located) */ + file->base_addr = 0; + + /* Set 'out' parameter */ + *_file = file; done : /* Can't cleanup 'file' information, since we don't know what type it is */ diff --git a/src/H5Z.c b/src/H5Z.c index 35c1cbf6f16..96ebabbb408 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1447,124 +1447,127 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i tmp_flags = flags | (pline->filter[idx].flags); tmp_flags |= (edc_read == H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; - H5E_PAUSE_ERRORS{ + H5E_PAUSE_ERRORS + { /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL){new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, - buf_size, buf); - } - H5_AFTER_USER_CB(FAIL) - } - H5E_RESUME_ERRORS + H5_BEFORE_USER_CB(FAIL) + { + new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, pline->filter[idx].cd_values, *nbytes, buf_size, buf); + } + H5_AFTER_USER_CB(FAIL) + } + H5E_RESUME_ERRORS #ifdef H5Z_DEBUG - H5_timer_stop(&timer); - H5_timer_get_times(timer, ×); - fstats->stats[1].times.elapsed += times.elapsed; - fstats->stats[1].times.system += times.system; - fstats->stats[1].times.user += times.user; - - fstats->stats[1].total += MAX(*nbytes, new_nbytes); - if (0 == new_nbytes) - fstats->stats[1].errors += *nbytes; + H5_timer_stop(&timer); + H5_timer_get_times(timer, ×); + fstats->stats[1].times.elapsed += times.elapsed; + fstats->stats[1].times.system += times.system; + fstats->stats[1].times.user += times.user; + + fstats->stats[1].total += MAX(*nbytes, new_nbytes); + if (0 == new_nbytes) + fstats->stats[1].errors += *nbytes; #endif - if (0 == new_nbytes) { - if (cb_struct.func) { - H5Z_cb_return_t status; + if (0 == new_nbytes) { + if (cb_struct.func) { + H5Z_cb_return_t status; + + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); + } + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); + } + else + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); + *nbytes = *buf_size; + failed |= (unsigned)1 << idx; } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); + else + *nbytes = new_nbytes; } - else - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - - *nbytes = *buf_size; - failed |= (unsigned)1 << idx; } - else - *nbytes = new_nbytes; -} -} -else if (pline) -{ /* Write */ - for (idx = 0; idx < pline->nused; idx++) { - if (*filter_mask & ((unsigned)1 << idx)) { - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } - if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { - /* Check if filter is optional -- If it isn't, then error */ - if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } /* end if */ + else if (pline) + { /* Write */ + for (idx = 0; idx < pline->nused; idx++) { + if (*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } + if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { + /* Check if filter is optional -- If it isn't, then error */ + if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } /* end if */ - fclass = &H5Z_table_g[fclass_idx]; + fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG - fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_start(&timer); + fstats = &H5Z_stat_table_g[fclass_idx]; + H5_timer_start(&timer); #endif - H5E_PAUSE_ERRORS{ - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL){new_nbytes = (fclass->filter)( - flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); - } - H5_AFTER_USER_CB(FAIL) -} -H5E_RESUME_ERRORS + H5E_PAUSE_ERRORS + { + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + new_nbytes = (fclass->filter)(flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, pline->filter[idx].cd_values, *nbytes, buf_size, buf); + } + H5_AFTER_USER_CB(FAIL) + } + H5E_RESUME_ERRORS #ifdef H5Z_DEBUG -H5_timer_stop(&timer); -H5_timer_get_times(timer, ×); -fstats->stats[0].times.elapsed += times.elapsed; -fstats->stats[0].times.system += times.system; -fstats->stats[0].times.user += times.user; - -fstats->stats[0].total += MAX(*nbytes, new_nbytes); -if (0 == new_nbytes) - fstats->stats[0].errors += *nbytes; + H5_timer_stop(&timer); + H5_timer_get_times(timer, ×); + fstats->stats[0].times.elapsed += times.elapsed; + fstats->stats[0].times.system += times.system; + fstats->stats[0].times.user += times.user; + + fstats->stats[0].total += MAX(*nbytes, new_nbytes); + if (0 == new_nbytes) + fstats->stats[0].errors += *nbytes; #endif -if (0 == new_nbytes) { - if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { - if (cb_struct.func) { - H5Z_cb_return_t status; + if (0 == new_nbytes) { + if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { + if (cb_struct.func) { + H5Z_cb_return_t status; - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); - } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); - } - else - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); + } + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + } + else + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); - *nbytes = *buf_size; + *nbytes = *buf_size; + } + failed |= (unsigned)1 << idx; + } + else + *nbytes = new_nbytes; + } /* end for */ } - failed |= (unsigned)1 << idx; -} -else - *nbytes = new_nbytes; -} /* end for */ -} -*filter_mask = failed; + *filter_mask = failed; -done : FUNC_LEAVE_NOAPI(ret_value) +done: + FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- From 4363094c4ae03cf3cbfad548362aa9956d6f60a1 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 17 Dec 2024 18:15:13 -0600 Subject: [PATCH 04/11] Fix(?) clang format syntax Signed-off-by: Quincey Koziol --- .clang-format | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.clang-format b/.clang-format index 6da69c034d7..de4f8b8e95c 100644 --- a/.clang-format +++ b/.clang-format @@ -58,12 +58,8 @@ IndentCaseLabels: true IndentGotoLabels: false #llvm11: IndentExternBlock: AfterExternBlock #llvm11: InsertTrailingCommas: None -MacroBlockBegin: - - "^_BEFORE_USER_CB" - - "^_PAUSE_ERRORS" -MacroBlockEnd: - - "^_AFTER_USER_CB" - - "^_RESUME_ERRORS" +MacroBlockBegin: "^H5_BEFORE_USER_CB*|^H5E_PAUSE_ERRORS" +MacroBlockEnd: "^H5_AFTER_USER_CB*|^H5E_RESUME_ERRORS" ObjCBlockIndentWidth: 4 #llvm11: ObjCBreakBeforeNestedBlockParam: true ReflowComments: true From f77bc18b806dca7cf58438ada36a898d649e34b4 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 00:17:36 +0000 Subject: [PATCH 05/11] Committing clang-format changes --- src/H5.c | 8 +- src/H5Adense.c | 20 +- src/H5Aint.c | 18 +- src/H5D.c | 14 +- src/H5Dchunk.c | 10 +- src/H5Dfill.c | 36 +-- src/H5ESint.c | 18 +- src/H5Eint.c | 46 ++-- src/H5FD.c | 211 +++++++------- src/H5FDcore.c | 42 +-- src/H5FDfamily.c | 6 +- src/H5FDint.c | 194 ++++++------- src/H5FDspace.c | 71 ++--- src/H5Fint.c | 6 +- src/H5Fsuper.c | 6 +- src/H5Gint.c | 24 +- src/H5Glink.c | 14 +- src/H5Gnode.c | 6 +- src/H5Gstab.c | 12 +- src/H5Gtraverse.c | 24 +- src/H5I.c | 14 +- src/H5Iint.c | 42 +-- src/H5Lexternal.c | 8 +- src/H5Lint.c | 32 +-- src/H5Ocopy.c | 6 +- src/H5Oint.c | 8 +- src/H5Olink.c | 8 +- src/H5Pencdec.c | 16 +- src/H5Pfapl.c | 107 ++++---- src/H5Pint.c | 145 +++++----- src/H5Sselect.c | 9 +- src/H5T.c | 43 +-- src/H5Tconv_bitfield.c | 12 +- src/H5Tconv_complex.c | 40 +-- src/H5Tconv_enum.c | 22 +- src/H5Tconv_float.c | 124 ++++----- src/H5Tconv_integer.c | 92 +++---- src/H5Tconv_macros.h | 280 +++++++++---------- src/H5Tvlen.c | 12 +- src/H5VLcallback.c | 605 +++++++++++++++++++++-------------------- src/H5VLint.c | 36 +-- src/H5Z.c | 213 ++++++++------- 42 files changed, 1335 insertions(+), 1325 deletions(-) diff --git a/src/H5.c b/src/H5.c index 6a0d54d3763..63d7aa15a26 100644 --- a/src/H5.c +++ b/src/H5.c @@ -335,10 +335,10 @@ H5_term_library(void) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOCHECK - { - /* Invoke callback, providing context */ - (*curr_atclose->func)(curr_atclose->ctx); - } + { + /* Invoke callback, providing context */ + (*curr_atclose->func)(curr_atclose->ctx); + } H5_AFTER_USER_CB_NOCHECK /* Advance to next node and free this one */ diff --git a/src/H5Adense.c b/src/H5Adense.c index e49c53c486c..f9ba92d1aa9 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -1055,11 +1055,11 @@ H5A__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(H5_ITER_ERROR) - { - /* Make the application callback */ - ret_value = (bt2_udata->attr_op->u.app_op2)( - bt2_udata->loc_id, fh_udata.attr->shared->name, &ainfo, bt2_udata->op_data); - } + { + /* Make the application callback */ + ret_value = (bt2_udata->attr_op->u.app_op2)( + bt2_udata->loc_id, fh_udata.attr->shared->name, &ainfo, bt2_udata->op_data); + } H5_AFTER_USER_CB(H5_ITER_ERROR) break; } @@ -1068,11 +1068,11 @@ H5A__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) case H5A_ATTR_OP_APP: /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(H5_ITER_ERROR) - { - /* Make the application callback */ - ret_value = (bt2_udata->attr_op->u.app_op)(bt2_udata->loc_id, fh_udata.attr->shared->name, - bt2_udata->op_data); - } + { + /* Make the application callback */ + ret_value = (bt2_udata->attr_op->u.app_op)( + bt2_udata->loc_id, fh_udata.attr->shared->name, bt2_udata->op_data); + } H5_AFTER_USER_CB(H5_ITER_ERROR) break; #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Aint.c b/src/H5Aint.c index bc62b7792a3..88e26790cd0 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -1894,11 +1894,11 @@ H5A__attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, hsize_t *l /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(H5_ITER_ERROR) - { - /* Make the application callback */ - ret_value = - (attr_op->u.app_op2)(loc_id, ((atable->attrs[u])->shared)->name, &ainfo, op_data); - } + { + /* Make the application callback */ + ret_value = + (attr_op->u.app_op2)(loc_id, ((atable->attrs[u])->shared)->name, &ainfo, op_data); + } H5_AFTER_USER_CB(H5_ITER_ERROR) break; } @@ -1907,10 +1907,10 @@ H5A__attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, hsize_t *l case H5A_ATTR_OP_APP: /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(H5_ITER_ERROR) - { - /* Make the application callback */ - ret_value = (attr_op->u.app_op)(loc_id, ((atable->attrs[u])->shared)->name, op_data); - } + { + /* Make the application callback */ + ret_value = (attr_op->u.app_op)(loc_id, ((atable->attrs[u])->shared)->name, op_data); + } H5_AFTER_USER_CB(H5_ITER_ERROR) break; #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5D.c b/src/H5D.c index 8472efd5010..711a257712a 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -1594,10 +1594,10 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_ while (nelmts > 0) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Make callback to retrieve data */ - ret_value = op(&src_buf, &src_buf_nbytes, op_data); - } + { + /* Make callback to retrieve data */ + ret_value = op(&src_buf, &src_buf_nbytes, op_data); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_DATASET, H5E_CALLBACK, FAIL, "callback operator returned failure"); @@ -1713,9 +1713,9 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf if (op) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = op(dst_buf, nelmts_gathered * type_size, op_data); - } + { + ret_value = op(dst_buf, nelmts_gathered * type_size, op_data); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_DATASET, H5E_CALLBACK, FAIL, "callback operator returned failure"); diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index d8a7d8f53a2..5fb47e7054a 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -8146,11 +8146,11 @@ H5D__chunk_iter_cb(const H5D_chunk_rec_t *chunk_rec, void *udata) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(FAIL) - { - ret_value = - (data->op)(offset, (unsigned)chunk_rec->filter_mask, data->base_addr + chunk_rec->chunk_addr, - (hsize_t)chunk_rec->nbytes, data->op_data); - } + { + ret_value = + (data->op)(offset, (unsigned)chunk_rec->filter_mask, data->base_addr + chunk_rec->chunk_addr, + (hsize_t)chunk_rec->nbytes, data->op_data); + } H5_AFTER_USER_CB_NOERR(FAIL) /* Check for callback failure and pass along return value */ diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 99f402789b7..093039987b8 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -350,9 +350,9 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat if (alloc_func) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - fb_info->fill_buf = alloc_func(fb_info->fill_buf_size, alloc_info); - } + { + fb_info->fill_buf = alloc_func(fb_info->fill_buf_size, alloc_info); + } H5_AFTER_USER_CB(FAIL) } else @@ -409,9 +409,9 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat if (alloc_func) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - fb_info->fill_buf = alloc_func(fb_info->fill_buf_size, alloc_info); - } + { + fb_info->fill_buf = alloc_func(fb_info->fill_buf_size, alloc_info); + } H5_AFTER_USER_CB(FAIL) } else @@ -450,9 +450,9 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat if (alloc_func) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - fb_info->fill_buf = alloc_func(fb_info->fill_buf_size, alloc_info); - } + { + fb_info->fill_buf = alloc_func(fb_info->fill_buf_size, alloc_info); + } H5_AFTER_USER_CB(FAIL) if (NULL == fb_info->fill_buf) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "memory allocation failed for fill buffer"); @@ -532,9 +532,9 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts) if (fb_info->fill_alloc_func) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - buf = fb_info->fill_alloc_func(fb_info->fill_buf_size, fb_info->fill_alloc_info); - } + { + buf = fb_info->fill_alloc_func(fb_info->fill_buf_size, fb_info->fill_alloc_info); + } H5_AFTER_USER_CB(FAIL) } else @@ -565,9 +565,9 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts) if (fb_info->fill_free_func) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(FAIL) - { - fb_info->fill_free_func(buf, fb_info->fill_free_info); - } + { + fb_info->fill_free_func(buf, fb_info->fill_free_info); + } H5_AFTER_USER_CB_NOERR(FAIL) } else @@ -602,9 +602,9 @@ H5D__fill_release(H5D_fill_buf_info_t *fb_info) if (fb_info->fill_free_func) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(FAIL) - { - fb_info->fill_free_func(fb_info->fill_buf, fb_info->fill_free_info); - } + { + fb_info->fill_free_func(fb_info->fill_buf, fb_info->fill_free_info); + } H5_AFTER_USER_CB_NOERR(FAIL) } else { diff --git a/src/H5ESint.c b/src/H5ESint.c index 47e7a92c61b..655fb818c04 100644 --- a/src/H5ESint.c +++ b/src/H5ESint.c @@ -303,9 +303,9 @@ H5ES__insert(H5ES_t *es, H5VL_connector_t *connector, void *request_token, const /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - status = (es->ins_func)(&ev->op_info, es->ins_ctx); - } + { + status = (es->ins_func)(&ev->op_info, es->ins_ctx); + } H5_AFTER_USER_CB(FAIL) if (status < 0) HGOTO_ERROR(H5E_EVENTSET, H5E_CALLBACK, FAIL, "'insert' callback for event set failed"); @@ -589,9 +589,9 @@ H5ES__op_complete(H5ES_t *es, H5ES_event_t *ev, H5VL_request_status_t ev_status) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - status = (es->comp_func)(&ev->op_info, op_status, H5I_INVALID_HID, es->comp_ctx); - } + { + status = (es->comp_func)(&ev->op_info, op_status, H5I_INVALID_HID, es->comp_ctx); + } H5_AFTER_USER_CB(FAIL) if (status < 0) HGOTO_ERROR(H5E_EVENTSET, H5E_CALLBACK, FAIL, "'complete' callback for event set failed"); @@ -618,9 +618,9 @@ H5ES__op_complete(H5ES_t *es, H5ES_event_t *ev, H5VL_request_status_t ev_status) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - status = (es->comp_func)(&ev->op_info, H5ES_STATUS_FAIL, err_stack_id, es->comp_ctx); - } + { + status = (es->comp_func)(&ev->op_info, H5ES_STATUS_FAIL, err_stack_id, es->comp_ctx); + } H5_AFTER_USER_CB(FAIL) if (status < 0) HGOTO_ERROR(H5E_EVENTSET, H5E_CALLBACK, FAIL, "'complete' callback for event set failed"); diff --git a/src/H5Eint.c b/src/H5Eint.c index 82280ce1312..271eb7639e0 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -1363,9 +1363,9 @@ H5E__walk(const H5E_stack_t *estack, H5E_direction_t direction, const H5E_walk_o /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) - { - ret_value = (op->u.func1)(i, &old_err, client_data); - } + { + ret_value = (op->u.func1)(i, &old_err, client_data); + } H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) } /* end for */ } /* end if */ @@ -1382,10 +1382,10 @@ H5E__walk(const H5E_stack_t *estack, H5E_direction_t direction, const H5E_walk_o /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) - { - ret_value = - (op->u.func1)((int)(estack->nused - (size_t)(i + 1)), &old_err, client_data); - } + { + ret_value = + (op->u.func1)((int)(estack->nused - (size_t)(i + 1)), &old_err, client_data); + } H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) } /* end for */ } /* end else */ @@ -1405,9 +1405,9 @@ H5E__walk(const H5E_stack_t *estack, H5E_direction_t direction, const H5E_walk_o for (i = 0; i < (int)estack->nused && ret_value == H5_ITER_CONT; i++) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) - { - ret_value = (op->u.func2)((unsigned)i, &estack->entries[i].err, client_data); - } + { + ret_value = (op->u.func2)((unsigned)i, &estack->entries[i].err, client_data); + } H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) } } /* end if */ @@ -1416,10 +1416,10 @@ H5E__walk(const H5E_stack_t *estack, H5E_direction_t direction, const H5E_walk_o for (i = (int)(estack->nused - 1); i >= 0 && ret_value == H5_ITER_CONT; i--) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) - { - ret_value = (op->u.func2)((unsigned)(estack->nused - (size_t)(i + 1)), - &estack->entries[i].err, client_data); - } + { + ret_value = (op->u.func2)((unsigned)(estack->nused - (size_t)(i + 1)), + &estack->entries[i].err, client_data); + } H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) } } /* end else */ @@ -1949,9 +1949,9 @@ H5E_dump_api_stack(void) if (estack->auto_op.func2) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) - { - (void)((estack->auto_op.func2)(H5E_DEFAULT, estack->auto_data)); - } + { + (void)((estack->auto_op.func2)(H5E_DEFAULT, estack->auto_data)); + } H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) } #else /* H5_NO_DEPRECATED_SYMBOLS */ @@ -1959,9 +1959,9 @@ H5E_dump_api_stack(void) if (estack->auto_op.func1) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) - { - (void)((estack->auto_op.func1)(estack->auto_data)); - } + { + (void)((estack->auto_op.func1)(estack->auto_data)); + } H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) } } /* end if */ @@ -1969,9 +1969,9 @@ H5E_dump_api_stack(void) if (estack->auto_op.func2) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) - { - (void)((estack->auto_op.func2)(H5E_DEFAULT, estack->auto_data)); - } + { + (void)((estack->auto_op.func2)(H5E_DEFAULT, estack->auto_data)); + } H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) } } /* end else */ diff --git a/src/H5FD.c b/src/H5FD.c index 703004f07d5..88564eff7b7 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -299,9 +299,9 @@ H5FD__free_cls(H5FD_class_t *cls, void H5_ATTR_UNUSED **request) if (cls->terminate) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = cls->terminate(); - } + { + ret_value = cls->terminate(); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEOBJ, FAIL, "virtual file driver '%s' did not terminate cleanly", @@ -580,9 +580,9 @@ H5FD_sb_size(H5FD_t *file) if (file->cls->sb_size) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(0) - { - ret_value = (file->cls->sb_size)(file); - } + { + ret_value = (file->cls->sb_size)(file); + } H5_AFTER_USER_CB_NOERR(0) } @@ -619,9 +619,9 @@ H5FD_sb_encode(H5FD_t *file, char *name /*out*/, uint8_t *buf) if (file->cls->sb_encode) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->sb_encode)(file, name /*out*/, buf /*out*/); - } + { + ret_value = (file->cls->sb_encode)(file, name /*out*/, buf /*out*/); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_encode request failed"); @@ -655,9 +655,9 @@ H5FD__sb_decode(H5FD_t *file, const char *name, const uint8_t *buf) if (file->cls->sb_decode) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->sb_decode)(file, name, buf); - } + { + ret_value = (file->cls->sb_decode)(file, name, buf); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_decode request failed"); @@ -740,9 +740,9 @@ H5FD_fapl_get(H5FD_t *file) if (file->cls->fapl_get) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(NULL) - { - ret_value = (file->cls->fapl_get)(file); - } + { + ret_value = (file->cls->fapl_get)(file); + } H5_AFTER_USER_CB_NOERR(NULL) } @@ -777,11 +777,11 @@ H5FD_free_driver_info(hid_t driver_id, const void *driver_info) if (driver->fapl_free) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Free the const pointer */ - /* (Cast through uintptr_t to de-const memory) */ - ret_value = (driver->fapl_free)((void *)(uintptr_t)driver_info); - } + { + /* Free the const pointer */ + /* (Cast through uintptr_t to de-const memory) */ + ret_value = (driver->fapl_free)((void *)(uintptr_t)driver_info); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "driver free request failed"); @@ -939,63 +939,62 @@ H5FD_open(bool try, H5FD_t **_file, const char *name, unsigned flags, hid_t fapl /* Try dispatching to file driver */ if (try) { H5E_PAUSE_ERRORS - {/* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - file = (driver->open)(name, flags, fapl_id, maxaddr); - } - H5_AFTER_USER_CB(FAIL) - } - H5E_RESUME_ERRORS - - /* Check if file was not opened */ - if (NULL == file) - HGOTO_DONE(SUCCEED); + {/* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL){file = (driver->open)(name, flags, fapl_id, maxaddr); } - else - { - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) +H5_AFTER_USER_CB +(FAIL) +} +H5E_RESUME_ERRORS + +/* Check if file was not opened */ +if (NULL == file) + HGOTO_DONE(SUCCEED); +} +else +{ + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) { file = (driver->open)(name, flags, fapl_id, maxaddr); } - H5_AFTER_USER_CB(FAIL) - if (NULL == file) - HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "can't open file"); - } + H5_AFTER_USER_CB(FAIL) + if (NULL == file) + HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "can't open file"); +} - /* Set the file access flags */ - file->access_flags = flags; +/* Set the file access flags */ +file->access_flags = flags; - /* Fill in public fields. We must increment the reference count on the - * driver ID to prevent it from being freed while this file is open. - */ - file->driver_id = driver_prop.driver_id; - if (H5I_inc_ref(file->driver_id, false) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); - file->cls = driver; - file->maxaddr = maxaddr; - if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); - if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); - - /* Retrieve the VFL driver feature flags */ - if (H5FD__query(file, &file->feature_flags) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); - - /* Increment the global serial number & assign it to this H5FD_t object */ - if (++H5FD_file_serial_no_g == 0) - /* (Just error out if we wrap around for now...) */ - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); - file->fileno = H5FD_file_serial_no_g; - - /* Start with base address set to 0 */ - /* (This will be changed later, when the superblock is located) */ - file->base_addr = 0; - - /* Set 'out' parameter */ - *_file = file; +/* Fill in public fields. We must increment the reference count on the + * driver ID to prevent it from being freed while this file is open. + */ +file->driver_id = driver_prop.driver_id; +if (H5I_inc_ref(file->driver_id, false) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); +file->cls = driver; +file->maxaddr = maxaddr; +if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); +if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); + +/* Retrieve the VFL driver feature flags */ +if (H5FD__query(file, &file->feature_flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); + +/* Increment the global serial number & assign it to this H5FD_t object */ +if (++H5FD_file_serial_no_g == 0) + /* (Just error out if we wrap around for now...) */ + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); +file->fileno = H5FD_file_serial_no_g; + +/* Start with base address set to 0 */ +/* (This will be changed later, when the superblock is located) */ +file->base_addr = 0; + +/* Set 'out' parameter */ +*_file = file; done : /* Can't cleanup 'file' information, since we don't know what type it is */ @@ -1064,13 +1063,13 @@ H5FD_close(H5FD_t *file) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Dispatch to the driver for actual close. If the driver fails to - * close the file then the file will be in an unusable state. - */ - assert(driver->close); - ret_value = (driver->close)(file); - } + { + /* Dispatch to the driver for actual close. If the driver fails to + * close the file then the file will be in an unusable state. + */ + assert(driver->close); + ret_value = (driver->close)(file); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "close failed"); @@ -1152,10 +1151,10 @@ H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOCHECK - { - /* Dispatch to driver */ - ret_value = (f1->cls->cmp)(f1, f2); - } + { + /* Dispatch to driver */ + ret_value = (f1->cls->cmp)(f1, f2); + } H5_AFTER_USER_CB_NOCHECK done: @@ -1219,9 +1218,9 @@ H5FD__query(const H5FD_t *file, unsigned long *flags /*out*/) if (file->cls->query) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->query)(file, flags); - } + { + ret_value = (file->cls->query)(file, flags); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to query feature flags"); @@ -1577,9 +1576,9 @@ H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map) if (file->cls->get_type_map) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->get_type_map)(file, type_map); - } + { + ret_value = (file->cls->get_type_map)(file, type_map); + } H5_AFTER_USER_CB(FAIL) /* Retrieve type mapping for this file */ if (ret_value < 0) @@ -2479,9 +2478,9 @@ H5FD_flush(H5FD_t *file, bool closing) if (file->cls->flush) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->flush)(file, H5CX_get_dxpl(), closing); - } + { + ret_value = (file->cls->flush)(file, H5CX_get_dxpl(), closing); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver flush request failed"); @@ -2552,9 +2551,9 @@ H5FD_truncate(H5FD_t *file, bool closing) if (file->cls->truncate) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->truncate)(file, H5CX_get_dxpl(), closing); - } + { + ret_value = (file->cls->truncate)(file, H5CX_get_dxpl(), closing); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "driver truncate request failed"); @@ -2618,9 +2617,9 @@ H5FD_lock(H5FD_t *file, bool rw) if (file->cls->lock) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->lock)(file, rw); - } + { + ret_value = (file->cls->lock)(file, rw); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "driver lock request failed"); @@ -2684,9 +2683,9 @@ H5FD_unlock(H5FD_t *file) if (file->cls->unlock) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->unlock)(file); - } + { + ret_value = (file->cls->unlock)(file); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "driver unlock request failed"); @@ -2781,9 +2780,9 @@ H5FD_ctl(H5FD_t *file, uint64_t op_code, uint64_t flags, const void *input, void if (file->cls->ctl) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->ctl)(file, op_code, flags, input, output); - } + { + ret_value = (file->cls->ctl)(file, op_code, flags, input, output); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "VFD ctl request failed"); @@ -2891,9 +2890,9 @@ H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->get_handle)(file, fapl_id, file_handle); - } + { + ret_value = (file->cls->get_handle)(file, fapl_id, file_handle); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file handle for file driver"); diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 6a4ea5b0ef8..f2c2a820e54 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -826,10 +826,10 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr if (file->fi_callbacks.image_malloc) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - file->mem = file->fi_callbacks.image_malloc(size, H5FD_FILE_IMAGE_OP_FILE_OPEN, - file->fi_callbacks.udata); - } + { + file->mem = file->fi_callbacks.image_malloc(size, H5FD_FILE_IMAGE_OP_FILE_OPEN, + file->fi_callbacks.udata); + } H5_AFTER_USER_CB(NULL) if (NULL == file->mem) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "image malloc callback failed"); @@ -849,11 +849,11 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - tmp = file->fi_callbacks.image_memcpy(file->mem, file_image_info.buffer, size, - H5FD_FILE_IMAGE_OP_FILE_OPEN, - file->fi_callbacks.udata); - } + { + tmp = file->fi_callbacks.image_memcpy(file->mem, file_image_info.buffer, size, + H5FD_FILE_IMAGE_OP_FILE_OPEN, + file->fi_callbacks.udata); + } H5_AFTER_USER_CB(NULL) if (file->mem != tmp) HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, NULL, "image_memcpy callback failed"); @@ -993,10 +993,10 @@ H5FD__core_close(H5FD_t *_file) if (file->fi_callbacks.image_free) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = file->fi_callbacks.image_free(file->mem, H5FD_FILE_IMAGE_OP_FILE_CLOSE, - file->fi_callbacks.udata); - } + { + ret_value = file->fi_callbacks.image_free(file->mem, H5FD_FILE_IMAGE_OP_FILE_CLOSE, + file->fi_callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "image_free callback failed"); @@ -1368,10 +1368,10 @@ H5FD__core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN if (file->fi_callbacks.image_realloc) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - x = file->fi_callbacks.image_realloc(file->mem, new_eof, H5FD_FILE_IMAGE_OP_FILE_RESIZE, - file->fi_callbacks.udata); - } + { + x = file->fi_callbacks.image_realloc(file->mem, new_eof, H5FD_FILE_IMAGE_OP_FILE_RESIZE, + file->fi_callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (NULL == x) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, @@ -1532,10 +1532,10 @@ H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool closing) if (file->fi_callbacks.image_realloc) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - x = file->fi_callbacks.image_realloc(file->mem, new_eof, H5FD_FILE_IMAGE_OP_FILE_RESIZE, - file->fi_callbacks.udata); - } + { + x = file->fi_callbacks.image_realloc( + file->mem, new_eof, H5FD_FILE_IMAGE_OP_FILE_RESIZE, file->fi_callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (NULL == x) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index fa65dc594cc..939a3ac5c4a 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -1488,9 +1488,9 @@ H5FD__family_delete(const char *filename, hid_t fapl_id) herr_t delete_error; H5E_PAUSE_ERRORS - { - delete_error = H5FD_delete(member_name, memb_fapl_id); - } + { + delete_error = H5FD_delete(member_name, memb_fapl_id); + } H5E_RESUME_ERRORS if (delete_error < 0) break; diff --git a/src/H5FDint.c b/src/H5FDint.c index a4ff1f1a965..bcb79e3fee6 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -247,9 +247,9 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, void *buf /* /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - eoa = (file->cls->get_eoa)(file, type); - } + { + eoa = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(FAIL) if (!H5_addr_defined(eoa)) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed"); @@ -262,10 +262,10 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, void *buf /* /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Dispatch to driver */ - ret_value = (file->cls->read)(file, type, dxpl_id, addr + file->base_addr, size, buf); - } + { + /* Dispatch to driver */ + ret_value = (file->cls->read)(file, type, dxpl_id, addr + file->base_addr, size, buf); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed"); @@ -320,9 +320,9 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, const void /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - eoa = (file->cls->get_eoa)(file, type); - } + { + eoa = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(FAIL) if (!H5_addr_defined(eoa)) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed"); @@ -333,10 +333,10 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, const void /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Dispatch to driver */ - ret_value = (file->cls->write)(file, type, dxpl_id, addr + file->base_addr, size, buf); - } + { + /* Dispatch to driver */ + ret_value = (file->cls->write)(file, type, dxpl_id, addr + file->base_addr, size, buf); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed"); @@ -479,9 +479,9 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - eoa = (file->cls->get_eoa)(file, type); - } + { + eoa = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(FAIL) if (!H5_addr_defined(eoa)) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed"); @@ -505,9 +505,9 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs if (file->cls->read_vector) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->read_vector)(file, dxpl_id, count, types, addrs, sizes, bufs); - } + { + ret_value = (file->cls->read_vector)(file, dxpl_id, count, types, addrs, sizes, bufs); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read vector request failed"); @@ -554,9 +554,9 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->read)(file, type, dxpl_id, addrs[i], size, bufs[i]); - } + { + ret_value = (file->cls->read)(file, type, dxpl_id, addrs[i], size, bufs[i]); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed"); @@ -703,9 +703,9 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - eoa = (file->cls->get_eoa)(file, type); - } + { + eoa = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(FAIL) if (!H5_addr_defined(eoa)) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed"); @@ -721,9 +721,9 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr if (file->cls->write_vector) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->write_vector)(file, dxpl_id, count, types, addrs, sizes, bufs); - } + { + ret_value = (file->cls->write_vector)(file, dxpl_id, count, types, addrs, sizes, bufs); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write vector request failed"); @@ -770,9 +770,9 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->write)(file, type, dxpl_id, addrs[i], size, bufs[i]); - } + { + ret_value = (file->cls->write)(file, type, dxpl_id, addrs[i], size, bufs[i]); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver write request failed"); @@ -1030,11 +1030,11 @@ H5FD__read_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_t else { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Issue scalar read call */ - ret_value = (file->cls->read)(file, type, dxpl_id, offsets[i] + file_off[file_seq_i], - io_len, (void *)((uint8_t *)buf + mem_off[mem_seq_i])); - } + { + /* Issue scalar read call */ + ret_value = (file->cls->read)(file, type, dxpl_id, offsets[i] + file_off[file_seq_i], + io_len, (void *)((uint8_t *)buf + mem_off[mem_seq_i])); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed"); @@ -1078,10 +1078,10 @@ H5FD__read_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_t H5_CHECK_OVERFLOW(vec_arr_nused, size_t, uint32_t); /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->read_vector)(file, dxpl_id, (uint32_t)vec_arr_nused, types, addrs, sizes, - vec_bufs); - } + { + ret_value = (file->cls->read_vector)(file, dxpl_id, (uint32_t)vec_arr_nused, types, addrs, + sizes, vec_bufs); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read vector request failed"); @@ -1245,9 +1245,9 @@ H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_s /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - eoa = (file->cls->get_eoa)(file, type); - } + { + eoa = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(FAIL) if (!H5_addr_defined(eoa)) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed"); @@ -1286,10 +1286,10 @@ H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_s /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->read_selection)(file, type, dxpl_id, count, mem_space_ids, file_space_ids, - offsets, element_sizes, bufs); - } + { + ret_value = (file->cls->read_selection)(file, type, dxpl_id, count, mem_space_ids, + file_space_ids, offsets, element_sizes, bufs); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read selection request failed"); @@ -1431,9 +1431,9 @@ H5FD_read_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - eoa = (file->cls->get_eoa)(file, type); - } + { + eoa = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(FAIL) if (!H5_addr_defined(eoa)) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed"); @@ -1450,10 +1450,10 @@ H5FD_read_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->read_selection)(file, type, dxpl_id, count, mem_space_ids, file_space_ids, - offsets, element_sizes, bufs); - } + { + ret_value = (file->cls->read_selection)(file, type, dxpl_id, count, mem_space_ids, + file_space_ids, offsets, element_sizes, bufs); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read selection request failed"); @@ -1727,12 +1727,12 @@ H5FD__write_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_ else { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Issue scalar write call */ - ret_value = - (file->cls->write)(file, type, dxpl_id, offsets[i] + file_off[file_seq_i], io_len, - (const void *)((const uint8_t *)buf + mem_off[mem_seq_i])); - } + { + /* Issue scalar write call */ + ret_value = + (file->cls->write)(file, type, dxpl_id, offsets[i] + file_off[file_seq_i], io_len, + (const void *)((const uint8_t *)buf + mem_off[mem_seq_i])); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed"); @@ -1776,10 +1776,10 @@ H5FD__write_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_ H5_CHECK_OVERFLOW(vec_arr_nused, size_t, uint32_t); /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->write_vector)(file, dxpl_id, (uint32_t)vec_arr_nused, types, addrs, sizes, - vec_bufs); - } + { + ret_value = (file->cls->write_vector)(file, dxpl_id, (uint32_t)vec_arr_nused, types, addrs, + sizes, vec_bufs); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write vector request failed"); @@ -1933,9 +1933,9 @@ H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_ */ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - eoa = (file->cls->get_eoa)(file, type); - } + { + eoa = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(FAIL) if (!H5_addr_defined(eoa)) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed"); @@ -1973,10 +1973,10 @@ H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->write_selection)(file, type, dxpl_id, count, mem_space_ids, - file_space_ids, offsets, element_sizes, bufs); - } + { + ret_value = (file->cls->write_selection)(file, type, dxpl_id, count, mem_space_ids, + file_space_ids, offsets, element_sizes, bufs); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write selection request failed"); @@ -2109,9 +2109,9 @@ H5FD_write_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_ */ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - eoa = (file->cls->get_eoa)(file, type); - } + { + eoa = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(FAIL) if (!H5_addr_defined(eoa)) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed"); @@ -2127,10 +2127,10 @@ H5FD_write_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (file->cls->write_selection)(file, type, dxpl_id, count, mem_space_ids, - file_space_ids, offsets, element_sizes, bufs); - } + { + ret_value = (file->cls->write_selection)(file, type, dxpl_id, count, mem_space_ids, + file_space_ids, offsets, element_sizes, bufs); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write selection request failed"); @@ -2416,10 +2416,10 @@ H5FD_set_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Dispatch to driver, convert to absolute address */ - ret_value = (file->cls->set_eoa)(file, type, addr + file->base_addr); - } + { + /* Dispatch to driver, convert to absolute address */ + ret_value = (file->cls->set_eoa)(file, type, addr + file->base_addr); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver set_eoa request failed"); @@ -2455,10 +2455,10 @@ H5FD_get_eoa(const H5FD_t *file, H5FD_mem_t type) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(HADDR_UNDEF) - { - /* Dispatch to driver */ - ret_value = (file->cls->get_eoa)(file, type); - } + { + /* Dispatch to driver */ + ret_value = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(HADDR_UNDEF) if (!H5_addr_defined(ret_value)) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed"); @@ -2499,9 +2499,9 @@ H5FD_get_eof(const H5FD_t *file, H5FD_mem_t type) if (file->cls->get_eof) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(HADDR_UNDEF) - { - ret_value = (file->cls->get_eof)(file, type); - } + { + ret_value = (file->cls->get_eof)(file, type); + } H5_AFTER_USER_CB(HADDR_UNDEF) if (!H5_addr_defined(ret_value)) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "driver get_eof request failed"); @@ -2542,9 +2542,9 @@ H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags /*out*/) if (driver->query) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(FAIL) - { - ret_value = (driver->query)(NULL, flags); - } + { + ret_value = (driver->query)(NULL, flags); + } H5_AFTER_USER_CB_NOERR(FAIL) } else @@ -3061,10 +3061,10 @@ H5FD_delete(const char *filename, hid_t fapl_id) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Dispatch to file driver */ - ret_value = (driver->del)(filename, fapl_id); - } + { + /* Dispatch to file driver */ + ret_value = (driver->del)(filename, fapl_id); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "delete failed"); diff --git a/src/H5FDspace.c b/src/H5FDspace.c index 747fdfb9bd2..cdd379e632e 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -99,10 +99,10 @@ H5FD__extend(H5FD_t *file, H5FD_mem_t type, hsize_t size) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(HADDR_UNDEF) - { - /* Get current end-of-allocated space address */ - eoa = (file->cls->get_eoa)(file, type); - } + { + /* Get current end-of-allocated space address */ + eoa = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(HADDR_UNDEF) /* Check for overflow when extending */ @@ -114,11 +114,11 @@ H5FD__extend(H5FD_t *file, H5FD_mem_t type, hsize_t size) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(HADDR_UNDEF) - { - /* Extend the end-of-allocated space address */ - eoa += size; - status = (file->cls->set_eoa)(file, type, eoa); - } + { + /* Extend the end-of-allocated space address */ + eoa += size; + status = (file->cls->set_eoa)(file, type, eoa); + } H5_AFTER_USER_CB(HADDR_UNDEF) if (status < 0) HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "file allocation request failed"); @@ -165,9 +165,9 @@ H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, haddr_t *frag_addr if (file->cls->query) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(HADDR_UNDEF) - { - status = (file->cls->query)(file, &flags); - } + { + status = (file->cls->query)(file, &flags); + } H5_AFTER_USER_CB(HADDR_UNDEF) if (status < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "driver query request failed"); @@ -178,10 +178,10 @@ H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, haddr_t *frag_addr /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(HADDR_UNDEF) - { - /* Get current end-of-allocated space address */ - eoa = (file->cls->get_eoa)(file, type); - } + { + /* Get current end-of-allocated space address */ + eoa = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(HADDR_UNDEF) /* Compute extra space to allocate, if this should be aligned */ @@ -207,9 +207,10 @@ H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, haddr_t *frag_addr if (file->cls->alloc) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(HADDR_UNDEF) - { - ret_value = (file->cls->alloc)(file, type, H5CX_get_dxpl(), use_alloc_size ? size : size + extra); - } + { + ret_value = + (file->cls->alloc)(file, type, H5CX_get_dxpl(), use_alloc_size ? size : size + extra); + } H5_AFTER_USER_CB(HADDR_UNDEF) if (!H5_addr_defined(ret_value)) HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver allocation request failed"); @@ -325,10 +326,10 @@ H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size) #endif /* H5FD_ALLOC_DEBUG */ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Dispatch to driver */ - ret_value = (file->cls->free)(file, type, H5CX_get_dxpl(), addr, size); - } + { + /* Dispatch to driver */ + ret_value = (file->cls->free)(file, type, H5CX_get_dxpl(), addr, size); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "driver free request failed"); @@ -341,10 +342,10 @@ H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Dispatch to driver */ - eoa = (file->cls->get_eoa)(file, type); - } + { + /* Dispatch to driver */ + eoa = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(FAIL) #ifdef H5FD_ALLOC_DEBUG fprintf(stderr, "%s: eoa = %" PRIuHADDR "\n", __func__, eoa); @@ -355,10 +356,10 @@ H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size) #endif /* H5FD_ALLOC_DEBUG */ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Dispatch to driver */ - ret_value = (file->cls->set_eoa)(file, type, addr); - } + { + /* Dispatch to driver */ + ret_value = (file->cls->set_eoa)(file, type, addr); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "set end of space allocation request failed"); @@ -448,10 +449,10 @@ H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, hsize_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Retrieve the end of the address space */ - eoa = (file->cls->get_eoa)(file, type); - } + { + /* Retrieve the end of the address space */ + eoa = (file->cls->get_eoa)(file, type); + } H5_AFTER_USER_CB(FAIL) if (!H5_addr_defined(eoa)) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_eoa request failed"); diff --git a/src/H5Fint.c b/src/H5Fint.c index 618ff9bc0ab..9f2b41f572f 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -3504,9 +3504,9 @@ H5F_object_flush_cb(H5F_t *f, hid_t obj_id) if (f->shared->object_flush.func) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = f->shared->object_flush.func(obj_id, f->shared->object_flush.udata); - } + { + ret_value = f->shared->object_flush.func(obj_id, f->shared->object_flush.udata); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "object flush callback returns error"); diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 1a84c455f83..095f17024b6 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -364,9 +364,9 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, bool initial_read) /* Try detecting file's signature */ /* (Don't leave before Bcast, to avoid hang on error) */ H5E_PAUSE_ERRORS - { - H5FD_locate_signature(file, &super_addr); - } + { + H5FD_locate_signature(file, &super_addr); + } H5E_RESUME_ERRORS } /* end if */ diff --git a/src/H5Gint.c b/src/H5Gint.c index 8f5712b19f1..34dbfb97331 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -859,10 +859,10 @@ H5G__iterate_cb(const H5O_link_t *lnk, void *_udata) case H5G_LINK_OP_OLD: /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(H5_ITER_ERROR) - { - /* Make the old-type application callback */ - ret_value = (udata->lnk_op.op_func.op_old)(udata->gid, lnk->name, udata->op_data); - } + { + /* Make the old-type application callback */ + ret_value = (udata->lnk_op.op_func.op_old)(udata->gid, lnk->name, udata->op_data); + } H5_AFTER_USER_CB(H5_ITER_ERROR) break; #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -876,10 +876,10 @@ H5G__iterate_cb(const H5O_link_t *lnk, void *_udata) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(H5_ITER_ERROR) - { - /* Make the application callback */ - ret_value = (udata->lnk_op.op_func.op_new)(udata->gid, lnk->name, &info, udata->op_data); - } + { + /* Make the application callback */ + ret_value = (udata->lnk_op.op_func.op_new)(udata->gid, lnk->name, &info, udata->op_data); + } H5_AFTER_USER_CB(H5_ITER_ERROR) } break; @@ -1022,10 +1022,10 @@ H5G__visit_cb(const H5O_link_t *lnk, void *_udata) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(H5_ITER_ERROR) - { - /* Make the application callback */ - ret_value = (udata->op)(udata->gid, udata->path, &info, udata->op_data); - } + { + /* Make the application callback */ + ret_value = (udata->op)(udata->gid, udata->path, &info, udata->op_data); + } H5_AFTER_USER_CB(H5_ITER_ERROR) /* Check for doing more work */ diff --git a/src/H5Glink.c b/src/H5Glink.c index e9a869147f3..2888481ae69 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -235,13 +235,13 @@ H5G_link_to_info(const H5O_loc_t *link_loc, const H5O_link_t *lnk, H5L_info2_t * /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the link's query routine to retrieve the user-defined link's value size */ - /* (in case the query routine packs/unpacks the link value in some way that changes - * its size) */ - cb_ret = (link_class->query_func)(lnk->name, lnk->u.ud.udata, lnk->u.ud.size, NULL, - (size_t)0); - } + { + /* Call the link's query routine to retrieve the user-defined link's value size */ + /* (in case the query routine packs/unpacks the link value in some way that + * changes its size) */ + cb_ret = (link_class->query_func)(lnk->name, lnk->u.ud.udata, lnk->u.ud.size, + NULL, (size_t)0); + } H5_AFTER_USER_CB(FAIL) if (cb_ret < 0) HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, diff --git a/src/H5Gnode.c b/src/H5Gnode.c index d647096b18c..336eb76d6cc 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -1420,9 +1420,9 @@ H5G_node_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, had /* Try loading symbol table node */ H5E_PAUSE_ERRORS - { - sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG); - } + { + sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG); + } H5E_RESUME_ERRORS if (sn) { unsigned u; /* Local index variable */ diff --git a/src/H5Gstab.c b/src/H5Gstab.c index c86406422b7..5c071b25f9c 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -975,9 +975,9 @@ H5G__stab_valid(H5O_loc_t *grp_oloc, H5O_stab_t *alt_stab) /* Check if the symbol table message's b-tree address is valid */ H5E_PAUSE_ERRORS - { - bt_status = H5B_valid(grp_oloc->file, H5B_SNODE, stab.btree_addr); - } + { + bt_status = H5B_valid(grp_oloc->file, H5B_SNODE, stab.btree_addr); + } H5E_RESUME_ERRORS if (bt_status < 0) { @@ -994,9 +994,9 @@ H5G__stab_valid(H5O_loc_t *grp_oloc, H5O_stab_t *alt_stab) /* Check if the symbol table message's heap address is valid */ H5E_PAUSE_ERRORS - { - heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG); - } + { + heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG); + } H5E_RESUME_ERRORS if (NULL == heap) { diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 88de0373096..89fac987c72 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -190,28 +190,28 @@ H5G__traverse_ud(const H5G_loc_t *grp_loc /*in,out*/, const H5O_link_t *lnk, H5G if (link_class->version == H5L_LINK_CLASS_T_VERS_0) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - cb_return = (((const H5L_class_0_t *)link_class)->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, - lnk->u.ud.size, H5CX_get_lapl()); - } + { + cb_return = (((const H5L_class_0_t *)link_class)->trav_func)( + lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, H5CX_get_lapl()); + } H5_AFTER_USER_CB(FAIL) } else { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - cb_return = (link_class->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, - H5CX_get_lapl(), H5CX_get_dxpl()); - } + { + cb_return = (link_class->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, + H5CX_get_lapl(), H5CX_get_dxpl()); + } H5_AFTER_USER_CB(FAIL) } #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - cb_return = (link_class->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, - H5CX_get_lapl(), H5CX_get_dxpl()); - } + { + cb_return = (link_class->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, + H5CX_get_lapl(), H5CX_get_dxpl()); + } H5_AFTER_USER_CB(FAIL) #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5I.c b/src/H5I.c index 3870a297227..dab4eed59a7 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -628,9 +628,9 @@ H5I__search_cb(void *obj, hid_t id, void *_udata) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) - { - cb_ret_val = (*udata->app_cb)(obj, id, udata->app_key); - } + { + cb_ret_val = (*udata->app_cb)(obj, id, udata->app_key); + } H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) /* Set the return value based on the callback's return value */ @@ -717,10 +717,10 @@ H5I__iterate_pub_cb(void H5_ATTR_UNUSED *obj, hid_t id, void *_udata) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) - { - /* Invoke the callback */ - cb_ret_val = (*udata->op)(id, udata->op_data); - } + { + /* Invoke the callback */ + cb_ret_val = (*udata->op)(id, udata->op_data); + } H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) /* Set the return value based on the callback's return value */ diff --git a/src/H5Iint.c b/src/H5Iint.c index d5a50e3d22b..fc59b1583bd 100644 --- a/src/H5Iint.c +++ b/src/H5Iint.c @@ -453,10 +453,10 @@ H5I__mark_node(void *_info, void H5_ATTR_UNUSED *key, void *_udata) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOCHECK - { - /* Discard the future object */ - status = (info->discard_cb)(info->u.object); - } + { + /* Discard the future object */ + status = (info->discard_cb)(info->u.object); + } H5_AFTER_USER_CB_NOCHECK if (status < 0) { if (udata->force) { @@ -476,9 +476,9 @@ H5I__mark_node(void *_info, void H5_ATTR_UNUSED *key, void *_udata) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOCHECK - { - status = (udata->type_info->cls->free_func)(info->u.object, H5_REQUEST_NULL); - } + { + status = (udata->type_info->cls->free_func)(info->u.object, H5_REQUEST_NULL); + } H5_AFTER_USER_CB_NOCHECK if (status < 0) { if (udata->force) { @@ -1072,9 +1072,9 @@ H5I__dec_ref(hid_t id, void **request) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB((-1)) - { - status = (type_info->cls->free_func)(info->u.object, request); - } + { + status = (type_info->cls->free_func)(info->u.object, request); + } H5_AFTER_USER_CB((-1)) if (status >= 0) @@ -1567,9 +1567,9 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) /* Invoke callback function */ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) - { - cb_ret_val = (*udata->user_func)((void *)object, info->id, udata->user_udata); - } + { + cb_ret_val = (*udata->user_func)((void *)object, info->id, udata->user_udata); + } H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) /* Set the return value based on the callback's return value */ @@ -1698,10 +1698,10 @@ H5I__find_id(hid_t id) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(NULL) - { - /* Invoke the realize callback, to get the actual object */ - status = (id_info->realize_cb)(id_info->u.object, &actual_id); - } + { + /* Invoke the realize callback, to get the actual object */ + status = (id_info->realize_cb)(id_info->u.object, &actual_id); + } H5_AFTER_USER_CB_NOERR(NULL) if (status < 0) HGOTO_DONE(NULL); @@ -1720,10 +1720,10 @@ H5I__find_id(hid_t id) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(NULL) - { - /* Discard the future object */ - status = (id_info->discard_cb)(future_object); - } + { + /* Discard the future object */ + status = (id_info->discard_cb)(future_object); + } H5_AFTER_USER_CB_NOERR(NULL) if (status < 0) HGOTO_DONE(NULL); diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 320d3e114b6..793825d1c3d 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -195,10 +195,10 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, cons /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (cb_info.func)(parent_file_name, parent_group_name, file_name, obj_name, &intent, - fapl_id, cb_info.user_data); - } + { + ret_value = (cb_info.func)(parent_file_name, parent_group_name, file_name, obj_name, &intent, + fapl_id, cb_info.user_data); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, H5I_INVALID_HID, "traversal operator failed"); diff --git a/src/H5Lint.c b/src/H5Lint.c index 65d38e34a5c..e8d5e150241 100644 --- a/src/H5Lint.c +++ b/src/H5Lint.c @@ -643,11 +643,11 @@ H5L__link_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t H5_AT /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Make callback */ - ret_value = (link_class->create_func)(name, grp_id, udata->lnk->u.ud.udata, - udata->lnk->u.ud.size, H5P_DEFAULT); - } + { + /* Make callback */ + ret_value = (link_class->create_func)(name, grp_id, udata->lnk->u.ud.udata, + udata->lnk->u.ud.size, H5P_DEFAULT); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "link creation callback failed"); @@ -984,9 +984,9 @@ H5L__get_val_real(const H5O_link_t *lnk, void *buf, size_t size) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - len = (link_class->query_func)(lnk->name, lnk->u.ud.udata, lnk->u.ud.size, buf, size); - } + { + len = (link_class->query_func)(lnk->name, lnk->u.ud.udata, lnk->u.ud.size, buf, size); + } H5_AFTER_USER_CB(FAIL) if (len < 0) HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "query callback returned failure"); @@ -1394,10 +1394,10 @@ H5L__move_dest_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t if (udata->copy) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (link_class->copy_func)(udata->lnk->name, grp_id, udata->lnk->u.ud.udata, - udata->lnk->u.ud.size); - } + { + ret_value = (link_class->copy_func)(udata->lnk->name, grp_id, udata->lnk->u.ud.udata, + udata->lnk->u.ud.size); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "UD copy callback returned error"); @@ -1405,10 +1405,10 @@ H5L__move_dest_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t else { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (link_class->move_func)(udata->lnk->name, grp_id, udata->lnk->u.ud.udata, - udata->lnk->u.ud.size); - } + { + ret_value = (link_class->move_func)(udata->lnk->name, grp_id, udata->lnk->u.ud.udata, + udata->lnk->u.ud.size); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "UD move callback returned error"); diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index d9b3efca383..3917ad15989 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -1509,9 +1509,9 @@ H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst /*i if (cpy_info->mcdt_cb) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - search_cb_ret = cpy_info->mcdt_cb(cpy_info->mcdt_ud); - } + { + search_cb_ret = cpy_info->mcdt_cb(cpy_info->mcdt_ud); + } H5_AFTER_USER_CB(FAIL) if (H5O_MCDT_SEARCH_ERROR == search_cb_ret) HGOTO_ERROR(H5E_OHDR, H5E_CALLBACK, FAIL, "callback returned error"); diff --git a/src/H5Oint.c b/src/H5Oint.c index 55e1235d1a0..bf62ad35a9e 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -2574,10 +2574,10 @@ H5O__visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info2_t *l /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Make the application callback */ - ret_value = (udata->op)(udata->obj_id, name, &oinfo, udata->op_data); - } + { + /* Make the application callback */ + ret_value = (udata->op)(udata->obj_id, name, &oinfo, udata->op_data); + } H5_AFTER_USER_CB(FAIL) /* Check for continuing to visit objects */ diff --git a/src/H5Olink.c b/src/H5Olink.c index 173e744c049..1aa5d14955c 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -638,10 +638,10 @@ H5O_link_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call user-defined link's 'delete' callback */ - ret_value = (link_class->del_func)(lnk->name, file_id, lnk->u.ud.udata, lnk->u.ud.size); - } + { + /* Call user-defined link's 'delete' callback */ + ret_value = (link_class->del_func)(lnk->name, file_id, lnk->u.ud.udata, lnk->u.ud.size); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_OHDR, H5E_CALLBACK, FAIL, "link deletion callback returned failure"); diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 7e461987570..9550a071be3 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -354,11 +354,11 @@ H5P__encode_cb(H5P_genprop_t *prop, void *_udata) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(H5_ITER_ERROR) - { - /* Encode (or not, if *(udata->pp) is NULL) the property value */ - prop_value_len = 0; - ret_value = (prop->encode)(prop->value, udata->pp, &prop_value_len); - } + { + /* Encode (or not, if *(udata->pp) is NULL) the property value */ + prop_value_len = 0; + ret_value = (prop->encode)(prop->value, udata->pp, &prop_value_len); + } H5_AFTER_USER_CB(H5_ITER_ERROR) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, H5_ITER_ERROR, "property encoding routine failed"); @@ -776,9 +776,9 @@ H5P__decode(const void *buf) if (prop->decode) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (prop->decode)((const void **)&p, value_buf); - } + { + ret_value = (prop->decode)((const void **)&p, value_buf); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTDECODE, FAIL, diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 3cd4481bd55..a07018a9214 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -2995,10 +2995,10 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) if (image_info.callbacks.image_free) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = image_info.callbacks.image_free( - image_info.buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, image_info.callbacks.udata); - } + { + ret_value = image_info.callbacks.image_free( + image_info.buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, image_info.callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed"); @@ -3013,10 +3013,10 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) if (image_info.callbacks.image_malloc) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - image_info.buffer = image_info.callbacks.image_malloc( - buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, image_info.callbacks.udata); - } + { + image_info.buffer = image_info.callbacks.image_malloc( + buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, image_info.callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (NULL == image_info.buffer) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "image malloc callback failed"); @@ -3030,11 +3030,11 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - tmp = image_info.callbacks.image_memcpy(image_info.buffer, buf_ptr, buf_len, - H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, - image_info.callbacks.udata); - } + { + tmp = image_info.callbacks.image_memcpy(image_info.buffer, buf_ptr, buf_len, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, + image_info.callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (image_info.buffer != tmp) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed"); @@ -3115,10 +3115,11 @@ H5Pget_file_image(hid_t fapl_id, void **buf /*out*/, size_t *buf_len /*out*/) if (image_info.callbacks.image_malloc) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - copy_ptr = image_info.callbacks.image_malloc( - image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, image_info.callbacks.udata); - } + { + copy_ptr = image_info.callbacks.image_malloc(image_info.size, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, + image_info.callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (NULL == copy_ptr) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "image malloc callback failed"); @@ -3132,11 +3133,11 @@ H5Pget_file_image(hid_t fapl_id, void **buf /*out*/, size_t *buf_len /*out*/) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - tmp = image_info.callbacks.image_memcpy(copy_ptr, image_info.buffer, image_info.size, - H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, - image_info.callbacks.udata); - } + { + tmp = image_info.callbacks.image_memcpy(copy_ptr, image_info.buffer, image_info.size, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, + image_info.callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (copy_ptr != tmp) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed"); @@ -3207,9 +3208,9 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = info.callbacks.udata_free(info.callbacks.udata); - } + { + ret_value = info.callbacks.udata_free(info.callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "udata_free callback failed"); @@ -3224,9 +3225,9 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - info.callbacks.udata = callbacks_ptr->udata_copy(callbacks_ptr->udata); - } + { + info.callbacks.udata = callbacks_ptr->udata_copy(callbacks_ptr->udata); + } H5_AFTER_USER_CB(FAIL) if (NULL == info.callbacks.udata) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't copy the supplied udata"); @@ -3243,9 +3244,9 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback if (copied_udata) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = callbacks_ptr->udata_free(info.callbacks.udata); - } + { + ret_value = callbacks_ptr->udata_free(info.callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HDONE_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "udata_free callback failed"); @@ -3300,9 +3301,9 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - callbacks->udata = info.callbacks.udata_copy(info.callbacks.udata); - } + { + callbacks->udata = info.callbacks.udata_copy(info.callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (NULL == callbacks->udata) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't copy udata"); @@ -3353,10 +3354,10 @@ H5P__file_image_info_copy(void *value) if (info->callbacks.image_malloc) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - info->buffer = info->callbacks.image_malloc( - info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata); - } + { + info->buffer = info->callbacks.image_malloc( + info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (NULL == info->buffer) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "image malloc callback failed"); @@ -3370,11 +3371,11 @@ H5P__file_image_info_copy(void *value) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - tmp = info->callbacks.image_memcpy(info->buffer, old_buffer, info->size, - H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, - info->callbacks.udata); - } + { + tmp = info->callbacks.image_memcpy(info->buffer, old_buffer, info->size, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, + info->callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (info->buffer != tmp) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "image_memcpy callback failed"); @@ -3392,9 +3393,9 @@ H5P__file_image_info_copy(void *value) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - info->callbacks.udata = info->callbacks.udata_copy(old_udata); - } + { + info->callbacks.udata = info->callbacks.udata_copy(old_udata); + } H5_AFTER_USER_CB(FAIL) } /* end if */ } /* end if */ @@ -3435,10 +3436,10 @@ H5P__file_image_info_free(void *value) if (info->callbacks.image_free) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (*info->callbacks.image_free)( - info->buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, info->callbacks.udata); - } + { + ret_value = (*info->callbacks.image_free)( + info->buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, info->callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "image_free callback failed"); @@ -3453,9 +3454,9 @@ H5P__file_image_info_free(void *value) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "udata_free not defined"); /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (*info->callbacks.udata_free)(info->callbacks.udata); - } + { + ret_value = (*info->callbacks.udata_free)(info->callbacks.udata); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "udata_free callback failed"); diff --git a/src/H5Pint.c b/src/H5Pint.c index 82bb92d16f5..0cacaf79527 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -806,10 +806,10 @@ H5P__do_prop_cb1(H5SL_t *slist, H5P_genprop_t *prop, H5P_prp_cb1_t cb) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call "type 1" callback ('create', 'copy' or 'close') */ - ret_value = cb(prop->name, prop->size, tmp_value); - } + { + /* Call "type 1" callback ('create', 'copy' or 'close') */ + ret_value = cb(prop->name, prop->size, tmp_value); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "Property callback failed"); @@ -1026,9 +1026,9 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, bool app_ref) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(H5I_INVALID_HID) - { - status = (new_prop->copy)(new_prop->name, new_prop->size, new_prop->value); - } + { + status = (new_prop->copy)(new_prop->name, new_prop->size, new_prop->value); + } H5_AFTER_USER_CB(H5I_INVALID_HID) if (status < 0) { H5P__free_prop(new_prop); @@ -1122,9 +1122,10 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, bool app_ref) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(H5I_INVALID_HID) - { - status = (tclass->copy_func)(new_plist_id, old_plist->plist_id, old_plist->pclass->copy_data); - } + { + status = + (tclass->copy_func)(new_plist_id, old_plist->plist_id, old_plist->pclass->copy_data); + } H5_AFTER_USER_CB(H5I_INVALID_HID) if (status < 0) { /* Delete ID, ignore return value */ @@ -1555,10 +1556,10 @@ H5P__free_prop_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) if (make_cb && tprop->close != NULL) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOCHECK - { - /* Call user's callback */ - (tprop->close)(tprop->name, tprop->size, tprop->value); - } + { + /* Call user's callback */ + (tprop->close)(tprop->name, tprop->size, tprop->value); + } H5_AFTER_USER_CB_NOCHECK } @@ -2042,9 +2043,9 @@ H5P_create_id(H5P_genclass_t *pclass, bool app_ref) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - status = (tclass->create_func)(plist_id, tclass->create_data); - } + { + status = (tclass->create_func)(plist_id, tclass->create_data); + } H5_AFTER_USER_CB(FAIL) if (status < 0) { /* Delete ID, ignore return value */ @@ -3072,10 +3073,10 @@ H5P__set_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call user's callback */ - ret_value = (*(prop->set))(plist->plist_id, name, prop->size, tmp_value); - } + { + /* Call user's callback */ + ret_value = (*(prop->set))(plist->plist_id, name, prop->size, tmp_value); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set property value"); @@ -3091,10 +3092,10 @@ H5P__set_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, if (NULL != prop->del) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call user's callback */ - ret_value = (*(prop->del))(plist->plist_id, name, prop->size, prop->value); - } + { + /* Call user's callback */ + ret_value = (*(prop->del))(plist->plist_id, name, prop->size, prop->value); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't release property value"); @@ -3162,10 +3163,10 @@ H5P__set_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call user's callback */ - ret_value = (*(prop->set))(plist->plist_id, name, prop->size, tmp_value); - } + { + /* Call user's callback */ + ret_value = (*(prop->set))(plist->plist_id, name, prop->size, tmp_value); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set property value"); @@ -3766,10 +3767,10 @@ H5P__cmp_prop(const H5P_genprop_t *prop1, const H5P_genprop_t *prop2) if (prop1->value != NULL) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOCHECK - { - /* Call comparison routine */ - cmp_value = prop1->cmp(prop1->value, prop2->value, prop1->size); - } + { + /* Call comparison routine */ + cmp_value = prop1->cmp(prop1->value, prop2->value, prop1->size); + } H5_AFTER_USER_CB_NOCHECK /* Call comparison routine */ if (0 != cmp_value) @@ -4270,10 +4271,10 @@ H5P__iterate_plist_cb(void *_item, void *_key, void *_udata) if (*udata->curr_idx_ptr >= udata->prev_idx) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) - { - /* Call the callback function */ - ret_value = (*udata->cb_func)(item, udata->udata); - } + { + /* Call the callback function */ + ret_value = (*udata->cb_func)(item, udata->udata); + } H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) if (ret_value != 0) HGOTO_DONE(ret_value); @@ -4486,10 +4487,10 @@ H5P__iterate_pclass_cb(void *_item, void H5_ATTR_NDEBUG_UNUSED *_key, void *_uda if (*udata->curr_idx_ptr >= udata->prev_idx) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR) - { - /* Call the callback function */ - ret_value = (*udata->cb_func)(item, udata->udata); - } + { + /* Call the callback function */ + ret_value = (*udata->cb_func)(item, udata->udata); + } H5_AFTER_USER_CB_NOERR(H5_ITER_ERROR) if (ret_value != 0) HGOTO_DONE(ret_value); @@ -4727,10 +4728,10 @@ H5P__get_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, void * /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call user's callback */ - ret_value = (*(prop->get))(plist->plist_id, name, prop->size, tmp_value); - } + { + /* Call user's callback */ + ret_value = (*(prop->get))(plist->plist_id, name, prop->size, tmp_value); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set property value"); @@ -4838,10 +4839,10 @@ H5P__del_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, if (NULL != prop->del) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call user's callback */ - ret_value = (*(prop->del))(plist->plist_id, name, prop->size, prop->value); - } + { + /* Call user's callback */ + ret_value = (*(prop->del))(plist->plist_id, name, prop->size, prop->value); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't release property value"); @@ -4919,10 +4920,10 @@ H5P__del_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call user's callback */ - ret_value = (*(prop->del))(plist->plist_id, name, prop->size, tmp_value); - } + { + /* Call user's callback */ + ret_value = (*(prop->del))(plist->plist_id, name, prop->size, tmp_value); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't close property value"); @@ -5065,10 +5066,10 @@ H5P__copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name) if (new_prop->copy) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call user's callback */ - ret_value = (new_prop->copy)(new_prop->name, new_prop->size, new_prop->value); - } + { + /* Call user's callback */ + ret_value = (new_prop->copy)(new_prop->name, new_prop->size, new_prop->value); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "Can't copy property"); @@ -5089,9 +5090,9 @@ H5P__copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name) if (new_prop->create) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (new_prop->create)(new_prop->name, new_prop->size, new_prop->value); - } + { + ret_value = (new_prop->create)(new_prop->name, new_prop->size, new_prop->value); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "Can't initialize property"); @@ -5305,10 +5306,10 @@ H5P_close(H5P_genplist_t *plist) if (NULL != tclass->close_func) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call user's "close" callback function, ignoring return value */ - (tclass->close_func)(plist->plist_id, tclass->close_data); - } + { + /* Call user's "close" callback function, ignoring return value */ + (tclass->close_func)(plist->plist_id, tclass->close_data); + } H5_AFTER_USER_CB(FAIL) } /* end if */ @@ -5337,10 +5338,10 @@ H5P_close(H5P_genplist_t *plist) if (tmp->close) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call user's callback */ - (tmp->close)(tmp->name, tmp->size, tmp->value); - } + { + /* Call user's callback */ + (tmp->close)(tmp->name, tmp->size, tmp->value); + } H5_AFTER_USER_CB(FAIL) } /* end if */ @@ -5389,10 +5390,10 @@ H5P_close(H5P_genplist_t *plist) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call user's callback */ - (tmp->close)(tmp->name, tmp->size, tmp_value); - } + { + /* Call user's callback */ + (tmp->close)(tmp->name, tmp->size, tmp_value); + } H5_AFTER_USER_CB(FAIL) /* Release the temporary value buffer */ diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 48bd0bbe560..d40474a5ac0 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -1451,10 +1451,11 @@ H5S_select_iterate(void *buf, const H5T_t *type, H5S_t *space, const H5S_sel_ite case H5S_SEL_ITER_OP_APP: /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(H5_ITER_ERROR) - { - /* Make the application callback */ - user_ret = (op->u.app_op.op)(loc, op->u.app_op.type_id, ndims, coords, op_data); - } + { + /* Make the application callback */ + user_ret = + (op->u.app_op.op)(loc, op->u.app_op.type_id, ndims, coords, op_data); + } H5_AFTER_USER_CB(H5_ITER_ERROR) break; diff --git a/src/H5T.c b/src/H5T.c index 9b9d9e9e032..4ad4f2dbf97 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -3200,10 +3200,10 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = - (conv->u.app_func)(tmp_sid, tmp_did, &cdata, 0, 0, 0, NULL, NULL, H5CX_get_dxpl()); - } + { + ret_value = (conv->u.app_func)(tmp_sid, tmp_did, &cdata, 0, 0, 0, NULL, NULL, + H5CX_get_dxpl()); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) { if (H5I_dec_ref(tmp_sid) < 0) @@ -5879,10 +5879,10 @@ H5T__path_find_init_new_path(H5T_path_t *path, const H5T_t *src, const H5T_t *ds /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - status = - (conv->u.app_func)(src_id, dst_id, &(path->cdata), 0, 0, 0, NULL, NULL, H5CX_get_dxpl()); - } + { + status = (conv->u.app_func)(src_id, dst_id, &(path->cdata), 0, 0, 0, NULL, NULL, + H5CX_get_dxpl()); + } H5_AFTER_USER_CB(FAIL) } else @@ -5939,10 +5939,10 @@ H5T__path_find_init_new_path(H5T_path_t *path, const H5T_t *src, const H5T_t *ds /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - status = (H5T_g.soft[i].conv.u.app_func)(src_id, dst_id, &(path->cdata), 0, 0, 0, NULL, NULL, - H5CX_get_dxpl()); - } + { + status = (H5T_g.soft[i].conv.u.app_func)(src_id, dst_id, &(path->cdata), 0, 0, 0, NULL, + NULL, H5CX_get_dxpl()); + } H5_AFTER_USER_CB(FAIL) } else @@ -6031,10 +6031,11 @@ H5T__path_free(H5T_path_t *path, H5T_conv_ctx_t *conv_ctx) if (path->conv.is_app) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(FAIL) - { - status = (path->conv.u.app_func)(conv_ctx->u.free.src_type_id, conv_ctx->u.free.dst_type_id, - &(path->cdata), 0, 0, 0, NULL, NULL, H5CX_get_dxpl()); - } + { + status = + (path->conv.u.app_func)(conv_ctx->u.free.src_type_id, conv_ctx->u.free.dst_type_id, + &(path->cdata), 0, 0, 0, NULL, NULL, H5CX_get_dxpl()); + } H5_AFTER_USER_CB_NOERR(FAIL) } else @@ -6452,11 +6453,11 @@ H5T_convert_with_ctx(H5T_path_t *tpath, const H5T_t *src_type, const H5T_t *dst_ if (tpath->conv.is_app) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (tpath->conv.u.app_func)(conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, - &(tpath->cdata), nelmts, buf_stride, bkg_stride, buf, bkg, - conv_ctx->u.conv.dxpl_id); - } + { + ret_value = (tpath->conv.u.app_func)( + conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, &(tpath->cdata), nelmts, + buf_stride, bkg_stride, buf, bkg, conv_ctx->u.conv.dxpl_id); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); diff --git a/src/H5Tconv_bitfield.c b/src/H5Tconv_bitfield.c index 58b574f2385..cc2ad9eb483 100644 --- a/src/H5Tconv_bitfield.c +++ b/src/H5Tconv_bitfield.c @@ -169,12 +169,12 @@ H5T__conv_b_b(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } /* end if */ diff --git a/src/H5Tconv_complex.c b/src/H5Tconv_complex.c index b0f6eb2fa39..9b4197c0f87 100644 --- a/src/H5Tconv_complex.c +++ b/src/H5Tconv_complex.c @@ -311,11 +311,11 @@ H5T__conv_complex_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ct /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)(except_type, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + except_type, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, src_rev, + d, conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -630,11 +630,11 @@ H5T__conv_complex_part(const H5T_t *src_p, const H5T_t *dst_p, uint8_t *s, uint8 /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, - src_rev, d, conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, + src_rev, d, conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -727,11 +727,11 @@ H5T__conv_complex_part(const H5T_t *src_p, const H5T_t *dst_p, uint8_t *s, uint8 /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, - src_rev, d, conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -1103,11 +1103,11 @@ H5T__conv_complex_f_matched(const H5T_t *src_p, const H5T_t *dst_p, const H5T_co /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)(except_type, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + except_type, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, src_rev, + d, conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } diff --git a/src/H5Tconv_enum.c b/src/H5Tconv_enum.c index 3ac66c99708..6460f6a8291 100644 --- a/src/H5Tconv_enum.c +++ b/src/H5Tconv_enum.c @@ -406,11 +406,12 @@ H5T__conv_enum(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T if (conv_ctx->u.conv.cb_struct.func) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, s, d, conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, s, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -453,11 +454,12 @@ H5T__conv_enum(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T if (conv_ctx->u.conv.cb_struct.func) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, s, d, conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, s, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } diff --git a/src/H5Tconv_float.c b/src/H5Tconv_float.c index 0d8e885185b..e5767bb3f62 100644 --- a/src/H5Tconv_float.c +++ b/src/H5Tconv_float.c @@ -304,11 +304,11 @@ H5T__conv_f_f_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)(except_type, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + except_type, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, src_rev, + d, conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -445,11 +445,11 @@ H5T__conv_f_f_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, - src_rev, d, conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -542,11 +542,12 @@ H5T__conv_f_f_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -986,11 +987,11 @@ H5T__conv_f_i_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)(except_type, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + except_type, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, src_rev, + d, conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -1110,11 +1111,12 @@ H5T__conv_f_i_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) if (except_ret == H5T_CONV_HANDLED) { @@ -1135,12 +1137,12 @@ H5T__conv_f_i_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -1162,12 +1164,12 @@ H5T__conv_f_i_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -1196,12 +1198,12 @@ H5T__conv_f_i_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -1233,12 +1235,12 @@ H5T__conv_f_i_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -1262,12 +1264,12 @@ H5T__conv_f_i_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -1289,12 +1291,12 @@ H5T__conv_f_i_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } diff --git a/src/H5Tconv_integer.c b/src/H5Tconv_integer.c index 3511420a33a..db61986c409 100644 --- a/src/H5Tconv_integer.c +++ b/src/H5Tconv_integer.c @@ -206,12 +206,12 @@ H5T__conv_i_i(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -248,12 +248,12 @@ H5T__conv_i_i(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -282,12 +282,12 @@ H5T__conv_i_i(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -321,12 +321,12 @@ H5T__conv_i_i(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -375,12 +375,12 @@ H5T__conv_i_i(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -424,12 +424,12 @@ H5T__conv_i_i(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, - conv_ctx->u.conv.dst_type_id, src_rev, d, - conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -728,11 +728,11 @@ H5T__conv_i_f_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_PRECISION, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, - src_rev, d, conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_PRECISION, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) } @@ -806,11 +806,11 @@ H5T__conv_i_f_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - except_ret = (conv_ctx->u.conv.cb_struct.func)( - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, - src_rev, d, conv_ctx->u.conv.cb_struct.user_data); - } + { + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, conv_ctx->u.conv.cb_struct.user_data); + } H5_AFTER_USER_CB(FAIL) if (except_ret == H5T_CONV_ABORT) diff --git a/src/H5Tconv_macros.h b/src/H5Tconv_macros.h index ebb4c256849..80a9369fc70 100644 --- a/src/H5Tconv_macros.h +++ b/src/H5Tconv_macros.h @@ -243,11 +243,11 @@ typedef struct H5T_conv_hw_t { if (*(S) > (ST)(D_MAX)) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ - D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -259,11 +259,11 @@ typedef struct H5T_conv_hw_t { else if (*(S) < (ST)(D_MIN)) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, \ - S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -294,11 +294,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ - D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -332,11 +332,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, \ - S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -401,11 +401,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, D, \ - conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ + D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler */ \ @@ -470,11 +470,11 @@ typedef struct H5T_conv_hw_t { if (*(S) < 0) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, \ - S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -486,11 +486,11 @@ typedef struct H5T_conv_hw_t { else if (sizeof(ST) > sizeof(DT) && *(S) > (ST)(D_MAX)) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ - D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -538,11 +538,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, \ - S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -577,11 +577,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ - D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -623,11 +623,11 @@ typedef struct H5T_conv_hw_t { if (*(S) > (ST)(D_MAX)) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ - D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -639,11 +639,11 @@ typedef struct H5T_conv_hw_t { else if (*(S) < (ST)(D_MIN)) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, \ - S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -745,11 +745,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_PRECISION, conv_ctx->u.conv.src_type_id, \ - conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_PRECISION, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -788,11 +788,11 @@ typedef struct H5T_conv_hw_t { if (*(S) > (ST)(D_MAX) || (sprec < dprec && *(S) == (ST)(D_MAX))) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ - D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -804,11 +804,11 @@ typedef struct H5T_conv_hw_t { else if (*(S) < (ST)(D_MIN)) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, \ - S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -820,11 +820,11 @@ typedef struct H5T_conv_hw_t { else if (*(S) != (ST)((DT)(*(S)))) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ - D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -863,11 +863,11 @@ typedef struct H5T_conv_hw_t { if (*(S) > (ST)(D_MAX) || (sprec < dprec && *(S) == (ST)(D_MAX))) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ - D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -879,11 +879,11 @@ typedef struct H5T_conv_hw_t { else if (*(S) < (ST)(D_MIN)) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, \ - S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -902,11 +902,11 @@ typedef struct H5T_conv_hw_t { if ((high_bit_pos - low_bit_pos) >= dprec) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_PRECISION, conv_ctx->u.conv.src_type_id, \ - conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_PRECISION, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -1097,21 +1097,21 @@ typedef struct H5T_conv_hw_t { if (sr_over || si_over) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, \ - conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ } \ else if (sr_under || si_under) { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, \ - conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ } \ \ @@ -1238,11 +1238,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ - D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -1256,11 +1256,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, \ - S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -1331,11 +1331,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ - D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -1349,11 +1349,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, \ - S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -1434,11 +1434,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_PRECISION, conv_ctx->u.conv.src_type_id, \ - conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_PRECISION, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -1472,11 +1472,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ - D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -1490,11 +1490,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, \ - S, D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ @@ -1508,11 +1508,11 @@ typedef struct H5T_conv_hw_t { \ /* Prepare & restore library for user callback */ \ H5_BEFORE_USER_CB(FAIL) \ - { \ - except_ret = (conv_ctx->u.conv.cb_struct.func)( \ - H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, \ - D, conv_ctx->u.conv.cb_struct.user_data); \ - } \ + { \ + except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, \ + conv_ctx->u.conv.dst_type_id, S, D, conv_ctx->u.conv.cb_struct.user_data); \ + } \ H5_AFTER_USER_CB(FAIL) \ if (except_ret == H5T_CONV_UNHANDLED) \ /* Let compiler convert if case is ignored by user handler*/ \ diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 89afdb4f341..fc0ff4b18a8 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -502,9 +502,9 @@ H5T__vlen_mem_seq_write(H5VL_object_t H5_ATTR_UNUSED *file, const H5T_vlen_alloc if (vl_alloc_info->alloc_func != NULL) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - vl.p = (vl_alloc_info->alloc_func)(len, vl_alloc_info->alloc_info); - } + { + vl.p = (vl_alloc_info->alloc_func)(len, vl_alloc_info->alloc_info); + } H5_AFTER_USER_CB(FAIL) if (NULL == vl.p) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, @@ -680,9 +680,9 @@ H5T__vlen_mem_str_write(H5VL_object_t H5_ATTR_UNUSED *file, const H5T_vlen_alloc if (vl_alloc_info->alloc_func != NULL) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - t = (vl_alloc_info->alloc_func)((seq_len + 1) * base_size, vl_alloc_info->alloc_info); - } + { + t = (vl_alloc_info->alloc_func)((seq_len + 1) * base_size, vl_alloc_info->alloc_info); + } H5_AFTER_USER_CB(FAIL) if (NULL == t) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index d73c4711cf0..71ad2035565 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -236,9 +236,9 @@ H5VLinitialize(hid_t connector_id, hid_t vipl_id) if (connector->cls->initialize) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = connector->cls->initialize(vipl_id); - } + { + ret_value = connector->cls->initialize(vipl_id); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "VOL connector did not initialize"); @@ -274,9 +274,9 @@ H5VLterminate(hid_t connector_id) if (connector->cls->terminate) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = connector->cls->terminate(); - } + { + ret_value = connector->cls->terminate(); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "VOL connector did not terminate cleanly"); @@ -417,9 +417,9 @@ H5VL_copy_connector_info(const H5VL_connector_t *connector, void **dst_info, con if (connector->cls->info_cls.copy) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - new_connector_info = (connector->cls->info_cls.copy)(src_info); - } + { + new_connector_info = (connector->cls->info_cls.copy)(src_info); + } H5_AFTER_USER_CB(FAIL) if (NULL == new_connector_info) HGOTO_ERROR(H5E_VOL, H5E_CANTCOPY, FAIL, "connector info copy callback failed"); @@ -516,9 +516,9 @@ H5VL_cmp_connector_info(const H5VL_connector_t *connector, int *cmp_value, const if (connector->cls->info_cls.cmp) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (connector->cls->info_cls.cmp)(cmp_value, info1, info2); - } + { + ret_value = (connector->cls->info_cls.cmp)(cmp_value, info1, info2); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCOMPARE, FAIL, "can't compare connector info"); @@ -593,10 +593,10 @@ H5VL_free_connector_info(const H5VL_connector_t *connector, const void *info) if (connector->cls->info_cls.free) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Cast through uintptr_t to de-const memory */ - ret_value = (connector->cls->info_cls.free)((void *)(uintptr_t)info); - } + { + /* Cast through uintptr_t to de-const memory */ + ret_value = (connector->cls->info_cls.free)((void *)(uintptr_t)info); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "connector info free request failed"); @@ -668,9 +668,9 @@ H5VLconnector_info_to_str(const void *info, hid_t connector_id, char **str) if (connector->cls->info_cls.to_str) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (connector->cls->info_cls.to_str)(info, str); - } + { + ret_value = (connector->cls->info_cls.to_str)(info, str); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSERIALIZE, FAIL, "can't serialize connector info"); @@ -708,9 +708,9 @@ H5VL__connector_str_to_info(const char *str, H5VL_connector_t *connector, void * if (connector->cls->info_cls.from_str) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (connector->cls->info_cls.from_str)(str, info); - } + { + ret_value = (connector->cls->info_cls.from_str)(str, info); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTUNSERIALIZE, FAIL, "can't deserialize connector info"); @@ -783,9 +783,9 @@ H5VLget_object(void *obj, hid_t connector_id) if (connector->cls->wrap_cls.get_object) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - ret_value = (connector->cls->wrap_cls.get_object)(obj); - } + { + ret_value = (connector->cls->wrap_cls.get_object)(obj); + } H5_AFTER_USER_CB(NULL) } else @@ -827,10 +827,10 @@ H5VLget_wrap_ctx(void *obj, hid_t connector_id, void **wrap_ctx /*out*/) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Invoke connector's callback */ - ret_value = (connector->cls->wrap_cls.get_wrap_ctx)(obj, wrap_ctx); - } + { + /* Invoke connector's callback */ + ret_value = (connector->cls->wrap_cls.get_wrap_ctx)(obj, wrap_ctx); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "connector wrap context callback failed"); @@ -867,10 +867,10 @@ H5VL_wrap_object(const H5VL_class_t *cls, void *wrap_ctx, void *obj, H5I_type_t if (wrap_ctx) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Ask the connector to wrap the object */ - ret_value = (cls->wrap_cls.wrap_object)(obj, obj_type, wrap_ctx); - } + { + /* Ask the connector to wrap the object */ + ret_value = (cls->wrap_cls.wrap_object)(obj, obj_type, wrap_ctx); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't wrap object"); @@ -939,10 +939,10 @@ H5VL_unwrap_object(const H5VL_class_t *cls, void *obj) if (cls->wrap_cls.wrap_object) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Ask the connector to unwrap the object */ - ret_value = (cls->wrap_cls.unwrap_object)(obj); - } + { + /* Ask the connector to unwrap the object */ + ret_value = (cls->wrap_cls.unwrap_object)(obj); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't unwrap object"); @@ -1012,10 +1012,10 @@ H5VLfree_wrap_ctx(void *wrap_ctx, hid_t connector_id) if (wrap_ctx) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Free the connector's object wrapping context */ - ret_value = (connector->cls->wrap_cls.free_wrap_ctx)(wrap_ctx); - } + { + /* Free the connector's object wrapping context */ + ret_value = (connector->cls->wrap_cls.free_wrap_ctx)(wrap_ctx); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "connector wrap context free request failed"); @@ -1049,11 +1049,11 @@ H5VL__attr_create(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_cla /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Call the corresponding VOL callback */ - ret_value = - (cls->attr_cls.create)(obj, loc_params, name, type_id, space_id, acpl_id, aapl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->attr_cls.create)(obj, loc_params, name, type_id, space_id, acpl_id, aapl_id, + dxpl_id, req); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "attribute create failed"); @@ -1158,10 +1158,10 @@ H5VL__attr_open(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Call the corresponding VOL open callback */ - ret_value = (cls->attr_cls.open)(obj, loc_params, name, aapl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL open callback */ + ret_value = (cls->attr_cls.open)(obj, loc_params, name, aapl_id, dxpl_id, req); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, NULL, "attribute open failed"); @@ -1263,10 +1263,10 @@ H5VL__attr_read(void *obj, const H5VL_class_t *cls, hid_t mem_type_id, void *buf /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->attr_cls.read)(obj, mem_type_id, buf, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->attr_cls.read)(obj, mem_type_id, buf, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_READERROR, FAIL, "attribute read failed"); @@ -1366,10 +1366,10 @@ H5VL__attr_write(void *obj, const H5VL_class_t *cls, hid_t mem_type_id, const vo /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->attr_cls.write)(obj, mem_type_id, buf, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->attr_cls.write)(obj, mem_type_id, buf, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_WRITEERROR, FAIL, "write failed"); @@ -1469,10 +1469,10 @@ H5VL__attr_get(void *obj, const H5VL_class_t *cls, H5VL_attr_get_args_t *args, h /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->attr_cls.get)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->attr_cls.get)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "attribute get failed"); @@ -1574,11 +1574,11 @@ H5VL__attr_specific(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_c /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - /* (Must return value from callback, for iterators) */ - ret_value = (cls->attr_cls.specific)(obj, loc_params, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + /* (Must return value from callback, for iterators) */ + ret_value = (cls->attr_cls.specific)(obj, loc_params, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute attribute 'specific' callback"); @@ -1682,11 +1682,11 @@ H5VL__attr_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *ar /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - /* (Must return value from callback, for iterators) */ - ret_value = (cls->attr_cls.optional)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + /* (Must return value from callback, for iterators) */ + ret_value = (cls->attr_cls.optional)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute attribute optional callback"); @@ -1830,10 +1830,10 @@ H5VL__attr_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **req) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->attr_cls.close)(obj, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->attr_cls.close)(obj, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "attribute close failed"); @@ -1937,11 +1937,11 @@ H5VL__dataset_create(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->dataset_cls.create)(obj, loc_params, name, lcpl_id, type_id, space_id, dcpl_id, - dapl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->dataset_cls.create)(obj, loc_params, name, lcpl_id, type_id, space_id, dcpl_id, + dapl_id, dxpl_id, req); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "dataset create failed"); @@ -2048,10 +2048,10 @@ H5VL__dataset_open(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_cl /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->dataset_cls.open)(obj, loc_params, name, dapl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->dataset_cls.open)(obj, loc_params, name, dapl_id, dxpl_id, req); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, NULL, "dataset open failed"); @@ -2155,11 +2155,11 @@ H5VL__dataset_read(size_t count, void *obj[], const H5VL_class_t *cls, hid_t mem /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = - (cls->dataset_cls.read)(count, obj, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->dataset_cls.read)(count, obj, mem_type_id, mem_space_id, file_space_id, dxpl_id, + buf, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_READERROR, FAIL, "dataset read failed"); @@ -2286,11 +2286,11 @@ H5VL__dataset_write(size_t count, void *obj[], const H5VL_class_t *cls, hid_t me /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = - (cls->dataset_cls.write)(count, obj, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->dataset_cls.write)(count, obj, mem_type_id, mem_space_id, file_space_id, + dxpl_id, buf, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_WRITEERROR, FAIL, "dataset write failed"); @@ -2417,10 +2417,10 @@ H5VL__dataset_get(void *obj, const H5VL_class_t *cls, H5VL_dataset_get_args_t *a /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->dataset_cls.get)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->dataset_cls.get)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "dataset get failed"); @@ -2521,10 +2521,10 @@ H5VL__dataset_specific(void *obj, const H5VL_class_t *cls, H5VL_dataset_specific /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->dataset_cls.specific)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->dataset_cls.specific)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute dataset specific callback"); @@ -2626,10 +2626,10 @@ H5VL__dataset_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->dataset_cls.optional)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->dataset_cls.optional)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute dataset optional callback"); @@ -2775,10 +2775,10 @@ H5VL__dataset_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **re /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->dataset_cls.close)(obj, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->dataset_cls.close)(obj, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "dataset close failed"); @@ -2885,11 +2885,11 @@ H5VL__datatype_commit(void *obj, const H5VL_loc_params_t *loc_params, const H5VL /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->datatype_cls.commit)(obj, loc_params, name, type_id, lcpl_id, tcpl_id, tapl_id, - dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->datatype_cls.commit)(obj, loc_params, name, type_id, lcpl_id, tcpl_id, tapl_id, + dxpl_id, req); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "datatype commit failed"); @@ -2994,10 +2994,10 @@ H5VL__datatype_open(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_c /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->datatype_cls.open)(obj, loc_params, name, tapl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->datatype_cls.open)(obj, loc_params, name, tapl_id, dxpl_id, req); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, NULL, "datatype open failed"); @@ -3101,10 +3101,10 @@ H5VL__datatype_get(void *obj, const H5VL_class_t *cls, H5VL_datatype_get_args_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->datatype_cls.get)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->datatype_cls.get)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "datatype 'get' failed"); @@ -3205,10 +3205,10 @@ H5VL__datatype_specific(void *obj, const H5VL_class_t *cls, H5VL_datatype_specif /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->datatype_cls.specific)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->datatype_cls.specific)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute datatype specific callback"); @@ -3310,10 +3310,10 @@ H5VL__datatype_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->datatype_cls.optional)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->datatype_cls.optional)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute datatype optional callback"); @@ -3503,10 +3503,10 @@ H5VL__datatype_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **r /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->datatype_cls.close)(obj, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->datatype_cls.close)(obj, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "datatype close failed"); @@ -3609,10 +3609,10 @@ H5VL__file_create(const H5VL_class_t *cls, const char *name, unsigned flags, hid /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->file_cls.create)(name, flags, fcpl_id, fapl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->file_cls.create)(name, flags, fcpl_id, fapl_id, dxpl_id, req); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "file create failed"); @@ -3709,10 +3709,10 @@ H5VL__file_open(const H5VL_class_t *cls, const char *name, unsigned flags, hid_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->file_cls.open)(name, flags, fapl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->file_cls.open)(name, flags, fapl_id, dxpl_id, req); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, NULL, "open failed"); @@ -3782,9 +3782,9 @@ H5VL__file_open_find_connector_cb(H5PL_type_t H5_ATTR_UNUSED plugin_type, vol_cb_args.args.is_accessible.accessible = &is_accessible; H5E_PAUSE_ERRORS - { - status = H5VL_file_specific(NULL, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL); - } + { + status = H5VL_file_specific(NULL, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL); + } H5E_RESUME_ERRORS if (status >= 0 && is_accessible) { @@ -3933,10 +3933,10 @@ H5VL__file_get(void *obj, const H5VL_class_t *cls, H5VL_file_get_args_t *args, h /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->file_cls.get)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->file_cls.get)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "file get failed"); @@ -4036,10 +4036,10 @@ H5VL__file_specific(void *obj, const H5VL_class_t *cls, H5VL_file_specific_args_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->file_cls.specific)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->file_cls.specific)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "file specific failed"); @@ -4172,10 +4172,10 @@ H5VL__file_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *ar /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->file_cls.optional)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->file_cls.optional)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "file optional failed"); @@ -4321,10 +4321,10 @@ H5VL__file_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **req) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->file_cls.close)(obj, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->file_cls.close)(obj, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEFILE, FAIL, "file close failed"); @@ -4424,10 +4424,11 @@ H5VL__group_create(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_cl /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->group_cls.create)(obj, loc_params, name, lcpl_id, gcpl_id, gapl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = + (cls->group_cls.create)(obj, loc_params, name, lcpl_id, gcpl_id, gapl_id, dxpl_id, req); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "group create failed"); @@ -4531,10 +4532,10 @@ H5VL__group_open(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_clas /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->group_cls.open)(obj, loc_params, name, gapl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->group_cls.open)(obj, loc_params, name, gapl_id, dxpl_id, req); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, NULL, "group open failed"); @@ -4636,10 +4637,10 @@ H5VL__group_get(void *obj, const H5VL_class_t *cls, H5VL_group_get_args_t *args, /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->group_cls.get)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->group_cls.get)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "group get failed"); @@ -4739,10 +4740,10 @@ H5VL__group_specific(void *obj, const H5VL_class_t *cls, H5VL_group_specific_arg /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->group_cls.specific)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->group_cls.specific)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute group specific callback"); @@ -4843,11 +4844,11 @@ H5VL__group_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *a /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - /* (Must return value from callback, for iterators) */ - ret_value = (cls->group_cls.optional)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + /* (Must return value from callback, for iterators) */ + ret_value = (cls->group_cls.optional)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute group optional callback"); @@ -4995,10 +4996,10 @@ H5VL__group_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **req) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->group_cls.close)(obj, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->group_cls.close)(obj, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "group close failed"); @@ -5100,10 +5101,10 @@ H5VL__link_create(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_param /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->link_cls.create)(args, obj, loc_params, lcpl_id, lapl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->link_cls.create)(args, obj, loc_params, lcpl_id, lapl_id, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "link create failed"); @@ -5217,11 +5218,11 @@ H5VL__link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_o /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = - (cls->link_cls.copy)(src_obj, loc_params1, dst_obj, loc_params2, lcpl_id, lapl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->link_cls.copy)(src_obj, loc_params1, dst_obj, loc_params2, lcpl_id, lapl_id, + dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCOPY, FAIL, "link copy failed"); @@ -5330,11 +5331,11 @@ H5VL__link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_o /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = - (cls->link_cls.move)(src_obj, loc_params1, dst_obj, loc_params2, lcpl_id, lapl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->link_cls.move)(src_obj, loc_params1, dst_obj, loc_params2, lcpl_id, lapl_id, + dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTMOVE, FAIL, "link move failed"); @@ -5446,10 +5447,10 @@ H5VL__link_get(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->link_cls.get)(obj, loc_params, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->link_cls.get)(obj, loc_params, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "link get failed"); @@ -5551,11 +5552,11 @@ H5VL__link_specific(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_c /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - /* (Must return value from callback, for iterators) */ - ret_value = (cls->link_cls.specific)(obj, loc_params, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + /* (Must return value from callback, for iterators) */ + ret_value = (cls->link_cls.specific)(obj, loc_params, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute link specific callback"); @@ -5660,10 +5661,10 @@ H5VL__link_optional(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_c /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->link_cls.optional)(obj, loc_params, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->link_cls.optional)(obj, loc_params, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute link optional callback"); @@ -5824,10 +5825,10 @@ H5VL__object_open(void *obj, const H5VL_loc_params_t *params, const H5VL_class_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->object_cls.open)(obj, params, opened_type, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->object_cls.open)(obj, params, opened_type, dxpl_id, req); + } H5_AFTER_USER_CB(NULL) if (NULL == ret_value) HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, NULL, "object open failed"); @@ -5931,11 +5932,11 @@ H5VL__object_copy(void *src_obj, const H5VL_loc_params_t *src_loc_params, const /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->object_cls.copy)(src_obj, src_loc_params, src_name, dst_obj, dst_loc_params, - dst_name, ocpypl_id, lcpl_id, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->object_cls.copy)(src_obj, src_loc_params, src_name, dst_obj, dst_loc_params, + dst_name, ocpypl_id, lcpl_id, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCOPY, FAIL, "object copy failed"); @@ -6046,10 +6047,10 @@ H5VL__object_get(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_clas /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->object_cls.get)(obj, loc_params, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->object_cls.get)(obj, loc_params, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "get failed"); @@ -6151,11 +6152,11 @@ H5VL__object_specific(void *obj, const H5VL_loc_params_t *loc_params, const H5VL /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - /* (Must return value from callback, for iterators) */ - ret_value = (cls->object_cls.specific)(obj, loc_params, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + /* (Must return value from callback, for iterators) */ + ret_value = (cls->object_cls.specific)(obj, loc_params, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HERROR(H5E_VOL, H5E_CANTOPERATE, "object specific failed"); @@ -6260,10 +6261,10 @@ H5VL__object_optional(void *obj, const H5VL_loc_params_t *loc_params, const H5VL /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->object_cls.optional)(obj, loc_params, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->object_cls.optional)(obj, loc_params, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute object optional callback"); @@ -6432,10 +6433,10 @@ H5VL__introspect_get_conn_cls(void *obj, const H5VL_class_t *cls, H5VL_get_conn_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->introspect_cls.get_conn_cls)(obj, lvl, conn_cls); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->introspect_cls.get_conn_cls)(obj, lvl, conn_cls); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't query connector class"); @@ -6547,10 +6548,10 @@ H5VL_introspect_get_cap_flags(const void *info, const H5VL_class_t *cls, uint64_ /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->introspect_cls.get_cap_flags)(info, cap_flags); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->introspect_cls.get_cap_flags)(info, cap_flags); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't query connector capability flags"); @@ -6619,10 +6620,10 @@ H5VL__introspect_opt_query(void *obj, const H5VL_class_t *cls, H5VL_subclass_t s /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->introspect_cls.opt_query)(obj, subcls, opt_type, flags); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->introspect_cls.opt_query)(obj, subcls, opt_type, flags); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't query optional operation support"); @@ -6727,10 +6728,10 @@ H5VL__request_wait(void *req, const H5VL_class_t *cls, uint64_t timeout, H5VL_re /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->request_cls.wait)(req, timeout, status); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->request_cls.wait)(req, timeout, status); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "request wait failed"); @@ -6835,10 +6836,10 @@ H5VL__request_notify(void *req, const H5VL_class_t *cls, H5VL_request_notify_t c /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->request_cls.notify)(req, cb, ctx); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->request_cls.notify)(req, cb, ctx); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "request notify failed"); @@ -6944,10 +6945,10 @@ H5VL__request_cancel(void *req, const H5VL_class_t *cls, H5VL_request_status_t * /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->request_cls.cancel)(req, status); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->request_cls.cancel)(req, status); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "request cancel failed"); @@ -7051,10 +7052,10 @@ H5VL__request_specific(void *req, const H5VL_class_t *cls, H5VL_request_specific /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->request_cls.specific)(req, args); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->request_cls.specific)(req, args); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, @@ -7161,10 +7162,10 @@ H5VL__request_optional(void *req, const H5VL_class_t *cls, H5VL_optional_args_t /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->request_cls.optional)(req, args); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->request_cls.optional)(req, args); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, @@ -7307,10 +7308,10 @@ H5VL__request_free(void *req, const H5VL_class_t *cls) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->request_cls.free)(req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->request_cls.free)(req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "request free failed"); @@ -7415,10 +7416,10 @@ H5VL__blob_put(void *obj, const H5VL_class_t *cls, const void *buf, size_t size, /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->blob_cls.put)(obj, buf, size, blob_id, ctx); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->blob_cls.put)(obj, buf, size, blob_id, ctx); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "blob put callback failed"); @@ -7515,10 +7516,10 @@ H5VL__blob_get(void *obj, const H5VL_class_t *cls, const void *blob_id, void *bu /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->blob_cls.get)(obj, blob_id, buf, size, ctx); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->blob_cls.get)(obj, blob_id, buf, size, ctx); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "blob get callback failed"); @@ -7614,10 +7615,10 @@ H5VL__blob_specific(void *obj, const H5VL_class_t *cls, void *blob_id, H5VL_blob /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->blob_cls.specific)(obj, blob_id, args); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->blob_cls.specific)(obj, blob_id, args); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute blob specific callback"); @@ -7713,10 +7714,10 @@ H5VL__blob_optional(void *obj, const H5VL_class_t *cls, void *blob_id, H5VL_opti /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->blob_cls.optional)(obj, blob_id, args); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->blob_cls.optional)(obj, blob_id, args); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute blob optional callback"); @@ -7826,9 +7827,9 @@ H5VL__token_cmp(void *obj, const H5VL_class_t *cls, const H5O_token_t *token1, c if (cls->token_cls.cmp) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (cls->token_cls.cmp)(obj, token1, token2, cmp_value); - } + { + ret_value = (cls->token_cls.cmp)(obj, token1, token2, cmp_value); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCOMPARE, FAIL, "can't compare object tokens"); @@ -7944,9 +7945,9 @@ H5VL__token_to_str(void *obj, H5I_type_t obj_type, const H5VL_class_t *cls, cons if (cls->token_cls.to_str) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (cls->token_cls.to_str)(obj, obj_type, token, token_str); - } + { + ret_value = (cls->token_cls.to_str)(obj, obj_type, token, token_str); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSERIALIZE, FAIL, "can't serialize object token"); @@ -8056,9 +8057,9 @@ H5VL__token_from_str(void *obj, H5I_type_t obj_type, const H5VL_class_t *cls, co if (cls->token_cls.from_str) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = (cls->token_cls.from_str)(obj, obj_type, token_str, token); - } + { + ret_value = (cls->token_cls.from_str)(obj, obj_type, token_str, token); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTUNSERIALIZE, FAIL, "can't deserialize object token string"); @@ -8161,10 +8162,10 @@ H5VL__optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args, h /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Call the corresponding VOL callback */ - ret_value = (cls->optional)(obj, args, dxpl_id, req); - } + { + /* Call the corresponding VOL callback */ + ret_value = (cls->optional)(obj, args, dxpl_id, req); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute optional callback"); diff --git a/src/H5VLint.c b/src/H5VLint.c index 7f332b50b11..477f5bc319a 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -331,9 +331,9 @@ H5VL__free_cls(H5VL_class_t *cls) if (cls->terminate) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - ret_value = cls->terminate(); - } + { + ret_value = cls->terminate(); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "VOL connector did not terminate cleanly"); @@ -1333,9 +1333,9 @@ H5VL__register_connector(const H5VL_class_t *cls, hid_t vipl_id) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(NULL) - { - status = cls->initialize(vipl_id); - } + { + status = cls->initialize(vipl_id); + } H5_AFTER_USER_CB(NULL) if (status < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, NULL, "unable to init VOL connector"); @@ -1808,9 +1808,9 @@ H5VL_object_data(const H5VL_object_t *vol_obj) if (vol_obj->connector->cls->wrap_cls.get_object) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB_NOERR(NULL) - { - ret_value = (vol_obj->connector->cls->wrap_cls.get_object)(vol_obj->data); - } + { + ret_value = (vol_obj->connector->cls->wrap_cls.get_object)(vol_obj->data); + } H5_AFTER_USER_CB_NOERR(NULL) } else @@ -2248,10 +2248,11 @@ H5VL__free_vol_wrapper(H5VL_wrap_ctx_t *vol_wrap_ctx) if (vol_wrap_ctx->obj_wrap_ctx) { /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Release the VOL connector's object wrapping context */ - ret_value = (*vol_wrap_ctx->connector->cls->wrap_cls.free_wrap_ctx)(vol_wrap_ctx->obj_wrap_ctx); - } + { + /* Release the VOL connector's object wrapping context */ + ret_value = + (*vol_wrap_ctx->connector->cls->wrap_cls.free_wrap_ctx)(vol_wrap_ctx->obj_wrap_ctx); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, @@ -2308,10 +2309,11 @@ H5VL_set_vol_wrapper(const H5VL_object_t *vol_obj) /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Get the wrap context from the connector */ - ret_value = (vol_obj->connector->cls->wrap_cls.get_wrap_ctx)(vol_obj->data, &obj_wrap_ctx); - } + { + /* Get the wrap context from the connector */ + ret_value = + (vol_obj->connector->cls->wrap_cls.get_wrap_ctx)(vol_obj->data, &obj_wrap_ctx); + } H5_AFTER_USER_CB(FAIL) if (ret_value < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't retrieve VOL connector's object wrap context"); diff --git a/src/H5Z.c b/src/H5Z.c index 96ebabbb408..a85156e8f5a 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -801,10 +801,10 @@ H5Z__prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hi /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Make callback to filter's "can apply" function */ - status = (fclass->can_apply)(dcpl_id, type_id, space_id); - } + { + /* Make callback to filter's "can apply" function */ + status = (fclass->can_apply)(dcpl_id, type_id, space_id); + } H5_AFTER_USER_CB(FAIL) /* Indicate error during filter callback */ @@ -825,10 +825,10 @@ H5Z__prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hi /* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) - { - /* Make callback to filter's "set local" function */ - status = (fclass->set_local)(dcpl_id, type_id, space_id); - } + { + /* Make callback to filter's "set local" function */ + status = (fclass->set_local)(dcpl_id, type_id, space_id); + } H5_AFTER_USER_CB(FAIL) /* Indicate error during filter callback */ @@ -1448,126 +1448,125 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i tmp_flags |= (edc_read == H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; H5E_PAUSE_ERRORS - { - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, pline->filter[idx].cd_values, *nbytes, buf_size, buf); - } - H5_AFTER_USER_CB(FAIL) - } - H5E_RESUME_ERRORS + {/* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL){ + new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, + pline->filter[idx].cd_values, *nbytes, buf_size, buf); + } +H5_AFTER_USER_CB +(FAIL) +} +H5E_RESUME_ERRORS #ifdef H5Z_DEBUG - H5_timer_stop(&timer); - H5_timer_get_times(timer, ×); - fstats->stats[1].times.elapsed += times.elapsed; - fstats->stats[1].times.system += times.system; - fstats->stats[1].times.user += times.user; - - fstats->stats[1].total += MAX(*nbytes, new_nbytes); - if (0 == new_nbytes) - fstats->stats[1].errors += *nbytes; +H5_timer_stop(&timer); +H5_timer_get_times(timer, ×); +fstats->stats[1].times.elapsed += times.elapsed; +fstats->stats[1].times.system += times.system; +fstats->stats[1].times.user += times.user; + +fstats->stats[1].total += MAX(*nbytes, new_nbytes); +if (0 == new_nbytes) + fstats->stats[1].errors += *nbytes; #endif - if (0 == new_nbytes) { - if (cb_struct.func) { - H5Z_cb_return_t status; - - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); - } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - } - else - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); +if (0 == new_nbytes) { + if (cb_struct.func) { + H5Z_cb_return_t status; - *nbytes = *buf_size; - failed |= (unsigned)1 << idx; + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); } - else - *nbytes = new_nbytes; - } + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); } - else if (pline) - { /* Write */ - for (idx = 0; idx < pline->nused; idx++) { - if (*filter_mask & ((unsigned)1 << idx)) { - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } - if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { - /* Check if filter is optional -- If it isn't, then error */ - if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } /* end if */ + else + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - fclass = &H5Z_table_g[fclass_idx]; + *nbytes = *buf_size; + failed |= (unsigned)1 << idx; +} +else + *nbytes = new_nbytes; +} +} +else if (pline) +{ /* Write */ + for (idx = 0; idx < pline->nused; idx++) { + if (*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } + if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { + /* Check if filter is optional -- If it isn't, then error */ + if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } /* end if */ + + fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG - fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_start(&timer); + fstats = &H5Z_stat_table_g[fclass_idx]; + H5_timer_start(&timer); #endif - H5E_PAUSE_ERRORS - { - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - new_nbytes = (fclass->filter)(flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, pline->filter[idx].cd_values, *nbytes, buf_size, buf); - } - H5_AFTER_USER_CB(FAIL) - } - H5E_RESUME_ERRORS + H5E_PAUSE_ERRORS + {/* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL){new_nbytes = (fclass->filter)( + flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, + pline->filter[idx].cd_values, *nbytes, buf_size, buf); + } +H5_AFTER_USER_CB +(FAIL) +} +H5E_RESUME_ERRORS #ifdef H5Z_DEBUG - H5_timer_stop(&timer); - H5_timer_get_times(timer, ×); - fstats->stats[0].times.elapsed += times.elapsed; - fstats->stats[0].times.system += times.system; - fstats->stats[0].times.user += times.user; - - fstats->stats[0].total += MAX(*nbytes, new_nbytes); - if (0 == new_nbytes) - fstats->stats[0].errors += *nbytes; +H5_timer_stop(&timer); +H5_timer_get_times(timer, ×); +fstats->stats[0].times.elapsed += times.elapsed; +fstats->stats[0].times.system += times.system; +fstats->stats[0].times.user += times.user; + +fstats->stats[0].total += MAX(*nbytes, new_nbytes); +if (0 == new_nbytes) + fstats->stats[0].errors += *nbytes; #endif - if (0 == new_nbytes) { - if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { - if (cb_struct.func) { - H5Z_cb_return_t status; - - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); - } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); - } - else - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); +if (0 == new_nbytes) { + if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { + if (cb_struct.func) { + H5Z_cb_return_t status; - *nbytes = *buf_size; + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); } - failed |= (unsigned)1 << idx; - } - else - *nbytes = new_nbytes; - } /* end for */ + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + } + else + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + + *nbytes = *buf_size; } + failed |= (unsigned)1 << idx; +} +else + *nbytes = new_nbytes; +} /* end for */ +} - *filter_mask = failed; +*filter_mask = failed; -done: - FUNC_LEAVE_NOAPI(ret_value) +done : FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- From c932bda038eaf7743651741a64629a680d169b4b Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 17 Dec 2024 18:26:59 -0600 Subject: [PATCH 06/11] Disable clang formatting for these blocks again Signed-off-by: Quincey Koziol --- src/H5FD.c | 107 ++++++++++++++-------------- src/H5Z.c | 199 +++++++++++++++++++++++++++-------------------------- 2 files changed, 158 insertions(+), 148 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index 88564eff7b7..cb23ff2ee00 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -936,65 +936,70 @@ H5FD_open(bool try, H5FD_t **_file, const char *name, unsigned flags, hid_t fapl if (HADDR_UNDEF == maxaddr) maxaddr = driver->maxaddr; + /* clang-format off */ + /* Try dispatching to file driver */ if (try) { H5E_PAUSE_ERRORS {/* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL){file = (driver->open)(name, flags, fapl_id, maxaddr); + H5_BEFORE_USER_CB(FAIL) + { + file = (driver->open)(name, flags, fapl_id, maxaddr); + } + H5_AFTER_USER_CB(FAIL) + } + H5E_RESUME_ERRORS + + /* Check if file was not opened */ + if (NULL == file) + HGOTO_DONE(SUCCEED); + } + else + { + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + file = (driver->open)(name, flags, fapl_id, maxaddr); + } + H5_AFTER_USER_CB(FAIL) + if (NULL == file) + HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "can't open file"); } -H5_AFTER_USER_CB -(FAIL) -} -H5E_RESUME_ERRORS -/* Check if file was not opened */ -if (NULL == file) - HGOTO_DONE(SUCCEED); -} -else -{ - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - file = (driver->open)(name, flags, fapl_id, maxaddr); - } - H5_AFTER_USER_CB(FAIL) - if (NULL == file) - HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "can't open file"); -} + /* clang-format on */ -/* Set the file access flags */ -file->access_flags = flags; + /* Set the file access flags */ + file->access_flags = flags; -/* Fill in public fields. We must increment the reference count on the - * driver ID to prevent it from being freed while this file is open. - */ -file->driver_id = driver_prop.driver_id; -if (H5I_inc_ref(file->driver_id, false) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); -file->cls = driver; -file->maxaddr = maxaddr; -if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); -if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); - -/* Retrieve the VFL driver feature flags */ -if (H5FD__query(file, &file->feature_flags) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); - -/* Increment the global serial number & assign it to this H5FD_t object */ -if (++H5FD_file_serial_no_g == 0) - /* (Just error out if we wrap around for now...) */ - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); -file->fileno = H5FD_file_serial_no_g; - -/* Start with base address set to 0 */ -/* (This will be changed later, when the superblock is located) */ -file->base_addr = 0; - -/* Set 'out' parameter */ -*_file = file; + /* Fill in public fields. We must increment the reference count on the + * driver ID to prevent it from being freed while this file is open. + */ + file->driver_id = driver_prop.driver_id; + if (H5I_inc_ref(file->driver_id, false) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); + file->cls = driver; + file->maxaddr = maxaddr; + if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); + if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); + + /* Retrieve the VFL driver feature flags */ + if (H5FD__query(file, &file->feature_flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); + + /* Increment the global serial number & assign it to this H5FD_t object */ + if (++H5FD_file_serial_no_g == 0) + /* (Just error out if we wrap around for now...) */ + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); + file->fileno = H5FD_file_serial_no_g; + + /* Start with base address set to 0 */ + /* (This will be changed later, when the superblock is located) */ + file->base_addr = 0; + + /* Set 'out' parameter */ + *_file = file; done : /* Can't cleanup 'file' information, since we don't know what type it is */ diff --git a/src/H5Z.c b/src/H5Z.c index a85156e8f5a..758c575778f 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1447,126 +1447,131 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i tmp_flags = flags | (pline->filter[idx].flags); tmp_flags |= (edc_read == H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; + /* clang-format off */ + H5E_PAUSE_ERRORS {/* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL){ - new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); - } -H5_AFTER_USER_CB -(FAIL) -} -H5E_RESUME_ERRORS + H5_BEFORE_USER_CB(FAIL) + { + new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, + pline->filter[idx].cd_values, *nbytes, buf_size, buf); + } + H5_AFTER_USER_CB(FAIL) + } + H5E_RESUME_ERRORS + + /* clang-format on */ #ifdef H5Z_DEBUG -H5_timer_stop(&timer); -H5_timer_get_times(timer, ×); -fstats->stats[1].times.elapsed += times.elapsed; -fstats->stats[1].times.system += times.system; -fstats->stats[1].times.user += times.user; - -fstats->stats[1].total += MAX(*nbytes, new_nbytes); -if (0 == new_nbytes) - fstats->stats[1].errors += *nbytes; + H5_timer_stop(&timer); + H5_timer_get_times(timer, ×); + fstats->stats[1].times.elapsed += times.elapsed; + fstats->stats[1].times.system += times.system; + fstats->stats[1].times.user += times.user; + + fstats->stats[1].total += MAX(*nbytes, new_nbytes); + if (0 == new_nbytes) + fstats->stats[1].errors += *nbytes; #endif -if (0 == new_nbytes) { - if (cb_struct.func) { - H5Z_cb_return_t status; + if (0 == new_nbytes) { + if (cb_struct.func) { + H5Z_cb_return_t status; + + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); + } + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); + } + else + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); + *nbytes = *buf_size; + failed |= (unsigned)1 << idx; } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - } - else - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - - *nbytes = *buf_size; - failed |= (unsigned)1 << idx; -} -else - *nbytes = new_nbytes; -} -} -else if (pline) -{ /* Write */ - for (idx = 0; idx < pline->nused; idx++) { - if (*filter_mask & ((unsigned)1 << idx)) { - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ + else + *nbytes = new_nbytes; } - if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { - /* Check if filter is optional -- If it isn't, then error */ - if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } /* end if */ + } + else if (pline) + { /* Write */ + for (idx = 0; idx < pline->nused; idx++) { + if (*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } + if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { + /* Check if filter is optional -- If it isn't, then error */ + if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } /* end if */ - fclass = &H5Z_table_g[fclass_idx]; + fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG - fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_start(&timer); + fstats = &H5Z_stat_table_g[fclass_idx]; + H5_timer_start(&timer); #endif - H5E_PAUSE_ERRORS - {/* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL){new_nbytes = (fclass->filter)( - flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); - } -H5_AFTER_USER_CB -(FAIL) -} -H5E_RESUME_ERRORS + H5E_PAUSE_ERRORS + {/* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + new_nbytes = (fclass->filter)(flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, + pline->filter[idx].cd_values, *nbytes, buf_size, buf); + } + H5_AFTER_USER_CB(FAIL) + } + H5E_RESUME_ERRORS #ifdef H5Z_DEBUG -H5_timer_stop(&timer); -H5_timer_get_times(timer, ×); -fstats->stats[0].times.elapsed += times.elapsed; -fstats->stats[0].times.system += times.system; -fstats->stats[0].times.user += times.user; - -fstats->stats[0].total += MAX(*nbytes, new_nbytes); -if (0 == new_nbytes) - fstats->stats[0].errors += *nbytes; + H5_timer_stop(&timer); + H5_timer_get_times(timer, ×); + fstats->stats[0].times.elapsed += times.elapsed; + fstats->stats[0].times.system += times.system; + fstats->stats[0].times.user += times.user; + + fstats->stats[0].total += MAX(*nbytes, new_nbytes); + if (0 == new_nbytes) + fstats->stats[0].errors += *nbytes; #endif -if (0 == new_nbytes) { - if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { - if (cb_struct.func) { - H5Z_cb_return_t status; + if (0 == new_nbytes) { + if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { + if (cb_struct.func) { + H5Z_cb_return_t status; - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); - } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); - } - else - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); + } + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + } + else + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); - *nbytes = *buf_size; + *nbytes = *buf_size; + } + failed |= (unsigned)1 << idx; + } + else + *nbytes = new_nbytes; + } /* end for */ } - failed |= (unsigned)1 << idx; -} -else - *nbytes = new_nbytes; -} /* end for */ -} -*filter_mask = failed; + *filter_mask = failed; -done : FUNC_LEAVE_NOAPI(ret_value) +done: + FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- From 1ee98925e21e92be56b51e8dc1b8493e4b202620 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 00:29:11 +0000 Subject: [PATCH 07/11] Committing clang-format changes --- src/H5FD.c | 64 +++++++++---------- src/H5Z.c | 181 ++++++++++++++++++++++++++--------------------------- 2 files changed, 122 insertions(+), 123 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index cb23ff2ee00..2e85b33e249 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -966,40 +966,40 @@ H5FD_open(bool try, H5FD_t **_file, const char *name, unsigned flags, hid_t fapl HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "can't open file"); } - /* clang-format on */ +/* clang-format on */ - /* Set the file access flags */ - file->access_flags = flags; +/* Set the file access flags */ +file->access_flags = flags; - /* Fill in public fields. We must increment the reference count on the - * driver ID to prevent it from being freed while this file is open. - */ - file->driver_id = driver_prop.driver_id; - if (H5I_inc_ref(file->driver_id, false) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); - file->cls = driver; - file->maxaddr = maxaddr; - if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); - if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); - - /* Retrieve the VFL driver feature flags */ - if (H5FD__query(file, &file->feature_flags) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); - - /* Increment the global serial number & assign it to this H5FD_t object */ - if (++H5FD_file_serial_no_g == 0) - /* (Just error out if we wrap around for now...) */ - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); - file->fileno = H5FD_file_serial_no_g; - - /* Start with base address set to 0 */ - /* (This will be changed later, when the superblock is located) */ - file->base_addr = 0; - - /* Set 'out' parameter */ - *_file = file; +/* Fill in public fields. We must increment the reference count on the + * driver ID to prevent it from being freed while this file is open. + */ +file->driver_id = driver_prop.driver_id; +if (H5I_inc_ref(file->driver_id, false) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); +file->cls = driver; +file->maxaddr = maxaddr; +if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); +if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); + +/* Retrieve the VFL driver feature flags */ +if (H5FD__query(file, &file->feature_flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); + +/* Increment the global serial number & assign it to this H5FD_t object */ +if (++H5FD_file_serial_no_g == 0) + /* (Just error out if we wrap around for now...) */ + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); +file->fileno = H5FD_file_serial_no_g; + +/* Start with base address set to 0 */ +/* (This will be changed later, when the superblock is located) */ +file->base_addr = 0; + +/* Set 'out' parameter */ +*_file = file; done : /* Can't cleanup 'file' information, since we don't know what type it is */ diff --git a/src/H5Z.c b/src/H5Z.c index 758c575778f..bd3438832f7 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1460,118 +1460,117 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i } H5E_RESUME_ERRORS - /* clang-format on */ +/* clang-format on */ #ifdef H5Z_DEBUG - H5_timer_stop(&timer); - H5_timer_get_times(timer, ×); - fstats->stats[1].times.elapsed += times.elapsed; - fstats->stats[1].times.system += times.system; - fstats->stats[1].times.user += times.user; - - fstats->stats[1].total += MAX(*nbytes, new_nbytes); - if (0 == new_nbytes) - fstats->stats[1].errors += *nbytes; +H5_timer_stop(&timer); +H5_timer_get_times(timer, ×); +fstats->stats[1].times.elapsed += times.elapsed; +fstats->stats[1].times.system += times.system; +fstats->stats[1].times.user += times.user; + +fstats->stats[1].total += MAX(*nbytes, new_nbytes); +if (0 == new_nbytes) + fstats->stats[1].errors += *nbytes; #endif - if (0 == new_nbytes) { - if (cb_struct.func) { - H5Z_cb_return_t status; +if (0 == new_nbytes) { + if (cb_struct.func) { + H5Z_cb_return_t status; - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); - } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - } - else - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - - *nbytes = *buf_size; - failed |= (unsigned)1 << idx; + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); } - else - *nbytes = new_nbytes; - } + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); } - else if (pline) - { /* Write */ - for (idx = 0; idx < pline->nused; idx++) { - if (*filter_mask & ((unsigned)1 << idx)) { - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } - if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { - /* Check if filter is optional -- If it isn't, then error */ - if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } /* end if */ + else + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - fclass = &H5Z_table_g[fclass_idx]; + *nbytes = *buf_size; + failed |= (unsigned)1 << idx; +} +else + *nbytes = new_nbytes; +} +} +else if (pline) +{ /* Write */ + for (idx = 0; idx < pline->nused; idx++) { + if (*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } + if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { + /* Check if filter is optional -- If it isn't, then error */ + if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } /* end if */ + + fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG - fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_start(&timer); + fstats = &H5Z_stat_table_g[fclass_idx]; + H5_timer_start(&timer); #endif - H5E_PAUSE_ERRORS - {/* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - new_nbytes = (fclass->filter)(flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); - } - H5_AFTER_USER_CB(FAIL) - } - H5E_RESUME_ERRORS + H5E_PAUSE_ERRORS + {/* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL){new_nbytes = (fclass->filter)( + flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, + pline->filter[idx].cd_values, *nbytes, buf_size, buf); + } +H5_AFTER_USER_CB +(FAIL) +} +H5E_RESUME_ERRORS #ifdef H5Z_DEBUG - H5_timer_stop(&timer); - H5_timer_get_times(timer, ×); - fstats->stats[0].times.elapsed += times.elapsed; - fstats->stats[0].times.system += times.system; - fstats->stats[0].times.user += times.user; - - fstats->stats[0].total += MAX(*nbytes, new_nbytes); - if (0 == new_nbytes) - fstats->stats[0].errors += *nbytes; +H5_timer_stop(&timer); +H5_timer_get_times(timer, ×); +fstats->stats[0].times.elapsed += times.elapsed; +fstats->stats[0].times.system += times.system; +fstats->stats[0].times.user += times.user; + +fstats->stats[0].total += MAX(*nbytes, new_nbytes); +if (0 == new_nbytes) + fstats->stats[0].errors += *nbytes; #endif - if (0 == new_nbytes) { - if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { - if (cb_struct.func) { - H5Z_cb_return_t status; - - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); - } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); - } - else - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); +if (0 == new_nbytes) { + if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { + if (cb_struct.func) { + H5Z_cb_return_t status; - *nbytes = *buf_size; + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); } - failed |= (unsigned)1 << idx; - } - else - *nbytes = new_nbytes; - } /* end for */ + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + } + else + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + + *nbytes = *buf_size; } + failed |= (unsigned)1 << idx; +} +else + *nbytes = new_nbytes; +} /* end for */ +} - *filter_mask = failed; +*filter_mask = failed; -done: - FUNC_LEAVE_NOAPI(ret_value) +done : FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- From 49513614d071586f53027b17726c1412680c7808 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 17 Dec 2024 18:32:56 -0600 Subject: [PATCH 08/11] Fix blocks again! Signed-off-by: Quincey Koziol --- src/H5FD.c | 66 +++++++++---------- src/H5Z.c | 187 +++++++++++++++++++++++++++-------------------------- 2 files changed, 127 insertions(+), 126 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index 2e85b33e249..8c752efda54 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -936,7 +936,7 @@ H5FD_open(bool try, H5FD_t **_file, const char *name, unsigned flags, hid_t fapl if (HADDR_UNDEF == maxaddr) maxaddr = driver->maxaddr; - /* clang-format off */ +/* clang-format off */ /* Try dispatching to file driver */ if (try) { @@ -966,40 +966,40 @@ H5FD_open(bool try, H5FD_t **_file, const char *name, unsigned flags, hid_t fapl HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "can't open file"); } -/* clang-format on */ + /* Set the file access flags */ + file->access_flags = flags; -/* Set the file access flags */ -file->access_flags = flags; + /* Fill in public fields. We must increment the reference count on the + * driver ID to prevent it from being freed while this file is open. + */ + file->driver_id = driver_prop.driver_id; + if (H5I_inc_ref(file->driver_id, false) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); + file->cls = driver; + file->maxaddr = maxaddr; + if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); + if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); + + /* Retrieve the VFL driver feature flags */ + if (H5FD__query(file, &file->feature_flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); + + /* Increment the global serial number & assign it to this H5FD_t object */ + if (++H5FD_file_serial_no_g == 0) + /* (Just error out if we wrap around for now...) */ + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); + file->fileno = H5FD_file_serial_no_g; + + /* Start with base address set to 0 */ + /* (This will be changed later, when the superblock is located) */ + file->base_addr = 0; + + /* Set 'out' parameter */ + *_file = file; -/* Fill in public fields. We must increment the reference count on the - * driver ID to prevent it from being freed while this file is open. - */ -file->driver_id = driver_prop.driver_id; -if (H5I_inc_ref(file->driver_id, false) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); -file->cls = driver; -file->maxaddr = maxaddr; -if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &file->threshold) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment threshold"); -if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &file->alignment) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); - -/* Retrieve the VFL driver feature flags */ -if (H5FD__query(file, &file->feature_flags) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to query file driver"); - -/* Increment the global serial number & assign it to this H5FD_t object */ -if (++H5FD_file_serial_no_g == 0) - /* (Just error out if we wrap around for now...) */ - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to get file serial number"); -file->fileno = H5FD_file_serial_no_g; - -/* Start with base address set to 0 */ -/* (This will be changed later, when the superblock is located) */ -file->base_addr = 0; - -/* Set 'out' parameter */ -*_file = file; +/* clang-format on */ done : /* Can't cleanup 'file' information, since we don't know what type it is */ diff --git a/src/H5Z.c b/src/H5Z.c index bd3438832f7..9954e107f09 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1389,6 +1389,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i assert(buf && *buf); assert(!pline || pline->nused < H5Z_MAX_NFILTERS); +/* clang-format off */ + #ifdef H5Z_DEBUG H5_timer_init(&timer); #endif @@ -1447,8 +1449,6 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i tmp_flags = flags | (pline->filter[idx].flags); tmp_flags |= (edc_read == H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; - /* clang-format off */ - H5E_PAUSE_ERRORS {/* Prepare & restore library for user callback */ H5_BEFORE_USER_CB(FAIL) @@ -1460,117 +1460,118 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i } H5E_RESUME_ERRORS -/* clang-format on */ - #ifdef H5Z_DEBUG -H5_timer_stop(&timer); -H5_timer_get_times(timer, ×); -fstats->stats[1].times.elapsed += times.elapsed; -fstats->stats[1].times.system += times.system; -fstats->stats[1].times.user += times.user; - -fstats->stats[1].total += MAX(*nbytes, new_nbytes); -if (0 == new_nbytes) - fstats->stats[1].errors += *nbytes; + H5_timer_stop(&timer); + H5_timer_get_times(timer, ×); + fstats->stats[1].times.elapsed += times.elapsed; + fstats->stats[1].times.system += times.system; + fstats->stats[1].times.user += times.user; + + fstats->stats[1].total += MAX(*nbytes, new_nbytes); + if (0 == new_nbytes) + fstats->stats[1].errors += *nbytes; #endif -if (0 == new_nbytes) { - if (cb_struct.func) { - H5Z_cb_return_t status; + if (0 == new_nbytes) { + if (cb_struct.func) { + H5Z_cb_return_t status; - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); - } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - } - else - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data); + } + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); + } + else + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read"); - *nbytes = *buf_size; - failed |= (unsigned)1 << idx; -} -else - *nbytes = new_nbytes; -} -} -else if (pline) -{ /* Write */ - for (idx = 0; idx < pline->nused; idx++) { - if (*filter_mask & ((unsigned)1 << idx)) { - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ + *nbytes = *buf_size; + failed |= (unsigned)1 << idx; + } + else + *nbytes = new_nbytes; } - if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { - /* Check if filter is optional -- If it isn't, then error */ - if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } /* end if */ + } + else if (pline) + { /* Write */ + for (idx = 0; idx < pline->nused; idx++) { + if (*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } + if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { + /* Check if filter is optional -- If it isn't, then error */ + if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered"); + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } /* end if */ - fclass = &H5Z_table_g[fclass_idx]; + fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG - fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_start(&timer); + fstats = &H5Z_stat_table_g[fclass_idx]; + H5_timer_start(&timer); #endif - H5E_PAUSE_ERRORS - {/* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL){new_nbytes = (fclass->filter)( - flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); - } -H5_AFTER_USER_CB -(FAIL) -} -H5E_RESUME_ERRORS + H5E_PAUSE_ERRORS + {/* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + new_nbytes = (fclass->filter)(flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, + pline->filter[idx].cd_values, *nbytes, buf_size, buf); + } + H5_AFTER_USER_CB(FAIL) + } + H5E_RESUME_ERRORS #ifdef H5Z_DEBUG -H5_timer_stop(&timer); -H5_timer_get_times(timer, ×); -fstats->stats[0].times.elapsed += times.elapsed; -fstats->stats[0].times.system += times.system; -fstats->stats[0].times.user += times.user; - -fstats->stats[0].total += MAX(*nbytes, new_nbytes); -if (0 == new_nbytes) - fstats->stats[0].errors += *nbytes; + H5_timer_stop(&timer); + H5_timer_get_times(timer, ×); + fstats->stats[0].times.elapsed += times.elapsed; + fstats->stats[0].times.system += times.system; + fstats->stats[0].times.user += times.user; + + fstats->stats[0].total += MAX(*nbytes, new_nbytes); + if (0 == new_nbytes) + fstats->stats[0].errors += *nbytes; #endif -if (0 == new_nbytes) { - if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { - if (cb_struct.func) { - H5Z_cb_return_t status; + if (0 == new_nbytes) { + if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { + if (cb_struct.func) { + H5Z_cb_return_t status; - /* Prepare & restore library for user callback */ - H5_BEFORE_USER_CB(FAIL) - { - status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); - } - H5_AFTER_USER_CB(FAIL) - if (H5Z_CB_FAIL == status) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); - } - else - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + /* Prepare & restore library for user callback */ + H5_BEFORE_USER_CB(FAIL) + { + status = cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data); + } + H5_AFTER_USER_CB(FAIL) + if (H5Z_CB_FAIL == status) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); + } + else + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure"); - *nbytes = *buf_size; + *nbytes = *buf_size; + } + failed |= (unsigned)1 << idx; + } + else + *nbytes = new_nbytes; + } /* end for */ } - failed |= (unsigned)1 << idx; -} -else - *nbytes = new_nbytes; -} /* end for */ -} -*filter_mask = failed; +/* clang-format on */ -done : FUNC_LEAVE_NOAPI(ret_value) + *filter_mask = failed; + +done: + FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- From 92b2bc5c62ab04fd9168e4676009fd04589b9b5e Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 00:35:06 +0000 Subject: [PATCH 09/11] Committing clang-format changes --- src/H5FD.c | 2 +- src/H5Z.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index 8c752efda54..cd971011b19 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -936,7 +936,7 @@ H5FD_open(bool try, H5FD_t **_file, const char *name, unsigned flags, hid_t fapl if (HADDR_UNDEF == maxaddr) maxaddr = driver->maxaddr; -/* clang-format off */ + /* clang-format off */ /* Try dispatching to file driver */ if (try) { diff --git a/src/H5Z.c b/src/H5Z.c index 9954e107f09..09e21ba770e 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1389,7 +1389,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i assert(buf && *buf); assert(!pline || pline->nused < H5Z_MAX_NFILTERS); -/* clang-format off */ + /* clang-format off */ #ifdef H5Z_DEBUG H5_timer_init(&timer); @@ -1568,10 +1568,9 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i /* clang-format on */ - *filter_mask = failed; +*filter_mask = failed; -done: - FUNC_LEAVE_NOAPI(ret_value) +done : FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- From 153226e7954230ad9da2bb7fa24da040b4152875 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 17 Dec 2024 18:36:26 -0600 Subject: [PATCH 10/11] Try again Signed-off-by: Quincey Koziol --- src/H5Z.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index 09e21ba770e..d195a2dc5d6 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1566,11 +1566,13 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i } /* end for */ } -/* clang-format on */ + *filter_mask = failed; -*filter_mask = failed; +done: + FUNC_LEAVE_NOAPI(ret_value) + +/* clang-format on */ -done : FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- From 405013042c92f06d0c949eff6065e782e352c298 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 00:38:23 +0000 Subject: [PATCH 11/11] Committing clang-format changes --- src/H5Z.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/H5Z.c b/src/H5Z.c index d195a2dc5d6..749652ce451 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1572,7 +1572,6 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i FUNC_LEAVE_NOAPI(ret_value) /* clang-format on */ - } /*-------------------------------------------------------------------------