Skip to content

Commit a9e24ed

Browse files
committed
fix modernize-use-default-member-init
Signed-off-by: Matt Liberty <[email protected]>
1 parent 38d0b39 commit a9e24ed

File tree

16 files changed

+45
-127
lines changed

16 files changed

+45
-127
lines changed

src/cts/src/LatencyBalancer.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ class LatencyBalancer
6767
openSta_(sta),
6868
wireSegmentUnit_(scalingUnit),
6969
capPerDBU_(capPerDBU),
70-
worseDelay_(std::numeric_limits<float>::min()),
71-
delayBufIndex_(0)
70+
worseDelay_(std::numeric_limits<float>::min())
7271
{
7372
}
7473

@@ -120,9 +119,9 @@ class LatencyBalancer
120119
float bufferDelay_;
121120
double capPerDBU_;
122121
float worseDelay_;
123-
int delayBufIndex_;
122+
int delayBufIndex_{0};
124123
std::vector<GraphNode> graph_;
125124
std::map<std::string, TreeBuilder*> inst2builder_;
126125
};
127126

128-
} // namespace cts
127+
} // namespace cts

src/drt/src/db/drObj/drShape.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ drPathSeg::drPathSeg(const frPathSeg& in) : layer_(in.getLayerNum())
4040
}
4141

4242
drPatchWire::drPatchWire(const frPatchWire& in)
43-
: layer_(in.getLayerNum()), owner_(nullptr)
43+
: layer_(in.getLayerNum())
4444
{
4545
offsetBox_ = in.getOffsetBox();
4646
origin_ = in.getOrigin();

src/drt/src/db/tech/frConstraint.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,7 +2232,7 @@ class frLef58EnclosureConstraint : public frConstraint
22322232
{
22332233
public:
22342234
frLef58EnclosureConstraint(odb::dbTechLayerCutEnclosureRule* ruleIn)
2235-
: db_rule_(ruleIn), cut_class_idx_(-1)
2235+
: db_rule_(ruleIn)
22362236
{
22372237
}
22382238
void setCutClassIdx(int in) { cut_class_idx_ = in; }
@@ -2270,7 +2270,7 @@ class frLef58EnclosureConstraint : public frConstraint
22702270

22712271
private:
22722272
odb::dbTechLayerCutEnclosureRule* db_rule_;
2273-
int cut_class_idx_;
2273+
int cut_class_idx_{-1};
22742274
};
22752275

22762276
// LEF58_MAXSPACING rule

src/drt/src/distributed/RoutingCallBack.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class RoutingCallBack : public dst::JobCallBack
4444
: router_(router),
4545
dist_(dist),
4646
logger_(logger),
47-
init_(true),
4847
pa_(router->getDesign(),
4948
logger,
5049
nullptr,
@@ -241,7 +240,7 @@ class RoutingCallBack : public dst::JobCallBack
241240
utl::Logger* logger_;
242241
std::string design_path_;
243242
std::string router_cfg_path_;
244-
bool init_;
243+
bool init_{true};
245244
FlexDRViaData via_data_;
246245
FlexPA pa_;
247246
};

src/drt/src/distributed/frArchive.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ struct frOArchive : OutputArchive
3737

3838
struct frIArchive : InputArchive
3939
{
40-
frIArchive(std::istream& os, unsigned flags = 0)
41-
: InputArchive(os, flags), design_(nullptr)
42-
{
43-
}
40+
frIArchive(std::istream& os, unsigned flags = 0) : InputArchive(os, flags) {}
4441

4542
// forward to base class
4643
template <class T>
@@ -52,7 +49,7 @@ struct frIArchive : InputArchive
5249
void setDesign(frDesign* in) { design_ = in; }
5350

5451
private:
55-
frDesign* design_;
52+
frDesign* design_{nullptr};
5653
};
5754
} // namespace drt
5855

src/drt/src/gr/FlexGR.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ class FlexGR
3939
utl::Logger* logger,
4040
stt::SteinerTreeBuilder* stt_builder,
4141
RouterConfiguration* router_cfg)
42-
: db_(nullptr),
43-
design_(designIn),
44-
cmap_(nullptr),
45-
cmap2D_(nullptr),
42+
: design_(designIn),
4643
logger_(logger),
4744
stt_builder_(stt_builder),
4845
router_cfg_(router_cfg)
@@ -65,7 +62,7 @@ class FlexGR
6562
void main(odb::dbDatabase* db = nullptr);
6663

6764
private:
68-
odb::dbDatabase* db_;
65+
odb::dbDatabase* db_{nullptr};
6966
frDesign* design_;
7067
std::unique_ptr<FlexGRCMap> cmap_;
7168
std::unique_ptr<FlexGRCMap> cmap2D_;

src/drt/src/ta/FlexTA.h

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,7 @@ class FlexTAWorker
116116
router_cfg_(router_cfg),
117117
save_updates_(save_updates),
118118
dir_(odb::dbTechLayerDir::NONE),
119-
taIter_(0),
120-
rq_(this),
121-
numAssigned_(0),
122-
totCost_(0),
123-
maxRetry_(1),
124-
hardIroutesMode_(false)
119+
rq_(this)
125120
{
126121
}
127122
// setters
@@ -197,18 +192,18 @@ class FlexTAWorker
197192
odb::Rect routeBox_;
198193
odb::Rect extBox_;
199194
odb::dbTechLayerDir dir_;
200-
int taIter_;
195+
int taIter_{0};
201196
FlexTAWorkerRegionQuery rq_;
202197

203198
std::vector<std::unique_ptr<taPin>> iroutes_; // unsorted iroutes
204199
std::vector<std::unique_ptr<taPin>> extIroutes_;
205200
std::vector<std::vector<frCoord>> trackLocs_;
206201
std::set<taPin*, taPinComp>
207202
reassignIroutes_; // iroutes to be assigned in sorted order
208-
int numAssigned_;
209-
int totCost_;
210-
int maxRetry_;
211-
bool hardIroutesMode_;
203+
int numAssigned_{0};
204+
int totCost_{0};
205+
int maxRetry_{1};
206+
bool hardIroutesMode_{false};
212207

213208
//// others
214209
void init();

src/dst/include/dst/BalancerJobDescription.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ namespace dst {
1414
class BalancerJobDescription : public JobDescription
1515
{
1616
public:
17-
BalancerJobDescription() : worker_port_(0) {}
1817
void setWorkerIP(const std::string& ip) { worker_ip_ = ip; }
1918
void setWorkerPort(unsigned short port) { worker_port_ = port; }
2019
std::string getWorkerIP() const { return worker_ip_; }
2120
unsigned short getWorkerPort() const { return worker_port_; }
2221

2322
private:
2423
std::string worker_ip_;
25-
unsigned short worker_port_;
24+
unsigned short worker_port_{0};
2625

2726
template <class Archive>
2827
void serialize(Archive& ar, const unsigned int version)

src/dst/include/dst/BroadcastJobDescription.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ namespace dst {
1212
class BroadcastJobDescription : public JobDescription
1313
{
1414
public:
15-
BroadcastJobDescription() : workers_count_(0) {}
1615
void setWorkersCount(unsigned short count) { workers_count_ = count; }
1716
unsigned short getWorkersCount() const { return workers_count_; }
1817

1918
private:
20-
unsigned short workers_count_;
19+
unsigned short workers_count_{0};
2120

2221
template <class Archive>
2322
void serialize(Archive& ar, const unsigned int version)

src/dst/test/cpp/stubs.cpp

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,7 @@
3333

3434
namespace ord {
3535

36-
OpenRoad::OpenRoad()
37-
: tcl_interp_(nullptr),
38-
logger_(nullptr),
39-
db_(nullptr),
40-
verilog_network_(nullptr),
41-
sta_(nullptr),
42-
resizer_(nullptr),
43-
ioPlacer_(nullptr),
44-
opendp_(nullptr),
45-
finale_(nullptr),
46-
macro_placer_(nullptr),
47-
global_router_(nullptr),
48-
restructure_(nullptr),
49-
tritonCts_(nullptr),
50-
tapcell_(nullptr),
51-
extractor_(nullptr),
52-
detailed_router_(nullptr),
53-
antenna_checker_(nullptr),
54-
replace_(nullptr),
55-
pdnsim_(nullptr),
56-
partitionMgr_(nullptr),
57-
pdngen_(nullptr),
58-
distributer_(nullptr),
59-
stt_builder_(nullptr),
60-
threads_(0)
61-
{
62-
}
36+
OpenRoad::OpenRoad() = default;
6337

6438
OpenRoad* OpenRoad::openRoad()
6539
{

0 commit comments

Comments
 (0)