Skip to content

Commit

Permalink
Address coverity issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Aug 27, 2024
1 parent a28082d commit 521dc51
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/seacas/applications/cpup/cpup.C
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ template <typename INT> void cpup(Cpup::SystemInterface &interFace, INT /*dummy*
}

// Now transfer the fields on the embedded node block...
auto pnb = pblock->get_node_block();
const auto &pnb = pblock->get_node_block();
fields.clear();
pnb.field_describe(Ioss::Field::TRANSIENT, &fields);
for (const auto &field_name : fields) {
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/aprepro_lib/apr_aprepro.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace SEAMS {

std::string Aprepro::long_version() const
{
auto comment = getsym("_C_")->value.svar;
const auto &comment = getsym("_C_")->value.svar;
return comment + " Algebraic Preprocessor (Aprepro) version " + version();
}

Expand Down
4 changes: 3 additions & 1 deletion packages/seacas/libraries/exodus/src/ex_put_assemblies.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ int ex_put_assemblies(int exoid, size_t count, const struct ex_assembly *assembl
}

/* Update the maximum_name_length attribute on the file. */
exi_update_max_name_length(exoid, max_name_len - 1);
if (max_name_len > 0) {
exi_update_max_name_length(exoid, max_name_len - 1);
}

/* Assembly are now all defined; see if any set data needs to be output... */
for (size_t i = 0; i < count; i++) {
Expand Down
10 changes: 9 additions & 1 deletion packages/seacas/libraries/exodus/src/ex_put_init_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,18 @@ int ex_put_init_ext(int exoid, const ex_init_params *model)
ex_err_fn(exoid, __func__, errmsg, status);
goto error_ret;
}

{
struct exi_file_item *file = exi_find_file_item(exoid);
file->time_varid = temp;
if (!file) {
char errmsg[MAX_ERR_LENGTH];
snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: unknown file id %d.", exoid);
ex_err_fn(exoid, __func__, errmsg, EX_BADFILEID);
goto error_ret;
}
file->time_varid = temp;
}

exi_compress_variable(exoid, temp, -2); /* Don't compress, but do set collective io */

if (model->num_dim > 0) {
Expand Down
8 changes: 4 additions & 4 deletions packages/seacas/libraries/ioss/src/Ioss_Region.C
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,13 @@ namespace Ioss {

// Region owns the database pointer even though other entities use it.
GroupingEntity::really_delete_database();

if (topologyObserver) {
topologyObserver->register_region(nullptr);
}
}
catch (...) {
}

if (topologyObserver) {
topologyObserver->register_region(nullptr);
}
}

void Region::reset_region()
Expand Down
3 changes: 0 additions & 3 deletions packages/seacas/libraries/ioss/src/init/Ionit_Initializer.C
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@

#include "Ioss_IOFactory.h"

#include "Ioss_DynamicTopology.h"

namespace {
#if defined(IOSS_THREADSAFE)
std::mutex m_;
Expand Down Expand Up @@ -100,7 +98,6 @@ namespace Ioss::Init {
Iogs::IOFactory::factory(); // Structured Mesh Generator
Ionull::IOFactory::factory();
Ioss::StorageInitializer();
Ioss::DynamicTopologyBroker::broker();
Ioss::Initializer();
Iotr::Initializer();
#ifdef HAVE_SEACASIOSS_ADIOS2
Expand Down

0 comments on commit 521dc51

Please sign in to comment.