From 5af41da255105aa1593bf6106720ef6d5d28b8de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 23:07:03 +0000 Subject: [PATCH 1/2] Build(deps): Bump msys2/setup-msys2 from 2.24.1 to 2.25.0 Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.24.1 to 2.25.0. - [Release notes](https://github.com/msys2/setup-msys2/releases) - [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md) - [Commits](https://github.com/msys2/setup-msys2/compare/ddf331adaebd714795f1042345e6ca57bd66cea8...c52d1fa9c7492275e60fe763540fb601f5f232a1) --- updated-dependencies: - dependency-name: msys2/setup-msys2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/msys2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml index 3173560bda..f05f724643 100644 --- a/.github/workflows/msys2.yml +++ b/.github/workflows/msys2.yml @@ -27,7 +27,7 @@ jobs: egress-policy: audit - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: msys2/setup-msys2@ddf331adaebd714795f1042345e6ca57bd66cea8 # v2.24.1 + - uses: msys2/setup-msys2@c52d1fa9c7492275e60fe763540fb601f5f232a1 # v2.25.0 with: msystem: MINGW64 update: true From 8a45f27120dc4c8b683e61233447680398a97fd3 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 23:14:03 +0000 Subject: [PATCH 2/2] Committing clang-format changes --- .../applications/exodiff/ED_SystemInterface.C | 8 ++- .../applications/exodiff/ED_SystemInterface.h | 48 +++++++++--------- .../seacas/applications/exodiff/create_file.C | 38 +++++++------- .../seacas/applications/exodiff/exo_entity.h | 8 +-- .../seacas/applications/exodiff/exo_read.C | 3 +- .../seacas/applications/exodiff/exo_read.h | 50 +++++++++---------- .../seacas/applications/exodiff/node_set.h | 2 +- .../seacas/applications/exodiff/stringx.h | 2 +- .../libraries/exodus/src/ex_get_init_ext.c | 24 ++++----- 9 files changed, 89 insertions(+), 94 deletions(-) diff --git a/packages/seacas/applications/exodiff/ED_SystemInterface.C b/packages/seacas/applications/exodiff/ED_SystemInterface.C index 8cfbb25cc6..5c68c68ceb 100644 --- a/packages/seacas/applications/exodiff/ED_SystemInterface.C +++ b/packages/seacas/applications/exodiff/ED_SystemInterface.C @@ -31,8 +31,7 @@ namespace { } std::string Parse_Variables(std::string xline, std::ifstream &cmd_file, bool &all_flag, - Tolerance &def_tol, NameList &names, - std::vector &toler); + Tolerance &def_tol, NameList &names, std::vector &toler); bool str_equal(const std::string &s1, const std::string &s2) { @@ -490,7 +489,7 @@ void SystemInterface::enroll_options() options_.enroll("T", GetLongOption::MandatoryValue, "Backward-compatible option for -TimeStepOffset", nullptr); options_.enroll("x", GetLongOption::MandatoryValue, "Backward-compatible option for -exclude", - nullptr); + nullptr); } bool SystemInterface::parse_options(int argc, char **argv) @@ -1375,8 +1374,7 @@ void SystemInterface::Parse_Command_File() namespace { std::string Parse_Variables(std::string xline, std::ifstream &cmd_file, bool &all_flag, - Tolerance &def_tol, NameList &names, - std::vector &toler) + Tolerance &def_tol, NameList &names, std::vector &toler) { toler.clear(); names.clear(); diff --git a/packages/seacas/applications/exodiff/ED_SystemInterface.h b/packages/seacas/applications/exodiff/ED_SystemInterface.h index 702e816368..e186a79398 100644 --- a/packages/seacas/applications/exodiff/ED_SystemInterface.h +++ b/packages/seacas/applications/exodiff/ED_SystemInterface.h @@ -48,37 +48,37 @@ class SystemInterface int max_warnings{100}; - NameList glob_var_names{}; - Tolerance glob_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector glob_var{}; + NameList glob_var_names{}; + Tolerance glob_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; + std::vector glob_var{}; - NameList node_var_names{}; - Tolerance node_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector node_var{}; + NameList node_var_names{}; + Tolerance node_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; + std::vector node_var{}; - NameList elmt_var_names{}; - Tolerance elmt_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector elmt_var{}; + NameList elmt_var_names{}; + Tolerance elmt_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; + std::vector elmt_var{}; - NameList elmt_att_names{}; - Tolerance elmt_att_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector elmt_att{}; + NameList elmt_att_names{}; + Tolerance elmt_att_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; + std::vector elmt_att{}; - NameList ns_var_names{}; - Tolerance ns_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector ns_var{}; + NameList ns_var_names{}; + Tolerance ns_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; + std::vector ns_var{}; - NameList ss_var_names{}; - Tolerance ss_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector ss_var{}; + NameList ss_var_names{}; + Tolerance ss_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; + std::vector ss_var{}; - NameList eb_var_names{}; - Tolerance eb_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector eb_var{}; + NameList eb_var_names{}; + Tolerance eb_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; + std::vector eb_var{}; - NameList fb_var_names{}; - Tolerance fb_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector fb_var{}; + NameList fb_var_names{}; + Tolerance fb_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; + std::vector fb_var{}; // time step exclusion data std::vector exclude_steps{}; diff --git a/packages/seacas/applications/exodiff/create_file.C b/packages/seacas/applications/exodiff/create_file.C index 489dcb7e93..c23fc192c1 100644 --- a/packages/seacas/applications/exodiff/create_file.C +++ b/packages/seacas/applications/exodiff/create_file.C @@ -20,17 +20,16 @@ template class Exo_Read; namespace { - void build_variable_names(const char *type, NameList &names, - std::vector &tols, const Tolerance &default_tol, - bool do_all_flag, const NameList &var_names1, - const NameList &var_names2, bool *diff_found); + void build_variable_names(const char *type, NameList &names, std::vector &tols, + const Tolerance &default_tol, bool do_all_flag, + const NameList &var_names1, const NameList &var_names2, + bool *diff_found); template - void build_truth_table(EXOTYPE type, const char *label, NameList &names, - size_t num_entity, Exo_Read &file1, Exo_Read &file2, - const NameList &var_names1, - const NameList &var_names2, std::vector &truth_tab, - bool quiet_flag, bool *diff_found); + void build_truth_table(EXOTYPE type, const char *label, NameList &names, size_t num_entity, + Exo_Read &file1, Exo_Read &file2, const NameList &var_names1, + const NameList &var_names2, std::vector &truth_tab, bool quiet_flag, + bool *diff_found); void output_exodus_names(int file_id, EXOTYPE type, const NameList &names); void output_diff_names(const char *type, const NameList &names); @@ -309,10 +308,10 @@ namespace { } } - void build_variable_names(const char *type, NameList &names, - std::vector &tols, const Tolerance &default_tol, - bool do_all_flag, const NameList &var_names1, - const NameList &var_names2, bool *diff_found) + void build_variable_names(const char *type, NameList &names, std::vector &tols, + const Tolerance &default_tol, bool do_all_flag, + const NameList &var_names1, const NameList &var_names2, + bool *diff_found) { NameList x_list; // exclusion list for (auto name : names) { @@ -380,8 +379,8 @@ namespace { } } - NameList tmp_list; - std::vector tmp_tols; + NameList tmp_list; + std::vector tmp_tols; for (size_t n = 0; n < names.size(); ++n) { std::string name = names[n]; chop_whitespace(name); @@ -425,11 +424,10 @@ namespace { } template - void build_truth_table(EXOTYPE type, const char *label, NameList &names, - size_t num_entity, Exo_Read &file1, Exo_Read &file2, - const NameList &var_names1, - const NameList &var_names2, std::vector &truth_tab, - bool quiet_flag, bool *diff_found) + void build_truth_table(EXOTYPE type, const char *label, NameList &names, size_t num_entity, + Exo_Read &file1, Exo_Read &file2, const NameList &var_names1, + const NameList &var_names2, std::vector &truth_tab, bool quiet_flag, + bool *diff_found) { if (!names.empty()) { int num_vars = names.size(); diff --git a/packages/seacas/applications/exodiff/exo_entity.h b/packages/seacas/applications/exodiff/exo_entity.h index 45f880021e..055df6aadb 100644 --- a/packages/seacas/applications/exodiff/exo_entity.h +++ b/packages/seacas/applications/exodiff/exo_entity.h @@ -54,10 +54,10 @@ class Exo_Entity const double *Get_Attributes(int attr_index) const; void Free_Attributes(); - const std::string &Get_Attribute_Name(int attr_index) const; - const std::string &Name() const { return name_; } - const NameList &Attribute_Names() const { return attributeNames; } - int Find_Attribute_Index(const std::string &name) const; + const std::string &Get_Attribute_Name(int attr_index) const; + const std::string &Name() const { return name_; } + const NameList &Attribute_Names() const { return attributeNames; } + int Find_Attribute_Index(const std::string &name) const; // Return "Element Block", "Nodeset", "Sideset, depending on underlying type. virtual const char *label() const = 0; diff --git a/packages/seacas/applications/exodiff/exo_read.C b/packages/seacas/applications/exodiff/exo_read.C index 09d2b1c70b..ce1bb25053 100644 --- a/packages/seacas/applications/exodiff/exo_read.C +++ b/packages/seacas/applications/exodiff/exo_read.C @@ -1337,8 +1337,7 @@ template void Exo_Read::Get_Init_Data() } // End of EXODIFF namespace { - void read_vars(int file_id, EXOTYPE flag, const char *type, int num_vars, - NameList &varlist) + void read_vars(int file_id, EXOTYPE flag, const char *type, int num_vars, NameList &varlist) { if (num_vars != 0) { int name_size = ex_inquire_int(file_id, EX_INQ_MAX_READ_NAME_LENGTH); diff --git a/packages/seacas/applications/exodiff/exo_read.h b/packages/seacas/applications/exodiff/exo_read.h index ec861d5790..bf2504feab 100644 --- a/packages/seacas/applications/exodiff/exo_read.h +++ b/packages/seacas/applications/exodiff/exo_read.h @@ -74,14 +74,14 @@ template class Exo_Read // Variables: - size_t Num_Global_Vars() const { return global_vars.size(); } - size_t Num_Nodal_Vars() const { return nodal_vars.size(); } - size_t Num_Element_Vars() const { return elmt_vars.size(); } - size_t Num_Element_Atts() const { return elmt_atts.size(); } - size_t Num_NS_Vars() const { return ns_vars.size(); } - size_t Num_SS_Vars() const { return ss_vars.size(); } - size_t Num_EB_Vars() const { return eb_vars.size(); } - size_t Num_FB_Vars() const { return fb_vars.size(); } + size_t Num_Global_Vars() const { return global_vars.size(); } + size_t Num_Nodal_Vars() const { return nodal_vars.size(); } + size_t Num_Element_Vars() const { return elmt_vars.size(); } + size_t Num_Element_Atts() const { return elmt_atts.size(); } + size_t Num_NS_Vars() const { return ns_vars.size(); } + size_t Num_SS_Vars() const { return ss_vars.size(); } + size_t Num_EB_Vars() const { return eb_vars.size(); } + size_t Num_FB_Vars() const { return fb_vars.size(); } const NameList &Global_Var_Names() const { return global_vars; } const NameList &Nodal_Var_Names() const { return nodal_vars; } const NameList &Element_Var_Names() const { return elmt_vars; } @@ -197,22 +197,22 @@ template class Exo_Read // GENESIS info: - std::string title{}; - NameList coord_names{}; - size_t num_nodes{0}; - int dimension{0}; - size_t num_elmts{0}; - size_t num_faces{0}; - size_t num_edges{0}; - size_t num_elmt_blocks{0}; - size_t num_node_sets{0}; - size_t num_side_sets{0}; - size_t num_edge_blocks{0}; - size_t num_face_blocks{0}; - size_t num_assemblies{0}; - float db_version{0.0}; - float api_version{0.0}; - int io_word_size{0}; // Note: The "compute word size" is always 8. + std::string title{}; + NameList coord_names{}; + size_t num_nodes{0}; + int dimension{0}; + size_t num_elmts{0}; + size_t num_faces{0}; + size_t num_edges{0}; + size_t num_elmt_blocks{0}; + size_t num_node_sets{0}; + size_t num_side_sets{0}; + size_t num_edge_blocks{0}; + size_t num_face_blocks{0}; + size_t num_assemblies{0}; + float db_version{0.0}; + float api_version{0.0}; + int io_word_size{0}; // Note: The "compute word size" is always 8. Exo_Block *eblocks{nullptr}; // Array. Node_Set *nsets{nullptr}; // Array. @@ -239,7 +239,7 @@ template class Exo_Read NameList fb_vars{}; std::vector change_set_ids{}; - NameList change_set_names{}; + NameList change_set_names{}; double time_scale{1.0}; double time_offset{0.0}; diff --git a/packages/seacas/applications/exodiff/node_set.h b/packages/seacas/applications/exodiff/node_set.h index e7c83df926..1a6203c008 100644 --- a/packages/seacas/applications/exodiff/node_set.h +++ b/packages/seacas/applications/exodiff/node_set.h @@ -5,8 +5,8 @@ // See packages/seacas/LICENSE for details #pragma once -#include "util.h" #include "exo_entity.h" +#include "util.h" template class Exo_Read; diff --git a/packages/seacas/applications/exodiff/stringx.h b/packages/seacas/applications/exodiff/stringx.h index 4605676480..0bd980286d 100644 --- a/packages/seacas/applications/exodiff/stringx.h +++ b/packages/seacas/applications/exodiff/stringx.h @@ -5,9 +5,9 @@ // See packages/seacas/LICENSE for details #pragma once +#include "util.h" #include #include -#include "util.h" //! Compare a string against another "master" string, where the string, str, //! can be abbreiviated to as little as min_length characters. Returns true diff --git a/packages/seacas/libraries/exodus/src/ex_get_init_ext.c b/packages/seacas/libraries/exodus/src/ex_get_init_ext.c index f3e91388ec..cd2fa90e21 100644 --- a/packages/seacas/libraries/exodus/src/ex_get_init_ext.c +++ b/packages/seacas/libraries/exodus/src/ex_get_init_ext.c @@ -186,22 +186,22 @@ int ex_get_init_ext(int exoid, ex_init_params *info) * trailing null */ if (title_len > 0) { if (title_len > MAX_LINE_LENGTH) { - char *title = malloc(title_len + 1); - if ((status = nc_get_att_text(rootid, NC_GLOBAL, ATT_TITLE, title)) == NC_NOERR) { - ex_copy_string(info->title, title, MAX_LINE_LENGTH + 1); - info->title[MAX_LINE_LENGTH] = '\0'; - } - free(title); + char *title = malloc(title_len + 1); + if ((status = nc_get_att_text(rootid, NC_GLOBAL, ATT_TITLE, title)) == NC_NOERR) { + ex_copy_string(info->title, title, MAX_LINE_LENGTH + 1); + info->title[MAX_LINE_LENGTH] = '\0'; + } + free(title); } else { - status = nc_get_att_text(rootid, NC_GLOBAL, ATT_TITLE, info->title); - info->title[title_len] = '\0'; + status = nc_get_att_text(rootid, NC_GLOBAL, ATT_TITLE, info->title); + info->title[title_len] = '\0'; } if (status != NC_NOERR) { - char errmsg[MAX_ERR_LENGTH]; - snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get title in file id %d", rootid); - ex_err_fn(exoid, __func__, errmsg, status); - EX_FUNC_LEAVE(EX_FATAL); + char errmsg[MAX_ERR_LENGTH]; + snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to get title in file id %d", rootid); + ex_err_fn(exoid, __func__, errmsg, status); + EX_FUNC_LEAVE(EX_FATAL); } } }