Skip to content

Commit

Permalink
odb/mpl: modernize-use-nullptr
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Liberty <[email protected]>
  • Loading branch information
maliberty committed Dec 26, 2024
1 parent da1677d commit ef8567f
Show file tree
Hide file tree
Showing 83 changed files with 2,305 additions and 2,275 deletions.
8 changes: 4 additions & 4 deletions src/mpl/src/ParquetFP/src/ClusterDB.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ using std::vector;
ClusterDB::ClusterDB(DB* db, Command_Line* params)
: _params(params),
_db(db),
_newDB(0),
_oldDB(0),
_newDB(nullptr),
_oldDB(nullptr),
_nodesSeenBB(0),
_numConnections(0, 0)
{
Expand Down Expand Up @@ -131,7 +131,7 @@ void ClusterDB::clusterMulti(DB*& newDB)

// Transfer ownership of the compressed DB to the caller
newDB = _newDB;
_newDB = 0;
_newDB = nullptr;
}

ClusterDB::~ClusterDB()
Expand Down Expand Up @@ -770,5 +770,5 @@ void ClusterDB::clusterMultiPhysical(DB*& newDB)

// Transfer ownership of the new DB
newDB = _newDB;
_newDB = 0;
_newDB = nullptr;
}
6 changes: 3 additions & 3 deletions src/mpl/src/ParquetFP/src/SolveMulti.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ using std::endl;
using std::numeric_limits;
using std::vector;

SolveMulti::SolveMulti(DB* db, Command_Line* params) : _newDB(0)
SolveMulti::SolveMulti(DB* db, Command_Line* params) : _newDB(nullptr)
{
_db = db;
_params = params;
Expand All @@ -66,7 +66,7 @@ DB* SolveMulti::clusterOnly() const
{
ClusterDB multiCluster(_db, _params);

DB* clusteredDB = 0;
DB* clusteredDB = nullptr;

if (_params->clusterPhysical)
multiCluster.clusterMultiPhysical(clusteredDB);
Expand Down Expand Up @@ -138,7 +138,7 @@ void SolveMulti::go()
_params->FPrep = "BTree";
}

BaseAnnealer* annealer = NULL;
BaseAnnealer* annealer = nullptr;
if (_params->FPrep == "BTree") {
annealer = new BTreeAreaWireAnnealer(_params, _newDB);
} else if (_params->FPrep == "SeqPair") {
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/src/ParquetFP/src/baseannealer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ BaseAnnealer::BaseAnnealer(const parquetfp::Command_Line* const params,
// --------------------------------------------------------
BaseAnnealer::~BaseAnnealer()
{
if (_analSolve != NULL)
if (_analSolve != nullptr)
delete _analSolve;
}
// --------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/mpl/src/ParquetFP/src/baseannealer.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ class BaseAnnealer

BaseAnnealer()
: annealTime(0),
_db(NULL),
_params(NULL),
_analSolve(NULL),
_db(nullptr),
_params(nullptr),
_analSolve(nullptr),
_isFixedOutline(false),
_outlineDeadspaceRatio(basepacking_h::Dimension::Infty),
_outlineArea(basepacking_h::Dimension::Infty),
Expand Down
4 changes: 2 additions & 2 deletions src/mpl/src/ParquetFP/src/btreeanneal.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ class BTreeAreaWireAnnealer : public BaseAnnealer
// =========================
BTreeAreaWireAnnealer::~BTreeAreaWireAnnealer()
{
if (_slackEval != NULL)
if (_slackEval != nullptr)
delete _slackEval;

if (_blockinfo_cleaner != NULL)
if (_blockinfo_cleaner != nullptr)
delete _blockinfo_cleaner;
}
// --------------------------------------------------------
Expand Down
16 changes: 8 additions & 8 deletions src/mpl/src/ParquetFP/src/skyline.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Skyline::Skyline(const Skyline& prev)
}
}

Skyline::Skyline() : arr(0), capacity(0), n(0)
Skyline::Skyline() : arr(nullptr), capacity(0), n(0)
{
}

Expand All @@ -57,7 +57,7 @@ Skyline::~Skyline()
if (arr) {
delete[] arr;
}
arr = 0;
arr = nullptr;
capacity = 0;
}

Expand Down Expand Up @@ -225,12 +225,12 @@ Skyline* Skyline::copy()
}

SkylineContour::SkylineContour()
: skyline_(0), width_(FLT_MIN), height_(FLT_MIN)
: skyline_(nullptr), width_(FLT_MIN), height_(FLT_MIN)
{
}

SkylineContour::SkylineContour(int capacity)
: skyline_(0), width_(FLT_MIN), height_(FLT_MIN)
: skyline_(nullptr), width_(FLT_MIN), height_(FLT_MIN)
{
}

Expand All @@ -240,14 +240,14 @@ SkylineContour::SkylineContour(const SkylineContour& prev)
if (prev.skyline_) {
skyline_ = prev.skyline_->copy();
} else {
skyline_ = 0;
skyline_ = nullptr;
}
}

// build from ParquetFP's BTree
// consider rotation of macro cells.
SkylineContour::SkylineContour(const BTree& bTree, bool isRotate)
: skyline_(0), width_(FLT_MIN), height_(FLT_MIN)
: skyline_(nullptr), width_(FLT_MIN), height_(FLT_MIN)
{
bTreeInfo_.reserve(bTree.NUM_BLOCKS);
for (int i = 0; i < bTree.NUM_BLOCKS; i++) {
Expand Down Expand Up @@ -276,7 +276,7 @@ bool SkylineContour::operator=(const SkylineContour& prev)
if (prev.skyline_) {
skyline_ = prev.skyline_->copy();
} else {
skyline_ = 0;
skyline_ = nullptr;
}
return true;
}
Expand All @@ -289,7 +289,7 @@ void SkylineContour::Clear()
{
if (skyline_) {
delete skyline_;
skyline_ = 0;
skyline_ = nullptr;
}
width_ = height_ = 0;
std::vector<BTreeNode>().swap(bTreeInfo_);
Expand Down
4 changes: 2 additions & 2 deletions src/odb/src/db/dbBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ _dbBlock::_dbBlock(_dbDatabase* db)
_right_bus_delimeter = 0;
_num_ext_corners = 0;
_corners_per_block = 0;
_corner_name_list = 0;
_name = 0;
_corner_name_list = nullptr;
_name = nullptr;
_maxCapNodeId = 0;
_maxRSegId = 0;
_maxCCSegId = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/odb/src/db/dbHashTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ T* dbHashTable<T>::find(const char* name)
uint sz = _hash_tbl.size();

if (sz == 0) {
return 0;
return nullptr;
}

uint hid = hash_string(name) & (sz - 1);
Expand Down
2 changes: 1 addition & 1 deletion src/odb/src/db/dbInst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ _dbInst::_dbInst(_dbDatabase*)
_flags._level = 0;
_flags._input_cone = 0;
_flags._inside_cone = 0;
_name = 0;
_name = nullptr;
_x = 0;
_y = 0;
_weight = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/odb/src/db/dbIntHashTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ T* dbIntHashTable<T>::find(uint id)
uint sz = _hash_tbl.size();

if (sz == 0) {
return 0;
return nullptr;
}

uint hid = hash_int(id) & (sz - 1);
Expand Down
2 changes: 1 addition & 1 deletion src/odb/src/db/dbLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ _dbLib::_dbLib(_dbDatabase* db)
_left_bus_delimeter = 0;
_right_bus_delimeter = 0;
_spare = 0;
_name = 0;
_name = nullptr;

_master_tbl = new dbTable<_dbMaster>(
db, this, (GetObjTbl_t) &_dbLib::getObjectTable, dbMasterObj);
Expand Down
2 changes: 1 addition & 1 deletion src/odb/src/db/dbMTerm.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ inline _dbMTerm::_dbMTerm(_dbDatabase*)
_flags._mark = 0;
_flags._spare_bits = 0;
_order_id = 0;
_name = 0;
_name = nullptr;
_par_met_area.clear();
_par_met_sidearea.clear();
_par_cut_area.clear();
Expand Down
2 changes: 1 addition & 1 deletion src/odb/src/db/dbMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ _dbMaster::_dbMaster(_dbDatabase* db)
_width = 0;
_mterm_cnt = 0;
_id = 0;
_name = 0;
_name = nullptr;

_mterm_tbl = new dbTable<_dbMTerm>(
db, this, (GetObjTbl_t) &_dbMaster::getObjectTable, dbMTermObj, 4, 2);
Expand Down
2 changes: 1 addition & 1 deletion src/odb/src/db/dbNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ _dbNet::_dbNet(_dbDatabase* db)
_flags._rc_disconnected = 0;
_flags._block_rule = 0;
_flags._has_jumpers = 0;
_name = 0;
_name = nullptr;
_gndc_calibration_factor = 1.0;
_cc_calibration_factor = 1.0;
_weight = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/odb/src/db/dbTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void dbTarget::destroy(dbTarget* target_)
_dbMTerm* mterm = (_dbMTerm*) master->_mterm_tbl->getPtr(target->_mterm);
uint tid = target->getOID();
uint id = mterm->_targets;
_dbTarget* p = 0;
_dbTarget* p = nullptr;

while (id) {
_dbTarget* t = master->_target_tbl->getPtr(id);
Expand Down
4 changes: 2 additions & 2 deletions src/odb/src/db/dbTechLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,8 @@ _dbTechLayer::_dbTechLayer(_dbDatabase* db)
_v55sp_length_idx.clear();
_v55sp_width_idx.clear();
_v55sp_spacing.clear();
_name = 0;
_alias = 0;
_name = nullptr;
_alias = nullptr;

_spacing_rules_tbl = new dbTable<_dbTechLayerSpacingRule>(
db,
Expand Down
4 changes: 2 additions & 2 deletions src/odb/src/db/dbTechVia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ _dbTechVia::_dbTechVia(_dbDatabase*)
_flags._has_params = 0;
_flags._spare_bits = 0;
_resistance = 0.0;
_name = 0;
_pattern = 0;
_name = nullptr;
_pattern = nullptr;
}

_dbTechVia::~_dbTechVia()
Expand Down
2 changes: 1 addition & 1 deletion src/odb/src/db/dbTechViaGenerateRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ _dbTechViaGenerateRule::_dbTechViaGenerateRule(_dbDatabase*,

_dbTechViaGenerateRule::_dbTechViaGenerateRule(_dbDatabase*)
{
_name = 0;
_name = nullptr;
_flags._default = 0;
_flags._spare_bits = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/odb/src/db/dbTechViaRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ _dbTechViaRule::_dbTechViaRule(_dbDatabase*, const _dbTechViaRule& v)

_dbTechViaRule::_dbTechViaRule(_dbDatabase*)
{
_name = 0;
_name = nullptr;
_flags._spare_bits = 0;
}

Expand Down
8 changes: 4 additions & 4 deletions src/odb/src/db/dbVia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ _dbVia::_dbVia(_dbDatabase*)
_flags._orient = dbOrientType::R0;
_flags.default_ = false;
_flags._spare_bits = 0;
_name = 0;
_pattern = 0;
_name = nullptr;
_pattern = nullptr;
}

_dbVia::~_dbVia()
Expand Down Expand Up @@ -279,7 +279,7 @@ std::string dbVia::getPattern()
{
_dbVia* via = (_dbVia*) this;

if (via->_pattern == 0) {
if (via->_pattern == nullptr) {
return "";
}

Expand All @@ -290,7 +290,7 @@ void dbVia::setPattern(const char* name)
{
_dbVia* via = (_dbVia*) this;

if (via->_pattern != 0) {
if (via->_pattern != nullptr) {
return;
}

Expand Down
Loading

0 comments on commit ef8567f

Please sign in to comment.