Skip to content

Commit b3b873f

Browse files
committed
pad: apply clang-tidy suggestions
Signed-off-by: Peter Gadfort <[email protected]>
1 parent 27a469e commit b3b873f

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

src/pad/src/RDLRoute.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44
#include "RDLRoute.h"
55

66
#include <algorithm>
7+
#include <array>
78
#include <map>
89
#include <memory>
10+
#include <set>
911
#include <tuple>
1012
#include <vector>
1113

1214
#include "boost/geometry/geometry.hpp"
13-
#include "boost/polygon/polygon.hpp"
15+
#include "boost/polygon/polygon_90_set_data.hpp"
16+
#include "boost/polygon/polygon_90_with_holes_data.hpp"
17+
#include "boost/polygon/rectangle_concept.hpp"
18+
#include "boost/polygon/rectangle_data.hpp"
1419
#include "odb/db.h"
1520
#include "odb/geom.h"
1621
#include "odb/geom_boost.h"
@@ -230,7 +235,9 @@ bool RDLRoute::contains(const odb::Point& pt) const
230235

231236
void RDLRoute::preprocess(odb::dbTechLayer* layer, utl::Logger* logger)
232237
{
233-
using namespace boost::polygon::operators;
238+
using boost::polygon::operators::operator+=;
239+
using boost::polygon::operators::operator-=;
240+
234241
using Rectangle = boost::polygon::rectangle_data<int>;
235242
using Polygon90 = boost::polygon::polygon_90_with_holes_data<int>;
236243
using Polygon90Set = boost::polygon::polygon_90_set_data<int>;
@@ -280,7 +287,7 @@ void RDLRoute::preprocess(odb::dbTechLayer* layer, utl::Logger* logger)
280287
for (const auto& [iterm, polys] : iterms_geoms) {
281288
Polygon90Set check = polys;
282289
check.interact(source_iterms);
283-
if (check.size() > 0) {
290+
if (!check.empty()) {
284291
// There is nothing to do
285292
locked_ = true;
286293
routed_ = true;
@@ -297,7 +304,7 @@ void RDLRoute::preprocess(odb::dbTechLayer* layer, utl::Logger* logger)
297304
Polygon90Set check = polys;
298305
check.bloat(min_dist, min_dist, min_dist, min_dist);
299306
check.interact(source_iterms);
300-
if (check.size() > 0) {
307+
if (!check.empty()) {
301308
Polygon90Set source_bloat = source_iterms;
302309
source_bloat.bloat(min_dist, min_dist, min_dist, min_dist);
303310
check += source_bloat;

src/pad/src/RDLRoute.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <map>
77
#include <memory>
8+
#include <set>
89
#include <vector>
910

1011
#include "RDLRouter.h"

src/pad/src/RDLRouter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,12 +1621,12 @@ void RDLRouter::writeToDb(odb::dbNet* net,
16211621
shape.bloat(width_ / 2, shape);
16221622
odb::dbSBox::Direction dir;
16231623
if (s.x() == t.x()) {
1624-
shape.set_ylo(shape.yMin() + width_ / 2);
1625-
shape.set_yhi(shape.yMax() - width_ / 2);
1624+
shape.set_ylo(shape.yMin() + (width_ / 2));
1625+
shape.set_yhi(shape.yMax() - (width_ / 2));
16261626
dir = odb::dbSBox::VERTICAL;
16271627
} else if (s.y() == t.y()) {
1628-
shape.set_xlo(shape.xMin() + width_ / 2);
1629-
shape.set_xhi(shape.xMax() - width_ / 2);
1628+
shape.set_xlo(shape.xMin() + (width_ / 2));
1629+
shape.set_xhi(shape.xMax() - (width_ / 2));
16301630
dir = odb::dbSBox::HORIZONTAL;
16311631
} else {
16321632
dir = odb::dbSBox::OCTILINEAR;

0 commit comments

Comments
 (0)