Skip to content

Commit

Permalink
Merge pull request #5840 from gadfort/coverity
Browse files Browse the repository at this point in the history
gui: fix coverity issues
  • Loading branch information
maliberty authored Oct 1, 2024
2 parents 81c8892 + fcf72ff commit b3be385
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/gui/src/staDescriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ Descriptor::Properties LibertyLibraryDescriptor::getProperties(

SelectionSet corners;
for (auto* corner : *sta_->corners()) {
for (const auto min_max : {sta::MinMax::min(), sta::MinMax::max()}) {
for (const sta::MinMax* min_max :
{sta::MinMax::min(), sta::MinMax::max()}) {
const auto libs = corner->libertyLibraries(min_max);
if (std::find(libs.begin(), libs.end(), library) != libs.end()) {
corners.insert(gui->makeSelected(corner));
Expand Down Expand Up @@ -511,13 +512,13 @@ Descriptor::Properties LibertyPortDescriptor::getProperties(
power_pin = power_pin_name;
}
if (power_pin.has_value()) {
props.push_back({"Related power pin", power_pin});
props.push_back({"Related power pin", std::move(power_pin)});
}
if (!ground_pin.has_value() && ground_pin_name != nullptr) {
ground_pin = ground_pin_name;
}
if (ground_pin.has_value()) {
props.push_back({"Related ground pin", ground_pin});
props.push_back({"Related ground pin", std::move(ground_pin)});
}

return props;
Expand Down Expand Up @@ -679,7 +680,7 @@ bool LibertyPgPortDescriptor::getAllObjects(SelectionSet& objects) const
return true;
}

odb::dbMTerm* LibertyPgPortDescriptor::getMTerm(std::any object) const
odb::dbMTerm* LibertyPgPortDescriptor::getMTerm(const std::any& object) const
{
auto port = std::any_cast<sta::LibertyPgPort*>(object);
odb::dbMaster* master = sta_->getDbNetwork()->staToDb(port->cell());
Expand Down Expand Up @@ -1052,7 +1053,7 @@ Descriptor::Properties ClockDescriptor::getProperties(std::any object) const
source = gui->makeSelected(bterm);
}
if (source.has_value()) {
props.push_back({"Source", source});
props.push_back({"Source", std::move(source)});
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/src/staDescriptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class LibertyPgPortDescriptor : public Descriptor
odb::dbDatabase* db_;
sta::dbSta* sta_;

odb::dbMTerm* getMTerm(std::any object) const;
odb::dbMTerm* getMTerm(const std::any& object) const;
};

class CornerDescriptor : public Descriptor
Expand Down

0 comments on commit b3be385

Please sign in to comment.