Skip to content

Commit 13b29fb

Browse files
authored
Merge pull request #7920 from gadfort/coverity
pdn/gui: fix a few coverity issues
2 parents d6695fc + 4f507d7 commit 13b29fb

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

src/gui/src/chartsWidget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class HistogramView : public QChartView
9595
int computeMaxYSnap(int largest_slack_count);
9696
int computeFirstDigit(int value, int digits);
9797

98-
utl::Logger* logger_;
98+
utl::Logger* logger_{nullptr};
9999
STAGuiInterface* sta_{nullptr};
100100

101101
QChart* chart_;

src/gui/src/dbDescriptors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ void DbNetDescriptor::findSourcesAndSinks(
10421042
}
10431043

10441044
if (!term_targets.empty()) {
1045-
targets.push_back(term_targets);
1045+
targets.push_back(std::move(term_targets));
10461046
}
10471047
}
10481048
};
@@ -1057,7 +1057,7 @@ void DbNetDescriptor::findSourcesAndSinks(
10571057
term_targets.emplace(rect, box->getTechLayer());
10581058
}
10591059
if (!term_targets.empty()) {
1060-
targets.push_back(term_targets);
1060+
targets.push_back(std::move(term_targets));
10611061
}
10621062
}
10631063
};

src/gui/src/renderThread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,7 @@ void RenderThread::drawIOPins(Painter& painter,
17071707
} else {
17081708
pin_specs.rect = odb::Rect();
17091709
}
1710-
pin_text_spec.push_back(pin_specs);
1710+
pin_text_spec.push_back(std::move(pin_specs));
17111711
}
17121712
}
17131713

src/gui/src/staGuiInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ ConeDepthMapPinSet STAGuiInterface::getFaninCone(const sta::Pin* pin) const
11381138
true); // thru_constants
11391139

11401140
ConeDepthMapPinSet depth_map;
1141-
for (auto& [level, pin_list] : getCone(pin, pins, true)) {
1141+
for (auto& [level, pin_list] : getCone(pin, std::move(pins), true)) {
11421142
depth_map[-level].insert(pin_list.begin(), pin_list.end());
11431143
}
11441144

src/pdn/src/grid.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,12 +1085,12 @@ void Grid::makeInitialObstructions(odb::dbBlock* block,
10851085
if (box->getTechLayer() == nullptr) {
10861086
for (auto* layer : block->getDb()->getTech()->getLayers()) {
10871087
auto shape = std::make_shared<Shape>(layer, obs_rect, Shape::BLOCK_OBS);
1088-
obs[layer].push_back(shape);
1088+
obs[layer].push_back(std::move(shape));
10891089
}
10901090
} else {
10911091
auto shape = std::make_shared<Shape>(
10921092
box->getTechLayer(), obs_rect, Shape::BLOCK_OBS);
1093-
obs[box->getTechLayer()].push_back(shape);
1093+
obs[box->getTechLayer()].push_back(std::move(shape));
10941094
}
10951095
}
10961096

@@ -1148,7 +1148,7 @@ void Grid::makeInitialObstructions(odb::dbBlock* block,
11481148
= std::make_shared<Shape>(layer, geom->getBox(), Shape::BLOCK_OBS);
11491149
shape->generateObstruction();
11501150
shape->setRect(shape->getRect());
1151-
obs[layer].push_back(shape);
1151+
obs[layer].push_back(std::move(shape));
11521152
}
11531153
}
11541154
}
@@ -1494,7 +1494,7 @@ ShapeVectorMap InstanceGrid::getInstanceObstructions(
14941494
transform.apply(obs_rect);
14951495
auto shape = std::make_shared<Shape>(layer, obs_rect, Shape::BLOCK_OBS);
14961496

1497-
obs[layer].push_back(shape);
1497+
obs[layer].push_back(std::move(shape));
14981498
}
14991499

15001500
// generate obstructions based on pins
@@ -1567,15 +1567,15 @@ ShapeVectorMap InstanceGrid::getInstancePins(odb::dbInst* inst)
15671567
auto shape = std::make_shared<Shape>(
15681568
via_box->getTechLayer(), net, box_rect);
15691569
shape->setShapeType(Shape::FIXED);
1570-
pins.push_back(shape);
1570+
pins.push_back(std::move(shape));
15711571
}
15721572
} else {
15731573
odb::Rect box_rect = box->getBox();
15741574
transform.apply(box_rect);
15751575
auto shape
15761576
= std::make_shared<Shape>(box->getTechLayer(), net, box_rect);
15771577
shape->setShapeType(Shape::FIXED);
1578-
pins.push_back(shape);
1578+
pins.push_back(std::move(shape));
15791579
}
15801580
}
15811581
}

src/pdn/src/renderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void PDNRenderer::update()
9898
channel.target->getName(),
9999
nets);
100100

101-
repair_.push_back(channel);
101+
repair_.push_back(std::move(channel));
102102
}
103103
}
104104
}

src/pdn/src/shape.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ void Shape::populateMapFromDb(odb::dbNet* net, ShapeVectorMap& map)
463463
shape->setShapeType(Shape::OBS);
464464
}
465465
shape->generateObstruction();
466-
map[layer].push_back(shape);
466+
map[layer].push_back(std::move(shape));
467467
}
468468
}
469469
}

src/pdn/src/straps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,7 @@ RepairChannelStraps::findRepairChannels(Grid* grid,
21832183
}
21842184
channel.obs_area = channel.obs_area.intersect(grid_core);
21852185

2186-
channels.push_back(channel);
2186+
channels.push_back(std::move(channel));
21872187
}
21882188
}
21892189

0 commit comments

Comments
 (0)