From b1ab59d239c74cdbea7d518b1398458c4150655f Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Fri, 28 Jul 2023 07:09:34 -0700 Subject: Bring clang-format changes from develop (#3305) --- .clang-format | 28 ++++++++++++++++------------ src/H5Iint.c | 6 +++--- test/ros3.c | 44 +++++++++++++++++++++----------------------- 3 files changed, 40 insertions(+), 38 deletions(-) diff --git a/.clang-format b/.clang-format index b51da2a..dfbfc2e 100644 --- a/.clang-format +++ b/.clang-format @@ -65,28 +65,32 @@ ObjCBlockIndentWidth: 4 ReflowComments: true SortIncludes: false StatementMacros: + - CATCH + - END_MEMBERS - FUNC_ENTER_API - - FUNC_LEAVE_API + - FUNC_ENTER_NOAPI + - FUNC_ENTER_NOAPI_NOERR + - FUNC_ENTER_NOAPI_NOINIT - FUNC_ENTER_NOAPI_NOINIT_NOERR + - FUNC_ENTER_PACKAGE + - FUNC_LEAVE_API - FUNC_LEAVE_NOAPI + - FUNC_LEAVE_NOAPI_NOFS + - H5E_END_TRY + - H5E_PRINTF + - H5E_THROW - H5_BEGIN_TAG - - HGOTO_DONE_TAG - H5_END_TAG - - HSYS_DONE_ERROR - - HSYS_GOTO_ERROR - - HDONE_ERROR - - HERROR + - H5_GCC_DIAG_OFF + - H5_GCC_DIAG_ON - H5_LEAVE - - H5E_PRINTF - - H5E_THROW - HGOTO_DONE - HGOTO_ERROR - - HMPI_ERROR - HMPI_DONE_ERROR + - HMPI_ERROR - HMPI_GOTO_ERROR - - H5_GCC_DIAG_OFF - - H5_GCC_DIAG_ON - - CATCH + - HSYS_DONE_ERROR + - HSYS_GOTO_ERROR #llvm10: TypenameMacros: #llvm10: - STACK_OF #llvm10: - LIST diff --git a/src/H5Iint.c b/src/H5Iint.c index 96ac0a5..13d2168 100644 --- a/src/H5Iint.c +++ b/src/H5Iint.c @@ -465,9 +465,9 @@ H5I__destroy_type(H5I_type_t type) } H5E_END_TRY /* don't care about errors */ - /* Check if we should release the ID class */ - if (type_info->cls->flags & H5I_CLASS_IS_APPLICATION) - type_info->cls = H5MM_xfree_const(type_info->cls); + /* Check if we should release the ID class */ + if (type_info->cls->flags & H5I_CLASS_IS_APPLICATION) + type_info->cls = H5MM_xfree_const(type_info->cls); HASH_CLEAR(hh, type_info->hash_table); type_info->hash_table = NULL; diff --git a/test/ros3.c b/test/ros3.c index ab77d93..e7bc131 100644 --- a/test/ros3.c +++ b/test/ros3.c @@ -1078,17 +1078,16 @@ test_H5FDread_without_eoa_set_fails(void) * TEST * ********/ - H5E_BEGIN_TRY{ - /* mute stack trace on expected failure */ - JSVERIFY(FAIL, H5FDread(file_shakespeare, H5FD_MEM_DRAW, H5P_DEFAULT, 1200699, 102, buffer), - "cannot read before eoa is set")} H5E_END_TRY JSVERIFY_STR("", buffer, - "buffer should remain untouched") + H5E_BEGIN_TRY{/* mute stack trace on expected failure */ + JSVERIFY(FAIL, H5FDread(file_shakespeare, H5FD_MEM_DRAW, H5P_DEFAULT, 1200699, 102, buffer), + "cannot read before eoa is set")} H5E_END_TRY + JSVERIFY_STR("", buffer, "buffer should remain untouched") - /************ - * TEARDOWN * - ************/ + /************ + * TEARDOWN * + ************/ - FAIL_IF(FAIL == H5FDclose(file_shakespeare)) file_shakespeare = NULL; + FAIL_IF(FAIL == H5FDclose(file_shakespeare)) file_shakespeare = NULL; FAIL_IF(FAIL == H5Pclose(fapl_id)) fapl_id = -1; @@ -1388,17 +1387,16 @@ test_noops_and_autofails(void) H5E_BEGIN_TRY{JSVERIFY(FAIL, H5FDwrite(file, H5FD_MEM_DRAW, H5P_DEFAULT, 1000, 35, data), "write must fail")} H5E_END_TRY - H5E_BEGIN_TRY{ - JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, FALSE), "truncate must fail")} H5E_END_TRY + H5E_BEGIN_TRY{JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, FALSE), "truncate must fail")} H5E_END_TRY - H5E_BEGIN_TRY{JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, TRUE), - "truncate must fail (closing)")} H5E_END_TRY + H5E_BEGIN_TRY{ + JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, TRUE), "truncate must fail (closing)")} H5E_END_TRY - /************ - * TEARDOWN * - ************/ + /************ + * TEARDOWN * + ************/ - FAIL_IF(FAIL == H5FDclose(file)) file = NULL; + FAIL_IF(FAIL == H5FDclose(file)) file = NULL; FAIL_IF(FAIL == H5Pclose(fapl_id)) fapl_id = -1; @@ -1622,13 +1620,13 @@ test_H5F_integration(void) */ H5E_BEGIN_TRY{FAIL_IF(0 <= H5Fopen(url_h5_public, H5F_ACC_RDWR, fapl_id))} H5E_END_TRY - /* H5Fcreate() is not allowed with this file driver. - */ - H5E_BEGIN_TRY{FAIL_IF(0 <= H5Fcreate(url_missing, H5F_ACC_RDONLY, H5P_DEFAULT, fapl_id))} H5E_END_TRY + /* H5Fcreate() is not allowed with this file driver. + */ + H5E_BEGIN_TRY{FAIL_IF(0 <= H5Fcreate(url_missing, H5F_ACC_RDONLY, H5P_DEFAULT, fapl_id))} H5E_END_TRY - /* Successful open. - */ - file = H5Fopen(url_h5_public, H5F_ACC_RDONLY, fapl_id); + /* Successful open. + */ + file = H5Fopen(url_h5_public, H5F_ACC_RDONLY, fapl_id); FAIL_IF(file < 0) /************ -- cgit v0.12