Skip to content

Commit

Permalink
IOSS: Address coverity concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Jan 3, 2024
1 parent afe063f commit 9f9ac60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions packages/seacas/libraries/ioss/src/Ioss_CopyDatabase.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 2021, 2022, 2023 National Technology & Engineering Solutions
// Copyright(C) 2021, 2022, 2023, 2024 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 @@ -482,8 +482,8 @@ namespace {
// really matter.
const auto &blocks = region.get_element_blocks();
const auto *topo = blocks[0]->topology();
auto elem_topo = topo->name();
auto face_topo = topo->boundary_type(0)->name();
const auto &elem_topo = topo->name();
const auto &face_topo = topo->boundary_type(0)->name();

auto *ss = new Ioss::SideSet(output_region.get_database(), "boundary");
output_region.add(ss);
Expand Down Expand Up @@ -1021,8 +1021,8 @@ namespace {
const auto &fbs = ss->get_side_blocks();
for (const auto &ifb : fbs) {
if (ifb->parent_block() != nullptr) {
auto fb_name = ifb->parent_block()->name();
auto *parent = dynamic_cast<Ioss::EntityBlock *>(
const auto &fb_name = ifb->parent_block()->name();
auto *parent = dynamic_cast<Ioss::EntityBlock *>(
output_region.get_entity(fb_name, Ioss::ELEMENTBLOCK));
if (parent == nullptr) {
parent = dynamic_cast<Ioss::EntityBlock *>(
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/libraries/ioss/src/Ioss_Utils.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 1999-2023 National Technology & Engineering Solutions
// Copyright(C) 1999-2024 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 @@ -1333,7 +1333,7 @@ std::string Ioss::Utils::get_type_from_file(const std::string &filename)
if (all_dig) {
auto tokens = Ioss::tokenize(filename, ".");
if (tokens.size() >= 4) {
auto proc_count = tokens[tokens.size() - 2];
const auto &proc_count = tokens[tokens.size() - 2];
if (proc_count.find_first_not_of("0123456789") == std::string::npos) {
extension = tokens[tokens.size() - 3];
}
Expand Down

0 comments on commit 9f9ac60

Please sign in to comment.