Skip to content

Commit

Permalink
Remove some compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Feb 3, 2022
1 parent 4156c12 commit 3fa47c6
Show file tree
Hide file tree
Showing 28 changed files with 228 additions and 224 deletions.
24 changes: 12 additions & 12 deletions packages/seacas/applications/conjoin/CJ_SystemInterface.h
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down Expand Up @@ -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};
Expand All @@ -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
16 changes: 8 additions & 8 deletions packages/seacas/applications/epu/EP_SystemInterface.h
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -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
Expand Down
48 changes: 24 additions & 24 deletions packages/seacas/applications/exodiff/ED_SystemInterface.h
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down Expand Up @@ -42,49 +42,49 @@ class SystemInterface
int time_step_stop{-1}; // Last step to compare
int time_step_increment{1}; // Step increment

std::pair<int, int> explicit_steps; // Only compare these two steps (db1:db2) if nonzero.
std::pair<int, int> explicit_steps{}; // Only compare these two steps (db1:db2) if nonzero.

int max_warnings{100};

std::vector<std::string> glob_var_names;
std::vector<std::string> glob_var_names{};
Tolerance glob_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0};
std::vector<Tolerance> glob_var;
std::vector<Tolerance> glob_var{};

std::vector<std::string> node_var_names;
std::vector<std::string> node_var_names{};
Tolerance node_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0};
std::vector<Tolerance> node_var;
std::vector<Tolerance> node_var{};

std::vector<std::string> elmt_var_names;
std::vector<std::string> elmt_var_names{};
Tolerance elmt_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0};
std::vector<Tolerance> elmt_var;
std::vector<Tolerance> elmt_var{};

std::vector<std::string> elmt_att_names;
std::vector<std::string> elmt_att_names{};
Tolerance elmt_att_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0};
std::vector<Tolerance> elmt_att;
std::vector<Tolerance> elmt_att{};

std::vector<std::string> ns_var_names;
std::vector<std::string> ns_var_names{};
Tolerance ns_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0};
std::vector<Tolerance> ns_var;
std::vector<Tolerance> ns_var{};

std::vector<std::string> ss_var_names;
std::vector<std::string> ss_var_names{};
Tolerance ss_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0};
std::vector<Tolerance> ss_var;
std::vector<Tolerance> ss_var{};

std::vector<std::string> eb_var_names;
std::vector<std::string> eb_var_names{};
Tolerance eb_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0};
std::vector<Tolerance> eb_var;
std::vector<Tolerance> eb_var{};

std::vector<std::string> fb_var_names;
std::vector<std::string> fb_var_names{};
Tolerance fb_var_default{ToleranceMode::RELATIVE_, 1.0e-6, 0.0};
std::vector<Tolerance> fb_var;
std::vector<Tolerance> fb_var{};

// time step exclusion data
std::vector<int> exclude_steps;
std::vector<int> 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;
Expand Down Expand Up @@ -137,7 +137,7 @@ class SystemInterface

private:
void enroll_options();
GetLongOption options_; //!< Options parsing
GetLongOption options_{}; //!< Options parsing
};

extern SystemInterface interFace;
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/applications/exodiff/edge_block.h
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down Expand Up @@ -34,7 +34,7 @@ template <typename INT> 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<INT>;
Expand Down
24 changes: 12 additions & 12 deletions packages/seacas/applications/exodiff/exoII_read.h
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down Expand Up @@ -184,13 +184,13 @@ template <typename INT> class ExoII_Read
std::pair<int, size_t> 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<std::string> coord_names;
std::string title{};
std::vector<std::string> coord_names{};
size_t num_nodes{0};
int dimension{0};
size_t num_elmts{0};
Expand Down Expand Up @@ -220,14 +220,14 @@ template <typename INT> class ExoII_Read

// RESULTS info:

std::vector<std::string> global_vars;
std::vector<std::string> nodal_vars;
std::vector<std::string> elmt_vars;
std::vector<std::string> elmt_atts;
std::vector<std::string> ns_vars;
std::vector<std::string> ss_vars;
std::vector<std::string> eb_vars;
std::vector<std::string> fb_vars;
std::vector<std::string> global_vars{};
std::vector<std::string> nodal_vars{};
std::vector<std::string> elmt_vars{};
std::vector<std::string> elmt_atts{};
std::vector<std::string> ns_vars{};
std::vector<std::string> ss_vars{};
std::vector<std::string> eb_vars{};
std::vector<std::string> fb_vars{};

int num_times{0};
double *times{nullptr};
Expand Down
6 changes: 3 additions & 3 deletions packages/seacas/applications/exodiff/exo_block.h
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down Expand Up @@ -48,10 +48,10 @@ template <typename INT> 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<INT> conn; // Array; holds a matrix, num_elmts by num_nodes_per_elmt.
std::vector<INT> conn{}; // Array; holds a matrix, num_elmts by num_nodes_per_elmt.

friend class ExoII_Read<INT>;
};
Expand Down
22 changes: 11 additions & 11 deletions packages/seacas/applications/exodiff/exo_entity.h
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down Expand Up @@ -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.
Expand All @@ -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<double *> attributes_; // Array of pointers (length numAttr)
// to arrays of attributes (length num_entity).
std::vector<std::string> 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<double *> attributes_{}; // Array of pointers (length numAttr)
// to arrays of attributes (length num_entity).
std::vector<std::string> attributeNames{};

template <typename INT> friend class ExoII_Read;
};
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/applications/exodiff/face_block.h
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down Expand Up @@ -34,7 +34,7 @@ template <typename INT> 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<INT>;
Expand Down
12 changes: 6 additions & 6 deletions packages/seacas/applications/nas2exo/N2EDataTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions packages/seacas/applications/nas2exo/N2EExoWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down Expand Up @@ -44,11 +44,11 @@ namespace ExoModules {
inline size_t getHexesOut() { return this->writtenHexes; };

protected:
std::vector<sectionType> sections;
std::vector<gridType> gridList;
std::vector<elementType> elementList;
std::vector<sectionType> sections{};
std::vector<gridType> gridList{};
std::vector<elementType> elementList{};

std::string modelTitle;
std::string modelTitle{};

int exoFileID{0};

Expand Down
10 changes: 5 additions & 5 deletions packages/seacas/applications/nas2exo/N2ENasReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
//============================================================================

Expand Down Expand Up @@ -47,11 +47,11 @@ namespace NasModules {
std::unique_ptr<std::ifstream> inStream{};
unsigned lineCount{0u};

std::vector<sectionType> sections;
std::vector<gridType> gridList;
std::vector<elementType> elementList;
std::vector<sectionType> sections{};
std::vector<gridType> gridList{};
std::vector<elementType> elementList{};

std::string modelTitle;
std::string modelTitle{};

bool doesFileExist(const std::string &fname);
// Local buffer for reading faster
Expand Down
Loading

0 comments on commit 3fa47c6

Please sign in to comment.