From 3fa47c6c951714a4df21fe0aae939d5a78b4ed53 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Thu, 3 Feb 2022 14:17:02 -0700 Subject: [PATCH] Remove some compiler warnings --- .../applications/conjoin/CJ_SystemInterface.h | 24 +++---- .../applications/epu/EP_SystemInterface.h | 16 ++--- .../applications/exodiff/ED_SystemInterface.h | 48 +++++++------- .../seacas/applications/exodiff/edge_block.h | 4 +- .../seacas/applications/exodiff/exoII_read.h | 24 +++---- .../seacas/applications/exodiff/exo_block.h | 6 +- .../seacas/applications/exodiff/exo_entity.h | 22 +++---- .../seacas/applications/exodiff/face_block.h | 4 +- .../applications/nas2exo/N2EDataTypes.h | 12 ++-- .../applications/nas2exo/N2EExoWriter.h | 10 +-- .../applications/nas2exo/N2ENasReader.h | 10 +-- packages/seacas/applications/nem_slice/elb.h | 22 +++---- .../applications/nem_spread/ps_pario_const.h | 36 +++++------ .../seacas/applications/zellij/Decompose.C | 5 +- .../seacas/libraries/aprepro_lib/aprepro.h | 4 +- .../seacas/libraries/chaco/assign/median.c | 64 +++++++++---------- .../seacas/libraries/chaco/bpmatch/movevtxs.c | 28 ++++---- .../libraries/exodus/src/ex_get_assemblies.c | 4 +- .../seacas/libraries/ioss/src/Ioss_DataPool.h | 38 +++++------ .../libraries/ioss/src/Ioss_DatabaseIO.h | 22 +++---- .../libraries/ioss/src/Ioss_ParallelUtils.h | 10 +-- .../libraries/ioss/src/Ioss_PropertyManager.h | 2 +- .../libraries/ioss/src/cgns/Iocgns_Utils.C | 3 +- .../libraries/ioss/src/main/io_modify.C | 2 +- .../seacas/libraries/supes/ext_lib/excpus.c | 10 ++- .../seacas/libraries/supes/ext_lib/extime.c | 3 +- .../seacas/libraries/suplib_cpp/GetLongOpt.h | 11 ++-- .../libraries/suplib_cpp/smart_assert.h | 8 +-- 28 files changed, 228 insertions(+), 224 deletions(-) diff --git a/packages/seacas/applications/conjoin/CJ_SystemInterface.h b/packages/seacas/applications/conjoin/CJ_SystemInterface.h index d39efb4457..230fd0170d 100644 --- a/packages/seacas/applications/conjoin/CJ_SystemInterface.h +++ b/packages/seacas/applications/conjoin/CJ_SystemInterface.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -52,13 +52,13 @@ namespace Excn { static void show_version(); // Make this private eventually... - StringVector inputFiles_; - std::string outputName_; + StringVector inputFiles_{}; + std::string outputName_{}; private: void enroll_options(); - GetLongOption options_; //!< Options parsing + GetLongOption options_{}; //!< Options parsing int debugLevel_{0}; int screenWidth_{0}; @@ -75,17 +75,17 @@ namespace Excn { double aliveValue_{-1.0}; double interpartMinimumTimeDelta_{0.0}; - std::string elementStatusVariable_; - std::string nodalStatusVariable_; + std::string elementStatusVariable_{}; + std::string nodalStatusVariable_{}; // Mesh status variable to combine with elementStatusVariable_ - std::string meshCombineStatusVariable_; + std::string meshCombineStatusVariable_{}; - StringIdVector globalVarNames_; - StringIdVector nodeVarNames_; - StringIdVector elemVarNames_; - StringIdVector nsetVarNames_; - StringIdVector ssetVarNames_; + StringIdVector globalVarNames_{}; + StringIdVector nodeVarNames_{}; + StringIdVector elemVarNames_{}; + StringIdVector nsetVarNames_{}; + StringIdVector ssetVarNames_{}; }; } // namespace Excn #endif diff --git a/packages/seacas/applications/epu/EP_SystemInterface.h b/packages/seacas/applications/epu/EP_SystemInterface.h index b7946d7466..5fba99aaef 100644 --- a/packages/seacas/applications/epu/EP_SystemInterface.h +++ b/packages/seacas/applications/epu/EP_SystemInterface.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -163,13 +163,13 @@ namespace Excn { bool verifyValidFile_{false}; bool addNodalCommunicationMap_{false}; - StringIdVector globalVarNames_; - StringIdVector nodeVarNames_; - StringIdVector elemVarNames_; - StringIdVector nsetVarNames_; - StringIdVector ssetVarNames_; - StringIdVector edblkVarNames_; - StringIdVector fablkVarNames_; + StringIdVector globalVarNames_{}; + StringIdVector nodeVarNames_{}; + StringIdVector elemVarNames_{}; + StringIdVector nsetVarNames_{}; + StringIdVector ssetVarNames_{}; + StringIdVector edblkVarNames_{}; + StringIdVector fablkVarNames_{}; }; inline int SystemInterface::part_count() const diff --git a/packages/seacas/applications/exodiff/ED_SystemInterface.h b/packages/seacas/applications/exodiff/ED_SystemInterface.h index c5764a6822..c0b12ded2d 100644 --- a/packages/seacas/applications/exodiff/ED_SystemInterface.h +++ b/packages/seacas/applications/exodiff/ED_SystemInterface.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -42,49 +42,49 @@ class SystemInterface int time_step_stop{-1}; // Last step to compare int time_step_increment{1}; // Step increment - std::pair explicit_steps; // Only compare these two steps (db1:db2) if nonzero. + std::pair explicit_steps{}; // Only compare these two steps (db1:db2) if nonzero. int max_warnings{100}; - std::vector glob_var_names; + std::vector glob_var_names{}; Tolerance glob_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector glob_var; + std::vector glob_var{}; - std::vector node_var_names; + std::vector node_var_names{}; Tolerance node_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector node_var; + std::vector node_var{}; - std::vector elmt_var_names; + std::vector elmt_var_names{}; Tolerance elmt_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector elmt_var; + std::vector elmt_var{}; - std::vector elmt_att_names; + std::vector elmt_att_names{}; Tolerance elmt_att_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector elmt_att; + std::vector elmt_att{}; - std::vector ns_var_names; + std::vector ns_var_names{}; Tolerance ns_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector ns_var; + std::vector ns_var{}; - std::vector ss_var_names; + std::vector ss_var_names{}; Tolerance ss_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector ss_var; + std::vector ss_var{}; - std::vector eb_var_names; + std::vector eb_var_names{}; Tolerance eb_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector eb_var; + std::vector eb_var{}; - std::vector fb_var_names; + std::vector fb_var_names{}; Tolerance fb_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0}; - std::vector fb_var; + std::vector fb_var{}; // time step exclusion data - std::vector exclude_steps; + std::vector exclude_steps{}; - std::string file1; - std::string file2; - std::string diff_file; - std::string command_file; + std::string file1{}; + std::string file2{}; + std::string diff_file{}; + std::string command_file{}; bool quiet_flag{false}; // By default, warnings and other info is produced bool show_all_diffs{false}; // Be default, show only maximum diff for each variable; @@ -137,7 +137,7 @@ class SystemInterface private: void enroll_options(); - GetLongOption options_; //!< Options parsing + GetLongOption options_{}; //!< Options parsing }; extern SystemInterface interFace; diff --git a/packages/seacas/applications/exodiff/edge_block.h b/packages/seacas/applications/exodiff/edge_block.h index 3ce1eeeaf2..94765fe873 100644 --- a/packages/seacas/applications/exodiff/edge_block.h +++ b/packages/seacas/applications/exodiff/edge_block.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -34,7 +34,7 @@ template class Edge_Block : public Exo_Entity const char *label() const override { return "Edgeblock"; } const char *short_label() const override { return "edgeblock"; } - std::string elmt_type; + std::string elmt_type{}; int num_edges_per_elmt{-1}; friend class ExoII_Read; diff --git a/packages/seacas/applications/exodiff/exoII_read.h b/packages/seacas/applications/exodiff/exoII_read.h index 6438c6f339..d1a4863bc0 100644 --- a/packages/seacas/applications/exodiff/exoII_read.h +++ b/packages/seacas/applications/exodiff/exoII_read.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -184,13 +184,13 @@ template class ExoII_Read std::pair Global_to_Block_Local(size_t global_elmt_num) const; protected: - std::string file_name; + std::string file_name{}; int file_id{-1}; // Exodus file id; also used to determine if file is open. // GENESIS info: - std::string title; - std::vector coord_names; + std::string title{}; + std::vector coord_names{}; size_t num_nodes{0}; int dimension{0}; size_t num_elmts{0}; @@ -220,14 +220,14 @@ template class ExoII_Read // RESULTS info: - std::vector global_vars; - std::vector nodal_vars; - std::vector elmt_vars; - std::vector elmt_atts; - std::vector ns_vars; - std::vector ss_vars; - std::vector eb_vars; - std::vector fb_vars; + std::vector global_vars{}; + std::vector nodal_vars{}; + std::vector elmt_vars{}; + std::vector elmt_atts{}; + std::vector ns_vars{}; + std::vector ss_vars{}; + std::vector eb_vars{}; + std::vector fb_vars{}; int num_times{0}; double *times{nullptr}; diff --git a/packages/seacas/applications/exodiff/exo_block.h b/packages/seacas/applications/exodiff/exo_block.h index 1facf8af38..af40f2cd25 100644 --- a/packages/seacas/applications/exodiff/exo_block.h +++ b/packages/seacas/applications/exodiff/exo_block.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -48,10 +48,10 @@ template class Exo_Block : public Exo_Entity const char *label() const override { return "Element Block"; } const char *short_label() const override { return "block"; } - std::string elmt_type; + std::string elmt_type{}; int num_nodes_per_elmt{-1}; int64_t offset_{0}; - std::vector conn; // Array; holds a matrix, num_elmts by num_nodes_per_elmt. + std::vector conn{}; // Array; holds a matrix, num_elmts by num_nodes_per_elmt. friend class ExoII_Read; }; diff --git a/packages/seacas/applications/exodiff/exo_entity.h b/packages/seacas/applications/exodiff/exo_entity.h index f36b921dce..798866c7bb 100644 --- a/packages/seacas/applications/exodiff/exo_entity.h +++ b/packages/seacas/applications/exodiff/exo_entity.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -71,7 +71,7 @@ class Exo_Entity virtual EXOTYPE exodus_type() const = 0; protected: - std::string name_; + std::string name_{}; int fileId{-1}; ex_entity_id id_{EX_INVALID_ID}; size_t index_{0}; // 0-offset index into Exodus nodeset list. @@ -83,15 +83,15 @@ class Exo_Entity void get_truth_table() const; - mutable int *truth_{nullptr}; // Array; holds local truth table for this entity - int currentStep{0}; // Time step number of the current results. - int numVars{0}; // Total number of variables in the file. - double **results_{nullptr}; // Array of pointers (length numVars) - // to arrays of results (length num_entity). - int numAttr{0}; // Total number of attributes in the file. - std::vector attributes_; // Array of pointers (length numAttr) - // to arrays of attributes (length num_entity). - std::vector attributeNames; + mutable int *truth_{nullptr}; // Array; holds local truth table for this entity + int currentStep{0}; // Time step number of the current results. + int numVars{0}; // Total number of variables in the file. + double **results_{nullptr}; // Array of pointers (length numVars) + // to arrays of results (length num_entity). + int numAttr{0}; // Total number of attributes in the file. + std::vector attributes_{}; // Array of pointers (length numAttr) + // to arrays of attributes (length num_entity). + std::vector attributeNames{}; template friend class ExoII_Read; }; diff --git a/packages/seacas/applications/exodiff/face_block.h b/packages/seacas/applications/exodiff/face_block.h index 1148e19618..c9eed0664f 100644 --- a/packages/seacas/applications/exodiff/face_block.h +++ b/packages/seacas/applications/exodiff/face_block.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -34,7 +34,7 @@ template class Face_Block : public Exo_Entity const char *label() const override { return "Faceblock"; } const char *short_label() const override { return "faceblock"; } - std::string elmt_type; + std::string elmt_type{}; int num_faces_per_elmt{-1}; friend class ExoII_Read; diff --git a/packages/seacas/applications/nas2exo/N2EDataTypes.h b/packages/seacas/applications/nas2exo/N2EDataTypes.h index 4a874e881d..9b6a6bea6b 100644 --- a/packages/seacas/applications/nas2exo/N2EDataTypes.h +++ b/packages/seacas/applications/nas2exo/N2EDataTypes.h @@ -4,7 +4,7 @@ * Created on: Oct 10, 2020 * Author: Ramon J. Moral(Contractor, STRA LLC) * John Niederhouse(ORG 1443, SNL, Coordinator) - * Copyright: Sandia National Labs, 2020, 2021 + * Copyright: Sandia National Labs, 2020, 2021, 2022 */ #ifndef INCLUDE_N2EDATATYPES_H_ @@ -24,12 +24,12 @@ namespace N2EModules { struct supportedElements { - ex_entity_type elementType; + ex_entity_type elementType{}; char elemDesc[MAX_STR_LENGTH]{'\0'}; - int64_t numNodesPerElem; - int64_t numEdgesPerElem; - int64_t numFacesPerElem; - int64_t numAttrPerElem; + int64_t numNodesPerElem{}; + int64_t numEdgesPerElem{}; + int64_t numFacesPerElem{}; + int64_t numAttrPerElem{}; supportedElements(ex_entity_type elType, std::string elDesc, int64_t nodesPer, int64_t edgesPer, int64_t facesPer, int64_t attrPer) diff --git a/packages/seacas/applications/nas2exo/N2EExoWriter.h b/packages/seacas/applications/nas2exo/N2EExoWriter.h index 187301dd79..2e764ebdcd 100644 --- a/packages/seacas/applications/nas2exo/N2EExoWriter.h +++ b/packages/seacas/applications/nas2exo/N2EExoWriter.h @@ -4,7 +4,7 @@ * Created on: Oct 10, 2020 * Author: Ramon J. Moral(Contractor, STRA LLC) * John Niederhouse(ORG 1443, SNL, Coordinator) - * Copyright: Sandia National Labs, OCT-2021 + * Copyright: Sandia National Labs, OCT-2022 */ #ifndef _EXOWRITER_H_ @@ -44,11 +44,11 @@ namespace ExoModules { inline size_t getHexesOut() { return this->writtenHexes; }; protected: - std::vector sections; - std::vector gridList; - std::vector elementList; + std::vector sections{}; + std::vector gridList{}; + std::vector elementList{}; - std::string modelTitle; + std::string modelTitle{}; int exoFileID{0}; diff --git a/packages/seacas/applications/nas2exo/N2ENasReader.h b/packages/seacas/applications/nas2exo/N2ENasReader.h index 2001c08600..a0872651f7 100644 --- a/packages/seacas/applications/nas2exo/N2ENasReader.h +++ b/packages/seacas/applications/nas2exo/N2ENasReader.h @@ -2,7 +2,7 @@ // Name : testnas2exo.cpp // Author : Ramon J. Moral (STRA LLC), John Niederhaus (Coordinator, SNL) // Version : -// Copyright : (c) Sandia National Labs 2020, 2021 +// Copyright : (c) Sandia National Labs 2020, 2021, 2022 // Description : Testing nas2exo Library, C++ 14 //============================================================================ @@ -47,11 +47,11 @@ namespace NasModules { std::unique_ptr inStream{}; unsigned lineCount{0u}; - std::vector sections; - std::vector gridList; - std::vector elementList; + std::vector sections{}; + std::vector gridList{}; + std::vector elementList{}; - std::string modelTitle; + std::string modelTitle{}; bool doesFileExist(const std::string &fname); // Local buffer for reading faster diff --git a/packages/seacas/applications/nem_slice/elb.h b/packages/seacas/applications/nem_slice/elb.h index 1e9e742d8d..183f0c5f77 100644 --- a/packages/seacas/applications/nem_slice/elb.h +++ b/packages/seacas/applications/nem_slice/elb.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -83,19 +83,19 @@ template struct LB_Description int *vertex2proc{nullptr}; /* Nodal */ - std::vector> int_nodes; - std::vector> bor_nodes; - std::vector> ext_nodes; - std::vector> ext_procs; + std::vector> int_nodes{}; + std::vector> bor_nodes{}; + std::vector> ext_nodes{}; + std::vector> ext_procs{}; /* Elemental */ std::vector>> born_procs{}; - std::vector> int_elems; - std::vector> bor_elems; - std::vector> e_cmap_elems; - std::vector> e_cmap_sides; - std::vector> e_cmap_procs; - std::vector> e_cmap_neigh; + std::vector> int_elems{}; + std::vector> bor_elems{}; + std::vector> e_cmap_elems{}; + std::vector> e_cmap_sides{}; + std::vector> e_cmap_procs{}; + std::vector> e_cmap_neigh{}; LB_Description() = default; }; diff --git a/packages/seacas/applications/nem_spread/ps_pario_const.h b/packages/seacas/applications/nem_spread/ps_pario_const.h index 6c33c48913..9890495127 100644 --- a/packages/seacas/applications/nem_spread/ps_pario_const.h +++ b/packages/seacas/applications/nem_spread/ps_pario_const.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -23,37 +23,37 @@ extern double PIO_Time_Array[]; /* Vector for timings */ struct Parallel_IO { - int Dsk_List_Cnt; + int Dsk_List_Cnt{}; - int *Dsk_List; - int **RDsk_List; + int *Dsk_List{nullptr}; + int **RDsk_List{nullptr}; - int Num_Dsk_Ctrlrs; /* The number of disk controllers. */ - int Num_Dsks_PCtrlr; /* The number of disks per controller. */ - int PDsk_Add_Fact; /* The offset from zero used by the */ - /* the target machine. */ + int Num_Dsk_Ctrlrs{}; /* The number of disk controllers. */ + int Num_Dsks_PCtrlr{}; /* The number of disks per controller. */ + int PDsk_Add_Fact{}; /* The offset from zero used by the */ + /* the target machine. */ - int Zeros; /* 1 - if the target machine uses leading zeros when */ - /* designating the disk number (eg - the paragon */ - /* uses /pfs/io_01) */ - /* 0 - if it does not (eg - the tflop uses */ - /* /pfs/tmp_1) */ + int Zeros{}; /* 1 - if the target machine uses leading zeros when */ + /* designating the disk number (eg - the paragon */ + /* uses /pfs/io_01) */ + /* 0 - if it does not (eg - the tflop uses */ + /* /pfs/tmp_1) */ /* 1 - don't create a subdirectory for the spread files; write * them in same directory as the mesh file */ - int NoSubdirectory; + int NoSubdirectory{}; /* The root location of the parallel disks */ - std::string Par_Dsk_Root; + std::string Par_Dsk_Root{}; /* The subdirectory to write files to */ - std::string Par_Dsk_SubDirec; + std::string Par_Dsk_SubDirec{}; /* The filename extension for the parallel files */ - std::string Exo_Extension; + std::string Exo_Extension{}; - bool Staged_Writes; + bool Staged_Writes{}; }; extern struct Parallel_IO PIO_Info; diff --git a/packages/seacas/applications/zellij/Decompose.C b/packages/seacas/applications/zellij/Decompose.C index 695d2dad95..6d91c371c0 100644 --- a/packages/seacas/applications/zellij/Decompose.C +++ b/packages/seacas/applications/zellij/Decompose.C @@ -1,4 +1,4 @@ -// Copyright(C) 2021 National Technology & Engineering Solutions +// Copyright(C) 2021, 2022 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -18,6 +18,7 @@ #include "Cell.h" #include "Grid.h" #include "Ioss_ElementBlock.h" +#include "Ioss_ParallelUtils.h" #include "Ioss_Sort.h" extern unsigned int debug_level; @@ -189,7 +190,7 @@ void decompose_grid(Grid &grid, int ranks, const std::string &method) int ierr = 0; float ver = 0.0; Zoltan_Initialize(argc, argv, &ver); - struct Zoltan_Struct *zz = Zoltan_Create(MPI_COMM_WORLD); + struct Zoltan_Struct *zz = Zoltan_Create(Ioss::ParallelUtils::comm_world()); /* Register Callback functions */ /* Using global Zoltan_Data; could register it here instead as data field. */ diff --git a/packages/seacas/libraries/aprepro_lib/aprepro.h b/packages/seacas/libraries/aprepro_lib/aprepro.h index 749aed5f5b..dfe8685249 100644 --- a/packages/seacas/libraries/aprepro_lib/aprepro.h +++ b/packages/seacas/libraries/aprepro_lib/aprepro.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-, 20212021, National Technology & Engineering Solutions +// Copyright(C) 1999-2022, National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -90,6 +90,8 @@ namespace SEAMS { /// construct a new parser aprepro context Aprepro(); ~Aprepro(); + Aprepro(const Aprepro &) = delete; + Aprepro &operator=(const Aprepro &) = delete; enum class SYMBOL_TYPE { VARIABLE = 1, diff --git a/packages/seacas/libraries/chaco/assign/median.c b/packages/seacas/libraries/chaco/assign/median.c index 8835a7c840..554b6f5f84 100644 --- a/packages/seacas/libraries/chaco/assign/median.c +++ b/packages/seacas/libraries/chaco/assign/median.c @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -10,11 +10,11 @@ #include "structs.h" // for vtx_data void median_assign(struct vtx_data **graph, /* data structure with vertex weights */ - double * vals, /* values of which to find median */ + double *vals, /* values of which to find median */ int nvtxs, /* number of values I own */ - double * goal, /* desired sizes for sets */ + double *goal, /* desired sizes for sets */ int using_vwgts, /* are vertex weights being used? */ - int * sets, /* assigned set for each vertex */ + int *sets, /* assigned set for each vertex */ double wlow, /* sum of weights below guess */ double whigh, /* sum of weights above guess */ double guess /* median value */ @@ -58,38 +58,38 @@ void median_assign(struct vtx_data **graph, /* data structure with vertex /* values which are on the wrong side of the guess. */ void median(struct vtx_data **graph, /* data structure with vertex weights */ - double * vals, /* values of which to find median */ + double *vals, /* values of which to find median */ int nvtxs, /* number of values I own */ - int * active, /* space for list of nvtxs ints */ - double * goal, /* desired sizes for sets */ + int *active, /* space for list of nvtxs ints */ + double *goal, /* desired sizes for sets */ int using_vwgts, /* are vertex weights being used? */ - int * sets /* set each vertex gets assigned to */ + int *sets /* set each vertex gets assigned to */ ) { - double *vptr; /* loops through vals array */ - double val; /* value in vals array */ - double maxval; /* largest active value */ - double minval; /* smallest active value */ - double guess; /* approximate median value */ - double nearup; /* lowest guy above guess */ - double neardown; /* highest guy below guess */ - double whigh; /* total weight of values above maxval */ - double wlow; /* total weight of values below minval */ - double wabove; /* total weight of active values above guess */ - double wbelow; /* total weight of active values below guess */ - double wexact; /* weight of vertices exactly at guess */ - double lweight; /* desired weight of lower values in set */ - double uweight; /* desired weight of upper values in set */ - double frac; /* fraction of values I want less than guess */ - int * aptr; /* loops through active array */ - int * aptr2; /* helps update active array */ - int myactive; /* number of active values I own */ - double wfree; /* weight of vtxs not yet divided */ - int removed; /* number of my values eliminated */ - /*int npass = 0;*/ /* counts passes required to find median */ - int done; /* check for termination criteria */ - int vtx; /* vertex being considered */ - int i; /* loop counters */ + double *vptr; /* loops through vals array */ + double val; /* value in vals array */ + double maxval; /* largest active value */ + double minval; /* smallest active value */ + double guess = 0.0; /* approximate median value */ + double nearup; /* lowest guy above guess */ + double neardown; /* highest guy below guess */ + double whigh; /* total weight of values above maxval */ + double wlow; /* total weight of values below minval */ + double wabove; /* total weight of active values above guess */ + double wbelow; /* total weight of active values below guess */ + double wexact; /* weight of vertices exactly at guess */ + double lweight; /* desired weight of lower values in set */ + double uweight; /* desired weight of upper values in set */ + double frac; /* fraction of values I want less than guess */ + int *aptr; /* loops through active array */ + int *aptr2; /* helps update active array */ + int myactive; /* number of active values I own */ + double wfree; /* weight of vtxs not yet divided */ + int removed; /* number of my values eliminated */ + /*int npass = 0;*/ /* counts passes required to find median */ + int done; /* check for termination criteria */ + int vtx; /* vertex being considered */ + int i; /* loop counters */ /* Initialize. */ diff --git a/packages/seacas/libraries/chaco/bpmatch/movevtxs.c b/packages/seacas/libraries/chaco/bpmatch/movevtxs.c index e9ae249eae..3cdb9c9077 100644 --- a/packages/seacas/libraries/chaco/bpmatch/movevtxs.c +++ b/packages/seacas/libraries/chaco/bpmatch/movevtxs.c @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -20,13 +20,13 @@ static void nextmove(), undo_coupling(), couple(); void movevtxs(struct vtx_data **graph, /* data structure with vertex weights */ int nvtxs, /* number of vertices in graph */ int nsets, /* how many sets am I dividing into? */ - double * dist, /* distances defining splitter */ - int * indices[][MAXSETS], /* indices that define order in sorted lists */ - double * vals[][MAXSETS], /* values in sorted lists */ + double *dist, /* distances defining splitter */ + int *indices[][MAXSETS], /* indices that define order in sorted lists */ + double *vals[][MAXSETS], /* values in sorted lists */ int startvtx[][MAXSETS], /* index values corresponding to splitter */ - int * sets, /* set assignment for each vertex */ - double * size, /* sizes of the different sets */ - double * goal, /* desired set sizes */ + int *sets, /* set assignment for each vertex */ + double *size, /* sizes of the different sets */ + double *goal, /* desired set sizes */ int vwgt_max /* largest vertex weight */ ) { @@ -157,14 +157,14 @@ void movevtxs(struct vtx_data **graph, /* data structure with vert static void nextmove(int nvtxs, /* number of vertices in graph */ int nsets, /* how many sets am I dividing into? */ double *vals[][MAXSETS], /* values in sorted lists */ - int * indices[][MAXSETS], /* indices that define order in sorted lists */ + int *indices[][MAXSETS], /* indices that define order in sorted lists */ int startvtx[][MAXSETS], /* index values corresponding to splitter */ double *dist, /* distances defining splitter */ - int * sets, /* set assignment for each vertex */ + int *sets, /* set assignment for each vertex */ int toobig, /* is bad set too big or too small? */ - int * active, /* flags sets trying to change size */ - int * next_vtx, /* vertex selected to move next */ - int * next_to, /* set vertex should be moved to */ + int *active, /* flags sets trying to change size */ + int *next_vtx, /* vertex selected to move next */ + int *next_to, /* set vertex should be moved to */ double *next_delta /* size of change in distances */ ) { @@ -178,7 +178,7 @@ static void nextmove(int nvtxs, /* number of vertices in graph int bestvtx = 0; /* vertex being moved between sets */ int from, to; /* sets vertex wants to move from and to */ int index; /* offset into indices array */ - int dir; /* direction to step through list */ + int dir = 0; /* direction to step through list */ int i, j; /* loop counter */ bestdelta = 0; @@ -277,7 +277,7 @@ static void couple(int nsets, /* number of sets being divided into */ } static void undo_coupling(struct vtx_data **graph, /* data structure with vertex weights */ - int * sets, /* sets each vertex is in */ + int *sets, /* sets each vertex is in */ int nsets, /* number of sets being divided into */ int from, int to, /* set final vertex moved from and to */ int toobig, /* are we shrinking or enlarging a set? */ diff --git a/packages/seacas/libraries/exodus/src/ex_get_assemblies.c b/packages/seacas/libraries/exodus/src/ex_get_assemblies.c index a58ac913d5..c12990d513 100644 --- a/packages/seacas/libraries/exodus/src/ex_get_assemblies.c +++ b/packages/seacas/libraries/exodus/src/ex_get_assemblies.c @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -13,7 +13,7 @@ * writes the assembly parameters and optionally assembly data for all assemblies * assumes that `assembly` is large enough to contain all assemblies. * \param exoid exodus file id - * \param *assembly array of ex_assembly structures + * \param assembly array of ex_assembly structures */ int ex_get_assemblies(int exoid, ex_assembly *assembly) { diff --git a/packages/seacas/libraries/ioss/src/Ioss_DataPool.h b/packages/seacas/libraries/ioss/src/Ioss_DataPool.h index 7441f39f98..9920fb965a 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_DataPool.h +++ b/packages/seacas/libraries/ioss/src/Ioss_DataPool.h @@ -1,4 +1,4 @@ -// Copyright(C) 2020, 2021 National Technology & Engineering Solutions +// Copyright(C) 2020, 2021, 2022 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -12,30 +12,32 @@ struct DataPool { // Data space shared by most field input/output routines... - std::vector data; - std::vector data_int; - std::vector data_int64; - std::vector data_double; - std::vector data_complex; + std::vector data{}; + std::vector data_int{}; + std::vector data_int64{}; + std::vector data_double{}; + std::vector data_complex{}; #ifdef SEACAS_HAVE_KOKKOS - Kokkos::View data_view_char; - Kokkos::View data_view_int; - Kokkos::View data_view_int64; - Kokkos::View data_view_double; + Kokkos::View data_view_char{}; + Kokkos::View data_view_int{}; + Kokkos::View data_view_int64{}; + Kokkos::View data_view_double{}; // Kokkos::View data_view_complex cannot be a global variable, // Since Kokkos::initialize() has not yet been called. Also, a Kokkos:View cannot // have type std::complex entities. - Kokkos::View data_view_2D_char; - Kokkos::View data_view_2D_int; - Kokkos::View data_view_2D_int64; - Kokkos::View data_view_2D_double; + Kokkos::View data_view_2D_char{}; + Kokkos::View data_view_2D_int{}; + Kokkos::View data_view_2D_int64{}; + Kokkos::View data_view_2D_double{}; // Kokkos::View data_view_2D_complex cannot be a global variable, // Since Kokkos::initialize() has not yet been called. Also, a Kokkos:View cannot // have type std::complex entities. - Kokkos::View data_view_2D_char_layout_space; - Kokkos::View data_view_2D_int_layout_space; - Kokkos::View data_view_2D_int64_layout_space; - Kokkos::View data_view_2D_double_layout_space; + Kokkos::View data_view_2D_char_layout_space{}; + Kokkos::View data_view_2D_int_layout_space{}; + Kokkos::View + data_view_2D_int64_layout_space{}; + Kokkos::View + data_view_2D_double_layout_space{}; // Kokkos::View // data_view_2D_complex_layout_space cannot be a global variable, // Since Kokkos::initialize() has not yet been called. Also, a Kokkos:View cannot diff --git a/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h b/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h index c3f10e29fb..ca450af2ff 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h @@ -584,9 +584,9 @@ namespace Ioss { * run since the passed in filename is just the basename, not the * processor-specific filename. */ - std::string originalDBFilename; - std::string DBFilename; - mutable std::string decodedFilename; + std::string originalDBFilename{}; + std::string DBFilename{}; + mutable std::string decodedFilename{}; /*! * `bbName` is a temporary swizzled name which resides inside Burst Buffer namespace. @@ -618,7 +618,7 @@ namespace Ioss { void check_side_topology() const; /// Used to speed up faceblock/edgeblock calculations. - TopoContainer sideTopology; + TopoContainer sideTopology{}; /*! Typically used for restart output, but can be used for all output... * Maximum number of states on the output file. Overwrite the existing @@ -641,7 +641,7 @@ namespace Ioss { double timeScaleFactor{1.0}; Ioss::SurfaceSplitType splitType{SPLIT_BY_TOPOLOGIES}; - Ioss::DatabaseUsage dbUsage; + Ioss::DatabaseUsage dbUsage{}; mutable Ioss::DataSize dbIntSizeAPI{USE_INT32_API}; @@ -664,11 +664,11 @@ namespace Ioss { // element ids and offsets are still calculated assuming that the // blocks exist in the model... // Only one of these can have values and the other must be empty. - std::vector blockOmissions; - std::vector blockInclusions; + std::vector blockOmissions{}; + std::vector blockInclusions{}; - std::vector informationRecords; - std::vector qaRecords; + std::vector informationRecords{}; + std::vector qaRecords{}; //---Node Map -- Maps internal (1..NUMNP) ids to global ids used on the // application side. global = nodeMap[local] @@ -818,8 +818,8 @@ namespace Ioss { // True is default and required for parallel-io databases. // Even if false, metadata operations must be called by all processors - bool singleProcOnly; // True if history or heartbeat which is only written from proc 0... - bool doLogging{false}; // True if logging field input/output + bool singleProcOnly{false}; // True if history or heartbeat which is only written from proc 0... + bool doLogging{false}; // True if logging field input/output bool useGenericCanonicalName{ false}; // True if "block_id" is used as canonical name instead of the name // given on the mesh file e.g. "fireset". Both names are still aliases. diff --git a/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.h b/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.h index 057a17a96d..4ae8dabb94 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.h +++ b/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.h @@ -40,9 +40,9 @@ namespace Ioss { static const Ioss_MPI_Comm comm_self() { return (Ioss_MPI_Comm)MPI_COMM_SELF; } static const Ioss_MPI_Comm comm_null() { return (Ioss_MPI_Comm)MPI_COMM_NULL; } #else - static constexpr Ioss_MPI_Comm comm_world() { return (Ioss_MPI_Comm)0; } - static constexpr Ioss_MPI_Comm comm_self() { return (Ioss_MPI_Comm)0; } - static constexpr Ioss_MPI_Comm comm_null() { return (Ioss_MPI_Comm)0; } + static constexpr Ioss_MPI_Comm comm_world() { return 0; } + static constexpr Ioss_MPI_Comm comm_self() { return 0; } + static constexpr Ioss_MPI_Comm comm_null() { return 0; } #endif /*! @@ -81,8 +81,8 @@ namespace Ioss { std::string decode_filename(const std::string &filename, bool is_parallel) const; Ioss_MPI_Comm communicator() const { return communicator_; } - int parallel_size() const; - int parallel_rank() const; + int parallel_size() const; + int parallel_rank() const; void barrier() const; diff --git a/packages/seacas/libraries/ioss/src/Ioss_PropertyManager.h b/packages/seacas/libraries/ioss/src/Ioss_PropertyManager.h index 1cde677f27..9885fd0842 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_PropertyManager.h +++ b/packages/seacas/libraries/ioss/src/Ioss_PropertyManager.h @@ -52,7 +52,7 @@ namespace Ioss { size_t count() const; private: - PropMapType m_properties; + PropMapType m_properties{}; #if defined(IOSS_THREADSAFE) mutable std::mutex m_; #endif diff --git a/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.C b/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.C index 44b833a133..cb297426b1 100644 --- a/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.C +++ b/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.C @@ -176,8 +176,7 @@ namespace { int min_proc = -1; for (int i = 0; i < static_cast(work.size()); i++) { if (work[i] < min_work && - proc_adam_map.find(std::make_pair(zone->m_adam->m_zone, static_cast(i))) == - proc_adam_map.end()) { + proc_adam_map.find(std::make_pair(zone->m_adam->m_zone, i)) == proc_adam_map.end()) { min_work = work[i]; min_proc = i; if (min_work == 0) { diff --git a/packages/seacas/libraries/ioss/src/main/io_modify.C b/packages/seacas/libraries/ioss/src/main/io_modify.C index 02de085247..c194fc0aac 100644 --- a/packages/seacas/libraries/ioss/src/main/io_modify.C +++ b/packages/seacas/libraries/ioss/src/main/io_modify.C @@ -337,7 +337,7 @@ int main(int argc, char *argv[]) } // NOTE: getline_int returns the trailing '\n' - auto tokens = Ioss::tokenize(std::string(input), " ,\n"); + auto tokens = Ioss::tokenize(input, " ,\n"); if (tokens.empty()) { continue; } diff --git a/packages/seacas/libraries/supes/ext_lib/excpus.c b/packages/seacas/libraries/supes/ext_lib/excpus.c index 01a810a7a5..edbb0142b6 100644 --- a/packages/seacas/libraries/supes/ext_lib/excpus.c +++ b/packages/seacas/libraries/supes/ext_lib/excpus.c @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -77,11 +77,9 @@ void excpus(FTNREAL *cpusec) #if defined(sgi) || defined(__osf__) || defined(__linux__) || defined(aix) || \ defined(__VACPP__) || defined(paragon) || defined(hpux) || defined(__APPLE__) struct rusage rusage; - int secs, mics; - getrusage(RUSAGE_SELF, &rusage); - secs = rusage.ru_utime.tv_sec + rusage.ru_stime.tv_sec; - mics = rusage.ru_utime.tv_usec + rusage.ru_stime.tv_usec; - *cpusec = (FTNREAL)secs + ((FTNREAL)mics / 1.e6); + long secs = rusage.ru_utime.tv_sec + rusage.ru_stime.tv_sec; + long mics = rusage.ru_utime.tv_usec + rusage.ru_stime.tv_usec; + *cpusec = (FTNREAL)secs + ((FTNREAL)mics / 1.e6); #endif } diff --git a/packages/seacas/libraries/supes/ext_lib/extime.c b/packages/seacas/libraries/supes/ext_lib/extime.c index 3cfb97ab96..530b7c153f 100644 --- a/packages/seacas/libraries/supes/ext_lib/extime.c +++ b/packages/seacas/libraries/supes/ext_lib/extime.c @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -28,7 +28,6 @@ C STRING CHARACTER String to receive the time */ -#define STRLEN 8 #include #if defined(ADDC_) diff --git a/packages/seacas/libraries/suplib_cpp/GetLongOpt.h b/packages/seacas/libraries/suplib_cpp/GetLongOpt.h index 7c9100e69c..951e131565 100644 --- a/packages/seacas/libraries/suplib_cpp/GetLongOpt.h +++ b/packages/seacas/libraries/suplib_cpp/GetLongOpt.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -39,10 +39,10 @@ class GetLongOption }; private: - Cell * table{nullptr}; // option table + Cell *table{nullptr}; // option table const char *ustring{nullptr}; // usage message - char * pname{nullptr}; // program basename - Cell * last{nullptr}; // last entry in option table + char *pname{nullptr}; // program basename + Cell *last{nullptr}; // last entry in option table char optmarker; // option marker bool options_parsed{false}; // parsed options, cannot enroll anymore options @@ -51,6 +51,9 @@ class GetLongOption public: explicit GetLongOption(char optmark = '-'); + GetLongOption(const GetLongOption &) = delete; + GetLongOption &operator=(const GetLongOption &) = delete; + ~GetLongOption(); static char *basename(char *pathname); diff --git a/packages/seacas/libraries/suplib_cpp/smart_assert.h b/packages/seacas/libraries/suplib_cpp/smart_assert.h index 619e2403fd..f0558454c1 100644 --- a/packages/seacas/libraries/suplib_cpp/smart_assert.h +++ b/packages/seacas/libraries/suplib_cpp/smart_assert.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -276,7 +276,7 @@ struct Assert // the handler typedef std::map handlers_collection; - static handlers_collection & handlers() + static handlers_collection &handlers() { static handlers_collection inst; return inst; @@ -294,8 +294,8 @@ struct Assert } private: - assert_context context_; - mutable bool needs_handling_; + assert_context context_{}; + mutable bool needs_handling_{true}; }; namespace smart_assert {