From 290e02f1201b45b71c3f32386dd98db51422f813 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Thu, 26 Dec 2024 05:37:58 +0000 Subject: [PATCH] odb/mpl: modernize-use-nullptr Signed-off-by: Matt Liberty --- src/mpl/src/ParquetFP/src/ClusterDB.cxx | 8 +- src/mpl/src/ParquetFP/src/SolveMulti.cxx | 6 +- src/mpl/src/ParquetFP/src/baseannealer.cxx | 2 +- src/mpl/src/ParquetFP/src/baseannealer.h | 6 +- src/mpl/src/ParquetFP/src/btreeanneal.h | 4 +- src/mpl/src/ParquetFP/src/skyline.cxx | 16 +- src/odb/src/db/dbBlock.cpp | 4 +- src/odb/src/db/dbHashTable.hpp | 2 +- src/odb/src/db/dbInst.cpp | 2 +- src/odb/src/db/dbIntHashTable.hpp | 2 +- src/odb/src/db/dbLib.cpp | 2 +- src/odb/src/db/dbMTerm.h | 2 +- src/odb/src/db/dbMaster.cpp | 2 +- src/odb/src/db/dbNet.cpp | 2 +- src/odb/src/db/dbTarget.cpp | 2 +- src/odb/src/db/dbTechLayer.cpp | 4 +- src/odb/src/db/dbTechVia.cpp | 4 +- src/odb/src/db/dbTechViaGenerateRule.cpp | 2 +- src/odb/src/db/dbTechViaRule.cpp | 2 +- src/odb/src/db/dbVia.cpp | 8 +- src/odb/src/def/def/def_keywords.cpp | 32 +- src/odb/src/def/def/defiAlias.cpp | 10 +- src/odb/src/def/def/defiAlias.hpp | 2 +- src/odb/src/def/def/defiAssertion.cpp | 2 +- src/odb/src/def/def/defiBlockage.cpp | 28 +- src/odb/src/def/def/defiComponent.cpp | 42 +- src/odb/src/def/def/defiFPC.cpp | 8 +- src/odb/src/def/def/defiFill.cpp | 22 +- src/odb/src/def/def/defiGroup.cpp | 12 +- src/odb/src/def/def/defiIOTiming.cpp | 22 +- src/odb/src/def/def/defiMisc.cpp | 6 +- src/odb/src/def/def/defiNet.cpp | 330 ++++++------ src/odb/src/def/def/defiNonDefault.cpp | 54 +- src/odb/src/def/def/defiPartition.cpp | 18 +- src/odb/src/def/def/defiPath.cpp | 34 +- src/odb/src/def/def/defiPinCap.cpp | 204 +++---- src/odb/src/def/def/defiPinProp.cpp | 4 +- src/odb/src/def/def/defiProp.cpp | 2 +- src/odb/src/def/def/defiPropType.cpp | 4 +- src/odb/src/def/def/defiRegion.cpp | 20 +- src/odb/src/def/def/defiRowTrack.cpp | 18 +- src/odb/src/def/def/defiScanchain.cpp | 42 +- src/odb/src/def/def/defiSite.cpp | 2 +- src/odb/src/def/def/defiSlot.cpp | 14 +- src/odb/src/def/def/defiTimingDisable.cpp | 16 +- src/odb/src/def/def/defiVia.cpp | 70 +-- src/odb/src/def/def/defrCallbacks.cpp | 208 +++---- src/odb/src/def/def/defrData.cpp | 40 +- src/odb/src/def/def/defrReader.cpp | 238 ++++---- src/odb/src/def/def/defrSettings.cpp | 32 +- src/odb/src/def/def/defwWriter.cpp | 68 +-- src/odb/src/def/def/defwWriterCalls.cpp | 76 +-- src/odb/src/def/defdiff/diffDefRW.cpp | 18 +- src/odb/src/def/defrw/defrw.cpp | 12 +- src/odb/src/def/defwrite/defwrite.cpp | 374 +++++++------ src/odb/src/def/defwrite/defwriteCbs.cpp | 373 +++++++------ src/odb/src/def/defzlib/defzlib.cpp | 6 +- src/odb/src/defin/definPin.cpp | 4 +- src/odb/src/lef/lef/lef_keywords.cpp | 34 +- src/odb/src/lef/lef/lefiArray.cpp | 18 +- src/odb/src/lef/lef/lefiCrossTalk.cpp | 6 +- src/odb/src/lef/lef/lefiDebug.cpp | 2 +- src/odb/src/lef/lef/lefiLayer.cpp | 598 ++++++++++----------- src/odb/src/lef/lef/lefiMacro.cpp | 319 +++++------ src/odb/src/lef/lef/lefiMisc.cpp | 64 +-- src/odb/src/lef/lef/lefiNonDefault.cpp | 76 +-- src/odb/src/lef/lef/lefiProp.cpp | 8 +- src/odb/src/lef/lef/lefiPropType.cpp | 8 +- src/odb/src/lef/lef/lefiUnits.cpp | 4 +- src/odb/src/lef/lef/lefiVia.cpp | 130 ++--- src/odb/src/lef/lef/lefiViaRule.cpp | 24 +- src/odb/src/lef/lef/lefrCallbacks.cpp | 118 ++-- src/odb/src/lef/lef/lefrData.cpp | 50 +- src/odb/src/lef/lef/lefrReader.cpp | 265 ++++----- src/odb/src/lef/lef/lefrSettings.cpp | 20 +- src/odb/src/lef/lef/lefwWriter.cpp | 165 +++--- src/odb/src/lef/lef/lefwWriterCalls.cpp | 70 +-- src/odb/src/lef/lefdiff/diffLefRW.cpp | 4 +- src/odb/src/lef/lefrw/lefrw.cpp | 8 +- src/odb/src/lef/lefwrite/lefwrite.cpp | 78 +-- src/odb/src/lef/lefwrite/lefwriteCbs.cpp | 70 +-- src/odb/src/lef/lefzlib/lefzlib.cpp | 4 +- src/odb/src/lefin/lefin.cpp | 2 +- 83 files changed, 2401 insertions(+), 2293 deletions(-) diff --git a/src/mpl/src/ParquetFP/src/ClusterDB.cxx b/src/mpl/src/ParquetFP/src/ClusterDB.cxx index 756ccccdd24..536cb13a7dd 100644 --- a/src/mpl/src/ParquetFP/src/ClusterDB.cxx +++ b/src/mpl/src/ParquetFP/src/ClusterDB.cxx @@ -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) { @@ -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() @@ -770,5 +770,5 @@ void ClusterDB::clusterMultiPhysical(DB*& newDB) // Transfer ownership of the new DB newDB = _newDB; - _newDB = 0; + _newDB = nullptr; } diff --git a/src/mpl/src/ParquetFP/src/SolveMulti.cxx b/src/mpl/src/ParquetFP/src/SolveMulti.cxx index a6f8fb89327..0b9a3778b3a 100644 --- a/src/mpl/src/ParquetFP/src/SolveMulti.cxx +++ b/src/mpl/src/ParquetFP/src/SolveMulti.cxx @@ -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; @@ -66,7 +66,7 @@ DB* SolveMulti::clusterOnly() const { ClusterDB multiCluster(_db, _params); - DB* clusteredDB = 0; + DB* clusteredDB = nullptr; if (_params->clusterPhysical) multiCluster.clusterMultiPhysical(clusteredDB); @@ -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") { diff --git a/src/mpl/src/ParquetFP/src/baseannealer.cxx b/src/mpl/src/ParquetFP/src/baseannealer.cxx index 0e2c4c319ca..30c8c866bd6 100644 --- a/src/mpl/src/ParquetFP/src/baseannealer.cxx +++ b/src/mpl/src/ParquetFP/src/baseannealer.cxx @@ -96,7 +96,7 @@ BaseAnnealer::BaseAnnealer(const parquetfp::Command_Line* const params, // -------------------------------------------------------- BaseAnnealer::~BaseAnnealer() { - if (_analSolve != NULL) + if (_analSolve != nullptr) delete _analSolve; } // -------------------------------------------------------- diff --git a/src/mpl/src/ParquetFP/src/baseannealer.h b/src/mpl/src/ParquetFP/src/baseannealer.h index 0ec2c88c068..6d9adf5d3cb 100644 --- a/src/mpl/src/ParquetFP/src/baseannealer.h +++ b/src/mpl/src/ParquetFP/src/baseannealer.h @@ -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), diff --git a/src/mpl/src/ParquetFP/src/btreeanneal.h b/src/mpl/src/ParquetFP/src/btreeanneal.h index e2091e973c9..84c3ebb71ef 100644 --- a/src/mpl/src/ParquetFP/src/btreeanneal.h +++ b/src/mpl/src/ParquetFP/src/btreeanneal.h @@ -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; } // -------------------------------------------------------- diff --git a/src/mpl/src/ParquetFP/src/skyline.cxx b/src/mpl/src/ParquetFP/src/skyline.cxx index 4afa1997696..39300cfae7b 100644 --- a/src/mpl/src/ParquetFP/src/skyline.cxx +++ b/src/mpl/src/ParquetFP/src/skyline.cxx @@ -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) { } @@ -57,7 +57,7 @@ Skyline::~Skyline() if (arr) { delete[] arr; } - arr = 0; + arr = nullptr; capacity = 0; } @@ -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) { } @@ -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++) { @@ -276,7 +276,7 @@ bool SkylineContour::operator=(const SkylineContour& prev) if (prev.skyline_) { skyline_ = prev.skyline_->copy(); } else { - skyline_ = 0; + skyline_ = nullptr; } return true; } @@ -289,7 +289,7 @@ void SkylineContour::Clear() { if (skyline_) { delete skyline_; - skyline_ = 0; + skyline_ = nullptr; } width_ = height_ = 0; std::vector().swap(bTreeInfo_); diff --git a/src/odb/src/db/dbBlock.cpp b/src/odb/src/db/dbBlock.cpp index 26bf7398a51..cd67036ba2f 100644 --- a/src/odb/src/db/dbBlock.cpp +++ b/src/odb/src/db/dbBlock.cpp @@ -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; diff --git a/src/odb/src/db/dbHashTable.hpp b/src/odb/src/db/dbHashTable.hpp index 68b783609fb..c6b226f0f36 100644 --- a/src/odb/src/db/dbHashTable.hpp +++ b/src/odb/src/db/dbHashTable.hpp @@ -200,7 +200,7 @@ T* dbHashTable::find(const char* name) uint sz = _hash_tbl.size(); if (sz == 0) { - return 0; + return nullptr; } uint hid = hash_string(name) & (sz - 1); diff --git a/src/odb/src/db/dbInst.cpp b/src/odb/src/db/dbInst.cpp index 31afab66b8d..6a48ffcb50b 100644 --- a/src/odb/src/db/dbInst.cpp +++ b/src/odb/src/db/dbInst.cpp @@ -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; diff --git a/src/odb/src/db/dbIntHashTable.hpp b/src/odb/src/db/dbIntHashTable.hpp index c9aa0574f31..b83448143a5 100644 --- a/src/odb/src/db/dbIntHashTable.hpp +++ b/src/odb/src/db/dbIntHashTable.hpp @@ -200,7 +200,7 @@ T* dbIntHashTable::find(uint id) uint sz = _hash_tbl.size(); if (sz == 0) { - return 0; + return nullptr; } uint hid = hash_int(id) & (sz - 1); diff --git a/src/odb/src/db/dbLib.cpp b/src/odb/src/db/dbLib.cpp index 8e53c6a84db..19c970d1a8d 100644 --- a/src/odb/src/db/dbLib.cpp +++ b/src/odb/src/db/dbLib.cpp @@ -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); diff --git a/src/odb/src/db/dbMTerm.h b/src/odb/src/db/dbMTerm.h index 21473275018..b7a0448e0ab 100644 --- a/src/odb/src/db/dbMTerm.h +++ b/src/odb/src/db/dbMTerm.h @@ -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(); diff --git a/src/odb/src/db/dbMaster.cpp b/src/odb/src/db/dbMaster.cpp index 728ba15760a..83dec05ddfb 100644 --- a/src/odb/src/db/dbMaster.cpp +++ b/src/odb/src/db/dbMaster.cpp @@ -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); diff --git a/src/odb/src/db/dbNet.cpp b/src/odb/src/db/dbNet.cpp index 55bbf939f88..186f9011580 100644 --- a/src/odb/src/db/dbNet.cpp +++ b/src/odb/src/db/dbNet.cpp @@ -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; diff --git a/src/odb/src/db/dbTarget.cpp b/src/odb/src/db/dbTarget.cpp index bc2da852d7e..ca18210f8f0 100644 --- a/src/odb/src/db/dbTarget.cpp +++ b/src/odb/src/db/dbTarget.cpp @@ -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); diff --git a/src/odb/src/db/dbTechLayer.cpp b/src/odb/src/db/dbTechLayer.cpp index 02d3c6f0d4a..fa3ba35582b 100644 --- a/src/odb/src/db/dbTechLayer.cpp +++ b/src/odb/src/db/dbTechLayer.cpp @@ -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, diff --git a/src/odb/src/db/dbTechVia.cpp b/src/odb/src/db/dbTechVia.cpp index bbc9ffa2428..fd4984fcf8b 100644 --- a/src/odb/src/db/dbTechVia.cpp +++ b/src/odb/src/db/dbTechVia.cpp @@ -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() diff --git a/src/odb/src/db/dbTechViaGenerateRule.cpp b/src/odb/src/db/dbTechViaGenerateRule.cpp index 958f5da1614..558f0e7a9e2 100644 --- a/src/odb/src/db/dbTechViaGenerateRule.cpp +++ b/src/odb/src/db/dbTechViaGenerateRule.cpp @@ -108,7 +108,7 @@ _dbTechViaGenerateRule::_dbTechViaGenerateRule(_dbDatabase*, _dbTechViaGenerateRule::_dbTechViaGenerateRule(_dbDatabase*) { - _name = 0; + _name = nullptr; _flags._default = 0; _flags._spare_bits = 0; } diff --git a/src/odb/src/db/dbTechViaRule.cpp b/src/odb/src/db/dbTechViaRule.cpp index 5748f67edea..df0dcb06c1a 100644 --- a/src/odb/src/db/dbTechViaRule.cpp +++ b/src/odb/src/db/dbTechViaRule.cpp @@ -107,7 +107,7 @@ _dbTechViaRule::_dbTechViaRule(_dbDatabase*, const _dbTechViaRule& v) _dbTechViaRule::_dbTechViaRule(_dbDatabase*) { - _name = 0; + _name = nullptr; _flags._spare_bits = 0; } diff --git a/src/odb/src/db/dbVia.cpp b/src/odb/src/db/dbVia.cpp index fb576d611fb..68974b92254 100644 --- a/src/odb/src/db/dbVia.cpp +++ b/src/odb/src/db/dbVia.cpp @@ -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() @@ -279,7 +279,7 @@ std::string dbVia::getPattern() { _dbVia* via = (_dbVia*) this; - if (via->_pattern == 0) { + if (via->_pattern == nullptr) { return ""; } @@ -290,7 +290,7 @@ void dbVia::setPattern(const char* name) { _dbVia* via = (_dbVia*) this; - if (via->_pattern != 0) { + if (via->_pattern != nullptr) { return; } diff --git a/src/odb/src/def/def/def_keywords.cpp b/src/odb/src/def/def/def_keywords.cpp index 3f5407906e6..b1d086952b6 100644 --- a/src/odb/src/def/def/def_keywords.cpp +++ b/src/odb/src/def/def/def_keywords.cpp @@ -114,12 +114,12 @@ void defrData::reload_buffer() first_buffer = 0; if (settings->ReadFunction) { if ((nb = (*settings->ReadFunction)(File, buffer, 4)) != 4) { - next = NULL; + next = nullptr; return; } } else { if ((nb = fread(buffer, 1, 4, File)) != 4) { - next = NULL; + next = nullptr; return; } } @@ -134,7 +134,7 @@ void defrData::reload_buffer() } if (nb <= 0) { - next = NULL; + next = nullptr; } else { next = buffer; last = buffer + nb - 1; @@ -147,7 +147,7 @@ int defrData::GETC() for (;;) { if (next > last) reload_buffer(); - if (next == NULL) + if (next == nullptr) return EOF; int ch = *next++; @@ -187,8 +187,8 @@ char* defrData::ringCopy(const char* string) int defrData::DefGetTokenFromStack(char* s) { - const char* ch; /* utility variable */ - char* prS = NULL; /* pointing to the previous char or s */ + const char* ch; /* utility variable */ + char* prS = nullptr; /* pointing to the previous char or s */ while (input_level >= 0) { for (ch = stack[input_level].c_str(); *ch != 0; ch++) /* skip white space */ @@ -418,7 +418,7 @@ void defrData::StoreAlias() } /* now keep getting lines till we get one that contains &ENDALIAS */ - for (char* p = NULL; p == NULL;) { + for (char* p = nullptr; p == nullptr;) { int i; char* s = line; for (i = 0; i < tokenSize - 1; i++) { @@ -440,7 +440,7 @@ void defrData::StoreAlias() uc_array(line, uc_line); /* make upper case copy */ p = strstr(uc_line, "&ENDALIAS"); /* look for END_ALIAS */ - if (p != NULL) /* if we find it */ + if (p != nullptr) /* if we find it */ *(line + (p - uc_line)) = 0; /* remove it from the line */ so_far += line; @@ -1095,11 +1095,11 @@ void defrData::defInfo(int msgNum, const char* s) lines2str(nlines)); } else { if (!hasOpenedDefLogFile) { - if ((defrLog = fopen("defRWarning.log", "w")) == 0) { + if ((defrLog = fopen("defRWarning.log", "w")) == nullptr) { printf( "WARNING(DEFPARS-8500): Unable to open the file defRWarning.log in " "%s.\n", - getcwd(NULL, 64)); + getcwd(nullptr, 64)); printf("Info messages will not be printed.\n"); } else { hasOpenedDefLogFile = 1; @@ -1112,11 +1112,11 @@ void defrData::defInfo(int msgNum, const char* s) lines2str(nlines)); } } else { - if ((defrLog = fopen("defRWarning.log", "a")) == 0) { + if ((defrLog = fopen("defRWarning.log", "a")) == nullptr) { printf( "WARNING (DEFPARS-8500): Unable to open the file defRWarning.log " "in %s.\n", - getcwd(NULL, 64)); + getcwd(nullptr, 64)); printf("Info messages will not be printed.\n"); } else { hasOpenedDefLogFile = 1; @@ -1175,11 +1175,11 @@ void defrData::defWarning(int msgNum, const char* s) lines2str(nlines)); } else { if (!hasOpenedDefLogFile) { - if ((defrLog = fopen("defRWarning.log", "w")) == 0) { + if ((defrLog = fopen("defRWarning.log", "w")) == nullptr) { printf( "WARNING (DEFPARS-7500): Unable to open the file defRWarning.log " "in %s.\n", - getcwd(NULL, 64)); + getcwd(nullptr, 64)); printf("Warning messages will not be printed.\n"); } else { hasOpenedDefLogFile = 1; @@ -1192,11 +1192,11 @@ void defrData::defWarning(int msgNum, const char* s) lines2str(nlines)); } } else { - if ((defrLog = fopen("defRWarning.log", "a")) == 0) { + if ((defrLog = fopen("defRWarning.log", "a")) == nullptr) { printf( "WARNING (DEFAPRS-7501): Unable to open the file defRWarning.log " "in %s.\n", - getcwd(NULL, 64)); + getcwd(nullptr, 64)); printf("Warning messages will not be printed.\n"); } else { hasOpenedDefLogFile = 1; diff --git a/src/odb/src/def/def/defiAlias.cpp b/src/odb/src/def/def/defiAlias.cpp index 567dfe80538..78b3cf7ddf5 100644 --- a/src/odb/src/def/def/defiAlias.cpp +++ b/src/odb/src/def/def/defiAlias.cpp @@ -42,7 +42,7 @@ class defAliasIterator }; defiAlias_itr::defiAlias_itr(defrData* data) - : first(1), iterator(NULL), defData(data ? data : defContext.data) + : first(1), iterator(nullptr), defData(data ? data : defContext.data) { defiAlias_itr::Init(); } @@ -56,7 +56,7 @@ void defiAlias_itr::Init() void defiAlias_itr::Destroy() { delete iterator; - iterator = NULL; + iterator = nullptr; } defiAlias_itr::~defiAlias_itr() @@ -83,7 +83,7 @@ int defiAlias_itr::Next() const char* defiAlias_itr::Key() { if (iterator->me == defData->def_alias_set.end()) { - return NULL; + return nullptr; } return iterator->me->first.c_str(); @@ -92,7 +92,7 @@ const char* defiAlias_itr::Key() const char* defiAlias_itr::Data() { if (iterator->me == defData->def_alias_set.end()) { - return NULL; + return nullptr; } // First char is reserved for 'marked' symbol ('0' or '1') @@ -103,7 +103,7 @@ int defiAlias_itr::Marked() { const char* value = iterator->me->second.c_str(); - if ((value == NULL) || (value[0] == '0')) { + if ((value == nullptr) || (value[0] == '0')) { return 0; } else { return 1; diff --git a/src/odb/src/def/def/defiAlias.hpp b/src/odb/src/def/def/defiAlias.hpp index 4a217158d7f..bdad0996c6e 100644 --- a/src/odb/src/def/def/defiAlias.hpp +++ b/src/odb/src/def/def/defiAlias.hpp @@ -40,7 +40,7 @@ class defrData; class defiAlias_itr { public: - defiAlias_itr(defrData* defData = 0); + defiAlias_itr(defrData* defData = nullptr); void Init(); void Destroy(); diff --git a/src/odb/src/def/def/defiAssertion.cpp b/src/odb/src/def/def/defiAssertion.cpp index ae103e15c4c..c0341a08bd9 100644 --- a/src/odb/src/def/def/defiAssertion.cpp +++ b/src/odb/src/def/def/defiAssertion.cpp @@ -108,7 +108,7 @@ void defiAssertion::clear() defData); } itemTypes_[i] = 'B'; // bogus - items_[i] = 0; + items_[i] = nullptr; } numItems_ = 0; diff --git a/src/odb/src/def/def/defiBlockage.cpp b/src/odb/src/def/def/defiBlockage.cpp index f76304fa307..d723c017d0e 100644 --- a/src/odb/src/def/def/defiBlockage.cpp +++ b/src/odb/src/def/def/defiBlockage.cpp @@ -55,17 +55,17 @@ void defiBlockage::Init() { numPolys_ = 0; clear(); - layerName_ = 0; - componentName_ = 0; + layerName_ = nullptr; + componentName_ = nullptr; layerNameLength_ = 0; componentNameLength_ = 0; - xl_ = 0; - yl_ = 0; - xh_ = 0; - yh_ = 0; + xl_ = nullptr; + yl_ = nullptr; + xh_ = nullptr; + yh_ = nullptr; rectsAllocated_ = 0; polysAllocated_ = 0; - polygons_ = 0; + polygons_ = nullptr; } defiBlockage::~defiBlockage() @@ -110,22 +110,22 @@ void defiBlockage::Destroy() free(layerName_); if (componentName_) free(componentName_); - layerName_ = 0; - componentName_ = 0; + layerName_ = nullptr; + componentName_ = nullptr; if (rectsAllocated_) { free((char*) (xl_)); free((char*) (yl_)); free((char*) (xh_)); free((char*) (yh_)); rectsAllocated_ = 0; - xl_ = 0; - yl_ = 0; - xh_ = 0; - yh_ = 0; + xl_ = nullptr; + yl_ = nullptr; + xh_ = nullptr; + yh_ = nullptr; } clearPoly(); free((char*) (polygons_)); - polygons_ = 0; + polygons_ = nullptr; clear(); } diff --git a/src/odb/src/def/def/defiComponent.cpp b/src/odb/src/def/def/defiComponent.cpp index 34d43344551..869d887d7d4 100644 --- a/src/odb/src/def/def/defiComponent.cpp +++ b/src/odb/src/def/def/defiComponent.cpp @@ -56,7 +56,7 @@ void defiComponentMaskShiftLayer::Init() { layersAllocated_ = 0; numLayers_ = 0; - layers_ = 0; + layers_ = nullptr; bumpLayers(16); } @@ -77,7 +77,7 @@ void defiComponentMaskShiftLayer::Destroy() } layersAllocated_ = 0; numLayers_ = 0; - layers_ = 0; + layers_ = nullptr; } void defiComponentMaskShiftLayer::addMaskShiftLayer(const char* layer) @@ -123,7 +123,7 @@ const char* defiComponentMaskShiftLayer::maskShiftLayer(int index) const return layers_[index]; } - return 0; + return nullptr; } /********************************************************* @@ -136,24 +136,24 @@ defiComponent::defiComponent(defrData* data) : defData(data) void defiComponent::Init() { - id_ = 0; - name_ = 0; - regionName_ = 0; - foreignName_ = 0; + id_ = nullptr; + name_ = nullptr; + regionName_ = nullptr; + foreignName_ = nullptr; Fori_ = 0; - EEQ_ = 0; - generateName_ = 0; - macroName_ = 0; + EEQ_ = nullptr; + generateName_ = nullptr; + macroName_ = nullptr; generateNameSize_ = 0; maskShiftSize_ = 0; - maskShift_ = 0; + maskShift_ = nullptr; macroNameSize_ = 0; minLayerSize_ = 0; maxLayerSize_ = 0; - minLayer_ = 0; - maxLayer_ = 0; - nets_ = 0; - source_ = 0; + minLayer_ = nullptr; + maxLayer_ = nullptr; + nets_ = nullptr; + source_ = nullptr; numNets_ = 0; bumpName(16); bumpId(16); @@ -567,7 +567,7 @@ void defiComponent::clear() if (maskShiftSize_) { free((int*) (maskShift_)); } - maskShift_ = 0; + maskShift_ = nullptr; maskShiftSize_ = 0; weight_ = 0; if (source_) @@ -576,7 +576,7 @@ void defiComponent::clear() free(nets_[i]); } numNets_ = 0; - source_ = 0; + source_ = nullptr; hasHalo_ = 0; hasHaloSoft_ = 0; haloDist_ = 0; @@ -789,7 +789,7 @@ char* defiComponent::propName(int index) const { if (index < 0 || index >= numProps_) { defiError(1, 0, "bad index for component property", defData); - return 0; + return nullptr; } return names_[index]; } @@ -798,7 +798,7 @@ char* defiComponent::propValue(int index) const { if (index < 0 || index >= numProps_) { defiError(1, 0, "bad index for component property", defData); - return 0; + return nullptr; } return values_[index]; } @@ -956,7 +956,7 @@ const char* defiComponent::net(int index) const if (index >= 0 && index < numNets_) { return nets_[index]; } - return 0; + return nullptr; } void defiComponent::bumpForeignName(int size) @@ -1036,7 +1036,7 @@ const char* defiComponent::foreignOri() const case 7: return ("FE"); } - return 0; + return nullptr; } int defiComponent::foreignOrient() const diff --git a/src/odb/src/def/def/defiFPC.cpp b/src/odb/src/def/def/defiFPC.cpp index ee6a6b98c0a..9d6e0df561c 100644 --- a/src/odb/src/def/def/defiFPC.cpp +++ b/src/odb/src/def/def/defiFPC.cpp @@ -52,12 +52,12 @@ defiFPC::defiFPC(defrData* data) : defData(data) void defiFPC::Init() { - name_ = 0; + name_ = nullptr; nameLength_ = 0; namesAllocated_ = 0; namesUsed_ = 0; - names_ = 0; - rowOrComp_ = 0; + names_ = nullptr; + rowOrComp_ = nullptr; clear(); } @@ -72,7 +72,7 @@ void defiFPC::Destroy() if (name_) free(name_); - name_ = 0; + name_ = nullptr; nameLength_ = 0; free((char*) (names_)); diff --git a/src/odb/src/def/def/defiFill.cpp b/src/odb/src/def/def/defiFill.cpp index b25d7091d5a..055c61112cc 100644 --- a/src/odb/src/def/def/defiFill.cpp +++ b/src/odb/src/def/def/defiFill.cpp @@ -63,13 +63,13 @@ void defiFill::Init() yh_ = (int*) malloc(sizeof(int) * 1); rectsAllocated_ = 1; // At least 1 rectangle will define polysAllocated_ = 0; - polygons_ = 0; - layerName_ = 0; - viaName_ = 0; + polygons_ = nullptr; + layerName_ = nullptr; + viaName_ = nullptr; viaNameLength_ = 0; - viaPts_ = 0; + viaPts_ = nullptr; ptsAllocated_ = 0; - viaPts_ = 0; + viaPts_ = nullptr; } defiFill::~defiFill() @@ -126,18 +126,18 @@ void defiFill::Destroy() free((char*) (xh_)); free((char*) (yh_)); rectsAllocated_ = 0; - xl_ = 0; - yl_ = 0; - xh_ = 0; - yh_ = 0; + xl_ = nullptr; + yl_ = nullptr; + xh_ = nullptr; + yh_ = nullptr; clearPoly(); if (polygons_) free((char*) (polygons_)); - polygons_ = 0; + polygons_ = nullptr; clearPts(); if (viaPts_) free((char*) (viaPts_)); - viaPts_ = 0; + viaPts_ = nullptr; clear(); } diff --git a/src/odb/src/def/def/defiGroup.cpp b/src/odb/src/def/def/defiGroup.cpp index 1b660363428..83ae587fdca 100644 --- a/src/odb/src/def/def/defiGroup.cpp +++ b/src/odb/src/def/def/defiGroup.cpp @@ -52,9 +52,9 @@ defiGroup::defiGroup(defrData* data) : defData(data) void defiGroup::Init() { - name_ = 0; + name_ = nullptr; nameLength_ = 0; - region_ = 0; + region_ = nullptr; regionLength_ = 0; numRects_ = 0; @@ -83,9 +83,9 @@ void defiGroup::Destroy() free(name_); if (region_) free(region_); - name_ = 0; + name_ = nullptr; nameLength_ = 0; - region_ = 0; + region_ = nullptr; regionLength_ = 0; clear(); @@ -309,7 +309,7 @@ const char* defiGroup::propName(int index) const index, numProps_); defiError(0, 6050, msg, defData); - return 0; + return nullptr; } return propNames_[index]; } @@ -324,7 +324,7 @@ const char* defiGroup::propValue(int index) const index, numProps_); defiError(0, 6050, msg, defData); - return 0; + return nullptr; } return propValues_[index]; } diff --git a/src/odb/src/def/def/defiIOTiming.cpp b/src/odb/src/def/def/defiIOTiming.cpp index d4a5b5e353d..685504f6b1b 100644 --- a/src/odb/src/def/def/defiIOTiming.cpp +++ b/src/odb/src/def/def/defiIOTiming.cpp @@ -52,15 +52,15 @@ defiIOTiming::defiIOTiming(defrData* data) : defData(data) void defiIOTiming::Init() { - inst_ = 0; + inst_ = nullptr; instLength_ = 0; - pin_ = 0; + pin_ = nullptr; pinLength_ = 0; - from_ = 0; + from_ = nullptr; fromLength_ = 0; - to_ = 0; + to_ = nullptr; toLength_ = 0; - driveCell_ = 0; + driveCell_ = nullptr; driveCellLength_ = 0; hasVariableRise_ = 0; hasVariableFall_ = 0; @@ -71,7 +71,7 @@ void defiIOTiming::Init() hasFrom_ = 0; if (pin_) free(pin_); - pin_ = 0; + pin_ = nullptr; pinLength_ = 0; hasTo_ = 0; @@ -97,27 +97,27 @@ void defiIOTiming::Destroy() { if (inst_) free(inst_); - inst_ = 0; + inst_ = nullptr; instLength_ = 0; if (pin_) free(pin_); - pin_ = 0; + pin_ = nullptr; pinLength_ = 0; if (from_) free(from_); - from_ = 0; + from_ = nullptr; fromLength_ = 0; if (to_) free(to_); - to_ = 0; + to_ = nullptr; toLength_ = 0; if (driveCell_) free(driveCell_); - driveCell_ = 0; + driveCell_ = nullptr; driveCellLength_ = 0; clear(); diff --git a/src/odb/src/def/def/defiMisc.cpp b/src/odb/src/def/def/defiMisc.cpp index cca1295d06f..06961fd017c 100644 --- a/src/odb/src/def/def/defiMisc.cpp +++ b/src/odb/src/def/def/defiMisc.cpp @@ -145,7 +145,7 @@ defiStyles::defiStyles() void defiStyles::Init() { styleNum_ = 0; - polygon_ = 0; + polygon_ = nullptr; } defiStyles::~defiStyles() @@ -169,7 +169,7 @@ void defiStyles::clear() free((char*) (polygon_)); } styleNum_ = 0; - polygon_ = 0; + polygon_ = nullptr; } void defiStyles::setStyle(int styleNum) @@ -182,7 +182,7 @@ void defiStyles::setPolygon(defiGeometries* geom) struct defiPoints* p; int i, x, y; - if (polygon_ == 0) { + if (polygon_ == nullptr) { p = (struct defiPoints*) malloc(sizeof(struct defiPoints)); p->numPoints = geom->numPoints(); p->x = (int*) malloc(sizeof(int) * p->numPoints); diff --git a/src/odb/src/def/def/defiNet.cpp b/src/odb/src/def/def/defiNet.cpp index d93ffe32499..1ce26a70545 100644 --- a/src/odb/src/def/def/defiNet.cpp +++ b/src/odb/src/def/def/defiNet.cpp @@ -94,25 +94,25 @@ defiSubnet::defiSubnet(defrData* data) : defData(data) void defiSubnet::Init() { - name_ = 0; + name_ = nullptr; bumpName(16); - instances_ = 0; - pins_ = 0; - musts_ = 0; - synthesized_ = 0; + instances_ = nullptr; + pins_ = nullptr; + musts_ = nullptr; + synthesized_ = nullptr; numPins_ = 0; bumpPins(16); // WMD -- this will be removed by the next release - paths_ = 0; + paths_ = nullptr; numPaths_ = 0; pathsAllocated_ = 0; numWires_ = 0; wiresAllocated_ = 0; - wires_ = 0; - nonDefaultRule_ = 0; + wires_ = nullptr; + nonDefaultRule_ = nullptr; clear(); } @@ -246,7 +246,7 @@ void defiSubnet::addWire(const char* type) } wire = wires_[numWires_] = new defiWire(defData); numWires_ += 1; - wire->Init(type, NULL); + wire->Init(type, nullptr); } void defiSubnet::addWirePath(defiPath* p, int reset, int netOsnet, int* needCbk) @@ -288,14 +288,14 @@ const char* defiSubnet::instance(int index) const { if (index >= 0 && index < numPins_) return instances_[index]; - return 0; + return nullptr; } const char* defiSubnet::pin(int index) const { if (index >= 0 && index < numPins_) return pins_[index]; - return 0; + return nullptr; } int defiSubnet::pinIsMustJoin(int index) const @@ -380,8 +380,8 @@ void defiSubnet::clear() for (i = 0; i < numPins_; i++) { free(instances_[i]); free(pins_[i]); - instances_[i] = 0; - pins_[i] = 0; + instances_[i] = nullptr; + pins_[i] = nullptr; musts_[i] = 0; synthesized_[i] = 0; } @@ -393,23 +393,23 @@ void defiSubnet::clear() delete paths_[i]; } delete[] paths_; - paths_ = 0; + paths_ = nullptr; numPaths_ = 0; pathsAllocated_ = 0; } if (nonDefaultRule_) { free(nonDefaultRule_); - nonDefaultRule_ = 0; + nonDefaultRule_ = nullptr; } if (numWires_) { for (i = 0; i < numWires_; i++) { delete wires_[i]; - wires_[i] = 0; + wires_[i] = nullptr; } free((char*) (wires_)); - wires_ = 0; + wires_ = nullptr; numWires_ = 0; wiresAllocated_ = 0; } @@ -460,14 +460,14 @@ defiWire* defiSubnet::wire(int index) { if (index >= 0 && index < numWires_) return wires_[index]; - return 0; + return nullptr; } const defiWire* defiSubnet::wire(int index) const { if (index >= 0 && index < numWires_) return wires_[index]; - return 0; + return nullptr; } // WMD -- this will be removed after the next release @@ -475,7 +475,7 @@ defiPath* defiSubnet::path(int index) { if (index >= 0 && index < numPaths_) return paths_[index]; - return 0; + return nullptr; } // WMD -- this will be removed after the next release @@ -483,7 +483,7 @@ const defiPath* defiSubnet::path(int index) const { if (index >= 0 && index < numPaths_) return paths_[index]; - return 0; + return nullptr; } // WMD -- this will be removed after the next release @@ -526,7 +526,7 @@ void defiVpin::Init(const char* name) strcpy(name_, defData->DEFCASE(name)); orient_ = -1; status_ = ' '; - layer_ = 0; + layer_ = nullptr; } defiVpin::~defiVpin() @@ -646,7 +646,7 @@ void defiShield::Init(const char* name) strcpy(name_, defData->DEFCASE(name)); numPaths_ = 0; pathsAllocated_ = 0; - paths_ = NULL; + paths_ = nullptr; } void defiShield::Destroy() @@ -703,7 +703,7 @@ void defiShield::clear() if (name_) { free(name_); - name_ = 0; + name_ = nullptr; } if (paths_) { @@ -713,7 +713,7 @@ void defiShield::clear() delete[] paths_; - paths_ = 0; + paths_ = nullptr; numPaths_ = 0; pathsAllocated_ = 0; } @@ -749,14 +749,14 @@ defiPath* defiShield::path(int index) { if (index >= 0 && index < numPaths_) return paths_[index]; - return 0; + return nullptr; } const defiPath* defiShield::path(int index) const { if (index >= 0 && index < numPaths_) return paths_[index]; - return 0; + return nullptr; } //////////////////////////////////////////////////// @@ -780,10 +780,10 @@ void defiWire::Init(const char* type, const char* wireShieldName) wireShieldName_ = (char*) malloc(strlen(wireShieldName) + 1); strcpy(wireShieldName_, wireShieldName); } else - wireShieldName_ = 0; + wireShieldName_ = nullptr; numPaths_ = 0; pathsAllocated_ = 0; - paths_ = 0; + paths_ = nullptr; } void defiWire::Destroy() @@ -842,12 +842,12 @@ void defiWire::clear() if (type_) { free(type_); - type_ = 0; + type_ = nullptr; } if (wireShieldName_) { free(wireShieldName_); - wireShieldName_ = 0; + wireShieldName_ = nullptr; } if (paths_) { @@ -856,7 +856,7 @@ void defiWire::clear() } delete[] paths_; - paths_ = 0; + paths_ = nullptr; numPaths_ = 0; pathsAllocated_ = 0; } @@ -894,14 +894,14 @@ defiPath* defiWire::path(int index) { if (index >= 0 && index < numPaths_) return paths_[index]; - return 0; + return nullptr; } const defiPath* defiWire::path(int index) const { if (index >= 0 && index < numPaths_) return paths_[index]; - return 0; + return nullptr; } //////////////////////////////////////////////////// @@ -919,40 +919,40 @@ defiNet::defiNet(defrData* data) : defData(data) void defiNet::Init() { - name_ = 0; - instances_ = 0; + name_ = nullptr; + instances_ = nullptr; numPins_ = 0; numProps_ = 0; - propNames_ = 0; - subnets_ = 0; - source_ = 0; - pattern_ = 0; + propNames_ = nullptr; + subnets_ = nullptr; + source_ = nullptr; + pattern_ = nullptr; style_ = 0; - shieldNet_ = 0; - original_ = 0; - use_ = 0; - nonDefaultRule_ = 0; + shieldNet_ = nullptr; + original_ = nullptr; + use_ = nullptr; + nonDefaultRule_ = nullptr; numWires_ = 0; wiresAllocated_ = 0; - wires_ = 0; + wires_ = nullptr; numWidths_ = 0; widthsAllocated_ = 0; - wlayers_ = 0; - wdist_ = 0; + wlayers_ = nullptr; + wdist_ = nullptr; numSpacing_ = 0; spacingAllocated_ = 0; - slayers_ = 0; - sdist_ = 0; - sleft_ = 0; - sright_ = 0; + slayers_ = nullptr; + sdist_ = nullptr; + sleft_ = nullptr; + sright_ = nullptr; - vpins_ = 0; + vpins_ = nullptr; numVpins_ = 0; vpinsAllocated_ = 0; - shields_ = 0; + shields_ = nullptr; numShields_ = 0; numNoShields_ = 0; shieldsAllocated_ = 0; @@ -964,33 +964,33 @@ void defiNet::Init() bumpPins(16); bumpSubnets(2); - rectNames_ = 0; - rectRouteStatus_ = 0; - rectRouteStatusShieldNames_ = 0; - rectShapeTypes_ = 0; - rectMasks_ = 0; - polygonNames_ = 0; - polyRouteStatus_ = 0; - polyShapeTypes_ = 0; - polyRouteStatusShieldNames_ = 0; + rectNames_ = nullptr; + rectRouteStatus_ = nullptr; + rectRouteStatusShieldNames_ = nullptr; + rectShapeTypes_ = nullptr; + rectMasks_ = nullptr; + polygonNames_ = nullptr; + polyRouteStatus_ = nullptr; + polyShapeTypes_ = nullptr; + polyRouteStatusShieldNames_ = nullptr; numPolys_ = 0; polysAllocated_ = 0; - polygons_ = 0; - polyMasks_ = 0; + polygons_ = nullptr; + polyMasks_ = nullptr; numSubnets_ = 0; - paths_ = 0; + paths_ = nullptr; numPaths_ = 0; numPts_ = 0; - viaNames_ = 0; - viaPts_ = 0; + viaNames_ = nullptr; + viaPts_ = nullptr; ptsAllocated_ = 0; - viaMasks_ = 0; - viaOrients_ = 0; - viaRouteStatus_ = 0; - viaShapeTypes_ = 0; - viaRouteStatusShieldNames_ = 0; + viaMasks_ = nullptr; + viaOrients_ = nullptr; + viaRouteStatus_ = nullptr; + viaShapeTypes_ = nullptr; + viaRouteStatusShieldNames_ = nullptr; clear(); } @@ -1337,14 +1337,14 @@ const char* defiNet::propName(int index) const { if (index >= 0 && index < numProps_) return propNames_[index]; - return 0; + return nullptr; } const char* defiNet::propValue(int index) const { if (index >= 0 && index < numProps_) return propValues_[index]; - return 0; + return nullptr; } double defiNet::propNumber(int index) const @@ -1389,14 +1389,14 @@ const char* defiNet::instance(int index) const { if (index >= 0 && index < numPins_) return instances_[index]; - return 0; + return nullptr; } const char* defiNet::pin(int index) const { if (index >= 0 && index < numPins_) return pins_[index]; - return 0; + return nullptr; } int defiNet::pinIsMustJoin(int index) const @@ -1427,14 +1427,14 @@ defiSubnet* defiNet::subnet(int index) { if (index >= 0 && index < numSubnets_) return subnets_[index]; - return 0; + return nullptr; } const defiSubnet* defiNet::subnet(int index) const { if (index >= 0 && index < numSubnets_) return subnets_[index]; - return 0; + return nullptr; } int defiNet::isFixed() const @@ -1462,10 +1462,10 @@ void defiNet::freeWire() for (i = 0; i < numWires_; i++) { wires_[i]->Destroy(); delete wires_[i]; - wires_[i] = 0; + wires_[i] = nullptr; } free((char*) (wires_)); - wires_ = 0; + wires_ = nullptr; numWires_ = 0; wiresAllocated_ = 0; } @@ -1482,7 +1482,7 @@ void defiNet::freeShield() for (i = 0; i < numShields_; i++) { shields_[i]->Destroy(); free((char*) (shields_[i])); - shields_[i] = 0; + shields_[i] = nullptr; } numShields_ = 0; shieldsAllocated_ = 0; @@ -1721,7 +1721,7 @@ void defiNet::clear() delete vpins_[i]; } free((char*) vpins_); - vpins_ = 0; + vpins_ = nullptr; numVpins_ = 0; vpinsAllocated_ = 0; } @@ -1729,8 +1729,8 @@ void defiNet::clear() for (i = 0; i < numProps_; i++) { free(propNames_[i]); free(propValues_[i]); - propNames_[i] = 0; - propValues_[i] = 0; + propNames_[i] = nullptr; + propValues_[i] = nullptr; propDValues_[i] = 0; } numProps_ = 0; @@ -1738,8 +1738,8 @@ void defiNet::clear() for (i = 0; i < numPins_; i++) { free(instances_[i]); free(pins_[i]); - instances_[i] = 0; - pins_[i] = 0; + instances_[i] = nullptr; + pins_[i] = nullptr; musts_[i] = 0; synthesized_[i] = 0; } @@ -1747,7 +1747,7 @@ void defiNet::clear() for (i = 0; i < numSubnets_; i++) { delete subnets_[i]; - subnets_[i] = 0; + subnets_[i] = nullptr; } numSubnets_ = 0; @@ -1761,7 +1761,7 @@ void defiNet::clear() } delete[] paths_; - paths_ = 0; + paths_ = nullptr; numPaths_ = 0; pathsAllocated_ = 0; } @@ -1771,33 +1771,33 @@ void defiNet::clear() if (source_) { free(source_); - source_ = 0; + source_ = nullptr; } if (pattern_) { free(pattern_); - pattern_ = 0; + pattern_ = nullptr; } if (original_) { free(original_); - original_ = 0; + original_ = nullptr; } if (use_) { free(use_); - use_ = 0; + use_ = nullptr; } if (nonDefaultRule_) { free(nonDefaultRule_); - nonDefaultRule_ = 0; + nonDefaultRule_ = nullptr; } style_ = 0; if (numWires_) { for (i = 0; i < numWires_; i++) { delete wires_[i]; - wires_[i] = 0; + wires_[i] = nullptr; } free((char*) (wires_)); - wires_ = 0; + wires_ = nullptr; numWires_ = 0; wiresAllocated_ = 0; } @@ -1805,7 +1805,7 @@ void defiNet::clear() if (numShields_) { for (i = 0; i < numShields_; i++) { delete shields_[i]; - shields_[i] = 0; + shields_[i] = nullptr; } numShields_ = 0; shieldsAllocated_ = 0; @@ -1814,7 +1814,7 @@ void defiNet::clear() if (numNoShields_) { for (i = 0; i < numNoShields_; i++) { delete shields_[i]; - shields_[i] = 0; + shields_[i] = nullptr; } numNoShields_ = 0; shieldsAllocated_ = 0; @@ -1822,7 +1822,7 @@ void defiNet::clear() if (shields_) free((char*) (shields_)); - shields_ = 0; + shields_ = nullptr; if (numWidths_) { for (i = 0; i < numWidths_; i++) @@ -1868,12 +1868,12 @@ void defiNet::clear() free((char*) (polyRouteStatus_)); free((char*) (polyShapeTypes_)); free((char*) (polyRouteStatusShieldNames_)); - polygonNames_ = 0; - polygons_ = 0; - polyMasks_ = 0; - polyRouteStatus_ = 0; - polyShapeTypes_ = 0; - polyRouteStatusShieldNames_ = 0; + polygonNames_ = nullptr; + polygons_ = nullptr; + polyMasks_ = nullptr; + polyRouteStatus_ = nullptr; + polyShapeTypes_ = nullptr; + polyRouteStatusShieldNames_ = nullptr; } numPolys_ = 0; polysAllocated_ = 0; @@ -1903,17 +1903,17 @@ void defiNet::clear() free((char*) (rectRouteStatusShieldNames_)); free((char*) (rectShapeTypes_)); } - rectNames_ = 0; - rectRouteStatus_ = 0; - rectShapeTypes_ = 0; - rectRouteStatusShieldNames_ = 0; + rectNames_ = nullptr; + rectRouteStatus_ = nullptr; + rectShapeTypes_ = nullptr; + rectRouteStatusShieldNames_ = nullptr; numRects_ = 0; rectsAllocated_ = 0; - xl_ = 0; - yl_ = 0; - xh_ = 0; - yh_ = 0; - rectMasks_ = 0; + xl_ = nullptr; + yl_ = nullptr; + xh_ = nullptr; + yh_ = nullptr; + rectMasks_ = nullptr; if (viaNames_) { struct defiPoints* p; @@ -1943,16 +1943,16 @@ void defiNet::clear() free((char*) (viaRouteStatus_)); free((char*) (viaShapeTypes_)); free((char*) (viaRouteStatusShieldNames_)); - viaNames_ = 0; - viaPts_ = 0; - viaRouteStatus_ = 0; - viaShapeTypes_ = 0; - viaRouteStatusShieldNames_ = 0; + viaNames_ = nullptr; + viaPts_ = nullptr; + viaRouteStatus_ = nullptr; + viaShapeTypes_ = nullptr; + viaRouteStatusShieldNames_ = nullptr; } numPts_ = 0; ptsAllocated_ = 0; - viaOrients_ = 0; - viaMasks_ = 0; + viaOrients_ = nullptr; + viaMasks_ = nullptr; } void defiNet::clearRectPolyNPath() @@ -2002,12 +2002,12 @@ void defiNet::clearRectPoly() } numPolys_ = 0; polysAllocated_ = 0; - polyMasks_ = 0; - polygonNames_ = 0; - polyRouteStatus_ = 0; - polyShapeTypes_ = 0; - polyRouteStatusShieldNames_ = 0; - polygons_ = 0; + polyMasks_ = nullptr; + polygonNames_ = nullptr; + polyRouteStatus_ = nullptr; + polyShapeTypes_ = nullptr; + polyRouteStatusShieldNames_ = nullptr; + polygons_ = nullptr; if (rectNames_) { for (i = 0; i < numRects_; i++) { @@ -2034,17 +2034,17 @@ void defiNet::clearRectPoly() free((char*) (rectRouteStatus_)); free((char*) (rectRouteStatusShieldNames_)); } - rectNames_ = 0; + rectNames_ = nullptr; rectsAllocated_ = 0; - xl_ = 0; - yl_ = 0; - xh_ = 0; - yh_ = 0; + xl_ = nullptr; + yl_ = nullptr; + xh_ = nullptr; + yh_ = nullptr; numRects_ = 0; - rectMasks_ = 0; - rectRouteStatus_ = 0; - rectShapeTypes_ = 0; - rectRouteStatusShieldNames_ = 0; + rectMasks_ = nullptr; + rectRouteStatus_ = nullptr; + rectShapeTypes_ = nullptr; + rectRouteStatusShieldNames_ = nullptr; } int defiNet::hasSource() const @@ -2240,14 +2240,14 @@ defiPath* defiNet::path(int index) { if (index >= 0 && index < numPaths_) return paths_[index]; - return 0; + return nullptr; } const defiPath* defiNet::path(int index) const { if (index >= 0 && index < numPaths_) return paths_[index]; - return 0; + return nullptr; } int defiNet::numWires() const @@ -2259,14 +2259,14 @@ defiWire* defiNet::wire(int index) { if (index >= 0 && index < numWires_) return wires_[index]; - return 0; + return nullptr; } const defiWire* defiNet::wire(int index) const { if (index >= 0 && index < numWires_) return wires_[index]; - return 0; + return nullptr; } void defiNet::bumpShieldNets(long long size) @@ -2294,14 +2294,14 @@ defiShield* defiNet::shield(int index) { if (index >= 0 && index < numShields_) return shields_[index]; - return 0; + return nullptr; } const defiShield* defiNet::shield(int index) const { if (index >= 0 && index < numShields_) return shields_[index]; - return 0; + return nullptr; } int defiNet::numNoShields() const @@ -2313,14 +2313,14 @@ defiShield* defiNet::noShield(int index) { if (index >= 0 && index < numNoShields_) return shields_[index]; - return 0; + return nullptr; } const defiShield* defiNet::noShield(int index) const { if (index >= 0 && index < numNoShields_) return shields_[index]; - return 0; + return nullptr; } int defiNet::hasVoltage() const @@ -2410,14 +2410,14 @@ int defiNet::numVpins() const defiVpin* defiNet::vpin(int index) { if (index < 0 || index >= numVpins_) - return 0; + return nullptr; return vpins_[index]; } const defiVpin* defiNet::vpin(int index) const { if (index < 0 || index >= numVpins_) - return 0; + return nullptr; return vpins_[index]; } @@ -2619,7 +2619,7 @@ const char* defiNet::polygonName(int index) const { if (index < 0 || index > numPolys_) { defiError6085(index, numPolys_, defData); - return 0; + return nullptr; } return polygonNames_[index]; } @@ -2628,7 +2628,7 @@ const char* defiNet::polyRouteStatus(int index) const { if (index < 0 || index > numPolys_) { defiError6085(index, numPolys_, defData); - return 0; + return nullptr; } return polyRouteStatus_[index]; } @@ -2637,7 +2637,7 @@ const char* defiNet::polyRouteStatusShieldName(int index) const { if (index < 0 || index > numPolys_) { defiError6085(index, numPolys_, defData); - return 0; + return nullptr; } return polyRouteStatusShieldNames_[index]; } @@ -2646,7 +2646,7 @@ const char* defiNet::polyShapeType(int index) const { if (index < 0 || index > numPolys_) { defiError6085(index, numPolys_, defData); - return 0; + return nullptr; } return polyShapeTypes_[index]; } @@ -2764,7 +2764,7 @@ int defiNet::numRectangles() const const char* defiNet::rectName(int index) const { if (index < 0 || index > numRects_) { - return 0; + return nullptr; } return rectNames_[index]; } @@ -2773,7 +2773,7 @@ const char* defiNet::rectRouteStatus(int index) const { if (index < 0 || index > numRects_) { defiError6086(index, numRects_, defData); - return 0; + return nullptr; } return rectRouteStatus_[index]; } @@ -2782,7 +2782,7 @@ const char* defiNet::rectRouteStatusShieldName(int index) const { if (index < 0 || index > numRects_) { defiError6086(index, numRects_, defData); - return 0; + return nullptr; } return rectRouteStatusShieldNames_[index]; } @@ -2791,7 +2791,7 @@ const char* defiNet::rectShapeType(int index) const { if (index < 0 || index > numRects_) { defiError6086(index, numRects_, defData); - return 0; + return nullptr; } return rectShapeTypes_[index]; } @@ -2939,7 +2939,7 @@ const char* defiNet::viaName(int index) const { if (index < 0 || index > numPts_) { defiError6085(index, numPolys_, defData); - return 0; + return nullptr; } return viaNames_[index]; } @@ -2948,7 +2948,7 @@ const char* defiNet::viaRouteStatus(int index) const { if (index < 0 || index > numPts_) { defiError6085(index, numPolys_, defData); - return 0; + return nullptr; } return viaRouteStatus_[index]; } @@ -2957,7 +2957,7 @@ const char* defiNet::viaRouteStatusShieldName(int index) const { if (index < 0 || index > numPts_) { defiError6085(index, numPolys_, defData); - return 0; + return nullptr; } return viaRouteStatusShieldNames_[index]; } @@ -2966,7 +2966,7 @@ const char* defiNet::viaShapeType(int index) const { if (index < 0 || index > numPts_) { defiError6085(index, numPolys_, defData); - return 0; + return nullptr; } return viaShapeTypes_[index]; } @@ -2984,7 +2984,7 @@ const char* defiNet::viaOrientStr(int index) const { if (index < 0 || index > numPts_) { defiError6085(index, numPolys_, defData); - return 0; + return nullptr; } return (defiOrientStr(viaOrients_[index])); } @@ -3069,15 +3069,15 @@ void defiNet::clearVia() } } - viaMasks_ = 0; - viaOrients_ = 0; + viaMasks_ = nullptr; + viaOrients_ = nullptr; numPts_ = 0; ptsAllocated_ = 0; - viaPts_ = 0; - viaRouteStatus_ = 0; - viaShapeTypes_ = 0; - viaRouteStatusShieldNames_ = 0; - viaNames_ = 0; + viaPts_ = nullptr; + viaRouteStatus_ = nullptr; + viaShapeTypes_ = nullptr; + viaRouteStatusShieldNames_ = nullptr; + viaNames_ = nullptr; } END_LEFDEF_PARSER_NAMESPACE diff --git a/src/odb/src/def/def/defiNonDefault.cpp b/src/odb/src/def/def/defiNonDefault.cpp index 13d81c3bf96..0e54412d464 100644 --- a/src/odb/src/def/def/defiNonDefault.cpp +++ b/src/odb/src/def/def/defiNonDefault.cpp @@ -79,38 +79,38 @@ defiNonDefault::defiNonDefault(defrData* data) : defData(data) void defiNonDefault::Init() { - name_ = 0; + name_ = nullptr; hardSpacing_ = 0; numLayers_ = 0; - width_ = 0; - hasDiagWidth_ = 0; - hasSpacing_ = 0; - hasWireExt_ = 0; + width_ = nullptr; + hasDiagWidth_ = nullptr; + hasSpacing_ = nullptr; + hasWireExt_ = nullptr; numVias_ = 0; viasAllocated_ = 0; - viaNames_ = 0; + viaNames_ = nullptr; numViaRules_ = 0; viaRulesAllocated_ = 0; - viaRuleNames_ = 0; + viaRuleNames_ = nullptr; numMinCuts_ = 0; minCutsAllocated_ = 0; - cutLayerName_ = 0; - numCuts_ = 0; + cutLayerName_ = nullptr; + numCuts_ = nullptr; numProps_ = 0; propsAllocated_ = 0; - names_ = 0; - values_ = 0; - dvalues_ = 0; - types_ = 0; + names_ = nullptr; + values_ = nullptr; + dvalues_ = nullptr; + types_ = nullptr; layersAllocated_ = 0; - layerName_ = 0; - width_ = 0; - hasDiagWidth_ = 0; - diagWidth_ = 0; - hasSpacing_ = 0; - spacing_ = 0; - hasWireExt_ = 0; - wireExt_ = 0; + layerName_ = nullptr; + width_ = nullptr; + hasDiagWidth_ = nullptr; + diagWidth_ = nullptr; + hasSpacing_ = nullptr; + spacing_ = nullptr; + hasWireExt_ = nullptr; + wireExt_ = nullptr; } defiNonDefault::~defiNonDefault() @@ -368,7 +368,7 @@ const char* defiNonDefault::layerName(int index) const { if (index < 0 || index >= numLayers_) { defiError6090(index, numLayers_, defData); - return 0; + return nullptr; } return layerName_[index]; } @@ -485,7 +485,7 @@ const char* defiNonDefault::viaName(int index) const { if (index < 0 || index >= numVias_) { defiError6090(index, numLayers_, defData); - return 0; + return nullptr; } return viaNames_[index]; } @@ -499,7 +499,7 @@ const char* defiNonDefault::viaRuleName(int index) const { if (index < 0 || index >= numViaRules_) { defiError6090(index, numLayers_, defData); - return 0; + return nullptr; } return viaRuleNames_[index]; } @@ -513,7 +513,7 @@ const char* defiNonDefault::cutLayerName(int index) const { if (index < 0 || index >= numMinCuts_) { defiError6090(index, numLayers_, defData); - return 0; + return nullptr; } return cutLayerName_[index]; } @@ -665,7 +665,7 @@ const char* defiNonDefault::propName(int index) const { if (index < 0 || index >= numProps_) { defiError6091(index, numProps_, defData); - return 0; + return nullptr; } return names_[index]; } @@ -674,7 +674,7 @@ const char* defiNonDefault::propValue(int index) const { if (index < 0 || index >= numProps_) { defiError6091(index, numProps_, defData); - return 0; + return nullptr; } return values_[index]; } diff --git a/src/odb/src/def/def/defiPartition.cpp b/src/odb/src/def/def/defiPartition.cpp index c49f73aa4c0..45d0f937ddc 100644 --- a/src/odb/src/def/def/defiPartition.cpp +++ b/src/odb/src/def/def/defiPartition.cpp @@ -52,16 +52,16 @@ defiPartition::defiPartition(defrData* data) : defData(data) void defiPartition::Init() { - name_ = 0; + name_ = nullptr; nameLength_ = 0; - pin_ = 0; + pin_ = nullptr; pinLength_ = 0; - inst_ = 0; + inst_ = nullptr; instLength_ = 0; pinsAllocated_ = 0; numPins_ = 0; - pins_ = 0; + pins_ = nullptr; clear(); } @@ -75,22 +75,22 @@ void defiPartition::Destroy() { if (name_) free(name_); - name_ = 0; + name_ = nullptr; nameLength_ = 0; if (pin_) free(pin_); - pin_ = 0; + pin_ = nullptr; pinLength_ = 0; if (inst_) free(inst_); - inst_ = 0; + inst_ = nullptr; instLength_ = 0; clear(); if (pins_) free((char*) (pins_)); - pins_ = 0; + pins_ = nullptr; pinsAllocated_ = 0; } @@ -114,7 +114,7 @@ void defiPartition::clear() if (numPins_) { for (i = 0; i < numPins_; i++) { free(pins_[i]); - pins_[i] = 0; + pins_[i] = nullptr; } numPins_ = 0; } diff --git a/src/odb/src/def/def/defiPath.cpp b/src/odb/src/def/def/defiPath.cpp index 908d751046b..d0a75ab706b 100644 --- a/src/odb/src/def/def/defiPath.cpp +++ b/src/odb/src/def/def/defiPath.cpp @@ -39,11 +39,11 @@ BEGIN_LEFDEF_PARSER_NAMESPACE defiPath::defiPath(defrData* data) - : keys_(NULL), - data_(NULL), + : keys_(nullptr), + data_(nullptr), numUsed_(0), numAllocated_(0), - pointer_(NULL), + pointer_(nullptr), numX_(0), numY_(0), stepX_(0), @@ -59,9 +59,9 @@ defiPath::defiPath(defiPath* defiPathRef) { *this = *defiPathRef; - defiPathRef->pointer_ = NULL; - defiPathRef->keys_ = NULL; - defiPathRef->data_ = NULL; + defiPathRef->pointer_ = nullptr; + defiPathRef->keys_ = nullptr; + defiPathRef->data_ = nullptr; } defiPath::~defiPath() @@ -96,24 +96,24 @@ void defiPath::clear() for (i = 0; i < numUsed_; i++) { free(data_[i]); - data_[i] = NULL; + data_[i] = nullptr; } numUsed_ = 0; delete pointer_; - pointer_ = NULL; + pointer_ = nullptr; } void defiPath::Destroy() { if (keys_) free((char*) (keys_)); - keys_ = NULL; + keys_ = nullptr; if (data_) { clear(); free((char*) (data_)); - data_ = NULL; + data_ = nullptr; } } @@ -211,28 +211,28 @@ int defiPath::getTaper() const const char* defiPath::getTaperRule() const { if (keys_[*(pointer_)] != 'R') - return 0; + return nullptr; return (char*) (data_[*(pointer_)]); } const char* defiPath::getLayer() const { if (keys_[*(pointer_)] != 'L') - return 0; + return nullptr; return (char*) (data_[*(pointer_)]); } const char* defiPath::getVia() const { if (keys_[*(pointer_)] != 'V') - return 0; + return nullptr; return (char*) (data_[*(pointer_)]); } const char* defiPath::getShape() const { if (keys_[*(pointer_)] != 'S') - return 0; + return nullptr; return (char*) (data_[*(pointer_)]); } @@ -312,7 +312,7 @@ const char* defiPath::getViaRotationStr() const { int* wptr; if (keys_[*(pointer_)] != 'O') - return 0; + return nullptr; wptr = (int*) (data_[*(pointer_)]); return defiOrientStr(*wptr); } @@ -511,7 +511,7 @@ void defiPath::setTaper() if (numUsed_ == numAllocated_) bumpSize(numAllocated_ * 2); keys_[numUsed_] = 'T'; - data_[numUsed_] = 0; + data_[numUsed_] = nullptr; (numUsed_)++; } @@ -542,7 +542,7 @@ void defiPath::print(FILE* fout) const { int i; int* wptr; - if (fout == 0) + if (fout == nullptr) fout = stdout; fprintf(fout, "Path:\n"); for (i = 0; i < numUsed_; i++) { diff --git a/src/odb/src/def/def/defiPinCap.cpp b/src/odb/src/def/def/defiPinCap.cpp index be9b01bb9c3..a4aa762ffee 100644 --- a/src/odb/src/def/def/defiPinCap.cpp +++ b/src/odb/src/def/def/defiPinCap.cpp @@ -81,7 +81,7 @@ void defiPinCap::print(FILE* f) const /////////////////////////////////////////////// defiPinAntennaModel::defiPinAntennaModel(defrData* data) - : oxide_(0), defData(data) + : oxide_(nullptr), defData(data) { Init(); } @@ -90,20 +90,20 @@ void defiPinAntennaModel::Init() { numAPinGateArea_ = 0; // 5.4 APinGateAreaAllocated_ = 0; // 5.4 - APinGateArea_ = 0; - APinGateAreaLayer_ = 0; + APinGateArea_ = nullptr; + APinGateAreaLayer_ = nullptr; numAPinMaxAreaCar_ = 0; // 5.4 APinMaxAreaCarAllocated_ = 0; // 5.4 - APinMaxAreaCar_ = 0; - APinMaxAreaCarLayer_ = 0; + APinMaxAreaCar_ = nullptr; + APinMaxAreaCarLayer_ = nullptr; numAPinMaxSideAreaCar_ = 0; // 5.4 APinMaxSideAreaCarAllocated_ = 0; // 5.4 - APinMaxSideAreaCar_ = 0; - APinMaxSideAreaCarLayer_ = 0; + APinMaxSideAreaCar_ = nullptr; + APinMaxSideAreaCarLayer_ = nullptr; numAPinMaxCutCar_ = 0; // 5.4 APinMaxCutCarAllocated_ = 0; // 5.4 - APinMaxCutCar_ = 0; - APinMaxCutCarLayer_ = 0; + APinMaxCutCar_ = nullptr; + APinMaxCutCarLayer_ = nullptr; } defiPinAntennaModel::~defiPinAntennaModel() @@ -117,7 +117,7 @@ void defiPinAntennaModel::clear() if (oxide_) free((char*) (oxide_)); - oxide_ = 0; + oxide_ = nullptr; for (i = 0; i < numAPinGateArea_; i++) { if (APinGateAreaLayer_[i]) @@ -208,7 +208,7 @@ void defiPinAntennaModel::addAPinGateArea(int value, const char* layer) APinGateAreaLayer_[numAPinGateArea_] = (char*) malloc(strlen(layer) + 1); strcpy(APinGateAreaLayer_[numAPinGateArea_], defData->DEFCASE(layer)); } else - APinGateAreaLayer_[numAPinGateArea_] = NULL; + APinGateAreaLayer_[numAPinGateArea_] = nullptr; numAPinGateArea_ += 1; } @@ -242,7 +242,7 @@ void defiPinAntennaModel::addAPinMaxAreaCar(int value, const char* layer) = (char*) malloc(strlen(layer) + 1); strcpy(APinMaxAreaCarLayer_[numAPinMaxAreaCar_], defData->DEFCASE(layer)); } else - APinMaxAreaCarLayer_[numAPinMaxAreaCar_] = NULL; + APinMaxAreaCarLayer_[numAPinMaxAreaCar_] = nullptr; numAPinMaxAreaCar_ += 1; } @@ -277,7 +277,7 @@ void defiPinAntennaModel::addAPinMaxSideAreaCar(int value, const char* layer) strcpy(APinMaxSideAreaCarLayer_[numAPinMaxSideAreaCar_], defData->DEFCASE(layer)); } else - APinMaxSideAreaCarLayer_[numAPinMaxSideAreaCar_] = NULL; + APinMaxSideAreaCarLayer_[numAPinMaxSideAreaCar_] = nullptr; numAPinMaxSideAreaCar_ += 1; } @@ -310,7 +310,7 @@ void defiPinAntennaModel::addAPinMaxCutCar(int value, const char* layer) APinMaxCutCarLayer_[numAPinMaxCutCar_] = (char*) malloc(strlen(layer) + 1); strcpy(APinMaxCutCarLayer_[numAPinMaxCutCar_], defData->DEFCASE(layer)); } else - APinMaxCutCarLayer_[numAPinMaxCutCar_] = NULL; + APinMaxCutCarLayer_[numAPinMaxCutCar_] = nullptr; numAPinMaxCutCar_ += 1; } @@ -438,27 +438,27 @@ void defiPinPort::Init() { layersAllocated_ = 0; numLayers_ = 0; - layers_ = 0; - layerMinSpacing_ = 0; - layerMask_ = 0; - layerEffectiveWidth_ = 0; - xl_ = 0; - yl_ = 0; - xh_ = 0; - yh_ = 0; + layers_ = nullptr; + layerMinSpacing_ = nullptr; + layerMask_ = nullptr; + layerEffectiveWidth_ = nullptr; + xl_ = nullptr; + yl_ = nullptr; + xh_ = nullptr; + yh_ = nullptr; polysAllocated_ = 0; numPolys_ = 0; - polygonNames_ = 0; - polyMinSpacing_ = 0; - polyMask_ = 0; - polyEffectiveWidth_ = 0; - polygons_ = 0; + polygonNames_ = nullptr; + polyMinSpacing_ = nullptr; + polyMask_ = nullptr; + polyEffectiveWidth_ = nullptr; + polygons_ = nullptr; viasAllocated_ = 0; numVias_ = 0; - viaNames_ = 0; - viaX_ = 0; - viaY_ = 0; - viaMask_ = 0; + viaNames_ = nullptr; + viaX_ = nullptr; + viaY_ = nullptr; + viaMask_ = nullptr; placeType_ = 0; x_ = 0; y_ = 0; @@ -492,10 +492,10 @@ void defiPinPort::clear() free((char*) (layerMask_)); free((char*) (layerEffectiveWidth_)); } - layers_ = 0; - layerMinSpacing_ = 0; - layerEffectiveWidth_ = 0; - layerMask_ = 0; + layers_ = nullptr; + layerMinSpacing_ = nullptr; + layerEffectiveWidth_ = nullptr; + layerMask_ = nullptr; numLayers_ = 0; layersAllocated_ = 0; if (polygonNames_) { @@ -513,11 +513,11 @@ void defiPinPort::clear() free((char*) (polyMinSpacing_)); free((char*) (polyMask_)); free((char*) (polyEffectiveWidth_)); - polygonNames_ = 0; - polygons_ = 0; - polyMinSpacing_ = 0; - polyEffectiveWidth_ = 0; - polyMask_ = 0; + polygonNames_ = nullptr; + polygons_ = nullptr; + polyMinSpacing_ = nullptr; + polyEffectiveWidth_ = nullptr; + polyMask_ = nullptr; } numPolys_ = 0; polysAllocated_ = 0; @@ -530,10 +530,10 @@ void defiPinPort::clear() free((char*) (viaY_)); free((char*) (viaMask_)); } - viaNames_ = 0; + viaNames_ = nullptr; numVias_ = 0; viasAllocated_ = 0; - viaMask_ = 0; + viaMask_ = nullptr; } void defiPinPort::addLayer(const char* layer) @@ -655,7 +655,7 @@ void defiPinPort::addPolygon(const char* layerName) polyMask_ = pm; } polygonNames_[numPolys_] = strdup(layerName); - polygons_[numPolys_] = 0; + polygons_[numPolys_] = nullptr; polyMinSpacing_[numPolys_] = -1; polyEffectiveWidth_[numPolys_] = -1; polyMask_[numPolys_] = 0; @@ -800,7 +800,7 @@ const char* defiPinPort::polygonName(int index) const { if (index < 0 || index > numPolys_) { defiError(1, 0, "index out of bounds", defData); - return 0; + return nullptr; } return polygonNames_[index]; } @@ -848,7 +848,7 @@ const char* defiPinPort::viaName(int index) const { if (index < 0 || index > numVias_) { defiError(1, 0, "index out of bounds", defData); - return 0; + return nullptr; } return viaNames_[index]; } @@ -934,63 +934,63 @@ defiPin::defiPin(defrData* data) : defData(data) void defiPin::Init() { pinNameLength_ = 0; - pinName_ = 0; + pinName_ = nullptr; netNameLength_ = 0; - netName_ = 0; + netName_ = nullptr; useLength_ = 0; - use_ = 0; + use_ = nullptr; directionLength_ = 0; - direction_ = 0; + direction_ = nullptr; hasDirection_ = 0; hasUse_ = 0; placeType_ = 0; orient_ = 0; - xl_ = 0; - yl_ = 0; - xh_ = 0; - yh_ = 0; + xl_ = nullptr; + yl_ = nullptr; + xh_ = nullptr; + yh_ = nullptr; x_ = 0; y_ = 0; netExprLength_ = 0; // 5.6 - netExpr_ = 0; // 5.6 + netExpr_ = nullptr; // 5.6 hasNetExpr_ = 0; // 5.6 supplySensLength_ = 0; // 5.6 - supplySens_ = 0; // 5.6 + supplySens_ = nullptr; // 5.6 hasSupplySens_ = 0; // 5.6 groundSensLength_ = 0; // 5.6 - groundSens_ = 0; // 5.6 + groundSens_ = nullptr; // 5.6 hasGroundSens_ = 0; // 5.6 - layers_ = 0; // 5.6 + layers_ = nullptr; // 5.6 layersAllocated_ = 0; // 5.6 numLayers_ = 0; // 5.6 - polygonNames_ = 0; // 5.6 + polygonNames_ = nullptr; // 5.6 numPolys_ = 0; // 5.6 polysAllocated_ = 0; // 5.6 - polygons_ = 0; // 5.6 + polygons_ = nullptr; // 5.6 numAPinPartialMetalArea_ = 0; // 5.4 APinPartialMetalAreaAllocated_ = 0; // 5.4 - APinPartialMetalArea_ = 0; - APinPartialMetalAreaLayer_ = 0; + APinPartialMetalArea_ = nullptr; + APinPartialMetalAreaLayer_ = nullptr; numAPinPartialMetalSideArea_ = 0; // 5.4 APinPartialMetalSideAreaAllocated_ = 0; // 5.4 - APinPartialMetalSideArea_ = 0; - APinPartialMetalSideAreaLayer_ = 0; + APinPartialMetalSideArea_ = nullptr; + APinPartialMetalSideAreaLayer_ = nullptr; numAPinDiffArea_ = 0; // 5.4 APinDiffAreaAllocated_ = 0; // 5.4 - APinDiffArea_ = 0; - APinDiffAreaLayer_ = 0; + APinDiffArea_ = nullptr; + APinDiffAreaLayer_ = nullptr; numAPinPartialCutArea_ = 0; // 5.4 APinPartialCutAreaAllocated_ = 0; // 5.4 - APinPartialCutArea_ = 0; - APinPartialCutAreaLayer_ = 0; - antennaModel_ = 0; - viaNames_ = 0; // 5.7 - viasAllocated_ = 0; // 5.7 - numVias_ = 0; // 5.7 - viaX_ = 0; // 5.7 - viaY_ = 0; // 5.7 - numPorts_ = 0; // 5.7 - pinPort_ = 0; // 5.7 + APinPartialCutArea_ = nullptr; + APinPartialCutAreaLayer_ = nullptr; + antennaModel_ = nullptr; + viaNames_ = nullptr; // 5.7 + viasAllocated_ = 0; // 5.7 + numVias_ = 0; // 5.7 + viaX_ = nullptr; // 5.7 + viaY_ = nullptr; // 5.7 + numPorts_ = 0; // 5.7 + pinPort_ = nullptr; // 5.7 numAntennaModel_ = 0; antennaModelAllocated_ = 0; } @@ -1028,10 +1028,10 @@ void defiPin::clear() free((char*) (layerMask_)); free((char*) (layerEffectiveWidth_)); } - layers_ = 0; - layerMinSpacing_ = 0; - layerMask_ = 0; - layerEffectiveWidth_ = 0; + layers_ = nullptr; + layerMinSpacing_ = nullptr; + layerMask_ = nullptr; + layerEffectiveWidth_ = nullptr; numLayers_ = 0; layersAllocated_ = 0; // 5.6 @@ -1050,11 +1050,11 @@ void defiPin::clear() free((char*) (polyMinSpacing_)); free((char*) (polyMask_)); free((char*) (polyEffectiveWidth_)); - polygonNames_ = 0; - polygons_ = 0; - polyMinSpacing_ = 0; - polyMask_ = 0; - polyEffectiveWidth_ = 0; + polygonNames_ = nullptr; + polygons_ = nullptr; + polyMinSpacing_ = nullptr; + polyMask_ = nullptr; + polyEffectiveWidth_ = nullptr; } numPolys_ = 0; polysAllocated_ = 0; @@ -1068,9 +1068,9 @@ void defiPin::clear() free((char*) (viaY_)); free((char*) (viaMask_)); } - viaNames_ = 0; + viaNames_ = nullptr; numVias_ = 0; - viaMask_ = 0; + viaMask_ = nullptr; viasAllocated_ = 0; // 5.7 if (pinPort_) { @@ -1082,7 +1082,7 @@ void defiPin::clear() } free(pinPort_); } - pinPort_ = 0; + pinPort_ = nullptr; numPorts_ = 0; portsAllocated_ = 0; @@ -1134,13 +1134,13 @@ void defiPin::Destroy() free(supplySens_); if (groundSens_) free(groundSens_); - pinName_ = 0; - netName_ = 0; - use_ = 0; - direction_ = 0; - netExpr_ = 0; - supplySens_ = 0; - groundSens_ = 0; + pinName_ = nullptr; + netName_ = nullptr; + use_ = nullptr; + direction_ = nullptr; + netExpr_ = nullptr; + supplySens_ = nullptr; + groundSens_ = nullptr; pinNameLength_ = 0; netNameLength_ = 0; useLength_ = 0; @@ -1580,7 +1580,7 @@ void defiPin::addAPinPartialMetalArea(int value, const char* layer) strcpy(APinPartialMetalAreaLayer_[numAPinPartialMetalArea_], defData->DEFCASE(layer)); } else - APinPartialMetalAreaLayer_[numAPinPartialMetalArea_] = NULL; + APinPartialMetalAreaLayer_[numAPinPartialMetalArea_] = nullptr; numAPinPartialMetalArea_ += 1; } @@ -1615,7 +1615,7 @@ void defiPin::addAPinPartialMetalSideArea(int value, const char* layer) strcpy(APinPartialMetalSideAreaLayer_[numAPinPartialMetalSideArea_], defData->DEFCASE(layer)); } else - APinPartialMetalSideAreaLayer_[numAPinPartialMetalSideArea_] = NULL; + APinPartialMetalSideAreaLayer_[numAPinPartialMetalSideArea_] = nullptr; numAPinPartialMetalSideArea_ += 1; } @@ -1655,7 +1655,7 @@ void defiPin::addAPinDiffArea(int value, const char* layer) APinDiffAreaLayer_[numAPinDiffArea_] = (char*) malloc(strlen(layer) + 1); strcpy(APinDiffAreaLayer_[numAPinDiffArea_], defData->DEFCASE(layer)); } else - APinDiffAreaLayer_[numAPinDiffArea_] = NULL; + APinDiffAreaLayer_[numAPinDiffArea_] = nullptr; numAPinDiffArea_ += 1; } @@ -1704,7 +1704,7 @@ void defiPin::addAPinPartialCutArea(int value, const char* layer) strcpy(APinPartialCutAreaLayer_[numAPinPartialCutArea_], defData->DEFCASE(layer)); } else - APinPartialCutAreaLayer_[numAPinPartialCutArea_] = NULL; + APinPartialCutAreaLayer_[numAPinPartialCutArea_] = nullptr; numAPinPartialCutArea_ += 1; } @@ -1864,7 +1864,7 @@ void defiPin::addPolygon(const char* layerName) polyMask_ = pm; } polygonNames_[numPolys_] = strdup(layerName); - polygons_[numPolys_] = 0; + polygons_[numPolys_] = nullptr; polyMinSpacing_[numPolys_] = -1; polyEffectiveWidth_[numPolys_] = -1; polyMask_[numPolys_] = 0; @@ -1918,7 +1918,7 @@ const char* defiPin::polygonName(int index) const { if (index < 0 || index > numPolys_) { defiError(1, 0, "index out of bounds", defData); - return 0; + return nullptr; } return polygonNames_[index]; } @@ -2048,7 +2048,7 @@ const char* defiPin::viaName(int index) const { if (index < 0 || index > numVias_) { defiError(1, 0, "index out of bounds", defData); - return 0; + return nullptr; } return viaNames_[index]; } @@ -2216,7 +2216,7 @@ defiPinPort* defiPin::pinPort(int index) const { if (index < 0 || index > numPorts_) { defiError(1, 0, "index out of bounds", defData); - return 0; + return nullptr; } return pinPort_[index]; } diff --git a/src/odb/src/def/def/defiPinProp.cpp b/src/odb/src/def/def/defiPinProp.cpp index 64dfb9f22d1..412cadf54f1 100644 --- a/src/odb/src/def/def/defiPinProp.cpp +++ b/src/odb/src/def/def/defiPinProp.cpp @@ -245,7 +245,7 @@ const char* defiPinProp::propName(int index) const { if (index < 0 || index >= numProps_) { defiError6120(index, numProps_, defData); - return 0; + return nullptr; } return propNames_[index]; } @@ -254,7 +254,7 @@ const char* defiPinProp::propValue(int index) const { if (index < 0 || index >= numProps_) { defiError6120(index, numProps_, defData); - return 0; + return nullptr; } return propValues_[index]; } diff --git a/src/odb/src/def/def/defiProp.cpp b/src/odb/src/def/def/defiProp.cpp index b5acb5ab768..34f4ff15b50 100644 --- a/src/odb/src/def/def/defiProp.cpp +++ b/src/odb/src/def/def/defiProp.cpp @@ -180,7 +180,7 @@ void defiProp::clear() *(stringData_) = '\0'; if (propName_) *(propName_) = '\0'; - propType_ = 0; + propType_ = nullptr; hasRange_ = 0; hasNumber_ = 0; hasNameMapString_ = 0; diff --git a/src/odb/src/def/def/defiPropType.cpp b/src/odb/src/def/def/defiPropType.cpp index c5602449447..9f6a115f099 100644 --- a/src/odb/src/def/def/defiPropType.cpp +++ b/src/odb/src/def/def/defiPropType.cpp @@ -46,8 +46,8 @@ void defiPropType::Init() { numProperties_ = 0; propertiesAllocated_ = 0; - propNames_ = 0; - propTypes_ = 0; + propNames_ = nullptr; + propTypes_ = nullptr; } void defiPropType::Clear() diff --git a/src/odb/src/def/def/defiRegion.cpp b/src/odb/src/def/def/defiRegion.cpp index 78e3b3b034a..6b26d3b102c 100644 --- a/src/odb/src/def/def/defiRegion.cpp +++ b/src/odb/src/def/def/defiRegion.cpp @@ -78,13 +78,13 @@ defiRegion::defiRegion(defrData* data) : defData(data) void defiRegion::Init() { - name_ = 0; + name_ = nullptr; nameLength_ = 0; - type_ = 0; - xl_ = 0; - yl_ = 0; - xh_ = 0; - yh_ = 0; + type_ = nullptr; + xl_ = nullptr; + yl_ = nullptr; + xh_ = nullptr; + yh_ = nullptr; numProps_ = 0; propsAllocated_ = 2; propNames_ = (char**) malloc(sizeof(char*) * 2); @@ -117,7 +117,7 @@ void defiRegion::clear() numRectangles_ = 0; if (type_) free(type_); - type_ = 0; + type_ = nullptr; } void defiRegion::Destroy() @@ -125,7 +125,7 @@ void defiRegion::Destroy() if (name_) free(name_); clear(); - name_ = 0; + name_ = nullptr; nameLength_ = 0; free((char*) (xl_)); free((char*) (yl_)); @@ -305,7 +305,7 @@ const char* defiRegion::propName(int index) const { if (index < 0 || index >= numProps_) { defiError6130(index, numProps_, defData); - return 0; + return nullptr; } return propNames_[index]; } @@ -314,7 +314,7 @@ const char* defiRegion::propValue(int index) const { if (index < 0 || index >= numProps_) { defiError6130(index, numProps_, defData); - return 0; + return nullptr; } return propValues_[index]; } diff --git a/src/odb/src/def/def/defiRowTrack.cpp b/src/odb/src/def/def/defiRowTrack.cpp index b6a38ac2d37..64d3ab51f8d 100644 --- a/src/odb/src/def/def/defiRowTrack.cpp +++ b/src/odb/src/def/def/defiRowTrack.cpp @@ -70,9 +70,9 @@ defiRow::defiRow(defrData* data) : defData(data) void defiRow::Init() { nameLength_ = 0; - name_ = 0; + name_ = nullptr; macroLength_ = 0; - macro_ = 0; + macro_ = nullptr; orient_ = 0; x_ = 0.0; y_ = 0.0; @@ -263,7 +263,7 @@ const char* defiRow::propName(int index) const { if (index < 0 || index >= numProps_) { defiError6140(index, numProps_, defData); - return 0; + return nullptr; } return propNames_[index]; } @@ -272,7 +272,7 @@ const char* defiRow::propValue(int index) const { if (index < 0 || index >= numProps_) { defiError6140(index, numProps_, defData); - return 0; + return nullptr; } return propValues_[index]; } @@ -401,14 +401,14 @@ defiTrack::defiTrack(defrData* data) : defData(data) void defiTrack::Init() { - macro_ = 0; + macro_ = nullptr; macroLength_ = 0; x_ = 0.0; xNum_ = 0.0; xStep_ = 0.0; layersLength_ = 0; numLayers_ = 0; - layers_ = 0; + layers_ = nullptr; firstTrackMask_ = 0; samemask_ = 0; } @@ -450,7 +450,7 @@ void defiTrack::setup(const char* macro) for (i = 0; i < numLayers_; i++) if (layers_[i]) { free(layers_[i]); - layers_[i] = 0; + layers_[i] = nullptr; } } numLayers_ = 0; @@ -529,7 +529,7 @@ const char* defiTrack::layer(int index) const return layers_[index]; } - return 0; + return nullptr; } int defiTrack::firstTrackMask() const @@ -570,7 +570,7 @@ defiGcellGrid::defiGcellGrid(defrData* data) : defData(data) void defiGcellGrid::Init() { - macro_ = 0; + macro_ = nullptr; macroLength_ = 0; x_ = 0; xNum_ = 0; diff --git a/src/odb/src/def/def/defiScanchain.cpp b/src/odb/src/def/def/defiScanchain.cpp index af8fd923878..1181c857a64 100644 --- a/src/odb/src/def/def/defiScanchain.cpp +++ b/src/odb/src/def/def/defiScanchain.cpp @@ -116,8 +116,8 @@ void defiOrdered::addOrdered(const char* inst) bump(); inst_[num_] = (char*) malloc(strlen(inst) + 1); strcpy(inst_[num_], defData->DEFCASE(inst)); - in_[num_] = 0; - out_[num_] = 0; + in_[num_] = nullptr; + out_[num_] = nullptr; bits_[num_] = -1; num_ += 1; } @@ -185,16 +185,16 @@ void defiScanchain::Init() floatOut_ = (char**) malloc(sizeof(char*) * 4); floatBits_ = (int*) malloc(sizeof(int) * 4); - stopInst_ = 0; - stopPin_ = 0; - startInst_ = 0; - startPin_ = 0; + stopInst_ = nullptr; + stopPin_ = nullptr; + startInst_ = nullptr; + startPin_ = nullptr; hasStart_ = 0; hasStop_ = 0; - commonInPin_ = 0; - commonOutPin_ = 0; + commonInPin_ = nullptr; + commonOutPin_ = nullptr; hasPartition_ = 0; - partName_ = 0; + partName_ = nullptr; maxBits_ = -1; } @@ -204,7 +204,7 @@ void defiScanchain::clear() for (i = 0; i < numOrdered_; i++) { delete ordered_[i]; - ordered_[i] = 0; + ordered_[i] = nullptr; } numOrdered_ = 0; @@ -215,7 +215,7 @@ void defiScanchain::clear() if (floatOut_[i]) free(floatOut_[i]); free(floatInst_[i]); - floatInst_[i] = 0; + floatInst_[i] = nullptr; floatBits_[i] = -1; } numFloating_ = 0; @@ -233,18 +233,18 @@ void defiScanchain::clear() if (commonOutPin_) free(commonOutPin_); - stopInst_ = 0; - stopPin_ = 0; - startInst_ = 0; - startPin_ = 0; + stopInst_ = nullptr; + stopPin_ = nullptr; + startInst_ = nullptr; + startPin_ = nullptr; hasStart_ = 0; hasStop_ = 0; - commonInPin_ = 0; - commonOutPin_ = 0; + commonInPin_ = nullptr; + commonOutPin_ = nullptr; hasPartition_ = 0; if (partName_) free((char*) (partName_)); - partName_ = 0; + partName_ = nullptr; maxBits_ = -1; } @@ -311,8 +311,8 @@ void defiScanchain::addFloatingInst(const char* name) floatInst_[numFloating_] = (char*) malloc(strlen(name) + 1); strcpy(floatInst_[numFloating_], defData->DEFCASE(name)); - floatIn_[numFloating_] = 0; - floatOut_[numFloating_] = 0; + floatIn_[numFloating_] = nullptr; + floatOut_[numFloating_] = nullptr; floatBits_[numFloating_] = -1; numFloating_ += 1; } @@ -513,7 +513,7 @@ void defiScanchain::ordered(int index, *bits = o->bits(); } else { *size = 10; - *inst = 0; + *inst = nullptr; } } diff --git a/src/odb/src/def/def/defiSite.cpp b/src/odb/src/def/def/defiSite.cpp index c378841a026..ad4d35f5ccd 100644 --- a/src/odb/src/def/def/defiSite.cpp +++ b/src/odb/src/def/def/defiSite.cpp @@ -189,7 +189,7 @@ void defiBox::Init() yl_ = 0; xh_ = 0; yh_ = 0; - points_ = 0; + points_ = nullptr; } defiBox::~defiBox() diff --git a/src/odb/src/def/def/defiSlot.cpp b/src/odb/src/def/def/defiSlot.cpp index 46b681c2111..a82e4813891 100644 --- a/src/odb/src/def/def/defiSlot.cpp +++ b/src/odb/src/def/def/defiSlot.cpp @@ -78,8 +78,8 @@ void defiSlot::Init() yh_ = (int*) malloc(sizeof(int) * 1); rectsAllocated_ = 1; // At least 1 rectangle will define polysAllocated_ = 0; - polygons_ = 0; - layerName_ = 0; + polygons_ = nullptr; + layerName_ = nullptr; } defiSlot::~defiSlot() @@ -116,14 +116,14 @@ void defiSlot::Destroy() free((char*) (xh_)); free((char*) (yh_)); rectsAllocated_ = 0; - xl_ = 0; - yl_ = 0; - xh_ = 0; - yh_ = 0; + xl_ = nullptr; + yl_ = nullptr; + xh_ = nullptr; + yh_ = nullptr; clearPoly(); if (polygons_) free((char*) (polygons_)); - polygons_ = 0; + polygons_ = nullptr; clear(); } diff --git a/src/odb/src/def/def/defiTimingDisable.cpp b/src/odb/src/def/def/defiTimingDisable.cpp index 00ce3fd698a..aedb51d6feb 100644 --- a/src/odb/src/def/def/defiTimingDisable.cpp +++ b/src/odb/src/def/def/defiTimingDisable.cpp @@ -52,13 +52,13 @@ defiTimingDisable::defiTimingDisable(defrData* data) : defData(data) void defiTimingDisable::Init() { - fromInst_ = 0; + fromInst_ = nullptr; fromInstLength_ = 0; - toInst_ = 0; + toInst_ = nullptr; toInstLength_ = 0; - toPin_ = 0; + toPin_ = nullptr; toPinLength_ = 0; - fromPin_ = 0; + fromPin_ = nullptr; fromPinLength_ = 0; } @@ -73,22 +73,22 @@ void defiTimingDisable::Destroy() if (fromInst_) free(fromInst_); - fromInst_ = 0; + fromInst_ = nullptr; fromInstLength_ = 0; if (toInst_) free(toInst_); - toInst_ = 0; + toInst_ = nullptr; toInstLength_ = 0; if (toPin_) free(toPin_); - toPin_ = 0; + toPin_ = nullptr; toPinLength_ = 0; if (fromPin_) free(fromPin_); - fromPin_ = 0; + fromPin_ = nullptr; fromPinLength_ = 0; } diff --git a/src/odb/src/def/def/defiVia.cpp b/src/odb/src/def/def/defiVia.cpp index 3f4459cc88e..90650c3c644 100644 --- a/src/odb/src/def/def/defiVia.cpp +++ b/src/odb/src/def/def/defiVia.cpp @@ -52,23 +52,23 @@ defiVia::defiVia(defrData* data) : defData(data) void defiVia::Init() { - name_ = 0; + name_ = nullptr; nameLength_ = 0; - pattern_ = 0; + pattern_ = nullptr; patternLength_ = 0; - xl_ = 0; - yl_ = 0; - xh_ = 0; - yh_ = 0; + xl_ = nullptr; + yl_ = nullptr; + xh_ = nullptr; + yh_ = nullptr; layersLength_ = 0; - layers_ = 0; - viaRule_ = 0; + layers_ = nullptr; + viaRule_ = nullptr; viaRuleLength_ = 0; xSize_ = 0; ySize_ = 0; - botLayer_ = 0; - cutLayer_ = 0; - topLayer_ = 0; + botLayer_ = nullptr; + cutLayer_ = nullptr; + topLayer_ = nullptr; botLayerLength_ = 0; cutLayerLength_ = 0; topLayerLength_ = 0; @@ -78,15 +78,15 @@ void defiVia::Init() yBotEnc_ = 0; xTopEnc_ = 0; yTopEnc_ = 0; - cutPattern_ = 0; + cutPattern_ = nullptr; cutPatternLength_ = 0; numLayers_ = 0; numPolys_ = 0; - polygons_ = 0; + polygons_ = nullptr; polysAllocated_ = 0; - polygonNames_ = 0; - rectMask_ = 0; - polyMask_ = 0; + polygonNames_ = nullptr; + rectMask_ = nullptr; + polyMask_ = nullptr; clear(); } @@ -121,9 +121,9 @@ void defiVia::clear() free(polygons_); free(polyMask_); - polygonNames_ = NULL; - polygons_ = NULL; - polyMask_ = NULL; + polygonNames_ = nullptr; + polygons_ = nullptr; + polyMask_ = nullptr; } numPolys_ = 0; @@ -140,10 +140,10 @@ void defiVia::Destroy() int i; free(name_); - name_ = NULL; + name_ = nullptr; free(pattern_); - pattern_ = NULL; + pattern_ = nullptr; if (layers_) { for (i = 0; i < numLayers_; i++) { @@ -151,41 +151,41 @@ void defiVia::Destroy() } free(layers_); - layers_ = NULL; + layers_ = nullptr; free(xl_); - xl_ = NULL; + xl_ = nullptr; free(yl_); - yl_ = NULL; + yl_ = nullptr; free(xh_); - xh_ = NULL; + xh_ = nullptr; free(yh_); - yh_ = NULL; + yh_ = nullptr; free(rectMask_); - rectMask_ = NULL; + rectMask_ = nullptr; free(polyMask_); - polyMask_ = NULL; + polyMask_ = nullptr; } free(viaRule_); - viaRule_ = NULL; + viaRule_ = nullptr; free(botLayer_); - botLayer_ = NULL; + botLayer_ = nullptr; free(cutLayer_); - cutLayer_ = NULL; + cutLayer_ = nullptr; free(topLayer_); - topLayer_ = NULL; + topLayer_ = nullptr; free(cutPattern_); - cutPattern_ = NULL; + cutPattern_ = nullptr; clear(); } @@ -204,7 +204,7 @@ void defiVia::setup(const char* name) if (layers_) { for (i = 0; i < numLayers_; i++) { free(layers_[i]); - layers_[i] = 0; + layers_[i] = nullptr; } } @@ -504,7 +504,7 @@ const char* defiVia::polygonName(int index) const index, numPolys_); defiError(0, 6180, msg, defData); - return 0; + return nullptr; } return polygonNames_[index]; } diff --git a/src/odb/src/def/def/defrCallbacks.cpp b/src/odb/src/def/def/defrCallbacks.cpp index 59d3c4fd83c..826f9baf963 100644 --- a/src/odb/src/def/def/defrCallbacks.cpp +++ b/src/odb/src/def/def/defrCallbacks.cpp @@ -32,110 +32,110 @@ BEGIN_LEFDEF_PARSER_NAMESPACE defrCallbacks::defrCallbacks() - : DesignCbk(NULL), - TechnologyCbk(NULL), - DesignEndCbk(NULL), - PropCbk(NULL), - PropDefEndCbk(NULL), - PropDefStartCbk(NULL), - ArrayNameCbk(NULL), - FloorPlanNameCbk(NULL), - UnitsCbk(NULL), - DividerCbk(NULL), - BusBitCbk(NULL), - SiteCbk(NULL), - CanplaceCbk(NULL), - CannotOccupyCbk(NULL), - ComponentStartCbk(NULL), - ComponentEndCbk(NULL), - ComponentCbk(NULL), - NetStartCbk(NULL), - NetEndCbk(NULL), - NetCbk(NULL), - NetNameCbk(NULL), - NetSubnetNameCbk(NULL), - NetNonDefaultRuleCbk(NULL), - NetPartialPathCbk(NULL), - PathCbk(NULL), - VersionCbk(NULL), - VersionStrCbk(NULL), - PinExtCbk(NULL), - ComponentExtCbk(NULL), - ViaExtCbk(NULL), - NetConnectionExtCbk(NULL), - NetExtCbk(NULL), - GroupExtCbk(NULL), - ScanChainExtCbk(NULL), - IoTimingsExtCbk(NULL), - PartitionsExtCbk(NULL), - HistoryCbk(NULL), - DieAreaCbk(NULL), - PinCapCbk(NULL), - PinCbk(NULL), - StartPinsCbk(NULL), - PinEndCbk(NULL), - DefaultCapCbk(NULL), - RowCbk(NULL), - TrackCbk(NULL), - GcellGridCbk(NULL), - ViaStartCbk(NULL), - ViaEndCbk(NULL), - ViaCbk(NULL), - RegionStartCbk(NULL), - RegionEndCbk(NULL), - RegionCbk(NULL), - SNetStartCbk(NULL), - SNetEndCbk(NULL), - SNetCbk(NULL), - SNetPartialPathCbk(NULL), - SNetWireCbk(NULL), - GroupsStartCbk(NULL), - GroupsEndCbk(NULL), - GroupNameCbk(NULL), - GroupMemberCbk(NULL), - GroupCbk(NULL), - AssertionsStartCbk(NULL), - AssertionsEndCbk(NULL), - AssertionCbk(NULL), - ConstraintsStartCbk(NULL), - ConstraintsEndCbk(NULL), - ConstraintCbk(NULL), - ScanchainsStartCbk(NULL), - ScanchainsEndCbk(NULL), - ScanchainCbk(NULL), - IOTimingsStartCbk(NULL), - IOTimingsEndCbk(NULL), - IOTimingCbk(NULL), - FPCStartCbk(NULL), - FPCEndCbk(NULL), - FPCCbk(NULL), - TimingDisablesStartCbk(NULL), - TimingDisablesEndCbk(NULL), - TimingDisableCbk(NULL), - PartitionsStartCbk(NULL), - PartitionsEndCbk(NULL), - PartitionCbk(NULL), - PinPropStartCbk(NULL), - PinPropEndCbk(NULL), - PinPropCbk(NULL), - CaseSensitiveCbk(NULL), - BlockageStartCbk(NULL), - BlockageEndCbk(NULL), - BlockageCbk(NULL), - SlotStartCbk(NULL), - SlotEndCbk(NULL), - SlotCbk(NULL), - FillStartCbk(NULL), - FillEndCbk(NULL), - FillCbk(NULL), - NonDefaultStartCbk(NULL), - NonDefaultEndCbk(NULL), - NonDefaultCbk(NULL), - StylesStartCbk(NULL), - StylesEndCbk(NULL), - StylesCbk(NULL), - ExtensionCbk(NULL), - ComponentMaskShiftLayerCbk(NULL) + : DesignCbk(nullptr), + TechnologyCbk(nullptr), + DesignEndCbk(nullptr), + PropCbk(nullptr), + PropDefEndCbk(nullptr), + PropDefStartCbk(nullptr), + ArrayNameCbk(nullptr), + FloorPlanNameCbk(nullptr), + UnitsCbk(nullptr), + DividerCbk(nullptr), + BusBitCbk(nullptr), + SiteCbk(nullptr), + CanplaceCbk(nullptr), + CannotOccupyCbk(nullptr), + ComponentStartCbk(nullptr), + ComponentEndCbk(nullptr), + ComponentCbk(nullptr), + NetStartCbk(nullptr), + NetEndCbk(nullptr), + NetCbk(nullptr), + NetNameCbk(nullptr), + NetSubnetNameCbk(nullptr), + NetNonDefaultRuleCbk(nullptr), + NetPartialPathCbk(nullptr), + PathCbk(nullptr), + VersionCbk(nullptr), + VersionStrCbk(nullptr), + PinExtCbk(nullptr), + ComponentExtCbk(nullptr), + ViaExtCbk(nullptr), + NetConnectionExtCbk(nullptr), + NetExtCbk(nullptr), + GroupExtCbk(nullptr), + ScanChainExtCbk(nullptr), + IoTimingsExtCbk(nullptr), + PartitionsExtCbk(nullptr), + HistoryCbk(nullptr), + DieAreaCbk(nullptr), + PinCapCbk(nullptr), + PinCbk(nullptr), + StartPinsCbk(nullptr), + PinEndCbk(nullptr), + DefaultCapCbk(nullptr), + RowCbk(nullptr), + TrackCbk(nullptr), + GcellGridCbk(nullptr), + ViaStartCbk(nullptr), + ViaEndCbk(nullptr), + ViaCbk(nullptr), + RegionStartCbk(nullptr), + RegionEndCbk(nullptr), + RegionCbk(nullptr), + SNetStartCbk(nullptr), + SNetEndCbk(nullptr), + SNetCbk(nullptr), + SNetPartialPathCbk(nullptr), + SNetWireCbk(nullptr), + GroupsStartCbk(nullptr), + GroupsEndCbk(nullptr), + GroupNameCbk(nullptr), + GroupMemberCbk(nullptr), + GroupCbk(nullptr), + AssertionsStartCbk(nullptr), + AssertionsEndCbk(nullptr), + AssertionCbk(nullptr), + ConstraintsStartCbk(nullptr), + ConstraintsEndCbk(nullptr), + ConstraintCbk(nullptr), + ScanchainsStartCbk(nullptr), + ScanchainsEndCbk(nullptr), + ScanchainCbk(nullptr), + IOTimingsStartCbk(nullptr), + IOTimingsEndCbk(nullptr), + IOTimingCbk(nullptr), + FPCStartCbk(nullptr), + FPCEndCbk(nullptr), + FPCCbk(nullptr), + TimingDisablesStartCbk(nullptr), + TimingDisablesEndCbk(nullptr), + TimingDisableCbk(nullptr), + PartitionsStartCbk(nullptr), + PartitionsEndCbk(nullptr), + PartitionCbk(nullptr), + PinPropStartCbk(nullptr), + PinPropEndCbk(nullptr), + PinPropCbk(nullptr), + CaseSensitiveCbk(nullptr), + BlockageStartCbk(nullptr), + BlockageEndCbk(nullptr), + BlockageCbk(nullptr), + SlotStartCbk(nullptr), + SlotEndCbk(nullptr), + SlotCbk(nullptr), + FillStartCbk(nullptr), + FillEndCbk(nullptr), + FillCbk(nullptr), + NonDefaultStartCbk(nullptr), + NonDefaultEndCbk(nullptr), + NonDefaultCbk(nullptr), + StylesStartCbk(nullptr), + StylesEndCbk(nullptr), + StylesCbk(nullptr), + ExtensionCbk(nullptr), + ComponentMaskShiftLayerCbk(nullptr) { } diff --git a/src/odb/src/def/def/defrData.cpp b/src/odb/src/def/def/defrData.cpp index 67a3c695b77..212d28f5b00 100644 --- a/src/odb/src/def/def/defrData.cpp +++ b/src/odb/src/def/def/defrData.cpp @@ -138,23 +138,23 @@ defrData::defrData(const defrCallbacks* pCallbacks, NonDefault(this), Styles(), Geometries(this), - File(0), + File(nullptr), session(pSession), - Subnet(0), + Subnet(nullptr), settings(pSettings), aOxide(0), defInvalidChar(0), defIgnoreVersion(0), - defMsg(NULL), + defMsg(nullptr), defPrintTokens(0), defPropDefType('\0'), defaultCapWarnings(0), - defrLog(0), + defrLog(nullptr), input_level(-1), - last(NULL), + last(nullptr), new_is_keyword(0), nlines(1), - rowName(NULL), + rowName(nullptr), iOTimingWarnings(0), magic((char*) malloc(1)), netWarnings(0), @@ -162,18 +162,18 @@ defrData::defrData(const defrCallbacks* pCallbacks, save_y(0.0), sNetWarnings(0), netOsnet(0), - next(NULL), + next(nullptr), rowWarnings(0), - shieldName(NULL), + shieldName(nullptr), deftokenLength(TOKEN_SIZE), xStep(0), yStep(0), NeedPathData(0), shield(FALSE), - shiftBuf(0), + shiftBuf(nullptr), shiftBufLength(0), virtual_is_keyword(0), - warningMsg(NULL), + warningMsg(nullptr), lVal(0.0), rVal(0.0), deftoken((char*) malloc(TOKEN_SIZE)), @@ -205,8 +205,8 @@ defrData::defrData(const defrCallbacks* pCallbacks, next = buffer; first_buffer = 1; - lVal = strtod("-2147483648", NULL); - rVal = strtod("2147483647", NULL); + lVal = strtod("-2147483648", nullptr); + rVal = strtod("2147483647", nullptr); } defrData::~defrData() @@ -215,7 +215,7 @@ defrData::~defrData() /* Close the file */ if (defrLog) { fclose(defrLog); - defrLog = 0; + defrLog = nullptr; } free(deftoken); @@ -288,7 +288,7 @@ const char* defrData::upperCase(const char* str) int len = strlen(str) + 1; if (len > shiftBufLength) { - if (shiftBuf == 0) { + if (shiftBuf == nullptr) { len = len < 64 ? 64 : len; shiftBuf = (char*) malloc(len); shiftBufLength = len; @@ -396,7 +396,7 @@ double defrData::convert_defname2num(char* versionName) { char majorNm[80]; char minorNm[80]; - char* subMinorNm = NULL; + char* subMinorNm = nullptr; char* versionNm = strdup(versionName); double major = 0, minor = 0, subMinor = 0; @@ -489,12 +489,12 @@ int defrData::defValidNum(int values) } defrContext::defrContext(int ownConf) - : settings(0), - session(0), - data(0), + : settings(nullptr), + session(nullptr), + data(nullptr), ownConfig(ownConf), - init_call_func(0), - callbacks(0) + init_call_func(nullptr), + callbacks(nullptr) { } diff --git a/src/odb/src/def/def/defrReader.cpp b/src/odb/src/def/def/defrReader.cpp index 9ed7d8a4482..019c9b0a772 100644 --- a/src/odb/src/def/def/defrReader.cpp +++ b/src/odb/src/def/def/defrReader.cpp @@ -62,17 +62,17 @@ void def_init(const char* func) return; } - if (defContext.settings == NULL) { + if (defContext.settings == nullptr) { defContext.settings = new defrSettings(); defContext.init_call_func = func; } - if (defContext.callbacks == NULL) { + if (defContext.callbacks == nullptr) { defContext.callbacks = new defrCallbacks(); defContext.init_call_func = func; } - if (defContext.session == NULL) { + if (defContext.session == nullptr) { defContext.session = new defrSession(); defContext.init_call_func = func; } @@ -340,7 +340,7 @@ int defrInit() int defrInitSession(int startSession) { if (startSession) { - if (defContext.init_call_func != NULL) { + if (defContext.init_call_func != nullptr) { fprintf(stderr, "ERROR: Attempt to call configuration function '%s' in DEF " "parser before defrInit() call in session-based mode.\n", @@ -357,15 +357,15 @@ int defrInitSession(int startSession) delete defContext.session; defContext.session = new defrSession(); } else { - if (defContext.callbacks == NULL) { + if (defContext.callbacks == nullptr) { defContext.callbacks = new defrCallbacks(); } - if (defContext.settings == NULL) { + if (defContext.settings == nullptr) { defContext.settings = new defrSettings(); } - if (defContext.session == NULL) { + if (defContext.session == nullptr) { defContext.session = new defrSession(); } else { memset(defContext.settings->UnusedCallbacks, 0, CBMAX * sizeof(int)); @@ -373,7 +373,7 @@ int defrInitSession(int startSession) } defContext.ownConfig = 0; - defContext.init_call_func = 0; + defContext.init_call_func = nullptr; return 0; } @@ -387,18 +387,18 @@ int defrReset() int defrClear() { delete defContext.callbacks; - defContext.callbacks = NULL; + defContext.callbacks = nullptr; delete defContext.settings; - defContext.settings = NULL; + defContext.settings = nullptr; delete defContext.session; - defContext.session = NULL; + defContext.session = nullptr; delete defContext.data; - defContext.data = NULL; + defContext.data = nullptr; - defContext.init_call_func = NULL; + defContext.init_call_func = nullptr; defContext.ownConfig = 0; return 0; @@ -453,625 +453,625 @@ int defrReleaseNResetMemory() void defrUnsetArrayNameCbk() { DEF_INIT; - defContext.callbacks->ArrayNameCbk = NULL; + defContext.callbacks->ArrayNameCbk = nullptr; } void defrUnsetAssertionCbk() { DEF_INIT; - defContext.callbacks->AssertionCbk = NULL; + defContext.callbacks->AssertionCbk = nullptr; } void defrUnsetAssertionsStartCbk() { DEF_INIT; - defContext.callbacks->AssertionsStartCbk = NULL; + defContext.callbacks->AssertionsStartCbk = nullptr; } void defrUnsetAssertionsEndCbk() { DEF_INIT; - defContext.callbacks->AssertionsEndCbk = NULL; + defContext.callbacks->AssertionsEndCbk = nullptr; } void defrUnsetBlockageCbk() { DEF_INIT; - defContext.callbacks->BlockageCbk = NULL; + defContext.callbacks->BlockageCbk = nullptr; } void defrUnsetBlockageStartCbk() { DEF_INIT; - defContext.callbacks->BlockageStartCbk = NULL; + defContext.callbacks->BlockageStartCbk = nullptr; } void defrUnsetBlockageEndCbk() { DEF_INIT; - defContext.callbacks->BlockageEndCbk = NULL; + defContext.callbacks->BlockageEndCbk = nullptr; } void defrUnsetBusBitCbk() { DEF_INIT; - defContext.callbacks->BusBitCbk = NULL; + defContext.callbacks->BusBitCbk = nullptr; } void defrUnsetCannotOccupyCbk() { DEF_INIT; - defContext.callbacks->CannotOccupyCbk = NULL; + defContext.callbacks->CannotOccupyCbk = nullptr; } void defrUnsetCanplaceCbk() { DEF_INIT; - defContext.callbacks->CanplaceCbk = NULL; + defContext.callbacks->CanplaceCbk = nullptr; } void defrUnsetCaseSensitiveCbk() { DEF_INIT; - defContext.callbacks->CaseSensitiveCbk = NULL; + defContext.callbacks->CaseSensitiveCbk = nullptr; } void defrUnsetComponentCbk() { DEF_INIT; - defContext.callbacks->ComponentCbk = NULL; + defContext.callbacks->ComponentCbk = nullptr; } void defrUnsetComponentExtCbk() { DEF_INIT; - defContext.callbacks->ComponentExtCbk = NULL; + defContext.callbacks->ComponentExtCbk = nullptr; } void defrUnsetComponentStartCbk() { DEF_INIT; - defContext.callbacks->ComponentStartCbk = NULL; + defContext.callbacks->ComponentStartCbk = nullptr; } void defrUnsetComponentEndCbk() { DEF_INIT; - defContext.callbacks->ComponentEndCbk = NULL; + defContext.callbacks->ComponentEndCbk = nullptr; } void defrUnsetConstraintCbk() { DEF_INIT; - defContext.callbacks->ConstraintCbk = NULL; + defContext.callbacks->ConstraintCbk = nullptr; } void defrUnsetConstraintsStartCbk() { DEF_INIT; - defContext.callbacks->ConstraintsStartCbk = NULL; + defContext.callbacks->ConstraintsStartCbk = nullptr; } void defrUnsetConstraintsEndCbk() { DEF_INIT; - defContext.callbacks->ConstraintsEndCbk = NULL; + defContext.callbacks->ConstraintsEndCbk = nullptr; } void defrUnsetDefaultCapCbk() { DEF_INIT; - defContext.callbacks->DefaultCapCbk = NULL; + defContext.callbacks->DefaultCapCbk = nullptr; } void defrUnsetDesignCbk() { DEF_INIT; - defContext.callbacks->DesignCbk = NULL; + defContext.callbacks->DesignCbk = nullptr; } void defrUnsetDesignEndCbk() { DEF_INIT; - defContext.callbacks->DesignEndCbk = NULL; + defContext.callbacks->DesignEndCbk = nullptr; } void defrUnsetDieAreaCbk() { DEF_INIT; - defContext.callbacks->DieAreaCbk = NULL; + defContext.callbacks->DieAreaCbk = nullptr; } void defrUnsetDividerCbk() { DEF_INIT; - defContext.callbacks->DividerCbk = NULL; + defContext.callbacks->DividerCbk = nullptr; } void defrUnsetExtensionCbk() { DEF_INIT; - defContext.callbacks->ExtensionCbk = NULL; + defContext.callbacks->ExtensionCbk = nullptr; } void defrUnsetFillCbk() { DEF_INIT; - defContext.callbacks->FillCbk = NULL; + defContext.callbacks->FillCbk = nullptr; } void defrUnsetFillStartCbk() { DEF_INIT; - defContext.callbacks->FillStartCbk = NULL; + defContext.callbacks->FillStartCbk = nullptr; } void defrUnsetFillEndCbk() { DEF_INIT; - defContext.callbacks->FillEndCbk = NULL; + defContext.callbacks->FillEndCbk = nullptr; } void defrUnsetFPCCbk() { DEF_INIT; - defContext.callbacks->FPCCbk = NULL; + defContext.callbacks->FPCCbk = nullptr; } void defrUnsetFPCStartCbk() { DEF_INIT; - defContext.callbacks->FPCStartCbk = NULL; + defContext.callbacks->FPCStartCbk = nullptr; } void defrUnsetFPCEndCbk() { DEF_INIT; - defContext.callbacks->FPCEndCbk = NULL; + defContext.callbacks->FPCEndCbk = nullptr; } void defrUnsetFloorPlanNameCbk() { DEF_INIT; - defContext.callbacks->FloorPlanNameCbk = NULL; + defContext.callbacks->FloorPlanNameCbk = nullptr; } void defrUnsetGcellGridCbk() { DEF_INIT; - defContext.callbacks->GcellGridCbk = NULL; + defContext.callbacks->GcellGridCbk = nullptr; } void defrUnsetGroupCbk() { DEF_INIT; - defContext.callbacks->GroupCbk = NULL; + defContext.callbacks->GroupCbk = nullptr; } void defrUnsetGroupExtCbk() { DEF_INIT; - defContext.callbacks->GroupExtCbk = NULL; + defContext.callbacks->GroupExtCbk = nullptr; } void defrUnsetGroupMemberCbk() { DEF_INIT; - defContext.callbacks->GroupMemberCbk = NULL; + defContext.callbacks->GroupMemberCbk = nullptr; } void defrUnsetComponentMaskShiftLayerCbk() { DEF_INIT; - defContext.callbacks->ComponentMaskShiftLayerCbk = NULL; + defContext.callbacks->ComponentMaskShiftLayerCbk = nullptr; } void defrUnsetGroupNameCbk() { DEF_INIT; - defContext.callbacks->GroupNameCbk = NULL; + defContext.callbacks->GroupNameCbk = nullptr; } void defrUnsetGroupsStartCbk() { DEF_INIT; - defContext.callbacks->GroupsStartCbk = NULL; + defContext.callbacks->GroupsStartCbk = nullptr; } void defrUnsetGroupsEndCbk() { DEF_INIT; - defContext.callbacks->GroupsEndCbk = NULL; + defContext.callbacks->GroupsEndCbk = nullptr; } void defrUnsetHistoryCbk() { DEF_INIT; - defContext.callbacks->HistoryCbk = NULL; + defContext.callbacks->HistoryCbk = nullptr; } void defrUnsetIOTimingCbk() { DEF_INIT; - defContext.callbacks->IOTimingCbk = NULL; + defContext.callbacks->IOTimingCbk = nullptr; } void defrUnsetIOTimingsStartCbk() { DEF_INIT; - defContext.callbacks->IOTimingsStartCbk = NULL; + defContext.callbacks->IOTimingsStartCbk = nullptr; } void defrUnsetIOTimingsEndCbk() { DEF_INIT; - defContext.callbacks->IOTimingsEndCbk = NULL; + defContext.callbacks->IOTimingsEndCbk = nullptr; } void defrUnsetIOTimingsExtCbk() { DEF_INIT; - defContext.callbacks->IoTimingsExtCbk = NULL; + defContext.callbacks->IoTimingsExtCbk = nullptr; } void defrUnsetNetCbk() { DEF_INIT; - defContext.callbacks->NetCbk = NULL; + defContext.callbacks->NetCbk = nullptr; } void defrUnsetNetNameCbk() { DEF_INIT; - defContext.callbacks->NetNameCbk = NULL; + defContext.callbacks->NetNameCbk = nullptr; } void defrUnsetNetNonDefaultRuleCbk() { DEF_INIT; - defContext.callbacks->NetNonDefaultRuleCbk = NULL; + defContext.callbacks->NetNonDefaultRuleCbk = nullptr; } void defrUnsetNetConnectionExtCbk() { DEF_INIT; - defContext.callbacks->NetConnectionExtCbk = NULL; + defContext.callbacks->NetConnectionExtCbk = nullptr; } void defrUnsetNetExtCbk() { DEF_INIT; - defContext.callbacks->NetExtCbk = NULL; + defContext.callbacks->NetExtCbk = nullptr; } void defrUnsetNetPartialPathCbk() { DEF_INIT; - defContext.callbacks->NetPartialPathCbk = NULL; + defContext.callbacks->NetPartialPathCbk = nullptr; } void defrUnsetNetSubnetNameCbk() { DEF_INIT; - defContext.callbacks->NetSubnetNameCbk = NULL; + defContext.callbacks->NetSubnetNameCbk = nullptr; } void defrUnsetNetStartCbk() { DEF_INIT; - defContext.callbacks->NetStartCbk = NULL; + defContext.callbacks->NetStartCbk = nullptr; } void defrUnsetNetEndCbk() { DEF_INIT; - defContext.callbacks->NetEndCbk = NULL; + defContext.callbacks->NetEndCbk = nullptr; } void defrUnsetNonDefaultCbk() { DEF_INIT; - defContext.callbacks->NonDefaultCbk = NULL; + defContext.callbacks->NonDefaultCbk = nullptr; } void defrUnsetNonDefaultStartCbk() { DEF_INIT; - defContext.callbacks->NonDefaultStartCbk = NULL; + defContext.callbacks->NonDefaultStartCbk = nullptr; } void defrUnsetNonDefaultEndCbk() { DEF_INIT; - defContext.callbacks->NonDefaultEndCbk = NULL; + defContext.callbacks->NonDefaultEndCbk = nullptr; } void defrUnsetPartitionCbk() { DEF_INIT; - defContext.callbacks->PartitionCbk = NULL; + defContext.callbacks->PartitionCbk = nullptr; } void defrUnsetPartitionsExtCbk() { DEF_INIT; - defContext.callbacks->PartitionsExtCbk = NULL; + defContext.callbacks->PartitionsExtCbk = nullptr; } void defrUnsetPartitionsStartCbk() { DEF_INIT; - defContext.callbacks->PartitionsStartCbk = NULL; + defContext.callbacks->PartitionsStartCbk = nullptr; } void defrUnsetPartitionsEndCbk() { DEF_INIT; - defContext.callbacks->PartitionsEndCbk = NULL; + defContext.callbacks->PartitionsEndCbk = nullptr; } void defrUnsetPathCbk() { DEF_INIT; - defContext.callbacks->PathCbk = NULL; + defContext.callbacks->PathCbk = nullptr; } void defrUnsetPinCapCbk() { DEF_INIT; - defContext.callbacks->PinCapCbk = NULL; + defContext.callbacks->PinCapCbk = nullptr; } void defrUnsetPinCbk() { DEF_INIT; - defContext.callbacks->PinCbk = NULL; + defContext.callbacks->PinCbk = nullptr; } void defrUnsetPinEndCbk() { DEF_INIT; - defContext.callbacks->PinEndCbk = NULL; + defContext.callbacks->PinEndCbk = nullptr; } void defrUnsetPinExtCbk() { DEF_INIT; - defContext.callbacks->PinExtCbk = NULL; + defContext.callbacks->PinExtCbk = nullptr; } void defrUnsetPinPropCbk() { DEF_INIT; - defContext.callbacks->PinPropCbk = NULL; + defContext.callbacks->PinPropCbk = nullptr; } void defrUnsetPinPropStartCbk() { DEF_INIT; - defContext.callbacks->PinPropStartCbk = NULL; + defContext.callbacks->PinPropStartCbk = nullptr; } void defrUnsetPinPropEndCbk() { DEF_INIT; - defContext.callbacks->PinPropEndCbk = NULL; + defContext.callbacks->PinPropEndCbk = nullptr; } void defrUnsetPropCbk() { DEF_INIT; - defContext.callbacks->PropCbk = NULL; + defContext.callbacks->PropCbk = nullptr; } void defrUnsetPropDefEndCbk() { DEF_INIT; - defContext.callbacks->PropDefEndCbk = NULL; + defContext.callbacks->PropDefEndCbk = nullptr; } void defrUnsetPropDefStartCbk() { DEF_INIT; - defContext.callbacks->PropDefStartCbk = NULL; + defContext.callbacks->PropDefStartCbk = nullptr; } void defrUnsetRegionCbk() { DEF_INIT; - defContext.callbacks->RegionCbk = NULL; + defContext.callbacks->RegionCbk = nullptr; } void defrUnsetRegionStartCbk() { DEF_INIT; - defContext.callbacks->RegionStartCbk = NULL; + defContext.callbacks->RegionStartCbk = nullptr; } void defrUnsetRegionEndCbk() { DEF_INIT; - defContext.callbacks->RegionEndCbk = NULL; + defContext.callbacks->RegionEndCbk = nullptr; } void defrUnsetRowCbk() { DEF_INIT; - defContext.callbacks->RowCbk = NULL; + defContext.callbacks->RowCbk = nullptr; } void defrUnsetScanChainExtCbk() { DEF_INIT; - defContext.callbacks->ScanChainExtCbk = NULL; + defContext.callbacks->ScanChainExtCbk = nullptr; } void defrUnsetScanchainCbk() { DEF_INIT; - defContext.callbacks->ScanchainCbk = NULL; + defContext.callbacks->ScanchainCbk = nullptr; } void defrUnsetScanchainsStartCbk() { DEF_INIT; - defContext.callbacks->ScanchainsStartCbk = NULL; + defContext.callbacks->ScanchainsStartCbk = nullptr; } void defrUnsetScanchainsEndCbk() { DEF_INIT; - defContext.callbacks->ScanchainsEndCbk = NULL; + defContext.callbacks->ScanchainsEndCbk = nullptr; } void defrUnsetSiteCbk() { DEF_INIT; - defContext.callbacks->SiteCbk = NULL; + defContext.callbacks->SiteCbk = nullptr; } void defrUnsetSlotCbk() { DEF_INIT; - defContext.callbacks->SlotCbk = NULL; + defContext.callbacks->SlotCbk = nullptr; } void defrUnsetSlotStartCbk() { DEF_INIT; - defContext.callbacks->SlotStartCbk = NULL; + defContext.callbacks->SlotStartCbk = nullptr; } void defrUnsetSlotEndCbk() { DEF_INIT; - defContext.callbacks->SlotEndCbk = NULL; + defContext.callbacks->SlotEndCbk = nullptr; } void defrUnsetSNetWireCbk() { DEF_INIT; - defContext.callbacks->SNetWireCbk = NULL; + defContext.callbacks->SNetWireCbk = nullptr; } void defrUnsetSNetCbk() { DEF_INIT; - defContext.callbacks->SNetCbk = NULL; + defContext.callbacks->SNetCbk = nullptr; } void defrUnsetSNetStartCbk() { DEF_INIT; - defContext.callbacks->SNetStartCbk = NULL; + defContext.callbacks->SNetStartCbk = nullptr; } void defrUnsetSNetEndCbk() { DEF_INIT; - defContext.callbacks->SNetEndCbk = NULL; + defContext.callbacks->SNetEndCbk = nullptr; } void defrUnsetSNetPartialPathCbk() { DEF_INIT; - defContext.callbacks->SNetPartialPathCbk = NULL; + defContext.callbacks->SNetPartialPathCbk = nullptr; } void defrUnsetStartPinsCbk() { DEF_INIT; - defContext.callbacks->StartPinsCbk = NULL; + defContext.callbacks->StartPinsCbk = nullptr; } void defrUnsetStylesCbk() { DEF_INIT; - defContext.callbacks->StylesCbk = NULL; + defContext.callbacks->StylesCbk = nullptr; } void defrUnsetStylesStartCbk() { DEF_INIT; - defContext.callbacks->StylesStartCbk = NULL; + defContext.callbacks->StylesStartCbk = nullptr; } void defrUnsetStylesEndCbk() { DEF_INIT; - defContext.callbacks->StylesEndCbk = NULL; + defContext.callbacks->StylesEndCbk = nullptr; } void defrUnsetTechnologyCbk() { DEF_INIT; - defContext.callbacks->TechnologyCbk = NULL; + defContext.callbacks->TechnologyCbk = nullptr; } void defrUnsetTimingDisableCbk() { DEF_INIT; - defContext.callbacks->TimingDisableCbk = NULL; + defContext.callbacks->TimingDisableCbk = nullptr; } void defrUnsetTimingDisablesStartCbk() { DEF_INIT; - defContext.callbacks->TimingDisablesStartCbk = NULL; + defContext.callbacks->TimingDisablesStartCbk = nullptr; } void defrUnsetTimingDisablesEndCbk() { DEF_INIT; - defContext.callbacks->TimingDisablesEndCbk = NULL; + defContext.callbacks->TimingDisablesEndCbk = nullptr; } void defrUnsetTrackCbk() { DEF_INIT; - defContext.callbacks->TrackCbk = NULL; + defContext.callbacks->TrackCbk = nullptr; } void defrUnsetUnitsCbk() { DEF_INIT; - defContext.callbacks->UnitsCbk = NULL; + defContext.callbacks->UnitsCbk = nullptr; } void defrUnsetVersionCbk() { DEF_INIT; - defContext.callbacks->VersionCbk = NULL; + defContext.callbacks->VersionCbk = nullptr; } void defrUnsetVersionStrCbk() { DEF_INIT; - defContext.callbacks->VersionStrCbk = NULL; + defContext.callbacks->VersionStrCbk = nullptr; } void defrUnsetViaCbk() { DEF_INIT; - defContext.callbacks->ViaCbk = NULL; + defContext.callbacks->ViaCbk = nullptr; } void defrUnsetViaExtCbk() { DEF_INIT; - defContext.callbacks->ViaExtCbk = NULL; + defContext.callbacks->ViaExtCbk = nullptr; } void defrUnsetViaStartCbk() { DEF_INIT; - defContext.callbacks->ViaStartCbk = NULL; + defContext.callbacks->ViaStartCbk = nullptr; } void defrUnsetViaEndCbk() { DEF_INIT; - defContext.callbacks->ViaEndCbk = NULL; + defContext.callbacks->ViaEndCbk = nullptr; } int* defUnusedCallbackCount() @@ -1083,7 +1083,7 @@ int* defUnusedCallbackCount() const char* defrFName() { DEF_INIT; - return NULL; + return nullptr; } void defrClearSession() @@ -2171,7 +2171,7 @@ void defrSetReadFunction(DEFI_READ_FUNCTION f) void defrUnsetReadFunction() { DEF_INIT; - defContext.settings->ReadFunction = 0; + defContext.settings->ReadFunction = nullptr; } void defrDisablePropStrProcess() diff --git a/src/odb/src/def/def/defrSettings.cpp b/src/odb/src/def/def/defrSettings.cpp index 3e4530d9159..8adafb7a87c 100644 --- a/src/odb/src/def/def/defrSettings.cpp +++ b/src/odb/src/def/def/defrSettings.cpp @@ -32,7 +32,7 @@ BEGIN_LEFDEF_PARSER_NAMESPACE -defrSettings* defSettings = NULL; +defrSettings* defSettings = nullptr; const char* defrSettings::defOxides[] = { "OXIDE1", "OXIDE2", "OXIDE3", "OXIDE4", "OXIDE5", "OXIDE6", "OXIDE7", @@ -66,24 +66,24 @@ defrSettings::defrSettings() VersionWarnings(999), ViaWarnings(999), nDDMsgs(0), - disableDMsgs(NULL), + disableDMsgs(nullptr), totalDefMsgLimit(0), AddPathToNet(0), AllowComponentNets(0), CommentChar('#'), - ReadFunction(NULL), - ErrorLogFunction(NULL), - WarningLogFunction(NULL), - ContextErrorLogFunction(NULL), - ContextWarningLogFunction(NULL), - MagicCommentFoundFunction(NULL), - MallocFunction(NULL), - ReallocFunction(NULL), - FreeFunction(NULL), - LineNumberFunction(NULL), - LongLineNumberFunction(NULL), - ContextLineNumberFunction(NULL), - ContextLongLineNumberFunction(NULL), + ReadFunction(nullptr), + ErrorLogFunction(nullptr), + WarningLogFunction(nullptr), + ContextErrorLogFunction(nullptr), + ContextWarningLogFunction(nullptr), + MagicCommentFoundFunction(nullptr), + MallocFunction(nullptr), + ReallocFunction(nullptr), + FreeFunction(nullptr), + LineNumberFunction(nullptr), + LongLineNumberFunction(nullptr), + ContextLineNumberFunction(nullptr), + ContextLongLineNumberFunction(nullptr), reader_case_sensitive_set(0), DisPropStrProcess(0), LogFileAppend(0) @@ -367,7 +367,7 @@ void defrSettings::init_symbol_table() } defrSession::defrSession() - : FileName(0), reader_case_sensitive(0), UserData(NULL) + : FileName(nullptr), reader_case_sensitive(0), UserData(nullptr) { } diff --git a/src/odb/src/def/def/defwWriter.cpp b/src/odb/src/def/def/defwWriter.cpp index e01c8e3f960..46912f4badb 100644 --- a/src/odb/src/def/def/defwWriter.cpp +++ b/src/odb/src/def/def/defwWriter.cpp @@ -162,7 +162,7 @@ BEGIN_LEFDEF_PARSER_NAMESPACE // ***************************************************************************** // Global Variables // ***************************************************************************** -FILE* defwFile = 0; // File to write to. +FILE* defwFile = nullptr; // File to write to. int defwLines = 0; // number of lines written int defwState = DEFW_UNINIT; // Current state of writer int defwFunc = DEFW_UNINIT; // Current function of writer @@ -369,7 +369,7 @@ int defwInit(FILE* f, } if ((vers1 == 5) && (vers2 < 6)) { // For version before 5.6 - if (caseSensitive == 0 || *caseSensitive == 0) + if (caseSensitive == nullptr || *caseSensitive == 0) return DEFW_BAD_DATA; fprintf(defwFile, "NAMESCASESENSITIVE %s ;\n", caseSensitive); } @@ -384,7 +384,7 @@ int defwInit(FILE* f, defwLines++; } - if (designName == 0 || *designName == 0) + if (designName == nullptr || *designName == 0) return DEFW_BAD_DATA; fprintf(defwFile, "DESIGN %s ;\n", designName); defwLines++; @@ -509,7 +509,7 @@ int defwBusBitChars(const char* busBitChars) // Check for repeated casesensitive if (defwState == DEFW_BUSBIT) return DEFW_BAD_ORDER; - if (busBitChars && busBitChars != 0 && *busBitChars != 0) { + if (busBitChars && busBitChars != nullptr && *busBitChars != 0) { fprintf(defwFile, "BUSBITCHARS \"%s\" ;\n", busBitChars); defwLines++; } @@ -528,7 +528,7 @@ int defwDividerChar(const char* dividerChar) // Check for repeated busbit if (defwState == DEFW_DIVIDER) return DEFW_BAD_ORDER; - if (dividerChar && dividerChar != 0 && *dividerChar != 0) { + if (dividerChar && dividerChar != nullptr && *dividerChar != 0) { fprintf(defwFile, "DIVIDERCHAR \"%s\" ;\n", dividerChar); defwLines++; } @@ -547,7 +547,7 @@ int defwDesignName(const char* name) // Check for repeated design if (defwState == DEFW_DESIGN) return DEFW_BAD_ORDER; - if (name && name != 0 && *name != 0) { + if (name && name != nullptr && *name != 0) { fprintf(defwFile, "DESIGN %s ;\n", name); defwLines++; } @@ -563,7 +563,7 @@ int defwTechnology(const char* technology) return DEFW_UNINITIALIZED; if (!defwDidInit) return DEFW_BAD_ORDER; - if (technology && technology != 0 && *technology != 0) { + if (technology && technology != nullptr && *technology != 0) { fprintf(defwFile, "TECHNOLOGY %s ;\n", technology); defwLines++; } @@ -581,7 +581,7 @@ int defwArray(const char* array) return DEFW_BAD_ORDER; if (defwState == DEFW_ARRAY) return DEFW_BAD_ORDER; // check for repeated array - if (array && array != 0 && *array != 0) { + if (array && array != nullptr && *array != 0) { fprintf(defwFile, "ARRAY %s ;\n", array); defwLines++; } @@ -599,7 +599,7 @@ int defwFloorplan(const char* floorplan) return DEFW_BAD_ORDER; if (defwState == DEFW_FLOORPLAN) return DEFW_BAD_ORDER; // Check for repeated floorplan - if (floorplan && floorplan != 0 && *floorplan != 0) { + if (floorplan && floorplan != nullptr && *floorplan != 0) { fprintf(defwFile, "FLOORPLAN %s ;\n", floorplan); defwLines++; } @@ -649,7 +649,7 @@ int defwHistory(const char* string) return DEFW_UNINITIALIZED; if (!defwDidInit) return DEFW_BAD_ORDER; - if (string == 0 || *string == 0) + if (string == nullptr || *string == 0) return DEFW_BAD_DATA; for (c = (char*) string; *c; c++) @@ -948,7 +948,8 @@ int defwRow(const char* rowName, fprintf(defwFile, ";\n"); // add the ; and newline for the previous row. // required - if ((rowName == 0) || (*rowName == 0) || (rowType == 0) || (*rowType == 0)) + if ((rowName == nullptr) || (*rowName == 0) || (rowType == nullptr) + || (*rowType == 0)) return DEFW_BAD_DATA; // do not have ; because the row may have properties @@ -1185,7 +1186,7 @@ int defwCanPlace(const char* master, if (defwState == DEFW_ROW) fprintf(defwFile, ";\n\n"); // add the ; and \n for the previous row. - if ((master == 0) || (*master == 0)) // required + if ((master == nullptr) || (*master == 0)) // required return DEFW_BAD_DATA; fprintf(defwFile, "CANPLACE %s %d %d %s DO %d BY %d STEP %d %d ;\n", @@ -1254,7 +1255,7 @@ int defwCannotOccupy(const char* master, if (!defwDidInit) return DEFW_BAD_ORDER; - if ((master == 0) || (*master == 0)) // required + if ((master == nullptr) || (*master == 0)) // required return DEFW_BAD_DATA; fprintf(defwFile, "CANNOTOCCUPY %s %d %d %s DO %d BY %d STEP %d %d ;\n", @@ -1764,7 +1765,8 @@ int defwComponent(const char* instance, defwCounter--; // required - if ((instance == 0) || (*instance == 0) || (master == 0) || (*master == 0)) + if ((instance == nullptr) || (*instance == 0) || (master == nullptr) + || (*master == 0)) return DEFW_BAD_DATA; if (source && strcmp(source, "NETLIST") && strcmp(source, "DIST") @@ -2499,7 +2501,7 @@ int defwPinNetExpr(const char* pinExpr) return DEFW_BAD_ORDER; if (defVersionNum < 5.6) return DEFW_WRONG_VERSION; - if (pinExpr && pinExpr != 0 && *pinExpr != 0) + if (pinExpr && pinExpr != nullptr && *pinExpr != 0) fprintf(defwFile, "\n + NETEXPR \"%s\"", pinExpr); defwLines++; @@ -2514,7 +2516,7 @@ int defwPinSupplySensitivity(const char* pinName) return DEFW_BAD_ORDER; if (defVersionNum < 5.6) return DEFW_WRONG_VERSION; - if (pinName && pinName != 0 && *pinName != 0) + if (pinName && pinName != nullptr && *pinName != 0) fprintf(defwFile, "\n + SUPPLYSENSITIVITY %s", pinName); defwLines++; @@ -2529,7 +2531,7 @@ int defwPinGroundSensitivity(const char* pinName) return DEFW_BAD_ORDER; if (defVersionNum < 5.6) return DEFW_WRONG_VERSION; - if (pinName && pinName != 0 && *pinName != 0) + if (pinName && pinName != nullptr && *pinName != 0) fprintf(defwFile, "\n + GROUNDSENSITIVITY %s", pinName); defwLines++; @@ -3663,7 +3665,7 @@ int defwNetVpin(const char* vpinName, return DEFW_UNINITIALIZED; if (!defwNetOptions()) return DEFW_BAD_ORDER; - if ((vpinName == 0) || (*vpinName == 0)) // required + if ((vpinName == nullptr) || (*vpinName == 0)) // required return DEFW_BAD_DATA; if (status && strcmp(status, "PLACED") && strcmp(status, "FIXED") @@ -4819,9 +4821,9 @@ int defwConstraintOperandPath(const char* comp1, if (defwState != DEFW_FPC_OPER && defwState != DEFW_FPC_OPER_SUM) return DEFW_BAD_ORDER; // path can be within SUM - if ((comp1 == 0) || (*comp1 == 0) || (fromPin == 0) || (*fromPin == 0) - || (comp2 == 0) || (*comp2 == 0) || (toPin == 0) - || (*toPin == 0)) // require + if ((comp1 == nullptr) || (*comp1 == 0) || (fromPin == nullptr) + || (*fromPin == 0) || (comp2 == nullptr) || (*comp2 == 0) + || (toPin == nullptr) || (*toPin == 0)) // require return DEFW_BAD_DATA; if (defwFPC > 0) fprintf(defwFile, " ,"); @@ -4946,8 +4948,8 @@ int defwGroup(const char* groupName, int numExpr, const char** groupExpr) if (defwState != DEFW_GROUP_START && defwState != DEFW_GROUP) return DEFW_BAD_ORDER; - if ((groupName == 0) || (*groupName == 0) || (groupExpr == 0) - || (*groupExpr == 0)) // require + if ((groupName == nullptr) || (*groupName == 0) || (groupExpr == nullptr) + || (*groupExpr == nullptr)) // require return DEFW_BAD_DATA; if (defwState == DEFW_GROUP) fprintf(defwFile, " ;\n"); // add ; for the previous group @@ -5132,7 +5134,7 @@ int defwBlockagesLayerComponent(const char* compName) if ((defwState != DEFW_BLOCKAGE_LAYER) && (defwState != DEFW_BLOCKAGE_RECT)) return DEFW_BAD_ORDER; - if ((compName == 0) || (*compName == 0)) // require + if ((compName == nullptr) || (*compName == 0)) // require return DEFW_BAD_DATA; if (defwState == DEFW_BLOCKAGE_RECT) @@ -5325,7 +5327,7 @@ int defwBlockageLayerPushdown(const char* layerName) || (defwState == DEFW_BLOCKAGE_LAYER))) return DEFW_BAD_DATA; - if ((layerName == 0) || (*layerName == 0)) // require + if ((layerName == nullptr) || (*layerName == 0)) // require return DEFW_BAD_DATA; if (defwState == DEFW_BLOCKAGE_RECT) fprintf(defwFile, " ;\n"); // end the previous rectangle @@ -5349,7 +5351,7 @@ int defwBlockageLayerExceptpgnet(const char* layerName) || (defwState == DEFW_BLOCKAGE_LAYER))) return DEFW_BAD_DATA; - if ((layerName == 0) || (*layerName == 0)) // require + if ((layerName == nullptr) || (*layerName == 0)) // require return DEFW_BAD_DATA; if (defwState == DEFW_BLOCKAGE_RECT) fprintf(defwFile, " ;\n"); // end the previous rectangle @@ -5430,7 +5432,7 @@ int defwBlockagesPlacementComponent(const char* compName) if ((defwState != DEFW_BLOCKAGE_PLACE) && (defwState != DEFW_BLOCKAGE_RECT)) return DEFW_BAD_ORDER; - if ((compName == 0) || (*compName == 0)) // require + if ((compName == nullptr) || (*compName == 0)) // require return DEFW_BAD_DATA; if (defwState == DEFW_BLOCKAGE_RECT) fprintf(defwFile, " ;\n"); // end the previous rectangle @@ -5582,7 +5584,7 @@ int defwBlockagePlacementComponent(const char* compName) || (defwState == DEFW_BLOCKAGE_PLACE))) return DEFW_BAD_DATA; - if ((compName == 0) || (*compName == 0)) // require + if ((compName == nullptr) || (*compName == 0)) // require return DEFW_BAD_DATA; if (defwState == DEFW_BLOCKAGE_RECT) fprintf(defwFile, " ;\n"); // end the previous rectangle @@ -6181,7 +6183,7 @@ int defwNonDefaultRuleViaRule(const char* viaRuleName) if (defwState != DEFW_NDR) return DEFW_BAD_ORDER; - if ((viaRuleName == 0) || (*viaRuleName == 0)) // require + if ((viaRuleName == nullptr) || (*viaRuleName == 0)) // require return DEFW_BAD_DATA; fprintf(defwFile, "\n + VIARULE %s ", viaRuleName); defwLines++; @@ -6198,7 +6200,7 @@ int defwNonDefaultRuleMinCuts(const char* cutLayerName, int numCuts) if (defwState != DEFW_NDR) return DEFW_BAD_ORDER; - if ((cutLayerName == 0) || (*cutLayerName == 0)) // require + if ((cutLayerName == nullptr) || (*cutLayerName == 0)) // require return DEFW_BAD_DATA; fprintf(defwFile, "\n + MINCUTS %s %d ", cutLayerName, numCuts); defwLines++; @@ -6302,7 +6304,7 @@ int defwStartBeginext(const char* name) return DEFW_BAD_ORDER; if (defwState == DEFW_BEGINEXT_START || defwState == DEFW_BEGINEXT) return DEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return DEFW_BAD_DATA; fprintf(defwFile, "BEGINEXT \"%s\"\n", name); @@ -6319,7 +6321,7 @@ int defwBeginextCreator(const char* creatorName) return DEFW_BAD_ORDER; if (defwState != DEFW_BEGINEXT_START && defwState != DEFW_BEGINEXT) return DEFW_BAD_ORDER; - if (!creatorName || creatorName == 0 || *creatorName == 0) + if (!creatorName || creatorName == nullptr || *creatorName == 0) return DEFW_BAD_DATA; fprintf(defwFile, " CREATOR \"%s\"\n", creatorName); @@ -6340,7 +6342,7 @@ int defwBeginextDate() if (defwState != DEFW_BEGINEXT_START && defwState != DEFW_BEGINEXT) return DEFW_BAD_ORDER; - todayTime = time(NULL); // time in UTC + todayTime = time(nullptr); // time in UTC rettime = ctime(&todayTime); // convert to string rettime[strlen(rettime) - 1] = '\0'; // replace \n with \0 fprintf(defwFile, " DATE \"%s\"", rettime); diff --git a/src/odb/src/def/def/defwWriterCalls.cpp b/src/odb/src/def/def/defwWriterCalls.cpp index cda498875f8..fd6924b118c 100644 --- a/src/odb/src/def/def/defwWriterCalls.cpp +++ b/src/odb/src/def/def/defwWriterCalls.cpp @@ -119,8 +119,8 @@ DEFI_WARNING_LOG_FUNCTION defwWarningLogFunction; // ///////////////////////////////////// -defiUserData defwUserData = 0; -static char* defwFileName = 0; +defiUserData defwUserData = nullptr; +static char* defwFileName = nullptr; static int defwRegisterUnused = 0; extern FILE* defwFile; @@ -134,40 +134,40 @@ extern FILE* defwFile; ///////////////////////////////////// // The callback routines defwVoidCbkFnType defwCallbacksSeq[MAXCBS] = { - 0, // defwVersionCbk - 0, // defwCaseSensitiveCbk - 0, // defwDividerCbk - 0, // defwBusBitCbk - 0, // defwDesignCbk - 0, // defwTechCbk - 0, // defwArrayCbk - 0, // defwFloorPlanCbk - 0, // defwUnitsCbk - 0, // defwHistoryCbk - 0, // defwPropDefCbk - 0, // defwDieAreaCbk - 0, // defwRowCbk - 0, // defwTrackCbk - 0, // defwGcellGridCbk - 0, // defwDefaultCapCbk - 0, // defwCanplaceCbk - 0, // defwCannotOccupyCbk - 0, // defwViaCbk - 0, // defwRegionCbk - 0, // defwComponentCbk - 0, // defwPinCbk - 0, // defwPinPropCbk - 0, // defwSNetCbk - 0, // defwNetCbk - 0, // defwIOTimingCbk - 0, // defwScanchainCbk - 0, // defwConstraintCbk - 0, // defwAssertionCbk pre 5.2 - 0, // defwGroupCbk - 0, // defwBlockageCbk 5.4 - 0, // defwExtCbk - 0, // defwDesignEndCbk - // Add NEW CALLBACK here + nullptr, // defwVersionCbk + nullptr, // defwCaseSensitiveCbk + nullptr, // defwDividerCbk + nullptr, // defwBusBitCbk + nullptr, // defwDesignCbk + nullptr, // defwTechCbk + nullptr, // defwArrayCbk + nullptr, // defwFloorPlanCbk + nullptr, // defwUnitsCbk + nullptr, // defwHistoryCbk + nullptr, // defwPropDefCbk + nullptr, // defwDieAreaCbk + nullptr, // defwRowCbk + nullptr, // defwTrackCbk + nullptr, // defwGcellGridCbk + nullptr, // defwDefaultCapCbk + nullptr, // defwCanplaceCbk + nullptr, // defwCannotOccupyCbk + nullptr, // defwViaCbk + nullptr, // defwRegionCbk + nullptr, // defwComponentCbk + nullptr, // defwPinCbk + nullptr, // defwPinPropCbk + nullptr, // defwSNetCbk + nullptr, // defwNetCbk + nullptr, // defwIOTimingCbk + nullptr, // defwScanchainCbk + nullptr, // defwConstraintCbk + nullptr, // defwAssertionCbk pre 5.2 + nullptr, // defwGroupCbk + nullptr, // defwBlockageCbk 5.4 + nullptr, // defwExtCbk + nullptr, // defwDesignEndCbk + // Add NEW CALLBACK here }; // the optional and required callbacks and @@ -304,7 +304,7 @@ int defwWrite(FILE* f, const char* fName, defiUserData uData) // callback routines if any are set for (i = 0; i < MAXCBS; i++) { - if (defwCallbacksSeq[i] != 0) { // user has set a callback function + if (defwCallbacksSeq[i] != nullptr) { // user has set a callback function WRITER_CALLBACK(defwCallbacksSeq[i], defwCallbacksType[i]); } else if ((defwCallbacksReq[i][0]) && (defwCallbacksReq[i][1] == 0)) { // it is required but user hasn't set up callback and there isn't a @@ -327,7 +327,7 @@ void defwSetUnusedCallbacks(defwVoidCbkFnType func) int i; for (i = 0; i < MAXCBS; i++) { - if (defwCallbacksSeq[i] == 0) + if (defwCallbacksSeq[i] == nullptr) defwCallbacksSeq[i] = (defwVoidCbkFnType) func; } } diff --git a/src/odb/src/def/defdiff/diffDefRW.cpp b/src/odb/src/def/defdiff/diffDefRW.cpp index b7b1d1ae4bd..260d928ac90 100644 --- a/src/odb/src/def/defdiff/diffDefRW.cpp +++ b/src/odb/src/def/defdiff/diffDefRW.cpp @@ -1413,7 +1413,7 @@ int cls(defrCallbackType_e c, void* cl, defiUserData ud) defiVia* via; defiRegion* re; defiGroup* group; - defiComponentMaskShiftLayer* maskShiftLayer = NULL; + defiComponentMaskShiftLayer* maskShiftLayer = nullptr; defiScanchain* sc; defiIOTiming* iot; defiFPC* fpc; @@ -1433,10 +1433,10 @@ int cls(defrCallbackType_e c, void* cl, defiUserData ud) const char* itemT; char dir; defiPinAntennaModel* aModel; - char* tmpPinName = NULL; - char* extraPinName = NULL; - char* pName = NULL; - char* tmpName = NULL; + char* tmpPinName = nullptr; + char* extraPinName = nullptr; + char* pName = nullptr; + char* tmpName = nullptr; checkType(c); if (ud != userData) @@ -1512,7 +1512,7 @@ int cls(defrCallbackType_e c, void* cl, defiUserData ud) // is set to 1 if (ignorePE) { // check if .extra is in the name, if it is, ignore it - if ((extraPinName = strstr(pName, ".extra")) == NULL) + if ((extraPinName = strstr(pName, ".extra")) == nullptr) tmpPinName = pName; else { // make sure name ends with .extraNNN @@ -1520,7 +1520,7 @@ int cls(defrCallbackType_e c, void* cl, defiUserData ud) extraPinName = extraPinName + 6; *tmpName = '\0'; tmpPinName = pName; - if (extraPinName != NULL) { + if (extraPinName != nullptr) { while (*extraPinName != '\0' && *extraPinName != '\n') { if (isdigit(*extraPinName++)) continue; @@ -2542,12 +2542,12 @@ int diffDefReadFile(char* inFile, if (strcmp(netSegComp, "0") != 0) netSeCmp = 1; - if ((f = fopen(inFile, "r")) == 0) { + if ((f = fopen(inFile, "r")) == nullptr) { fprintf(stderr, "Couldn't open input file '%s'\n", inFile); return (2); } - if ((fout = fopen(outFile, "w")) == 0) { + if ((fout = fopen(outFile, "w")) == nullptr) { fprintf(stderr, "Couldn't open output file '%s'\n", outFile); fclose(f); return (2); diff --git a/src/odb/src/def/defrw/defrw.cpp b/src/odb/src/def/defrw/defrw.cpp index 9e564dcd54a..85de07f1b98 100644 --- a/src/odb/src/def/defrw/defrw.cpp +++ b/src/odb/src/def/defrw/defrw.cpp @@ -1943,7 +1943,7 @@ int cls(defrCallbackType_e c, void* cl, defiUserData ud) defiVia* via; defiRegion* re; defiGroup* group; - defiComponentMaskShiftLayer* maskShiftLayer = NULL; + defiComponentMaskShiftLayer* maskShiftLayer = nullptr; defiScanchain* sc; defiIOTiming* iot; defiFPC* fpc; @@ -3144,7 +3144,7 @@ int main(int argc, char** argv) argv++; argc--; outFile = *argv; - if ((fout = fopen(outFile, "w")) == 0) { + if ((fout = fopen(outFile, "w")) == nullptr) { fprintf(stderr, "ERROR: could not open output file\n"); return 2; } @@ -3388,7 +3388,7 @@ int main(int argc, char** argv) if (test1) { // for special tests for (fileCt = 0; fileCt < numInFile; fileCt++) { - if ((f = fopen(inFile[fileCt], "r")) == 0) { + if ((f = fopen(inFile[fileCt], "r")) == nullptr) { fprintf(stderr, "Couldn't open input file '%s'\n", inFile[fileCt]); return (2); } @@ -3427,7 +3427,7 @@ int main(int argc, char** argv) } else defrEnableAllMsgs(); - if ((f = fopen(inFile[fileCt], "r")) == 0) { + if ((f = fopen(inFile[fileCt], "r")) == nullptr) { fprintf(stderr, "Couldn't open input file '%s'\n", inFile[fileCt]); return (2); } @@ -3447,7 +3447,7 @@ int main(int argc, char** argv) for (fileCt = 0; fileCt < numInFile; fileCt++) { if (strcmp(inFile[fileCt], "STDIN") == 0) { f = stdin; - } else if ((f = fopen(inFile[fileCt], "r")) == 0) { + } else if ((f = fopen(inFile[fileCt], "r")) == nullptr) { fprintf(stderr, "Couldn't open input file '%s'\n", inFile[fileCt]); return (2); } @@ -3463,7 +3463,7 @@ int main(int argc, char** argv) defrAddAlias("alias1", "aliasValue1", 1); defiAlias_itr aliasStore; - const char* alias1Value = NULL; + const char* alias1Value = nullptr; while (aliasStore.Next()) { if (strcmp(aliasStore.Key(), "alias1") == 0) { diff --git a/src/odb/src/def/defwrite/defwrite.cpp b/src/odb/src/def/defwrite/defwrite.cpp index abdad94b7df..a7130e55608 100644 --- a/src/odb/src/def/defwrite/defwrite.cpp +++ b/src/odb/src/def/defwrite/defwrite.cpp @@ -82,7 +82,7 @@ int main(int argc, char** argv) argv++; argc--; outfile = *argv; - if ((fout = fopen(outfile, "w")) == 0) { + if ((fout = fopen(outfile, "w")) == nullptr) { fprintf(stderr, "ERROR: could not open output file\n"); return 2; } @@ -226,19 +226,19 @@ int main(int argc, char** argv) CHECK_STATUS(status); defwAddComment("defwPropDef is broken into 3 routines, defwStringPropDef"); defwAddComment("defwIntPropDef, and defwRealPropDef"); - status = defwStringPropDef("REGION", "scum", 0, 0, 0); + status = defwStringPropDef("REGION", "scum", 0, 0, nullptr); CHECK_STATUS(status); status = defwIntPropDef("REGION", "center", 0, 0, 0); CHECK_STATUS(status); status = defwRealPropDef("REGION", "area", 0, 0, 0); CHECK_STATUS(status); - status = defwStringPropDef("GROUP", "ggrp", 0, 0, 0); + status = defwStringPropDef("GROUP", "ggrp", 0, 0, nullptr); CHECK_STATUS(status); status = defwIntPropDef("GROUP", "site", 0, 25, 0); CHECK_STATUS(status); status = defwRealPropDef("GROUP", "maxarea", 0, 0, 0); CHECK_STATUS(status); - status = defwStringPropDef("COMPONENT", "cc", 0, 0, 0); + status = defwStringPropDef("COMPONENT", "cc", 0, 0, nullptr); CHECK_STATUS(status); status = defwIntPropDef("COMPONENT", "index", 0, 0, 0); CHECK_STATUS(status); @@ -246,11 +246,11 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwIntPropDef("NET", "alt", 0, 0, 0); CHECK_STATUS(status); - status = defwStringPropDef("NET", "lastName", 0, 0, 0); + status = defwStringPropDef("NET", "lastName", 0, 0, nullptr); CHECK_STATUS(status); status = defwRealPropDef("NET", "length", 0, 0, 0); CHECK_STATUS(status); - status = defwStringPropDef("SPECIALNET", "contype", 0, 0, 0); + status = defwStringPropDef("SPECIALNET", "contype", 0, 0, nullptr); CHECK_STATUS(status); status = defwIntPropDef("SPECIALNET", "ind", 0, 0, 0); CHECK_STATUS(status); @@ -264,25 +264,25 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwRealPropDef("ROW", "minlength", 1.0, 100.0, 0); CHECK_STATUS(status); - status = defwStringPropDef("ROW", "firstName", 0, 0, 0); + status = defwStringPropDef("ROW", "firstName", 0, 0, nullptr); CHECK_STATUS(status); status = defwIntPropDef("ROW", "idx", 0, 0, 0); CHECK_STATUS(status); status = defwIntPropDef("COMPONENTPIN", "dpIgnoreTerm", 0, 0, 0); CHECK_STATUS(status); - status = defwStringPropDef("COMPONENTPIN", "dpBit", 0, 0, 0); + status = defwStringPropDef("COMPONENTPIN", "dpBit", 0, 0, nullptr); CHECK_STATUS(status); status = defwRealPropDef("COMPONENTPIN", "realProperty", 0, 0, 0); CHECK_STATUS(status); - status = defwStringPropDef("NET", "IGNOREOPTIMIZATION", 0, 0, 0); + status = defwStringPropDef("NET", "IGNOREOPTIMIZATION", 0, 0, nullptr); CHECK_STATUS(status); - status = defwStringPropDef("SPECIALNET", "IGNOREOPTIMIZATION", 0, 0, 0); + status = defwStringPropDef("SPECIALNET", "IGNOREOPTIMIZATION", 0, 0, nullptr); CHECK_STATUS(status); status = defwRealPropDef("NET", "FREQUENCY", 0, 0, 0); CHECK_STATUS(status); status = defwRealPropDef("SPECIALNET", "FREQUENCY", 0, 0, 0); CHECK_STATUS(status); - status = defwStringPropDef("NONDEFAULTRULE", "ndprop1", 0, 0, 0); + status = defwStringPropDef("NONDEFAULTRULE", "ndprop1", 0, 0, nullptr); CHECK_STATUS(status); status = defwIntPropDef("NONDEFAULTRULE", "ndprop2", 0, 0, 0); CHECK_STATUS(status); @@ -556,22 +556,22 @@ int main(int argc, char** argv) status = defwComponent("Z38A01", "DFF3", 0, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "PLACED", 18592, 5400, 6, 0, - NULL, + nullptr, 0, 0, 0, @@ -584,22 +584,22 @@ int main(int argc, char** argv) status = defwComponentStr("Z38A03", "DFF3", 0, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "PLACED", 16576, 45600, "FS", 0, - NULL, + nullptr, 0, 0, 0, @@ -610,22 +610,22 @@ int main(int argc, char** argv) status = defwComponent("Z38A05", "DFF3", 0, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "PLACED", 51520, 9600, 6, 0, - NULL, + nullptr, 0, 0, 0, @@ -634,17 +634,17 @@ int main(int argc, char** argv) status = defwComponent("|i0", "INV_B", 0, - NULL, + nullptr, "INV", - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, 0, 0, -1, @@ -660,22 +660,22 @@ int main(int argc, char** argv) status = defwComponent("|i1", "INV_B", 0, - NULL, + nullptr, "INV", - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "UNPLACED", 1000, 1000, 0, 0, - NULL, + nullptr, 0, 0, 0, @@ -684,22 +684,22 @@ int main(int argc, char** argv) status = defwComponent("cell1", "CHM6A", 0, - NULL, - NULL, + nullptr, + nullptr, "generator", - NULL, + nullptr, "USER", 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "FIXED", 0, 10, 0, 100.4534535, - NULL, + nullptr, 0, 0, 0, @@ -708,22 +708,22 @@ int main(int argc, char** argv) status = defwComponent("cell2", "CHM6A", 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "NETLIST", 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "COVER", 120, 10, 4, 2, - NULL, + nullptr, 0, 0, 0, @@ -736,10 +736,10 @@ int main(int argc, char** argv) status = defwComponent("cell3", "CHM6A", 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "TIMING", 1, foreigns, @@ -771,10 +771,10 @@ int main(int argc, char** argv) status = defwComponentStr("cell4", "CHM3A", 0, - NULL, + nullptr, "CHM6A", - NULL, - NULL, + nullptr, + nullptr, "DIST", 2, foreigns, @@ -803,22 +803,22 @@ int main(int argc, char** argv) status = defwComponent("scancell1", "CHK3A", 0, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "PLACED", 500, 10, 7, 0, - NULL, + nullptr, 0, 0, 0, @@ -827,22 +827,22 @@ int main(int argc, char** argv) status = defwComponent("scancell2", "CHK3A", 0, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "PLACED", 700, 10, 6, 0, - NULL, + nullptr, 0, 0, 0, @@ -878,15 +878,39 @@ int main(int argc, char** argv) // PINS status = defwStartPins(11); CHECK_STATUS(status); - status = defwPin( - "scanpin", "net1", 0, "INPUT", NULL, NULL, 0, 0, -1, NULL, 0, 0, 0, 0); + status = defwPin("scanpin", + "net1", + 0, + "INPUT", + nullptr, + nullptr, + 0, + 0, + -1, + nullptr, + 0, + 0, + 0, + 0); CHECK_STATUS(status); status = defwPinPolygon("metal1", 0, 1000, 6, xP, yP); CHECK_STATUS(status); status = defwPinNetExpr("power1 VDD1"); CHECK_STATUS(status); - status = defwPin( - "pin0", "net1", 0, "INPUT", "SCAN", NULL, 0, 0, -1, NULL, 0, 0, 0, 0); + status = defwPin("pin0", + "net1", + 0, + "INPUT", + "SCAN", + nullptr, + 0, + 0, + -1, + nullptr, + 0, + 0, + 0, + 0); CHECK_STATUS(status); status = defwPinStr("pin0.5", "net1", @@ -897,7 +921,7 @@ int main(int argc, char** argv) 0, 0, "S", - NULL, + nullptr, 0, 0, 0, @@ -910,9 +934,9 @@ int main(int argc, char** argv) status = defwPin("pin1", "net1", 1, - NULL, + nullptr, "POWER", - NULL, + nullptr, 0, 0, -1, @@ -947,7 +971,7 @@ int main(int argc, char** argv) 0, "INPUT", "SIGNAL", - NULL, + nullptr, 0, 0, -1, @@ -969,13 +993,13 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwPinGroundSensitivity("gndpin1"); CHECK_STATUS(status); - status = defwPinAntennaPinPartialMetalArea(5000, NULL); + status = defwPinAntennaPinPartialMetalArea(5000, nullptr); CHECK_STATUS(status); status = defwPinAntennaPinPartialMetalSideArea(4580, "M2"); CHECK_STATUS(status); - status = defwPinAntennaPinGateArea(5000, NULL); + status = defwPinAntennaPinGateArea(5000, nullptr); CHECK_STATUS(status); - status = defwPinAntennaPinPartialCutArea(5000, NULL); + status = defwPinAntennaPinPartialCutArea(5000, nullptr); CHECK_STATUS(status); status = defwPin("INBUS[1]", "|INBUS[1]", @@ -1058,8 +1082,20 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwPinNetExpr("gnd1 GND"); CHECK_STATUS(status); - status = defwPin( - "VDD", "VDD", 1, "INOUT", "POWER", NULL, 0, 0, -1, NULL, 0, 0, 0, 0); + status = defwPin("VDD", + "VDD", + 1, + "INOUT", + "POWER", + nullptr, + 0, + 0, + -1, + nullptr, + 0, + 0, + 0, + 0); CHECK_STATUS(status); status = defwPin("BUSA[0]", "BUSA[0]", @@ -1070,7 +1106,7 @@ int main(int argc, char** argv) 0, 2500, 1, - NULL, + nullptr, 0, 0, 0, @@ -1082,8 +1118,20 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwPinVia("via12", 0, 25); CHECK_STATUS(status); - status = defwPin( - "VDD", "VDD", 1, "INOUT", "POWER", NULL, 0, 0, -1, NULL, 0, 0, 0, 0); + status = defwPin("VDD", + "VDD", + 1, + "INOUT", + "POWER", + nullptr, + 0, + 0, + -1, + nullptr, + 0, + 0, + 0, + 0); CHECK_STATUS(status); status = defwPinPort(); CHECK_STATUS(status); @@ -1491,7 +1539,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetWeight(2); CHECK_STATUS(status); - status = defwNetVpin("P1", NULL, 0, 0, 0, 0, "PLACED", 54, 64, 3); + status = defwNetVpin("P1", nullptr, 0, 0, 0, 0, "PLACED", 54, 64, 3); CHECK_STATUS(status); status = defwNetEndOneNet(); CHECK_STATUS(status); @@ -1543,7 +1591,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetPathStart("ROUTED"); CHECK_STATUS(status); - status = defwNetPathLayer("M2", 0, NULL); + status = defwNetPathLayer("M2", 0, nullptr); CHECK_STATUS(status); status = defwNetPathStyle(2); CHECK_STATUS(status); @@ -1563,7 +1611,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetPathStart("NEW"); CHECK_STATUS(status); - status = defwNetPathLayer("M1", 1, NULL); + status = defwNetPathLayer("M1", 1, nullptr); CHECK_STATUS(status); status = defwNetPathStyle(4); CHECK_STATUS(status); @@ -1630,14 +1678,30 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetConnection("Z38A01", "G", 0); CHECK_STATUS(status); - status = defwNetVpin( - "V_SUB3_XX100", NULL, -333, -333, 333, 333, "PLACED", 189560, 27300, 0); - CHECK_STATUS(status); - status = defwNetVpin( - "V_SUB2_XX100", NULL, -333, -333, 333, 333, "PLACED", 169400, 64500, 0); + status = defwNetVpin("V_SUB3_XX100", + nullptr, + -333, + -333, + 333, + 333, + "PLACED", + 189560, + 27300, + 0); + CHECK_STATUS(status); + status = defwNetVpin("V_SUB2_XX100", + nullptr, + -333, + -333, + 333, + 333, + "PLACED", + 169400, + 64500, + 0); CHECK_STATUS(status); status = defwNetVpin( - "V_SUB1_XX100", NULL, -333, -333, 333, 333, "PLACED", 55160, 31500, 0); + "V_SUB1_XX100", nullptr, -333, -333, 333, 333, "PLACED", 55160, 31500, 0); CHECK_STATUS(status); status = defwNetSubnetStart("SUB1_XX100"); CHECK_STATUS(status); @@ -1692,7 +1756,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetPathStart("ROUTED"); CHECK_STATUS(status); - status = defwNetPathLayer("M1", 0, NULL); + status = defwNetPathLayer("M1", 0, nullptr); CHECK_STATUS(status); coorX[0] = 168280.0; coorY[0] = 63300.0; @@ -1723,7 +1787,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetPathStart("ROUTED"); CHECK_STATUS(status); - status = defwNetPathLayer("M1", 0, NULL); + status = defwNetPathLayer("M1", 0, nullptr); CHECK_STATUS(status); coorX[0] = 188400.0; coorY[0] = 26100.0; @@ -1755,7 +1819,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetPathStart("ROUTED"); CHECK_STATUS(status); - status = defwNetPathLayer("M3", 0, NULL); + status = defwNetPathLayer("M3", 0, nullptr); CHECK_STATUS(status); coorX[0] = 269400.0; coorY[0] = 64500.0; @@ -1821,7 +1885,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetPathStart("NEW"); CHECK_STATUS(status); - status = defwNetPathLayer("M3", 1, NULL); + status = defwNetPathLayer("M3", 1, nullptr); CHECK_STATUS(status); coorX[0] = 55160.0; coorY[0] = 31500.0; @@ -1885,7 +1949,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetPathStart("ROUTED"); CHECK_STATUS(status); - status = defwNetPathLayer("M2", 0, NULL); + status = defwNetPathLayer("M2", 0, nullptr); CHECK_STATUS(status); coorX[0] = 100.0; coorY[0] = 100.0; @@ -1909,7 +1973,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetPathStart("ROUTED"); CHECK_STATUS(status); - status = defwNetPathLayer("M1", 0, NULL); + status = defwNetPathLayer("M1", 0, nullptr); CHECK_STATUS(status); coorX[0] = 1288210.0; coorY[0] = 580930.0; @@ -1927,7 +1991,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetPathStart("NEW"); CHECK_STATUS(status); - status = defwNetPathLayer("M3", 0, NULL); + status = defwNetPathLayer("M3", 0, nullptr); CHECK_STATUS(status); coorX[0] = 1141350.0; coorY[0] = 582820.0; @@ -1945,7 +2009,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetPathStart("NEW"); CHECK_STATUS(status); - status = defwNetPathLayer("M1", 0, NULL); + status = defwNetPathLayer("M1", 0, nullptr); CHECK_STATUS(status); coorX[0] = 1278410.0; coorY[0] = 275170.0; @@ -1953,7 +2017,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwNetPathStart("NEW"); CHECK_STATUS(status); - status = defwNetPathLayer("M1", 0, NULL); + status = defwNetPathLayer("M1", 0, nullptr); CHECK_STATUS(status); coorX[0] = 1141210.0; coorY[0] = 271250.0; @@ -2047,18 +2111,26 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwScanchainStop("cell4", "PA2"); CHECK_STATUS(status); - status = defwScanchainOrdered( - "cell2", "IN", "PA0", NULL, NULL, "cell1", "OUT", "P10", NULL, NULL); + status = defwScanchainOrdered("cell2", + "IN", + "PA0", + nullptr, + nullptr, + "cell1", + "OUT", + "P10", + nullptr, + nullptr); CHECK_STATUS(status); - status = defwScanchainFloating("scancell1", "IN", "PA0", NULL, NULL); + status = defwScanchainFloating("scancell1", "IN", "PA0", nullptr, nullptr); CHECK_STATUS(status); - status = defwScanchainFloating("scancell2", "OUT", "P10", NULL, NULL); + status = defwScanchainFloating("scancell2", "OUT", "P10", nullptr, nullptr); CHECK_STATUS(status); status = defwScanchain("chain1_clock1"); CHECK_STATUS(status); status = defwScanchainPartition("clock1", -1); CHECK_STATUS(status); - status = defwScanchainStart("block1/current_state_reg_0_QZ", NULL); + status = defwScanchainStart("block1/current_state_reg_0_QZ", nullptr); CHECK_STATUS(status); status = defwScanchainFloating("block1/pgm_cgm_en_reg", "IN", "SD", "OUT", "QZ"); @@ -2066,13 +2138,13 @@ int main(int argc, char** argv) status = defwScanchainFloating( "block1/start_reset_dd_reg", "IN", "SD", "OUT", "QZ"); CHECK_STATUS(status); - status = defwScanchainStop("block1/start_reset_d_reg", NULL); + status = defwScanchainStop("block1/start_reset_d_reg", nullptr); CHECK_STATUS(status); status = defwScanchain("chain2_clock2"); CHECK_STATUS(status); status = defwScanchainPartition("clock2", 1000); CHECK_STATUS(status); - status = defwScanchainStart("block1/current_state_reg_0_QZ", NULL); + status = defwScanchainStart("block1/current_state_reg_0_QZ", nullptr); CHECK_STATUS(status); status = defwScanchainFloating( "block1/port2_phy_addr_reg_0_", "IN", "SD", "OUT", "QZ "); @@ -2100,11 +2172,13 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = defwScanchainPartition("clock3", -1); CHECK_STATUS(status); - status = defwScanchainStart("block1/prescaler_IO/lfsr_reg1", NULL); + status = defwScanchainStart("block1/prescaler_IO/lfsr_reg1", nullptr); CHECK_STATUS(status); - status = defwScanchainFloating("block1/dp1_timers", NULL, NULL, NULL, NULL); + status = defwScanchainFloating( + "block1/dp1_timers", nullptr, nullptr, nullptr, nullptr); CHECK_STATUS(status); - status = defwScanchainFloatingBits("block1/bus8", NULL, NULL, NULL, NULL, 8); + status = defwScanchainFloatingBits( + "block1/bus8", nullptr, nullptr, nullptr, nullptr, 8); CHECK_STATUS(status); status = defwScanchainOrderedBits("block1/dsl/ffl", "IN", @@ -2132,7 +2206,7 @@ int main(int argc, char** argv) "Y", 0); CHECK_STATUS(status); - status = defwScanchainStop("block1/start_reset_d_reg", NULL); + status = defwScanchainStop("block1/start_reset_d_reg", nullptr); CHECK_STATUS(status); status = defwEndScanchain(); @@ -2196,11 +2270,11 @@ int main(int argc, char** argv) status = defwGroup("group2", 1, groupExpr); CHECK_STATUS(status); free((char*) groupExpr[0]); - status = defwGroupRegion(0, 10, 1000, 1010, NULL); + status = defwGroupRegion(0, 10, 1000, 1010, nullptr); CHECK_STATUS(status); status = defwStringProperty("ggrp", "after the fall"); CHECK_STATUS(status); - status = defwGroupSoft("MAXHALFPERIMETER", 4000, "MAXX", 10000, 0, 0); + status = defwGroupSoft("MAXHALFPERIMETER", 4000, "MAXX", 10000, nullptr, 0); CHECK_STATUS(status); status = defwEndGroups(); CHECK_STATUS(status); diff --git a/src/odb/src/def/defwrite/defwriteCbs.cpp b/src/odb/src/def/defwrite/defwriteCbs.cpp index 37c79b32802..6080716637d 100644 --- a/src/odb/src/def/defwrite/defwriteCbs.cpp +++ b/src/odb/src/def/defwrite/defwriteCbs.cpp @@ -191,35 +191,35 @@ int propdefCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); defwAddComment("defwPropDef is broken into 3 routines, defwStringPropDef"); defwAddComment("defwIntPropDef, and defwRealPropDef"); - status = defwStringPropDef("REGION", "scum", 0, 0, NULL); + status = defwStringPropDef("REGION", "scum", 0, 0, nullptr); CHECK_STATUS(status); - status = defwIntPropDef("REGION", "center", 0, 0, NULL); + status = defwIntPropDef("REGION", "center", 0, 0, nullptr); CHECK_STATUS(status); - status = defwRealPropDef("REGION", "area", 0, 0, NULL); + status = defwRealPropDef("REGION", "area", 0, 0, nullptr); CHECK_STATUS(status); - status = defwStringPropDef("GROUP", "ggrp", 0, 0, NULL); + status = defwStringPropDef("GROUP", "ggrp", 0, 0, nullptr); CHECK_STATUS(status); - status = defwIntPropDef("GROUP", "site", 0, 25, NULL); + status = defwIntPropDef("GROUP", "site", 0, 25, nullptr); CHECK_STATUS(status); - status = defwRealPropDef("GROUP", "maxarea", 0, 0, NULL); + status = defwRealPropDef("GROUP", "maxarea", 0, 0, nullptr); CHECK_STATUS(status); - status = defwStringPropDef("COMPONENT", "cc", 0, 0, NULL); + status = defwStringPropDef("COMPONENT", "cc", 0, 0, nullptr); CHECK_STATUS(status); - status = defwIntPropDef("COMPONENT", "index", 0, 0, NULL); + status = defwIntPropDef("COMPONENT", "index", 0, 0, nullptr); CHECK_STATUS(status); - status = defwRealPropDef("COMPONENT", "size", 0, 0, NULL); + status = defwRealPropDef("COMPONENT", "size", 0, 0, nullptr); CHECK_STATUS(status); - status = defwIntPropDef("NET", "alt", 0, 0, NULL); + status = defwIntPropDef("NET", "alt", 0, 0, nullptr); CHECK_STATUS(status); - status = defwStringPropDef("NET", "lastName", 0, 0, NULL); + status = defwStringPropDef("NET", "lastName", 0, 0, nullptr); CHECK_STATUS(status); - status = defwRealPropDef("NET", "length", 0, 0, NULL); + status = defwRealPropDef("NET", "length", 0, 0, nullptr); CHECK_STATUS(status); - status = defwStringPropDef("SPECIALNET", "contype", 0, 0, NULL); + status = defwStringPropDef("SPECIALNET", "contype", 0, 0, nullptr); CHECK_STATUS(status); - status = defwIntPropDef("SPECIALNET", "ind", 0, 0, NULL); + status = defwIntPropDef("SPECIALNET", "ind", 0, 0, nullptr); CHECK_STATUS(status); - status = defwRealPropDef("SPECIALNET", "maxlength", 0, 0, NULL); + status = defwRealPropDef("SPECIALNET", "maxlength", 0, 0, nullptr); CHECK_STATUS(status); status = defwStringPropDef("DESIGN", "title", 0, 0, "Buffer"); CHECK_STATUS(status); @@ -227,25 +227,25 @@ int propdefCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); status = defwRealPropDef("DESIGN", "howbig", 0, 0, 15.16); CHECK_STATUS(status); - status = defwRealPropDef("ROW", "minlength", 1.0, 100.0, NULL); + status = defwRealPropDef("ROW", "minlength", 1.0, 100.0, nullptr); CHECK_STATUS(status); - status = defwStringPropDef("ROW", "firstName", 0, 0, NULL); + status = defwStringPropDef("ROW", "firstName", 0, 0, nullptr); CHECK_STATUS(status); - status = defwIntPropDef("ROW", "idx", 0, 0, NULL); + status = defwIntPropDef("ROW", "idx", 0, 0, nullptr); CHECK_STATUS(status); - status = defwIntPropDef("COMPONENTPIN", "dpIgnoreTerm", 0, 0, NULL); + status = defwIntPropDef("COMPONENTPIN", "dpIgnoreTerm", 0, 0, nullptr); CHECK_STATUS(status); - status = defwStringPropDef("COMPONENTPIN", "dpBit", 0, 0, NULL); + status = defwStringPropDef("COMPONENTPIN", "dpBit", 0, 0, nullptr); CHECK_STATUS(status); - status = defwRealPropDef("COMPONENTPIN", "realProperty", 0, 0, NULL); + status = defwRealPropDef("COMPONENTPIN", "realProperty", 0, 0, nullptr); CHECK_STATUS(status); - status = defwStringPropDef("NET", "IGNOREOPTIMIZATION", 0, 0, NULL); + status = defwStringPropDef("NET", "IGNOREOPTIMIZATION", 0, 0, nullptr); CHECK_STATUS(status); - status = defwStringPropDef("SPECIALNET", "IGNOREOPTIMIZATION", 0, 0, NULL); + status = defwStringPropDef("SPECIALNET", "IGNOREOPTIMIZATION", 0, 0, nullptr); CHECK_STATUS(status); - status = defwRealPropDef("NET", "FREQUENCY", 0, 0, NULL); + status = defwRealPropDef("NET", "FREQUENCY", 0, 0, nullptr); CHECK_STATUS(status); - status = defwRealPropDef("SPECIALNET", "FREQUENCY", 0, 0, NULL); + status = defwRealPropDef("SPECIALNET", "FREQUENCY", 0, 0, nullptr); CHECK_STATUS(status); status = defwEndPropDef(); CHECK_STATUS(status); @@ -416,22 +416,22 @@ int componentCB(defwCallbackType_e c, defiUserData ud) status = defwComponent("Z38A01", "DFF3", 0, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "PLACED", 18592, 5400, 6, 0, - NULL, + nullptr, 0, 0, 0, @@ -440,22 +440,22 @@ int componentCB(defwCallbackType_e c, defiUserData ud) status = defwComponent("Z38A03", "DFF3", 0, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "PLACED", 16576, 45600, 6, 0, - NULL, + nullptr, 0, 0, 0, @@ -464,22 +464,22 @@ int componentCB(defwCallbackType_e c, defiUserData ud) status = defwComponent("Z38A05", "DFF3", 0, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "PLACED", 51520, 9600, 6, 0, - NULL, + nullptr, 0, 0, 0, @@ -488,17 +488,17 @@ int componentCB(defwCallbackType_e c, defiUserData ud) status = defwComponent("|i0", "INV_B", 0, - NULL, + nullptr, "INV", - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, 0, 0, -1, @@ -512,22 +512,22 @@ int componentCB(defwCallbackType_e c, defiUserData ud) status = defwComponent("|i1", "INV_B", 0, - NULL, + nullptr, "INV", - NULL, - NULL, - NULL, - 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + 0, + nullptr, + nullptr, + nullptr, + nullptr, "UNPLACED", 1000, 1000, 0, 0, - NULL, + nullptr, 0, 0, 0, @@ -536,22 +536,22 @@ int componentCB(defwCallbackType_e c, defiUserData ud) status = defwComponent("cell1", "CHM6A", 0, - NULL, - NULL, + nullptr, + nullptr, "generator", - NULL, + nullptr, "USER", 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "FIXED", 0, 10, 0, 100, - NULL, + nullptr, 0, 0, 0, @@ -560,22 +560,22 @@ int componentCB(defwCallbackType_e c, defiUserData ud) status = defwComponent("cell2", "CHM6A", 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "NETLIST", 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "COVER", 120, 10, 4, 2, - NULL, + nullptr, 0, 0, 0, @@ -588,10 +588,10 @@ int componentCB(defwCallbackType_e c, defiUserData ud) status = defwComponent("cell3", "CHM6A", 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "TIMING", 1, foreigns, @@ -612,16 +612,16 @@ int componentCB(defwCallbackType_e c, defiUserData ud) status = defwComponent("cell4", "CHM3A", 0, - NULL, + nullptr, "CHM6A", - NULL, - NULL, + nullptr, + nullptr, "DIST", 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "PLACED", 360, 10, @@ -642,22 +642,22 @@ int componentCB(defwCallbackType_e c, defiUserData ud) status = defwComponent("scancell1", "CHK3A", 0, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "PLACED", 500, 10, 7, 0, - NULL, + nullptr, 0, 0, 0, @@ -666,22 +666,22 @@ int componentCB(defwCallbackType_e c, defiUserData ud) status = defwComponent("scancell2", "CHK3A", 0, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, 0, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, "PLACED", 700, 10, 6, 0, - NULL, + nullptr, 0, 0, 0, @@ -707,15 +707,27 @@ int pinCB(defwCallbackType_e c, defiUserData ud) dataError(); status = defwStartPins(6); CHECK_STATUS(status); - status = defwPin( - "scanpin", "SCAN", 0, "INPUT", NULL, NULL, 0, 0, -1, NULL, 0, 0, 0, 0); + status = defwPin("scanpin", + "SCAN", + 0, + "INPUT", + nullptr, + nullptr, + 0, + 0, + -1, + nullptr, + 0, + 0, + 0, + 0); CHECK_STATUS(status); status = defwPin("pin1", "net1", 1, - NULL, + nullptr, "POWER", - NULL, + nullptr, 0, 0, -1, @@ -730,7 +742,7 @@ int pinCB(defwCallbackType_e c, defiUserData ud) 0, "INPUT", "SIGNAL", - NULL, + nullptr, 0, 0, -1, @@ -1057,17 +1069,17 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); status = defwNetPathStart("ROUTED"); CHECK_STATUS(status); - status = defwNetPathLayer("M2", 0, NULL); + status = defwNetPathLayer("M2", 0, nullptr); CHECK_STATUS(status); coorX[0] = strdup("14000"); coorY[0] = strdup("341440"); - coorValue[0] = NULL; + coorValue[0] = nullptr; coorX[1] = strdup("9600"); coorY[1] = strdup("*"); - coorValue[1] = NULL; + coorValue[1] = nullptr; coorX[2] = strdup("*"); coorY[2] = strdup("282400"); - coorValue[2] = NULL; + coorValue[2] = nullptr; status = defwNetPathPoint(3, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1076,7 +1088,7 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); coorX[0] = strdup("2400"); coorY[0] = strdup("*"); - coorValue[0] = NULL; + coorValue[0] = nullptr; status = defwNetPathPoint(1, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1085,14 +1097,14 @@ int netCB(defwCallbackType_e c, defiUserData ud) free((char*) coorY[1]); status = defwNetPathStart("NEW"); CHECK_STATUS(status); - status = defwNetPathLayer("M1", 1, NULL); + status = defwNetPathLayer("M1", 1, nullptr); CHECK_STATUS(status); coorX[0] = strdup("2400"); coorY[0] = strdup("282400"); - coorValue[0] = NULL; + coorValue[0] = nullptr; coorX[1] = strdup("240"); coorY[1] = strdup("*"); - coorValue[1] = NULL; + coorValue[1] = nullptr; status = defwNetPathPoint(2, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1150,14 +1162,30 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); status = defwNetConnection("Z38A01", "G", 0); CHECK_STATUS(status); - status = defwNetVpin( - "V_SUB3_XX100", NULL, -333, -333, 333, 333, "PLACED", 189560, 27300, 0); - CHECK_STATUS(status); - status = defwNetVpin( - "V_SUB2_XX100", NULL, -333, -333, 333, 333, "PLACED", 169400, 64500, 0); + status = defwNetVpin("V_SUB3_XX100", + nullptr, + -333, + -333, + 333, + 333, + "PLACED", + 189560, + 27300, + 0); + CHECK_STATUS(status); + status = defwNetVpin("V_SUB2_XX100", + nullptr, + -333, + -333, + 333, + 333, + "PLACED", + 169400, + 64500, + 0); CHECK_STATUS(status); status = defwNetVpin( - "V_SUB1_XX100", NULL, -333, -333, 333, 333, "PLACED", 55160, 31500, 0); + "V_SUB1_XX100", nullptr, -333, -333, 333, 333, "PLACED", 55160, 31500, 0); CHECK_STATUS(status); status = defwNetSubnetStart("SUB1_XX100"); CHECK_STATUS(status); @@ -1174,7 +1202,7 @@ int netCB(defwCallbackType_e c, defiUserData ud) coorValue[0] = strdup("0"); coorX[1] = strdup("*"); coorY[1] = strdup("30900"); - coorValue[1] = NULL; + coorValue[1] = nullptr; status = defwNetPathPoint(2, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1189,7 +1217,7 @@ int netCB(defwCallbackType_e c, defiUserData ud) coorValue[0] = strdup("0"); coorX[1] = strdup("56280"); coorY[1] = strdup("*"); - coorValue[1] = NULL; + coorValue[1] = nullptr; status = defwNetPathPoint(2, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1201,10 +1229,10 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); coorX[0] = strdup("*"); coorY[0] = strdup("31500"); - coorValue[0] = NULL; + coorValue[0] = nullptr; coorX[1] = strdup("55160"); coorY[1] = strdup("*"); - coorValue[1] = NULL; + coorValue[1] = nullptr; status = defwNetPathPoint(2, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1223,14 +1251,14 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); status = defwNetPathStart("ROUTED"); CHECK_STATUS(status); - status = defwNetPathLayer("M1", 0, NULL); + status = defwNetPathLayer("M1", 0, nullptr); CHECK_STATUS(status); coorX[0] = strdup("168280"); coorY[0] = strdup("63300"); coorValue[0] = strdup("7"); coorX[1] = strdup("*"); coorY[1] = strdup("64500"); - coorValue[1] = NULL; + coorValue[1] = nullptr; status = defwNetPathPoint(2, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1262,7 +1290,7 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); status = defwNetPathStart("ROUTED"); CHECK_STATUS(status); - status = defwNetPathLayer("M1", 0, NULL); + status = defwNetPathLayer("M1", 0, nullptr); CHECK_STATUS(status); coorX[0] = strdup("188400"); coorY[0] = strdup("26100"); @@ -1306,23 +1334,23 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); status = defwNetPathStart("ROUTED"); CHECK_STATUS(status); - status = defwNetPathLayer("M3", 0, NULL); + status = defwNetPathLayer("M3", 0, nullptr); CHECK_STATUS(status); coorX[0] = strdup("269400"); coorY[0] = strdup("64500"); coorValue[0] = strdup("0"); coorX[1] = strdup("*"); coorY[1] = strdup("54900"); - coorValue[1] = NULL; + coorValue[1] = nullptr; coorX[2] = strdup("170520"); coorY[2] = strdup("*"); - coorValue[2] = NULL; + coorValue[2] = nullptr; coorX[3] = strdup("*"); coorY[3] = strdup("37500"); - coorValue[3] = NULL; + coorValue[3] = nullptr; coorX[4] = strdup("*"); coorY[4] = strdup("30300"); - coorValue[4] = NULL; + coorValue[4] = nullptr; status = defwNetPathPoint(5, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1340,7 +1368,7 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); coorX[0] = strdup("171080"); coorY[0] = strdup("*"); - coorValue[0] = NULL; + coorValue[0] = nullptr; coorX[1] = strdup("17440"); coorY[1] = strdup("0"); coorValue[1] = strdup("0"); @@ -1355,7 +1383,7 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); coorX[0] = strdup("*"); coorY[0] = strdup("*"); - coorValue[0] = NULL; + coorValue[0] = nullptr; coorX[1] = strdup("*"); coorY[1] = strdup("26700"); coorValue[1] = strdup("8"); @@ -1370,7 +1398,7 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); coorX[0] = strdup("177800"); coorY[0] = strdup("*"); - coorValue[0] = NULL; + coorValue[0] = nullptr; status = defwNetPathPoint(1, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1416,7 +1444,7 @@ int netCB(defwCallbackType_e c, defiUserData ud) free((char*) coorValue[0]); status = defwNetPathStart("NEW"); CHECK_STATUS(status); - status = defwNetPathLayer("M3", 1, NULL); + status = defwNetPathLayer("M3", 1, nullptr); CHECK_STATUS(status); coorX[0] = strdup("55160"); coorY[0] = strdup("31500"); @@ -1446,10 +1474,10 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); coorX[0] = strdup("*"); coorY[0] = strdup("35700"); - coorValue[0] = NULL; + coorValue[0] = nullptr; coorX[1] = strdup("*"); coorY[1] = strdup("37500"); - coorValue[1] = NULL; + coorValue[1] = nullptr; status = defwNetPathPoint(2, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1501,11 +1529,11 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); status = defwNetPathStart("ROUTED"); CHECK_STATUS(status); - status = defwNetPathLayer("M1", 0, NULL); + status = defwNetPathLayer("M1", 0, nullptr); CHECK_STATUS(status); coorX[0] = strdup("1288210"); coorY[0] = strdup("580930"); - coorValue[0] = NULL; + coorValue[0] = nullptr; status = defwNetPathPoint(1, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1522,11 +1550,11 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); status = defwNetPathStart("NEW"); CHECK_STATUS(status); - status = defwNetPathLayer("M3", 0, NULL); + status = defwNetPathLayer("M3", 0, nullptr); CHECK_STATUS(status); coorX[0] = strdup("1141350"); coorY[0] = strdup("582820"); - coorValue[0] = NULL; + coorValue[0] = nullptr; status = defwNetPathPoint(1, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1543,22 +1571,22 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); status = defwNetPathStart("NEW"); CHECK_STATUS(status); - status = defwNetPathLayer("M1", 0, NULL); + status = defwNetPathLayer("M1", 0, nullptr); CHECK_STATUS(status); coorX[0] = strdup("1278410"); coorY[0] = strdup("275170"); - coorValue[0] = NULL; + coorValue[0] = nullptr; status = defwNetPathPoint(1, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); free((char*) coorY[0]); status = defwNetPathStart("NEW"); CHECK_STATUS(status); - status = defwNetPathLayer("M1", 0, NULL); + status = defwNetPathLayer("M1", 0, nullptr); CHECK_STATUS(status); coorX[0] = strdup("1141210"); coorY[0] = strdup("271250"); - coorValue[0] = NULL; + coorValue[0] = nullptr; status = defwNetPathPoint(1, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1567,7 +1595,7 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); coorX[0] = strdup("*"); coorY[0] = strdup("271460"); - coorValue[0] = NULL; + coorValue[0] = nullptr; status = defwNetPathPoint(1, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1576,7 +1604,7 @@ int netCB(defwCallbackType_e c, defiUserData ud) CHECK_STATUS(status); coorX[0] = strdup("1142820"); coorY[0] = strdup("*"); - coorValue[0] = NULL; + coorValue[0] = nullptr; status = defwNetPathPoint(1, coorX, coorY, coorValue); CHECK_STATUS(status); free((char*) coorX[0]); @@ -1625,11 +1653,12 @@ int groupCB(defwCallbackType_e c, defiUserData ud) status = defwGroup("group2", 1, groupExpr); CHECK_STATUS(status); free((char*) groupExpr[0]); - status = defwGroupRegion(0, 10, 1000, 1010, NULL); + status = defwGroupRegion(0, 10, 1000, 1010, nullptr); CHECK_STATUS(status); status = defwStringProperty("ggrp", "after the fall"); CHECK_STATUS(status); - status = defwGroupSoft("MAXHALFPERIMETER", 4000, "MAXX", 10000, NULL, NULL); + status = defwGroupSoft( + "MAXHALFPERIMETER", 4000, "MAXX", 10000, nullptr, nullptr); CHECK_STATUS(status); status = defwEndGroups(); CHECK_STATUS(status); @@ -1700,7 +1729,7 @@ main(int argc, char** argv) argv++; argc--; outfile = *argv; - if ((fout = fopen(outfile, "w")) == 0) { + if ((fout = fopen(outfile, "w")) == nullptr) { fprintf(stderr, "ERROR: could not open output file\n"); return 2; } diff --git a/src/odb/src/def/defzlib/defzlib.cpp b/src/odb/src/def/defzlib/defzlib.cpp index 9e97c1e754d..e5c0be3febe 100644 --- a/src/odb/src/def/defzlib/defzlib.cpp +++ b/src/odb/src/def/defzlib/defzlib.cpp @@ -56,7 +56,7 @@ size_t defGZip_read(FILE* file, char* buf, size_t len) defGZFile defGZipOpen(const char* gzipPath, const char* mode) { if (!gzipPath) - return NULL; + return nullptr; defGZFile fptr = gzopen(gzipPath, mode); @@ -66,7 +66,7 @@ defGZFile defGZipOpen(const char* gzipPath, const char* mode) defrSetReadFunction(defGZip_read); return (defGZFile) fptr; } else - return NULL; + return nullptr; } int defGZipClose(defGZFile filePtr) @@ -88,7 +88,7 @@ void defrSetGZipReadFunction() defGZFile defrGZipOpen(const char* gzipPath, const char* mode) { if (!gzipPath) - return NULL; + return nullptr; return gzopen(gzipPath, mode); } diff --git a/src/odb/src/defin/definPin.cpp b/src/odb/src/defin/definPin.cpp index 9fe3574cf26..a55229e26ce 100644 --- a/src/odb/src/defin/definPin.cpp +++ b/src/odb/src/defin/definPin.cpp @@ -55,7 +55,7 @@ definPin::definPin() _effective_width(0), _left_bus('['), _right_bus(']'), - _layer(0), + _layer(nullptr), _has_min_spacing(false), _has_effective_width(false), _has_placement(false) @@ -297,7 +297,7 @@ void definPin::portBegin() void definPin::portEnd() { - dbBPin* pin = 0; + dbBPin* pin = nullptr; if (!_rects.empty() || !_polygons.empty()) { pin = dbBPin::create(_cur_bterm); diff --git a/src/odb/src/lef/lef/lef_keywords.cpp b/src/odb/src/lef/lef/lef_keywords.cpp index 180ecf6d170..ea44d8da800 100644 --- a/src/odb/src/lef/lef/lef_keywords.cpp +++ b/src/odb/src/lef/lef/lef_keywords.cpp @@ -165,12 +165,12 @@ void lefReloadBuffer() if ((nb = (*lefSettings->ReadFunction)( lefData->lefrFile, lefData->current_buffer, 4)) != 4) { - lefData->next = NULL; + lefData->next = nullptr; return; } } else { if ((nb = fread(lefData->current_buffer, 1, 4, lefData->lefrFile)) != 4) { - lefData->next = NULL; + lefData->next = nullptr; return; } } @@ -205,7 +205,7 @@ void lefReloadBuffer() } if (nb <= 0) { - lefData->next = NULL; + lefData->next = nullptr; } else { lefData->next = lefData->current_buffer; lefData->last = lefData->current_buffer + nb - 1; @@ -225,7 +225,7 @@ int lefGetc() for (;;) { if (lefData->next > lefData->last) lefReloadBuffer(); - if (lefData->next == NULL) + if (lefData->next == nullptr) return EOF; int ch = *lefData->next++; @@ -302,9 +302,9 @@ void lefAddNumDefine(const char* token, double val) static int GetTokenFromStack(char* s) { - const char* ch; // utility variable - char* prS = NULL; // pointing to the previous char or s - char* save = s; // for debug printing + const char* ch; // utility variable + char* prS = nullptr; // pointing to the previous char or s + char* save = s; // for debug printing while (lefData->input_level >= 0) { for (ch = lefData->current_stack[lefData->input_level]; *ch != 0; @@ -569,7 +569,7 @@ void lefStoreAlias() lefError(1000, "Expecting '='"); /* now keep getting lines till we get one that contains &ENDALIAS */ - for (char* p = NULL; p == NULL;) { + for (char* p = nullptr; p == nullptr;) { int i; char* s = line; for (i = 0; i < tokenSize - 1; i++) { @@ -591,7 +591,7 @@ void lefStoreAlias() lefuc_array(line, uc_line); // make upper case copy p = strstr(uc_line, "&ENDALIAS"); // look for END_ALIAS - if (p != NULL) // if we find it + if (p != nullptr) // if we find it *(line + (p - uc_line)) = 0; // remove it from the line so_far += line; @@ -1198,11 +1198,11 @@ void lefInfo(int msgNum, const char* s) lefData->lef_nlines); } else { if (!lefData->hasOpenedLogFile) { - if ((lefData->lefrLog = fopen("lefRWarning.log", "w")) == 0) { + if ((lefData->lefrLog = fopen("lefRWarning.log", "w")) == nullptr) { printf( "WARNING (LEFPARS-3500): Unable to open the file lefRWarning.log " "in %s.\n", - getcwd(NULL, 64)); + getcwd(nullptr, 64)); printf("Info messages will not be printed.\n"); } else { lefData->hasOpenedLogFile = 1; @@ -1216,11 +1216,11 @@ void lefInfo(int msgNum, const char* s) lefData->lef_nlines); } } else { - if ((lefData->lefrLog = fopen("lefRWarning.log", "a")) == 0) { + if ((lefData->lefrLog = fopen("lefRWarning.log", "a")) == nullptr) { printf( "WARNING (LEFPARS-3500): Unable to open the file lefRWarning.log " "in %s.\n", - getcwd(NULL, 64)); + getcwd(nullptr, 64)); printf("Info messages will not be printed.\n"); } else { fprintf(lefData->lefrLog, @@ -1301,11 +1301,11 @@ void lefWarning(int msgNum, const char* s) lefData->lef_nlines); } else { if (!lefData->hasOpenedLogFile) { - if ((lefData->lefrLog = fopen("lefRWarning.log", "w")) == 0) { + if ((lefData->lefrLog = fopen("lefRWarning.log", "w")) == nullptr) { printf( "WARNING (LEFPARS-2500): Unable to open the file lefRWarning.log " "in %s.\n", - getcwd(NULL, 64)); + getcwd(nullptr, 64)); printf("Warning messages will not be printed.\n"); } else { lefData->hasOpenedLogFile = 1; @@ -1320,11 +1320,11 @@ void lefWarning(int msgNum, const char* s) lefData->lef_nlines); } } else { - if ((lefData->lefrLog = fopen("lefRWarning.log", "a")) == 0) { + if ((lefData->lefrLog = fopen("lefRWarning.log", "a")) == nullptr) { printf( "WARNING (LEFPARS-2501): Unable to open the file lefRWarning.log " "in %s.\n", - getcwd(NULL, 64)); + getcwd(nullptr, 64)); printf("Warning messages will not be printed.\n"); } else { fprintf(lefData->lefrLog, diff --git a/src/odb/src/lef/lef/lefiArray.cpp b/src/odb/src/lef/lef/lefiArray.cpp index 24f1a5ab677..7c4100a58b3 100644 --- a/src/odb/src/lef/lef/lefiArray.cpp +++ b/src/odb/src/lef/lef/lefiArray.cpp @@ -123,31 +123,31 @@ const char* lefiArrayFloorPlan::name() const // ***************************************************************************** lefiArray::lefiArray() : nameSize_(0), - name_(NULL), + name_(nullptr), patternsAllocated_(0), numPatterns_(0), - pattern_(NULL), + pattern_(nullptr), canAllocated_(0), numCan_(0), - canPlace_(NULL), + canPlace_(nullptr), cannotAllocated_(0), numCannot_(0), - cannotOccupy_(NULL), + cannotOccupy_(nullptr), tracksAllocated_(0), numTracks_(0), - track_(NULL), + track_(nullptr), gAllocated_(0), numG_(0), - gcell_(NULL), + gcell_(nullptr), hasDefault_(0), tableSize_(0), numDefault_(0), defaultAllocated_(0), - minPins_(NULL), - caps_(NULL), + minPins_(nullptr), + caps_(nullptr), numFloorPlans_(0), floorPlansAllocated_(0), - floors_(0) + floors_(nullptr) { Init(); } diff --git a/src/odb/src/lef/lef/lefiCrossTalk.cpp b/src/odb/src/lef/lef/lefiCrossTalk.cpp index aec6ed5d011..f5070a6c4c6 100644 --- a/src/odb/src/lef/lef/lefiCrossTalk.cpp +++ b/src/odb/src/lef/lef/lefiCrossTalk.cpp @@ -43,7 +43,7 @@ BEGIN_LEFDEF_PARSER_NAMESPACE // ***************************************************************************** lefiNoiseVictim::lefiNoiseVictim(double d) - : length_(0.0), numNoises_(0), noisesAllocated_(0), noises_(NULL) + : length_(0.0), numNoises_(0), noisesAllocated_(0), noises_(nullptr) { Init(d); } @@ -118,10 +118,10 @@ double lefiNoiseVictim::length() const lefiNoiseResistance::lefiNoiseResistance() : numNums_(0), numsAllocated_(0), - nums_(NULL), + nums_(nullptr), numVictims_(0), victimsAllocated_(0), - victims_(NULL) + victims_(nullptr) { Init(); } diff --git a/src/odb/src/lef/lef/lefiDebug.cpp b/src/odb/src/lef/lef/lefiDebug.cpp index 2e24f0ca2b5..167ae6f3203 100644 --- a/src/odb/src/lef/lef/lefiDebug.cpp +++ b/src/odb/src/lef/lef/lefiDebug.cpp @@ -124,7 +124,7 @@ const char* lefUpperCase(const char* str) int len = strlen(str) + 1; if (len > lefData->shiftBufLength) { - if (lefData->shiftBuf == 0) { + if (lefData->shiftBuf == nullptr) { len = len < 64 ? 64 : len; lefData->shiftBuf = (char*) lefMalloc(len); lefData->shiftBufLength = len; diff --git a/src/odb/src/lef/lef/lefiLayer.cpp b/src/odb/src/lef/lef/lefiLayer.cpp index e57dabb2e8e..a4fb6b8b9b1 100644 --- a/src/odb/src/lef/lef/lefiLayer.cpp +++ b/src/odb/src/lef/lef/lefiLayer.cpp @@ -45,7 +45,7 @@ BEGIN_LEFDEF_PARSER_NAMESPACE // lefiAntennaPWL // ***************************************************************************** -lefiAntennaPWL::lefiAntennaPWL() : d_(0), r_(0) +lefiAntennaPWL::lefiAntennaPWL() : d_(nullptr), r_(nullptr) { Init(); } @@ -54,8 +54,8 @@ lefiAntennaPWL* lefiAntennaPWL::create() { lefiAntennaPWL* pAntenna = (lefiAntennaPWL*) lefMalloc(sizeof(lefiAntennaPWL)); - pAntenna->d_ = 0; - pAntenna->r_ = 0; + pAntenna->d_ = nullptr; + pAntenna->r_ = nullptr; pAntenna->Init(); return pAntenna; @@ -157,13 +157,13 @@ void lefiLayerDensity::Init(const char* type) strcpy(type_, CASE(type)); oneEntry_ = 0; numFrequency_ = 0; - frequency_ = 0; + frequency_ = nullptr; numWidths_ = 0; - widths_ = 0; + widths_ = nullptr; numTableEntries_ = 0; - tableEntries_ = 0; + tableEntries_ = nullptr; numCutareas_ = 0; - cutareas_ = 0; + cutareas_ = nullptr; } void lefiLayerDensity::Destroy() @@ -618,9 +618,9 @@ lefiSpacingTable::lefiSpacingTable() void lefiSpacingTable::Init() { hasInfluence_ = 0; - parallel_ = 0; - influence_ = 0; - twoWidths_ = 0; // 5.7 + parallel_ = nullptr; + influence_ = nullptr; + twoWidths_ = nullptr; // 5.7 } void lefiSpacingTable::Destroy() @@ -649,7 +649,7 @@ void lefiSpacingTable::addParallelLength(int numLength, double* lengths) { lefiParallel* parallel; - if (parallel_ == 0) { + if (parallel_ == nullptr) { parallel = (lefiParallel*) lefMalloc(sizeof(lefiParallel)); parallel->Init(); parallel_ = parallel; @@ -728,7 +728,7 @@ void lefiSpacingTable::addTwoWidths(double width, { lefiTwoWidths* twoWidths; - if (twoWidths_ == 0) { + if (twoWidths_ == nullptr) { twoWidths = (lefiTwoWidths*) lefMalloc(sizeof(lefiTwoWidths)); twoWidths->Init(); twoWidths_ = twoWidths; @@ -750,8 +750,8 @@ void lefiOrthogonal::Init() { numAllocated_ = 0; numCutOrtho_ = 0; - cutWithin_ = 0; - ortho_ = 0; + cutWithin_ = nullptr; + ortho_ = nullptr; } lefiOrthogonal::~lefiOrthogonal() @@ -848,12 +848,12 @@ void lefiAntennaModel::Init() hasAntennaCumRoutingPlusCut_ = 0; // 5.7 hasAntennaGatePlusDiff_ = 0; // 5.7 hasAntennaAreaMinusDiff_ = 0; // 5.7 - antennaDiffAreaRatioPWL_ = 0; - antennaCumDiffAreaRatioPWL_ = 0; - antennaDiffSideAreaRatioPWL_ = 0; - antennaCumDiffSideAreaRatioPWL_ = 0; - antennaAreaDiffReducePWL_ = 0; // 5.7 - oxide_ = 0; + antennaDiffAreaRatioPWL_ = nullptr; + antennaCumDiffAreaRatioPWL_ = nullptr; + antennaDiffSideAreaRatioPWL_ = nullptr; + antennaCumDiffSideAreaRatioPWL_ = nullptr; + antennaAreaDiffReducePWL_ = nullptr; // 5.7 + oxide_ = nullptr; } void lefiAntennaModel::Destroy() @@ -865,31 +865,31 @@ void lefiAntennaModel::Destroy() if (antennaDiffAreaRatioPWL_) { antennaDiffAreaRatioPWL_->Destroy(); lefFree((char*) (antennaDiffAreaRatioPWL_)); - antennaDiffAreaRatioPWL_ = 0; + antennaDiffAreaRatioPWL_ = nullptr; } if (antennaCumDiffAreaRatioPWL_) { antennaCumDiffAreaRatioPWL_->Destroy(); lefFree((char*) (antennaCumDiffAreaRatioPWL_)); - antennaCumDiffAreaRatioPWL_ = 0; + antennaCumDiffAreaRatioPWL_ = nullptr; } if (antennaDiffSideAreaRatioPWL_) { antennaDiffSideAreaRatioPWL_->Destroy(); lefFree((char*) (antennaDiffSideAreaRatioPWL_)); - antennaDiffSideAreaRatioPWL_ = 0; + antennaDiffSideAreaRatioPWL_ = nullptr; } if (antennaCumDiffSideAreaRatioPWL_) { antennaCumDiffSideAreaRatioPWL_->Destroy(); lefFree((char*) (antennaCumDiffSideAreaRatioPWL_)); - antennaCumDiffSideAreaRatioPWL_ = 0; + antennaCumDiffSideAreaRatioPWL_ = nullptr; } if (antennaAreaDiffReducePWL_) { // 5.7 antennaAreaDiffReducePWL_->Destroy(); lefFree((char*) (antennaAreaDiffReducePWL_)); - antennaAreaDiffReducePWL_ = 0; + antennaAreaDiffReducePWL_ = nullptr; } } @@ -1269,11 +1269,11 @@ lefiAntennaPWL* lefiAntennaModel::antennaAreaDiffReducePWL() const // lefiLayer // ***************************************************************************** lefiLayer::lefiLayer() - : name_(NULL), + : name_(nullptr), nameSize_(0), - type_(NULL), + type_(nullptr), typeSize_(0), - layerType_(NULL), + layerType_(nullptr), hasPitch_(0), hasMask_(0), hasOffset_(0), @@ -1283,21 +1283,21 @@ lefiLayer::lefiLayer() hasDiagPitch_(0), hasDiagWidth_(0), hasDiagSpacing_(0), - hasSpacingName_(NULL), - hasSpacingLayerStack_(NULL), - hasSpacingAdjacent_(NULL), - hasSpacingRange_(NULL), - hasSpacingUseLengthThreshold_(NULL), - hasSpacingLengthThreshold_(NULL), - hasSpacingCenterToCenter_(NULL), - hasSpacingParallelOverlap_(NULL), - hasSpacingCutArea_(NULL), - hasSpacingEndOfLine_(NULL), - hasSpacingParellelEdge_(NULL), - hasSpacingTwoEdges_(NULL), - hasSpacingAdjacentExcept_(NULL), - hasSpacingSamenet_(NULL), - hasSpacingSamenetPGonly_(NULL), + hasSpacingName_(nullptr), + hasSpacingLayerStack_(nullptr), + hasSpacingAdjacent_(nullptr), + hasSpacingRange_(nullptr), + hasSpacingUseLengthThreshold_(nullptr), + hasSpacingLengthThreshold_(nullptr), + hasSpacingCenterToCenter_(nullptr), + hasSpacingParallelOverlap_(nullptr), + hasSpacingCutArea_(nullptr), + hasSpacingEndOfLine_(nullptr), + hasSpacingParellelEdge_(nullptr), + hasSpacingTwoEdges_(nullptr), + hasSpacingAdjacentExcept_(nullptr), + hasSpacingSamenet_(nullptr), + hasSpacingSamenetPGonly_(nullptr), hasArraySpacing_(0), hasDirection_(0), hasResistance_(0), @@ -1326,48 +1326,48 @@ lefiLayer::lefiLayer() numSpacings_(0), spacingsAllocated_(0), maskNumber_(0), - spacing_(NULL), - spacingAdjacentCuts_(NULL), - spacingAdjacentWithin_(NULL), - spacingCutArea_(NULL), - rangeMin_(NULL), - rangeMax_(NULL), - rangeInfluence_(NULL), - rangeInfluenceRangeMin_(NULL), - rangeInfluenceRangeMax_(NULL), - rangeRangeMin_(NULL), - rangeRangeMax_(NULL), - lengthThreshold_(NULL), - lengthThresholdRangeMin_(NULL), - lengthThresholdRangeMax_(NULL), + spacing_(nullptr), + spacingAdjacentCuts_(nullptr), + spacingAdjacentWithin_(nullptr), + spacingCutArea_(nullptr), + rangeMin_(nullptr), + rangeMax_(nullptr), + rangeInfluence_(nullptr), + rangeInfluenceRangeMin_(nullptr), + rangeInfluenceRangeMax_(nullptr), + rangeRangeMin_(nullptr), + rangeRangeMax_(nullptr), + lengthThreshold_(nullptr), + lengthThresholdRangeMin_(nullptr), + lengthThresholdRangeMax_(nullptr), numMinimumcut_(0), minimumcutAllocated_(0), - minimumcut_(NULL), - minimumcutWidth_(NULL), - hasMinimumcutWithin_(NULL), - minimumcutWithin_(NULL), - hasMinimumcutConnection_(NULL), - hasMinimumcutNumCuts_(NULL), - minimumcutLength_(NULL), - minimumcutDistance_(NULL), + minimumcut_(nullptr), + minimumcutWidth_(nullptr), + hasMinimumcutWithin_(nullptr), + minimumcutWithin_(nullptr), + hasMinimumcutConnection_(nullptr), + hasMinimumcutNumCuts_(nullptr), + minimumcutLength_(nullptr), + minimumcutDistance_(nullptr), maxwidth_(0.0), minwidth_(0.0), numMinenclosedarea_(0), minenclosedareaAllocated_(0), - minenclosedarea_(NULL), - minenclosedareaWidth_(NULL), + minenclosedarea_(nullptr), + minenclosedareaWidth_(nullptr), protrusionWidth1_(0.0), protrusionLength_(0.0), protrusionWidth2_(0.0), numMinstep_(0), numMinstepAlloc_(0), - minstep_(NULL), - minstepLengthsum_(NULL), - minstepMaxEdges_(NULL), - minstepMinAdjLength_(NULL), - minstepMinBetLength_(NULL), - minstepXSameCorners_(NULL), - direction_(NULL), + minstep_(nullptr), + minstepLengthsum_(nullptr), + minstepMaxEdges_(nullptr), + minstepMinAdjLength_(nullptr), + minstepMinBetLength_(nullptr), + minstepXSameCorners_(nullptr), + direction_(nullptr), resistance_(0.0), capacitance_(0.0), height_(0.0), @@ -1379,29 +1379,29 @@ lefiLayer::lefiLayer() antennaLength_(0.0), numCurrentPoints_(0), currentPointsAllocated_(0), - currentWidths_(NULL), - current_(NULL), + currentWidths_(nullptr), + current_(nullptr), numCapacitancePoints_(0), capacitancePointsAllocated_(0), - capacitanceWidths_(NULL), - capacitances_(NULL), + capacitanceWidths_(nullptr), + capacitances_(nullptr), numResistancePoints_(0), resistancePointsAllocated_(0), - resistanceWidths_(NULL), - resistances_(NULL), + resistanceWidths_(nullptr), + resistances_(nullptr), numProps_(0), propsAllocated_(0), - dvalues_(NULL), - types_(NULL), + dvalues_(nullptr), + types_(nullptr), numAccurrents_(0), accurrentAllocated_(0), - accurrents_(NULL), + accurrents_(nullptr), numDccurrents_(0), dccurrentAllocated_(0), - dccurrents_(NULL), + dccurrents_(nullptr), numNums_(0), numAllocated_(0), - nums_(NULL), + nums_(nullptr), hasAntennaAreaRatio_(0), hasAntennaDiffAreaRatio_(0), hasAntennaDiffAreaRatioPWL_(0), @@ -1418,10 +1418,10 @@ lefiLayer::lefiLayer() hasAntennaCumDiffSideAreaRatioPWL_(0), hasAntennaSideAreaFactor_(0), hasAntennaSideAreaFactorDUO_(0), - currentAntennaModel_(0), + currentAntennaModel_(nullptr), numAntennaModel_(0), antennaModelAllocated_(0), - antennaModel_(NULL), + antennaModel_(nullptr), hasSlotWireWidth_(0), hasSlotWireLength_(0), hasSlotWidth_(0), @@ -1452,42 +1452,42 @@ lefiLayer::lefiLayer() fillActiveSpacing_(0.0), numSpacingTable_(0), spacingTableAllocated_(0), - spacingTable_(NULL), + spacingTable_(nullptr), numEnclosure_(0), enclosureAllocated_(0), - overhang1_(NULL), - overhang2_(NULL), - encminWidth_(NULL), - cutWithin_(NULL), - minLength_(NULL), + overhang1_(nullptr), + overhang2_(nullptr), + encminWidth_(nullptr), + cutWithin_(nullptr), + minLength_(nullptr), numPreferEnclosure_(0), preferEnclosureAllocated_(0), - preferOverhang1_(NULL), - preferOverhang2_(NULL), - preferMinWidth_(NULL), + preferOverhang1_(nullptr), + preferOverhang2_(nullptr), + preferMinWidth_(nullptr), resPerCut_(0.0), diagMinEdgeLength_(0.0), numMinSize_(0), - minSizeWidth_(NULL), - minSizeLength_(NULL), - eolWidth_(NULL), - eolWithin_(NULL), - parSpace_(NULL), - parWithin_(NULL), + minSizeWidth_(nullptr), + minSizeLength_(nullptr), + eolWidth_(nullptr), + eolWithin_(nullptr), + parSpace_(nullptr), + parWithin_(nullptr), maxArea_(0.0), hasLongArray_(0), viaWidth_(0.0), cutSpacing_(0.0), numArrayCuts_(0), arrayCutsAllocated_(0), - arrayCuts_(NULL), - arraySpacings_(NULL), + arrayCuts_(nullptr), + arraySpacings_(nullptr), hasSpacingTableOrtho_(0), - spacingTableOrtho_(NULL), - notchLength_(NULL), - endOfNotchWidth_(NULL), - minNotchSpacing_(NULL), - eonotchLength_(NULL) + spacingTableOrtho_(nullptr), + notchLength_(nullptr), + endOfNotchWidth_(nullptr), + minNotchSpacing_(nullptr), + eonotchLength_(nullptr) { Init(); } @@ -1498,7 +1498,7 @@ void lefiLayer::Init() nameSize_ = 16; type_ = (char*) lefMalloc(16); typeSize_ = 16; - layerType_ = 0; + layerType_ = nullptr; numSpacings_ = 0; spacingsAllocated_ = 0; numMinimumcut_ = 0; @@ -1541,49 +1541,49 @@ void lefiLayer::Init() numArrayCuts_ = 0; arrayCutsAllocated_ = 0; cutSpacing_ = 0; // Initialize ARRAYSPACING - currentAntennaModel_ = 0; + currentAntennaModel_ = nullptr; numAntennaModel_ = 0; antennaModelAllocated_ = 0; - antennaModel_ = 0; + antennaModel_ = nullptr; hasSpacingTableOrtho_ = 0; - spacing_ = 0; - spacingName_ = 0; - spacingAdjacentCuts_ = 0; - spacingAdjacentWithin_ = 0; - hasSpacingName_ = 0; - hasSpacingLayerStack_ = 0; - hasSpacingAdjacent_ = 0; - hasSpacingCenterToCenter_ = 0; - hasSpacingParallelOverlap_ = 0; - hasSpacingEndOfLine_ = 0; - eolWidth_ = 0; - eolWithin_ = 0; - hasSpacingParellelEdge_ = 0; - parSpace_ = 0; - parWithin_ = 0; - hasSpacingTwoEdges_ = 0; - hasSpacingAdjacentExcept_ = 0; - hasSpacingSamenet_ = 0; - hasSpacingSamenetPGonly_ = 0; - hasSpacingCutArea_ = 0; - spacingCutArea_ = 0; - notchLength_ = 0; - endOfNotchWidth_ = 0; - minNotchSpacing_ = 0; - eonotchLength_ = 0; - rangeMin_ = 0; - rangeMax_ = 0; - rangeInfluence_ = 0; - rangeInfluenceRangeMin_ = 0; - rangeInfluenceRangeMax_ = 0; - rangeRangeMin_ = 0; - rangeRangeMax_ = 0; - lengthThreshold_ = 0; - lengthThresholdRangeMin_ = 0; - lengthThresholdRangeMax_ = 0; - hasSpacingRange_ = 0; - hasSpacingUseLengthThreshold_ = 0; - hasSpacingLengthThreshold_ = 0; + spacing_ = nullptr; + spacingName_ = nullptr; + spacingAdjacentCuts_ = nullptr; + spacingAdjacentWithin_ = nullptr; + hasSpacingName_ = nullptr; + hasSpacingLayerStack_ = nullptr; + hasSpacingAdjacent_ = nullptr; + hasSpacingCenterToCenter_ = nullptr; + hasSpacingParallelOverlap_ = nullptr; + hasSpacingEndOfLine_ = nullptr; + eolWidth_ = nullptr; + eolWithin_ = nullptr; + hasSpacingParellelEdge_ = nullptr; + parSpace_ = nullptr; + parWithin_ = nullptr; + hasSpacingTwoEdges_ = nullptr; + hasSpacingAdjacentExcept_ = nullptr; + hasSpacingSamenet_ = nullptr; + hasSpacingSamenetPGonly_ = nullptr; + hasSpacingCutArea_ = nullptr; + spacingCutArea_ = nullptr; + notchLength_ = nullptr; + endOfNotchWidth_ = nullptr; + minNotchSpacing_ = nullptr; + eonotchLength_ = nullptr; + rangeMin_ = nullptr; + rangeMax_ = nullptr; + rangeInfluence_ = nullptr; + rangeInfluenceRangeMin_ = nullptr; + rangeInfluenceRangeMax_ = nullptr; + rangeRangeMin_ = nullptr; + rangeRangeMax_ = nullptr; + lengthThreshold_ = nullptr; + lengthThresholdRangeMin_ = nullptr; + lengthThresholdRangeMax_ = nullptr; + hasSpacingRange_ = nullptr; + hasSpacingUseLengthThreshold_ = nullptr; + hasSpacingLengthThreshold_ = nullptr; clear(); } @@ -1596,121 +1596,121 @@ void lefiLayer::Destroy() typeSize_ = 0; if (spacing_) lefFree((char*) (spacing_)); - spacing_ = 0; + spacing_ = nullptr; if (spacingTable_) lefFree((char*) spacingTable_); - spacingTable_ = 0; + spacingTable_ = nullptr; if (spacingName_) lefFree((char*) (spacingName_)); - spacingName_ = 0; + spacingName_ = nullptr; if (spacingAdjacentCuts_) lefFree((char*) (spacingAdjacentCuts_)); - spacingAdjacentCuts_ = 0; + spacingAdjacentCuts_ = nullptr; if (spacingAdjacentWithin_) lefFree((char*) (spacingAdjacentWithin_)); - spacingAdjacentWithin_ = 0; + spacingAdjacentWithin_ = nullptr; if (hasSpacingName_) lefFree((char*) (hasSpacingName_)); - hasSpacingName_ = 0; + hasSpacingName_ = nullptr; if (hasSpacingLayerStack_) lefFree((char*) (hasSpacingLayerStack_)); - hasSpacingLayerStack_ = 0; + hasSpacingLayerStack_ = nullptr; if (hasSpacingAdjacent_) lefFree((char*) (hasSpacingAdjacent_)); - hasSpacingAdjacent_ = 0; + hasSpacingAdjacent_ = nullptr; if (hasSpacingCenterToCenter_) lefFree((char*) (hasSpacingCenterToCenter_)); - hasSpacingCenterToCenter_ = 0; + hasSpacingCenterToCenter_ = nullptr; if (hasSpacingParallelOverlap_) lefFree((char*) (hasSpacingParallelOverlap_)); - hasSpacingParallelOverlap_ = 0; + hasSpacingParallelOverlap_ = nullptr; if (hasSpacingEndOfLine_) lefFree((char*) (hasSpacingEndOfLine_)); - hasSpacingEndOfLine_ = 0; + hasSpacingEndOfLine_ = nullptr; if (eolWidth_) lefFree((char*) (eolWidth_)); - eolWidth_ = 0; + eolWidth_ = nullptr; if (eolWithin_) lefFree((char*) (eolWithin_)); - eolWithin_ = 0; + eolWithin_ = nullptr; if (hasSpacingParellelEdge_) lefFree((char*) (hasSpacingParellelEdge_)); - hasSpacingParellelEdge_ = 0; + hasSpacingParellelEdge_ = nullptr; if (parSpace_) lefFree((char*) (parSpace_)); - parSpace_ = 0; + parSpace_ = nullptr; if (parWithin_) lefFree((char*) (parWithin_)); - parWithin_ = 0; + parWithin_ = nullptr; if (hasSpacingTwoEdges_) lefFree((char*) (hasSpacingTwoEdges_)); - hasSpacingTwoEdges_ = 0; + hasSpacingTwoEdges_ = nullptr; if (hasSpacingAdjacentExcept_) lefFree((char*) (hasSpacingAdjacentExcept_)); - hasSpacingAdjacentExcept_ = 0; + hasSpacingAdjacentExcept_ = nullptr; if (hasSpacingSamenet_) lefFree((char*) (hasSpacingSamenet_)); - hasSpacingSamenet_ = 0; + hasSpacingSamenet_ = nullptr; if (hasSpacingSamenetPGonly_) lefFree((char*) (hasSpacingSamenetPGonly_)); - hasSpacingSamenetPGonly_ = 0; + hasSpacingSamenetPGonly_ = nullptr; if (hasSpacingCutArea_) lefFree((char*) (hasSpacingCutArea_)); - hasSpacingCutArea_ = 0; + hasSpacingCutArea_ = nullptr; if (spacingCutArea_) lefFree((char*) (spacingCutArea_)); - spacingCutArea_ = 0; + spacingCutArea_ = nullptr; if (notchLength_) lefFree((char*) (notchLength_)); - notchLength_ = 0; + notchLength_ = nullptr; if (endOfNotchWidth_) lefFree((char*) (endOfNotchWidth_)); - endOfNotchWidth_ = 0; + endOfNotchWidth_ = nullptr; if (minNotchSpacing_) lefFree((char*) (minNotchSpacing_)); - minNotchSpacing_ = 0; + minNotchSpacing_ = nullptr; if (eonotchLength_) lefFree((char*) (eonotchLength_)); - eonotchLength_ = 0; + eonotchLength_ = nullptr; if (rangeMin_) lefFree((char*) (rangeMin_)); - rangeMin_ = 0; + rangeMin_ = nullptr; if (rangeMax_) lefFree((char*) (rangeMax_)); - rangeMax_ = 0; + rangeMax_ = nullptr; if (rangeInfluence_) lefFree((char*) (rangeInfluence_)); - rangeInfluence_ = 0; + rangeInfluence_ = nullptr; if (rangeInfluenceRangeMin_) lefFree((char*) (rangeInfluenceRangeMin_)); - rangeInfluenceRangeMin_ = 0; + rangeInfluenceRangeMin_ = nullptr; if (rangeInfluenceRangeMax_) lefFree((char*) (rangeInfluenceRangeMax_)); - rangeInfluenceRangeMax_ = 0; + rangeInfluenceRangeMax_ = nullptr; if (rangeRangeMin_) lefFree((char*) (rangeRangeMin_)); - rangeRangeMin_ = 0; + rangeRangeMin_ = nullptr; if (rangeRangeMax_) lefFree((char*) (rangeRangeMax_)); - rangeRangeMax_ = 0; + rangeRangeMax_ = nullptr; if (lengthThreshold_) lefFree((char*) (lengthThreshold_)); - lengthThreshold_ = 0; + lengthThreshold_ = nullptr; if (lengthThresholdRangeMin_) lefFree((char*) (lengthThresholdRangeMin_)); - lengthThresholdRangeMin_ = 0; + lengthThresholdRangeMin_ = nullptr; if (lengthThresholdRangeMax_) lefFree((char*) (lengthThresholdRangeMax_)); - lengthThresholdRangeMax_ = 0; + lengthThresholdRangeMax_ = nullptr; if (hasSpacingRange_) lefFree((char*) (hasSpacingRange_)); - hasSpacingRange_ = 0; + hasSpacingRange_ = nullptr; if (hasSpacingUseLengthThreshold_) lefFree((char*) (hasSpacingUseLengthThreshold_)); - hasSpacingUseLengthThreshold_ = 0; + hasSpacingUseLengthThreshold_ = nullptr; if (hasSpacingLengthThreshold_) lefFree((char*) (hasSpacingLengthThreshold_)); - hasSpacingLengthThreshold_ = 0; + hasSpacingLengthThreshold_ = nullptr; lefFree((char*) (currentWidths_)); lefFree((char*) (current_)); lefFree((char*) (resistanceWidths_)); @@ -1744,7 +1744,7 @@ void lefiLayer::clear() *(type_) = 0; if (layerType_) { lefFree(layerType_); - layerType_ = 0; + layerType_ = nullptr; } hasMask_ = 0; hasPitch_ = 0; @@ -1789,7 +1789,7 @@ void lefiLayer::clear() numAccurrents_ = 0; accurrentAllocated_ = 0; lefFree((char*) (accurrents_)); - accurrents_ = 0; + accurrents_ = nullptr; } if (numDccurrents_) { for (i = 0; i < numDccurrents_; i++) { @@ -1800,7 +1800,7 @@ void lefiLayer::clear() numDccurrents_ = 0; dccurrentAllocated_ = 0; lefFree((char*) (dccurrents_)); - dccurrents_ = 0; + dccurrents_ = nullptr; } // 8/29/2001 - Wanda da Rosa. The following are 5.4 enhancements hasSlotWireWidth_ = 0; @@ -1877,10 +1877,10 @@ void lefiLayer::clear() } lefFree((char*) (antennaModel_)); - antennaModel_ = 0; + antennaModel_ = nullptr; } - currentAntennaModel_ = 0; + currentAntennaModel_ = nullptr; numAntennaModel_ = 0; antennaModelAllocated_ = 0; @@ -1929,8 +1929,8 @@ void lefiLayer::clear() lefFree((char*) (arrayCuts_)); lefFree((char*) (arraySpacings_)); } - arrayCuts_ = 0; - arraySpacings_ = 0; + arrayCuts_ = nullptr; + arraySpacings_ = nullptr; arrayCutsAllocated_ = 0; numArrayCuts_ = 0; @@ -2183,7 +2183,7 @@ void lefiLayer::addMinimumcut(int mincut, double width) hasMinimumcutWithin_[numMinimumcut_] = 0; minimumcutWithin_[numMinimumcut_] = 0; hasMinimumcutConnection_[numMinimumcut_] = 0; - minimumcutConnection_[numMinimumcut_] = 0; + minimumcutConnection_[numMinimumcut_] = nullptr; hasMinimumcutNumCuts_[numMinimumcut_] = 0; minimumcutLength_[numMinimumcut_] = 0; minimumcutDistance_[numMinimumcut_] = 0; @@ -2273,7 +2273,7 @@ void lefiLayer::addMinstep(double distance) minstepXSameCorners_ = mx; } minstep_[numMinstep_] = distance; - minstepType_[numMinstep_] = 0; + minstepType_[numMinstep_] = nullptr; minstepLengthsum_[numMinstep_] = -1; minstepMaxEdges_[numMinstep_] = -1; minstepMinAdjLength_[numMinstep_] = -1; @@ -2453,7 +2453,7 @@ void lefiLayer::setSpacingMin(double dist) if (spacingName_[i]) // is null if is not CUT layer nn[i] = spacingName_[i]; else - nn[i] = 0; + nn[i] = nullptr; nac[i] = spacingAdjacentCuts_[i]; naw[i] = spacingAdjacentWithin_[i]; nsn[i] = hasSpacingName_[i]; @@ -2571,7 +2571,7 @@ void lefiLayer::setSpacingMin(double dist) } hasSpacing_ = 1; spacing_[numSpacings_] = dist; - spacingName_[numSpacings_] = 0; + spacingName_[numSpacings_] = nullptr; hasSpacingName_[numSpacings_] = 0; hasSpacingLayerStack_[numSpacings_] = 0; spacingAdjacentCuts_[numSpacings_] = 0; @@ -3973,7 +3973,7 @@ const char* lefiLayer::propName(int i) const i, numProps_); lefiError(0, 1300, msg); - return 0; + return nullptr; } return names_[i]; } @@ -3988,7 +3988,7 @@ const char* lefiLayer::propValue(int i) const i, numProps_); lefiError(0, 1300, msg); - return 0; + return nullptr; } return values_[i]; } @@ -4088,7 +4088,7 @@ void lefiLayer::addAcFrequency() density->addFrequency(numNums_, nums_); numNums_ = 0; numAllocated_ = 0; - nums_ = 0; + nums_ = nullptr; } void lefiLayer::addAcCutarea() @@ -4098,7 +4098,7 @@ void lefiLayer::addAcCutarea() density->addCutarea(numNums_, nums_); numNums_ = 0; numAllocated_ = 0; - nums_ = 0; + nums_ = nullptr; } void lefiLayer::addAcTableEntry() @@ -4108,7 +4108,7 @@ void lefiLayer::addAcTableEntry() density->addTableEntry(numNums_, nums_); numNums_ = 0; numAllocated_ = 0; - nums_ = 0; + nums_ = nullptr; } void lefiLayer::addAcWidth() @@ -4118,7 +4118,7 @@ void lefiLayer::addAcWidth() density->addWidth(numNums_, nums_); numNums_ = 0; numAllocated_ = 0; - nums_ = 0; + nums_ = nullptr; } void lefiLayer::setDcOneEntry(double num) @@ -4156,7 +4156,7 @@ void lefiLayer::addDcCutarea() density->addCutarea(numNums_, nums_); numNums_ = 0; numAllocated_ = 0; - nums_ = 0; + nums_ = nullptr; } void lefiLayer::addDcTableEntry() @@ -4166,7 +4166,7 @@ void lefiLayer::addDcTableEntry() density->addTableEntry(numNums_, nums_); numNums_ = 0; numAllocated_ = 0; - nums_ = 0; + nums_ = nullptr; } void lefiLayer::addDcWidth() @@ -4176,7 +4176,7 @@ void lefiLayer::addDcWidth() density->addWidth(numNums_, nums_); numNums_ = 0; numAllocated_ = 0; - nums_ = 0; + nums_ = nullptr; } void lefiLayer::addNumber(double num) @@ -4223,14 +4223,14 @@ int lefiLayer::numDccurrentDensity() const lefiLayerDensity* lefiLayer::accurrent(int index) const { if (index >= numAccurrents_) - return 0; + return nullptr; return (accurrents_[index]); } lefiLayerDensity* lefiLayer::dccurrent(int index) const { if (index >= numDccurrents_) - return 0; + return nullptr; return (dccurrents_[index]); } @@ -4628,7 +4628,7 @@ void lefiLayer::addSpParallelLength() sp->addParallelLength(numNums_, nums_); numNums_ = 0; numAllocated_ = 0; - nums_ = 0; + nums_ = nullptr; } void lefiLayer::addSpParallelWidth(double width) @@ -4648,7 +4648,7 @@ void lefiLayer::addSpParallelWidthSpacing() lefFree((char*) (nums_)); numNums_ = 0; numAllocated_ = 0; - nums_ = 0; + nums_ = nullptr; } void lefiLayer::addSpTwoWidths(double width, double runLength) @@ -4669,7 +4669,7 @@ void lefiLayer::addSpTwoWidths(double width, double runLength) lefFree((char*) (nums_)); numNums_ = 0; numAllocated_ = 0; - nums_ = 0; + nums_ = nullptr; hasTwoWidthPRL_ = 0; } @@ -4751,11 +4751,11 @@ void lefiLayer::addEnclosure(char* enclRule, double overhang1, double overhang2) } if (enclRule) { if (strcmp(enclRule, "NULL") == 0) - enclosureRules_[numEnclosure_] = NULL; + enclosureRules_[numEnclosure_] = nullptr; else enclosureRules_[numEnclosure_] = strdup(enclRule); } else - enclosureRules_[numEnclosure_] = NULL; + enclosureRules_[numEnclosure_] = nullptr; overhang1_[numEnclosure_] = overhang1; overhang2_[numEnclosure_] = overhang2; encminWidth_[numEnclosure_] = 0; @@ -4872,7 +4872,7 @@ void lefiLayer::addPreferEnclosure(char* enclRule, preferMinWidth_ = mw; } if (strcmp(enclRule, "NULL") == 0) - preferEnclosureRules_[numPreferEnclosure_] = NULL; + preferEnclosureRules_[numPreferEnclosure_] = nullptr; else preferEnclosureRules_[numPreferEnclosure_] = strdup(enclRule); preferOverhang1_[numPreferEnclosure_] = overhang1; @@ -4966,8 +4966,8 @@ void lefiLayer::setMinSize(lefiGeometries* geom) minSizeLength_[i] = tempPoly.y[i]; } } else { - minSizeWidth_ = 0; - minSizeLength_ = 0; + minSizeWidth_ = nullptr; + minSizeLength_ = nullptr; } } @@ -5052,7 +5052,7 @@ char* lefiLayer::minstepType(int index) const index, numMinstep_); lefiError(0, 1302, msg); - return 0; + return nullptr; } return minstepType_[index]; } @@ -5295,10 +5295,10 @@ void lefiLayer::parseSpacing(int index) return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); spValue = atof(value); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if ((strcmp(value, "CENTERTOCENTER") == 0) || (strcmp(value, "SAMENET") == 0) || (strcmp(value, "LAYER") == 0) || (strcmp(value, "ADJACENTCUTS") == 0) @@ -5328,29 +5328,29 @@ void lefiLayer::parseSpacing(int index) if (strcmp(value, "CENTERTOCENTER") == 0) { // SPACING minSpacing CENTERTOCENTER ; setSpacingCenterToCenter(); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (*value == ';') { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); continue; // Look for a new statement } } if (strcmp(value, "SAMENET") == 0) { // SPACING minSpacing SAMENET ; setSpacingSamenet(); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (*value == ';') { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); continue; // Look for a new statement } } if (strcmp(value, "LAYER") == 0) { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (value && *value != '\n') { setSpacingName(value); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (strcmp(value, "STACK") == 0) { setSpacingLayerStack(); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (*value != ';') { /* sprintf(msg, "ERROR (LEFPARS-1320): Incorrect @@ -5393,12 +5393,12 @@ void lefiLayer::parseSpacing(int index) free(wrkingStr); return; } else { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); continue; } } } else if (strcmp(value, "ADJACENTCUTS") == 0) { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); numCuts = atoi(value); if ((numCuts < 2) || (numCuts > 4)) { /* @@ -5421,15 +5421,15 @@ void lefiLayer::parseSpacing(int index) free(wrkingStr); return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (strcmp(value, "WITHIN") == 0) { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); within = atof(value); setSpacingAdjacent(numCuts, within); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (strcmp(value, "EXCEPTSAMEPGNET") == 0) { setSpacingAdjacentExcept(); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (*value != ';') { /* sprintf(msg, "ERROR (LEFPARS-1320): Incorrect @@ -5472,7 +5472,7 @@ void lefiLayer::parseSpacing(int index) free(wrkingStr); return; } else { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); } } else { /* @@ -5498,7 +5498,7 @@ void lefiLayer::parseSpacing(int index) } else if (strcmp(value, "PARALLELOVERLAP") == 0) { // SPACING minSpacing PARALLELOVERLAP ; setSpacingParallelOverlap(); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (*value != ';') { /* sprintf(msg, "ERROR (LEFPARS-1320): Incorrect syntax @@ -5520,13 +5520,13 @@ void lefiLayer::parseSpacing(int index) free(wrkingStr); return; } else { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); } } else if (strcmp(value, "AREA") == 0) { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); cutArea = atof(value); setSpacingArea(cutArea); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (*value != ';') { /* sprintf(msg, "ERROR (LEFPARS-1320): Incorrect syntax @@ -5548,7 +5548,7 @@ void lefiLayer::parseSpacing(int index) free(wrkingStr); return; } else { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); } } } else if (strcmp(value, "SAMEMETAL") == 0) { @@ -5587,32 +5587,32 @@ void lefiLayer::parseSpacing(int index) twoEdges = 0; - value = strtok(NULL, " "); + value = strtok(nullptr, " "); width = atof(value); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (strcmp(value, "WITHIN") == 0) { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); within = atof(value); // * setSpacingMin(spValue); // * setSpacingEol(width, within); // Check if option [PARALLELEDGE parSpace WITHIN parWithin] is set - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (value && *value != '\n') { if (strcmp(value, "PARALLELEDGE") == 0) { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); pValue = atof(value); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (strcmp(value, "WITHIN") == 0) { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); pWithin = atof(value); // * setSpacingParSW(pValue, pWithin); // Check if TWOEDGES is set - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (value && *value != '\n') { if (strcmp(value, "TWOEDGES") == 0) { // * setSpacingParTwoEdges(); twoEdges = 1; - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (*value == ';') { // Save the value to lefiLayer class setSpacingMin(spValue); @@ -5620,14 +5620,14 @@ void lefiLayer::parseSpacing(int index) setSpacingParSW(pValue, pWithin); if (twoEdges) setSpacingParTwoEdges(); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); continue; // with the while loop } else { // More rules, skip to ; while ((value) && (*value != ';') && (*value != '\n')) - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if ((value) && (*value == ';')) { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); continue; } } @@ -5635,14 +5635,14 @@ void lefiLayer::parseSpacing(int index) setSpacingMin(spValue); setSpacingEol(width, within); setSpacingParSW(pValue, pWithin); - value = strtok(NULL, " "); // done with this - continue; // statement with the while loop + value = strtok(nullptr, " "); // done with this + continue; // statement with the while loop } else { // More rules, skip to ; while ((value) && (*value != ';') && (*value != '\n')) - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if ((value) && (*value == ';')) { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); continue; } } @@ -5699,13 +5699,13 @@ void lefiLayer::parseSpacing(int index) // Save the data in lefiLayer lefData->first setSpacingMin(spValue); setSpacingEol(width, within); - value = strtok(NULL, " "); // done with this + value = strtok(nullptr, " "); // done with this continue; } else { while ((value) && (*value != ';') && (*value != '\n')) - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if ((value) && (*value == ';')) { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); continue; } } @@ -5813,7 +5813,7 @@ void lefiLayer::parseArraySpacing(int index) free(wrkingStr); return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); while (strcmp(value, ";") != 0) { if (strcmp(value, "LONGARRAY") == 0) { @@ -5836,7 +5836,7 @@ void lefiLayer::parseArraySpacing(int index) return; } hasLongArray = 1; - value = strtok(NULL, " "); + value = strtok(nullptr, " "); } else if (strcmp(value, "WIDTH") == 0) { if (cutSpacing != 0) { // make sure syntax has correct order /* @@ -5856,9 +5856,9 @@ void lefiLayer::parseArraySpacing(int index) free(wrkingStr); return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); viaWidth = atof(value); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); } else if (strcmp(value, "CUTSPACING") == 0) { if (cutSpacing != 0) { // make sure syntax has correct order /* @@ -5878,7 +5878,7 @@ void lefiLayer::parseArraySpacing(int index) free(wrkingStr); return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); cutSpacing = atof(value); /* setArraySpacing(hasLongArray, viaWidth, cutSpacing); @@ -5887,7 +5887,7 @@ void lefiLayer::parseArraySpacing(int index) setArraySpacingLongArray(); setArraySpacingWidth(viaWidth); setArraySpacingCut(cutSpacing); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); } else if (strcmp(value, "ARRAYCUTS") == 0) { if (cutSpacing == 0) { // make sure cutSpacing is already set /* @@ -5909,9 +5909,9 @@ void lefiLayer::parseArraySpacing(int index) free(wrkingStr); return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); arrayCuts = atoi(value); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (strcmp(value, "SPACING") != 0) { /* sprintf(msg, "ERROR (LEFPARS-1312): Incorrect syntax defined @@ -5931,13 +5931,13 @@ void lefiLayer::parseArraySpacing(int index) free(wrkingStr); return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); arraySpacing = atof(value); /* addArrayCuts(arrayCuts, arraySpacing); */ addArraySpacingArray(arrayCuts, arraySpacing); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); hasArrayCut = 1; } else { // Doesn't match any of the format /* @@ -6032,10 +6032,10 @@ void lefiLayer::parseMinstep(int index) return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); minStepLength = atof(value); // addMinstep(minStepLength); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); while (done == 0) { if (value && *value != '\n') { if (strcmp(value, "MAXEDGES") == 0) { @@ -6059,10 +6059,10 @@ void lefiLayer::parseMinstep(int index) free(wrkingStr); // done parsing return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); maxEdges = atoi(value); // addMinstepMaxedges(maxEdges); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); } else if (strcmp(value, "MINADJACENTLENGTH") == 0) { if (minBetLength) { // MINBETWEENLENGTH has defined, it is either MINADJACENTLENGTH @@ -6085,10 +6085,10 @@ void lefiLayer::parseMinstep(int index) free(wrkingStr); // done parsing return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); minAdjLength = atof(value); // addMinstepMinAdjLength(minAdjLength); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); } else if (strcmp(value, "MINBETWEENLENGTH") == 0) { if (minAdjLength) { // minadjACENTLENGTH has defined, it is either MINBETWEENLENGTH @@ -6111,15 +6111,15 @@ void lefiLayer::parseMinstep(int index) free(wrkingStr); // done parsing return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); minBetLength = atof(value); // addMinstepMinBetLength(minBetLength); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); } else if (strcmp(value, "EXCEPTSAMECORNERS") == 0) { if (minBetLength) { xSameCorners = 1; // addMinstepXSameCorners(); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); } else { /* sprintf(msg, "ERROR (LEFPARS-1315): Incorrect syntax @@ -6255,7 +6255,7 @@ void lefiLayer::parseAntennaGatePlus(int index) return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); pDiffFactor = atof(value); if (numAntennaModel_ == 0) { // haven't created any antannaModel yet @@ -6295,7 +6295,7 @@ void lefiLayer::parseAntennaAreaMinus(int index) return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); mDiffFactor = atof(value); if (numAntennaModel_ == 0) { // haven't created any antannaModel yet @@ -6339,19 +6339,19 @@ void lefiLayer::parseAntennaAreaDiff(int index) return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (strcmp(value, "(") == 0) { // beginning of ( ( d1 r1 ) ( d2 r2 ) ... ) pwlPtr = lefiAntennaPWL::create(); while (done == 0) { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (strcmp(value, "(") == 0) { - value = strtok(NULL, " "); + value = strtok(nullptr, " "); diffA = atof(value); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); diffF = atof(value); pwlPtr->addAntennaPWL(diffA, diffF); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); if (strcmp(value, ")") != 0) { break; } @@ -6398,7 +6398,7 @@ void lefiLayer::parseLayerEnclosure(int index) char* value; char msg[1024]; int overh = 0, width = 0, except = 0, length = 0; - char* enclRule = 0; + char* enclRule = nullptr; double overhang1 = 0, overhang2 = 0, minWidth = 0, cutWithin = 0, minLength = 0; @@ -6441,7 +6441,7 @@ void lefiLayer::parseLayerEnclosure(int index) return; } - value = strtok(NULL, " "); + value = strtok(nullptr, " "); while (strcmp(value, ";") != 0) { if (strcmp(value, "CUTCLASS") == 0) { @@ -6474,7 +6474,7 @@ void lefiLayer::parseLayerEnclosure(int index) return; } enclRule = strdup(value); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); } else if (strcmp(value, "WIDTH") == 0) { if ((!overh)) { /* @@ -6496,14 +6496,14 @@ void lefiLayer::parseLayerEnclosure(int index) free(enclRule); return; } - minWidth = strtod(strtok(NULL, " "), 0); - value = strtok(NULL, " "); + minWidth = strtod(strtok(nullptr, " "), nullptr); + value = strtok(nullptr, " "); width = 1; if (strcmp(value, "EXCEPTEXTRACUT") == 0) { // continue with WIDTH except = 1; - value = strtok(NULL, " "); - cutWithin = strtod(value, 0); - value = strtok(NULL, " "); + value = strtok(nullptr, " "); + cutWithin = strtod(value, nullptr); + value = strtok(nullptr, " "); if (strcmp(value, "NOSHAREDEDGE") == 0) { // 5.8 syntax but not in OA data model free(wrkingStr); @@ -6533,8 +6533,8 @@ void lefiLayer::parseLayerEnclosure(int index) free(enclRule); return; } - minLength = strtod(strtok(NULL, " "), 0); - value = strtok(NULL, " "); + minLength = strtod(strtok(nullptr, " "), nullptr); + value = strtok(nullptr, " "); length = 1; } else { if (overh == 1) { // Already has overhang value @@ -6557,10 +6557,10 @@ void lefiLayer::parseLayerEnclosure(int index) free(enclRule); return; } - overhang1 = strtod(value, 0); - overhang2 = strtod(strtok(NULL, " "), 0); + overhang1 = strtod(value, nullptr); + overhang2 = strtod(strtok(nullptr, " "), nullptr); overh = 1; // set the flag on - value = strtok(NULL, " "); + value = strtok(nullptr, " "); } } if (!overh) { diff --git a/src/odb/src/lef/lef/lefiMacro.cpp b/src/odb/src/lef/lef/lefiMacro.cpp index 4a46ba9bca0..1701dea9c3a 100644 --- a/src/odb/src/lef/lef/lefiMacro.cpp +++ b/src/odb/src/lef/lef/lefiMacro.cpp @@ -44,14 +44,14 @@ BEGIN_LEFDEF_PARSER_NAMESPACE // lefiObstruction // ***************************************************************************** -lefiObstruction::lefiObstruction() : geometries_(NULL) +lefiObstruction::lefiObstruction() : geometries_(nullptr) { Init(); } void lefiObstruction::Init() { - geometries_ = 0; + geometries_ = nullptr; } lefiObstruction::~lefiObstruction() @@ -70,7 +70,7 @@ void lefiObstruction::clear() geometries_->Destroy(); lefFree((char*) (geometries_)); } - geometries_ = 0; + geometries_ = nullptr; } void lefiObstruction::setGeometries(lefiGeometries* g) @@ -101,11 +101,11 @@ void lefiObstruction::print(FILE* f) const lefiDensity::lefiDensity() : numLayers_(0), layersAllocated_(0), - layerName_(NULL), - numRects_(NULL), - rectsAllocated_(NULL), - rects_(NULL), - densityValue_(NULL) + layerName_(nullptr), + numRects_(nullptr), + rectsAllocated_(nullptr), + rects_(nullptr), + densityValue_(nullptr) { Init(); } @@ -140,13 +140,13 @@ void lefiDensity::clear() lefFree((char*) (densityValue_)); lefFree((char*) (numRects_)); lefFree((char*) (rectsAllocated_)); - layerName_ = 0; + layerName_ = nullptr; numLayers_ = 0; layersAllocated_ = 0; - numRects_ = 0; - rects_ = 0; - densityValue_ = 0; - rectsAllocated_ = 0; + numRects_ = nullptr; + rects_ = nullptr; + densityValue_ = nullptr; + rectsAllocated_ = nullptr; } void lefiDensity::addLayer(const char* name) @@ -188,8 +188,8 @@ void lefiDensity::addLayer(const char* name) layerName_[numLayers_] = strdup(name); numRects_[numLayers_] = 0; rectsAllocated_[numLayers_] = 0; - rects_[numLayers_] = 0; - densityValue_[numLayers_] = 0; + rects_[numLayers_] = nullptr; + densityValue_[numLayers_] = nullptr; numLayers_ += 1; } @@ -297,24 +297,24 @@ void lefiDensity::print(FILE* f) const // ***************************************************************************** lefiPinAntennaModel::lefiPinAntennaModel() - : oxide_(NULL), + : oxide_(nullptr), hasReturn_(0), numAntennaGateArea_(0), antennaGateAreaAllocated_(0), - antennaGateArea_(NULL), - antennaGateAreaLayer_(NULL), + antennaGateArea_(nullptr), + antennaGateAreaLayer_(nullptr), numAntennaMaxAreaCar_(0), antennaMaxAreaCarAllocated_(0), - antennaMaxAreaCar_(NULL), - antennaMaxAreaCarLayer_(NULL), + antennaMaxAreaCar_(nullptr), + antennaMaxAreaCarLayer_(nullptr), numAntennaMaxSideAreaCar_(0), antennaMaxSideAreaCarAllocated_(0), - antennaMaxSideAreaCar_(NULL), - antennaMaxSideAreaCarLayer_(NULL), + antennaMaxSideAreaCar_(nullptr), + antennaMaxSideAreaCarLayer_(nullptr), numAntennaMaxCutCar_(0), antennaMaxCutCarAllocated_(0), - antennaMaxCutCar_(NULL), - antennaMaxCutCarLayer_(NULL) + antennaMaxCutCar_(nullptr), + antennaMaxCutCarLayer_(nullptr) { Init(); } @@ -343,7 +343,7 @@ void lefiPinAntennaModel::Init() antennaMaxCutCar_ = (double*) lefMalloc(sizeof(double)); antennaMaxCutCarLayer_ = (char**) lefMalloc(sizeof(char*)); - oxide_ = 0; + oxide_ = nullptr; hasReturn_ = 0; } @@ -358,7 +358,7 @@ void lefiPinAntennaModel::clear() if (oxide_) { lefFree((char*) (oxide_)); - oxide_ = 0; + oxide_ = nullptr; hasReturn_ = 0; } @@ -370,7 +370,7 @@ void lefiPinAntennaModel::clear() numAntennaGateArea_ = 0; lefFree((char*) (antennaGateAreaLayer_)); - antennaGateAreaLayer_ = NULL; + antennaGateAreaLayer_ = nullptr; } if (antennaMaxAreaCarLayer_) { @@ -380,7 +380,7 @@ void lefiPinAntennaModel::clear() } numAntennaMaxAreaCar_ = 0; lefFree((char*) (antennaMaxAreaCarLayer_)); - antennaMaxAreaCarLayer_ = NULL; + antennaMaxAreaCarLayer_ = nullptr; } if (antennaMaxSideAreaCarLayer_) { @@ -390,7 +390,7 @@ void lefiPinAntennaModel::clear() } numAntennaMaxSideAreaCar_ = 0; lefFree((char*) (antennaMaxSideAreaCarLayer_)); - antennaMaxSideAreaCarLayer_ = NULL; + antennaMaxSideAreaCarLayer_ = nullptr; } if (antennaMaxCutCarLayer_) { @@ -400,20 +400,20 @@ void lefiPinAntennaModel::clear() } numAntennaMaxCutCar_ = 0; lefFree((char*) (antennaMaxCutCarLayer_)); - antennaMaxCutCarLayer_ = NULL; + antennaMaxCutCarLayer_ = nullptr; } lefFree((char*) (antennaGateArea_)); - antennaGateArea_ = NULL; + antennaGateArea_ = nullptr; lefFree((char*) (antennaMaxAreaCar_)); - antennaMaxAreaCar_ = NULL; + antennaMaxAreaCar_ = nullptr; lefFree((char*) (antennaMaxSideAreaCar_)); - antennaMaxSideAreaCar_ = NULL; + antennaMaxSideAreaCar_ = nullptr; lefFree((char*) (antennaMaxCutCar_)); - antennaMaxCutCar_ = NULL; + antennaMaxCutCar_ = nullptr; } // 5.5 @@ -424,7 +424,7 @@ void lefiPinAntennaModel::setAntennaModel(int aOxide) } if (aOxide < 1 || aOxide > lefMaxOxides) { - oxide_ = NULL; + oxide_ = nullptr; } else { oxide_ = strdup(lefrSettings::lefOxides[aOxide - 1]); } @@ -461,7 +461,7 @@ void lefiPinAntennaModel::addAntennaGateArea(double val, const char* layer) antennaGateAreaLayer_[numAntennaGateArea_] = (char*) lefMalloc(len); strcpy(antennaGateAreaLayer_[numAntennaGateArea_], layer); } else - antennaGateAreaLayer_[numAntennaGateArea_] = NULL; + antennaGateAreaLayer_[numAntennaGateArea_] = nullptr; numAntennaGateArea_ += 1; } @@ -496,7 +496,7 @@ void lefiPinAntennaModel::addAntennaMaxAreaCar(double val, const char* layer) antennaMaxAreaCarLayer_[numAntennaMaxAreaCar_] = (char*) lefMalloc(len); strcpy(antennaMaxAreaCarLayer_[numAntennaMaxAreaCar_], layer); } else - antennaMaxAreaCarLayer_[numAntennaMaxAreaCar_] = NULL; + antennaMaxAreaCarLayer_[numAntennaMaxAreaCar_] = nullptr; numAntennaMaxAreaCar_ += 1; } @@ -533,7 +533,7 @@ void lefiPinAntennaModel::addAntennaMaxSideAreaCar(double val, = (char*) lefMalloc(len); strcpy(antennaMaxSideAreaCarLayer_[numAntennaMaxSideAreaCar_], layer); } else - antennaMaxSideAreaCarLayer_[numAntennaMaxSideAreaCar_] = NULL; + antennaMaxSideAreaCarLayer_[numAntennaMaxSideAreaCar_] = nullptr; numAntennaMaxSideAreaCar_ += 1; } @@ -568,7 +568,7 @@ void lefiPinAntennaModel::addAntennaMaxCutCar(double val, const char* layer) antennaMaxCutCarLayer_[numAntennaMaxCutCar_] = (char*) lefMalloc(len); strcpy(antennaMaxCutCarLayer_[numAntennaMaxCutCar_], layer); } else - antennaMaxCutCarLayer_[numAntennaMaxCutCar_] = NULL; + antennaMaxCutCarLayer_[numAntennaMaxCutCar_] = nullptr; numAntennaMaxCutCar_ += 1; } @@ -675,7 +675,7 @@ int lefiPinAntennaModel::hasReturn() const lefiPin::lefiPin() : nameSize_(0), - name_(NULL), + name_(nullptr), hasLEQ_(0), hasDirection_(0), hasUse_(0), @@ -707,16 +707,16 @@ lefiPin::lefiPin() hasFallSlewLimit_(0), numForeigns_(0), foreignAllocated_(0), - hasForeignOrient_(NULL), - hasForeignPoint_(NULL), - foreignOrient_(NULL), - foreignX_(NULL), - foreignY_(NULL), - foreign_(NULL), + hasForeignOrient_(nullptr), + hasForeignPoint_(nullptr), + foreignOrient_(nullptr), + foreignX_(nullptr), + foreignY_(nullptr), + foreign_(nullptr), LEQSize_(0), - LEQ_(NULL), + LEQ_(nullptr), mustjoinSize_(0), - mustjoin_(NULL), + mustjoin_(nullptr), outMarginH_(0.0), outMarginL_(0.0), outResistanceH_(0.0), @@ -740,56 +740,56 @@ lefiPin::lefiPin() riseSatcur_(0.0), fallSatcur_(0.0), lowTableSize_(0), - lowTable_(NULL), + lowTable_(nullptr), highTableSize_(0), - highTable_(NULL), + highTable_(nullptr), riseSlewLimit_(0.0), fallSlewLimit_(0.0), numAntennaModel_(0), antennaModelAllocated_(0), curAntennaModelIndex_(0), - pinAntennaModel_(NULL), + pinAntennaModel_(nullptr), numAntennaSize_(0), antennaSizeAllocated_(0), - antennaSize_(NULL), - antennaSizeLayer_(NULL), + antennaSize_(nullptr), + antennaSizeLayer_(nullptr), numAntennaMetalArea_(0), antennaMetalAreaAllocated_(0), - antennaMetalArea_(NULL), - antennaMetalAreaLayer_(NULL), + antennaMetalArea_(nullptr), + antennaMetalAreaLayer_(nullptr), numAntennaMetalLength_(0), antennaMetalLengthAllocated_(0), - antennaMetalLength_(NULL), - antennaMetalLengthLayer_(NULL), + antennaMetalLength_(nullptr), + antennaMetalLengthLayer_(nullptr), numAntennaPartialMetalArea_(0), antennaPartialMetalAreaAllocated_(0), - antennaPartialMetalArea_(NULL), - antennaPartialMetalAreaLayer_(NULL), + antennaPartialMetalArea_(nullptr), + antennaPartialMetalAreaLayer_(nullptr), numAntennaPartialMetalSideArea_(0), antennaPartialMetalSideAreaAllocated_(0), - antennaPartialMetalSideArea_(NULL), - antennaPartialMetalSideAreaLayer_(NULL), + antennaPartialMetalSideArea_(nullptr), + antennaPartialMetalSideAreaLayer_(nullptr), numAntennaPartialCutArea_(0), antennaPartialCutAreaAllocated_(0), - antennaPartialCutArea_(NULL), - antennaPartialCutAreaLayer_(NULL), + antennaPartialCutArea_(nullptr), + antennaPartialCutAreaLayer_(nullptr), numAntennaDiffArea_(0), antennaDiffAreaAllocated_(0), - antennaDiffArea_(NULL), - antennaDiffAreaLayer_(NULL), - taperRule_(NULL), - netEpxr_(NULL), - ssPinName_(NULL), - gsPinName_(NULL), + antennaDiffArea_(nullptr), + antennaDiffAreaLayer_(nullptr), + taperRule_(nullptr), + netEpxr_(nullptr), + ssPinName_(nullptr), + gsPinName_(nullptr), numProperties_(0), propertiesAllocated_(0), - propNames_(NULL), - propValues_(NULL), - propNums_(NULL), - propTypes_(NULL), + propNames_(nullptr), + propValues_(nullptr), + propNums_(nullptr), + propTypes_(nullptr), numPorts_(0), portsAllocated_(0), - ports_(NULL) + ports_(nullptr) { Init(); } @@ -803,20 +803,20 @@ void lefiPin::Init() numPorts_ = 0; numProperties_ = 0; propertiesAllocated_ = 0; - propNames_ = 0; - propValues_ = 0; - propTypes_ = 0; - foreign_ = 0; - LEQ_ = 0; - mustjoin_ = 0; - lowTable_ = 0; - highTable_ = 0; - taperRule_ = 0; - pinAntennaModel_ = 0; + propNames_ = nullptr; + propValues_ = nullptr; + propTypes_ = nullptr; + foreign_ = nullptr; + LEQ_ = nullptr; + mustjoin_ = nullptr; + lowTable_ = nullptr; + highTable_ = nullptr; + taperRule_ = nullptr; + pinAntennaModel_ = nullptr; numAntennaModel_ = 0; - netEpxr_ = 0; - ssPinName_ = 0; - gsPinName_ = 0; + netEpxr_ = nullptr; + ssPinName_ = nullptr; + gsPinName_ = nullptr; bump(&(LEQ_), 16, &(LEQSize_)); bump(&(mustjoin_), 16, &(mustjoinSize_)); @@ -875,16 +875,16 @@ void lefiPin::Destroy() lefFree(highTable_); if (propNames_) lefFree((char*) (propNames_)); - propNames_ = 0; + propNames_ = nullptr; if (propValues_) lefFree((char*) (propValues_)); - propValues_ = 0; + propValues_ = nullptr; if (propNums_) lefFree((char*) (propNums_)); - propNums_ = 0; + propNums_ = nullptr; if (propTypes_) lefFree((char*) (propTypes_)); - propTypes_ = 0; + propTypes_ = nullptr; lefFree((char*) (antennaSize_)); lefFree((char*) (antennaSizeLayer_)); lefFree((char*) (antennaMetalArea_)); @@ -1011,7 +1011,7 @@ void lefiPin::clear() lefFree((char*) pinAntennaModel_); } - pinAntennaModel_ = 0; // 5.5 + pinAntennaModel_ = nullptr; // 5.5 numAntennaModel_ = 0; // 5.5 curAntennaModelIndex_ = 0; // 5.5 antennaModelAllocated_ = 0; // 5.5 @@ -1024,19 +1024,19 @@ void lefiPin::clear() propertiesAllocated_ = 0; if (taperRule_) { lefFree(taperRule_); - taperRule_ = 0; + taperRule_ = nullptr; } if (netEpxr_) { lefFree(netEpxr_); - netEpxr_ = 0; + netEpxr_ = nullptr; } if (ssPinName_) { lefFree(ssPinName_); - ssPinName_ = 0; + ssPinName_ = nullptr; } if (gsPinName_) { lefFree(gsPinName_); - gsPinName_ = 0; + gsPinName_ = nullptr; } } @@ -1047,7 +1047,7 @@ void lefiPin::bump(char** array, int len, int* size) if (len > 0) *array = (char*) lefMalloc(len); else - *array = 0; + *array = nullptr; *size = len; } @@ -1685,7 +1685,7 @@ lefiGeometries* lefiPin::port(int index) const index, numPorts_); lefiError(0, 1350, msg); - return 0; + return nullptr; } return ports_[index]; } @@ -2016,7 +2016,7 @@ void lefiPin::addAntennaMetalLength(double val, const char* layer) antennaMetalLengthLayer_[numAntennaMetalLength_] = (char*) lefMalloc(len); strcpy(antennaMetalLengthLayer_[numAntennaMetalLength_], layer); } else - antennaMetalLengthLayer_[numAntennaMetalLength_] = NULL; + antennaMetalLengthLayer_[numAntennaMetalLength_] = nullptr; numAntennaMetalLength_ += 1; } @@ -2129,7 +2129,7 @@ void lefiPin::addAntennaSize(double val, const char* layer) antennaSizeLayer_[numAntennaSize_] = (char*) lefMalloc(len); strcpy(antennaSizeLayer_[numAntennaSize_], layer); } else - antennaSizeLayer_[numAntennaSize_] = NULL; + antennaSizeLayer_[numAntennaSize_] = nullptr; numAntennaSize_ += 1; } @@ -2164,7 +2164,7 @@ void lefiPin::addAntennaMetalArea(double val, const char* layer) antennaMetalAreaLayer_[numAntennaMetalArea_] = (char*) lefMalloc(len); strcpy(antennaMetalAreaLayer_[numAntennaMetalArea_], layer); } else - antennaMetalAreaLayer_[numAntennaMetalArea_] = NULL; + antennaMetalAreaLayer_[numAntennaMetalArea_] = nullptr; numAntennaMetalArea_ += 1; } @@ -2200,7 +2200,7 @@ void lefiPin::addAntennaPartialMetalArea(double val, const char* layer) = (char*) lefMalloc(len); strcpy(antennaPartialMetalAreaLayer_[numAntennaPartialMetalArea_], layer); } else - antennaPartialMetalAreaLayer_[numAntennaPartialMetalArea_] = NULL; + antennaPartialMetalAreaLayer_[numAntennaPartialMetalArea_] = nullptr; numAntennaPartialMetalArea_ += 1; } @@ -2238,7 +2238,8 @@ void lefiPin::addAntennaPartialMetalSideArea(double val, const char* layer) strcpy(antennaPartialMetalSideAreaLayer_[numAntennaPartialMetalSideArea_], layer); } else - antennaPartialMetalSideAreaLayer_[numAntennaPartialMetalSideArea_] = NULL; + antennaPartialMetalSideAreaLayer_[numAntennaPartialMetalSideArea_] + = nullptr; numAntennaPartialMetalSideArea_ += 1; } @@ -2274,7 +2275,7 @@ void lefiPin::addAntennaPartialCutArea(double val, const char* layer) = (char*) lefMalloc(len); strcpy(antennaPartialCutAreaLayer_[numAntennaPartialCutArea_], layer); } else - antennaPartialCutAreaLayer_[numAntennaPartialCutArea_] = NULL; + antennaPartialCutAreaLayer_[numAntennaPartialCutArea_] = nullptr; numAntennaPartialCutArea_ += 1; } @@ -2309,7 +2310,7 @@ void lefiPin::addAntennaDiffArea(double val, const char* layer) antennaDiffAreaLayer_[numAntennaDiffArea_] = (char*) lefMalloc(len); strcpy(antennaDiffAreaLayer_[numAntennaDiffArea_], layer); } else - antennaDiffAreaLayer_[numAntennaDiffArea_] = NULL; + antennaDiffAreaLayer_[numAntennaDiffArea_] = nullptr; numAntennaDiffArea_ += 1; } @@ -2356,7 +2357,7 @@ const char* lefiPin::propName(int index) const index, numProperties_); lefiError(0, 1352, msg); - return 0; + return nullptr; } return propNames_[index]; } @@ -2371,7 +2372,7 @@ const char* lefiPin::propValue(int index) const index, numProperties_); lefiError(0, 1352, msg); - return 0; + return nullptr; } return propValues_[index]; } @@ -2456,9 +2457,9 @@ void lefiPin::print(FILE* f) const lefiMacro::lefiMacro() : nameSize_(0), - name_(NULL), + name_(nullptr), generatorSize_(0), - generator_(NULL), + generator_(nullptr), hasClass_(0), hasGenerator_(0), hasGenerate_(0), @@ -2473,13 +2474,13 @@ lefiMacro::lefiMacro() hasClockType_(0), isBuffer_(0), isInverter_(0), - EEQ_(NULL), + EEQ_(nullptr), EEQSize_(0), - LEQ_(NULL), + LEQ_(nullptr), LEQSize_(0), - gen1_(NULL), + gen1_(nullptr), gen1Size_(0), - gen2_(NULL), + gen2_(nullptr), gen2Size_(0), power_(0.0), originX_(0.0), @@ -2488,25 +2489,25 @@ lefiMacro::lefiMacro() sizeY_(0.0), numSites_(0), sitesAllocated_(0), - pattern_(NULL), + pattern_(nullptr), numForeigns_(0), foreignAllocated_(0), - hasForeignOrigin_(NULL), - hasForeignPoint_(NULL), - foreignOrient_(NULL), - foreignX_(NULL), - foreignY_(NULL), - foreign_(NULL), + hasForeignOrigin_(nullptr), + hasForeignPoint_(nullptr), + foreignOrient_(nullptr), + foreignX_(nullptr), + foreignY_(nullptr), + foreign_(nullptr), siteNameSize_(0), - siteName_(NULL), - clockType_(NULL), + siteName_(nullptr), + clockType_(nullptr), clockTypeSize_(0), numProperties_(0), propertiesAllocated_(0), - propNames_(NULL), - propValues_(NULL), - propNums_(NULL), - propTypes_(NULL), + propNames_(nullptr), + propValues_(nullptr), + propNums_(nullptr), + propTypes_(nullptr), isFixedMask_(0) { Init(); @@ -2514,18 +2515,18 @@ lefiMacro::lefiMacro() void lefiMacro::Init() { - name_ = 0; - generator_ = 0; - EEQ_ = 0; - LEQ_ = 0; - gen1_ = 0; - gen2_ = 0; - foreign_ = 0; - siteName_ = 0; - clockType_ = 0; - propNames_ = 0; - propValues_ = 0; - propTypes_ = 0; + name_ = nullptr; + generator_ = nullptr; + EEQ_ = nullptr; + LEQ_ = nullptr; + gen1_ = nullptr; + gen2_ = nullptr; + foreign_ = nullptr; + siteName_ = nullptr; + clockType_ = nullptr; + propNames_ = nullptr; + propValues_ = nullptr; + propTypes_ = nullptr; bump(&(name_), 16, &(nameSize_)); bump(&(generator_), 16, &(generatorSize_)); @@ -2545,7 +2546,7 @@ void lefiMacro::Init() numSites_ = 0; sitesAllocated_ = 0; - pattern_ = 0; + pattern_ = nullptr; numForeigns_ = 0; foreignAllocated_ = 0; isFixedMask_ = 0; @@ -2619,7 +2620,7 @@ void lefiMacro::clear() numSites_ = 0; sitesAllocated_ = 0; lefFree((char*) (pattern_)); - pattern_ = 0; + pattern_ = nullptr; } for (i = 0; i < numProperties_; i++) { @@ -2638,7 +2639,7 @@ void lefiMacro::bump(char** array, int len, int* size) if (len) *array = (char*) lefMalloc(len); else - *array = 0; + *array = nullptr; *size = len; } @@ -3049,7 +3050,7 @@ const char* lefiMacro::propName(int index) const index, numProperties_); lefiError(0, 1352, msg); - return 0; + return nullptr; } return propNames_[index]; } @@ -3064,7 +3065,7 @@ const char* lefiMacro::propValue(int index) const index, numProperties_); lefiError(0, 1352, msg); - return 0; + return nullptr; } return propValues_[index]; } @@ -3328,10 +3329,10 @@ void lefiMacro::print(FILE* f) const lefiTiming::lefiTiming() : numFrom_(0), - from_(NULL), + from_(nullptr), fromAllocated_(0), numTo_(0), - to_(NULL), + to_(nullptr), toAllocated_(0), hasTransition_(0), hasDelay_(0), @@ -3358,18 +3359,18 @@ lefiTiming::lefiTiming() hasSDFcond_(0), nowRise_(0), numOfAxisNumbers_(0), - axisNumbers_(NULL), + axisNumbers_(nullptr), axisNumbersAllocated_(0), numOfTableEntries_(0), tableEntriesAllocated_(0), - table_(NULL), // three numbers per entry - delayRiseOrFall_(NULL), - delayUnateness_(NULL), + table_(nullptr), // three numbers per entry + delayRiseOrFall_(nullptr), + delayUnateness_(nullptr), delayTableOne_(0.0), delayTableTwo_(0.0), delayTableThree_(0.0), - transitionRiseOrFall_(NULL), - transitionUnateness_(NULL), + transitionRiseOrFall_(nullptr), + transitionUnateness_(nullptr), transitionTableOne_(0.0), transitionTableTwo_(0.0), transitionTableThree_(0.0), @@ -3403,7 +3404,7 @@ lefiTiming::lefiTiming() fallRSTwo_(0.0), fallCSOne_(0.0), fallCSTwo_(0.0), - unateness_(NULL), + unateness_(nullptr), riseAtt1One_(0.0), riseAtt1Two_(0.0), fallAtt1One_(0.0), @@ -3414,16 +3415,16 @@ lefiTiming::lefiTiming() riseToTwo_(0.0), stableSetup_(0.0), stableHold_(0.0), - stableRiseFall_(NULL), - SDFtriggerType_(NULL), - SDFfromTrigger_(NULL), - SDFtoTrigger_(NULL), + stableRiseFall_(nullptr), + SDFtriggerType_(nullptr), + SDFfromTrigger_(nullptr), + SDFtoTrigger_(nullptr), SDFtriggerTableOne_(0.0), SDFtriggerTableTwo_(0.0), SDFtriggerTableThree_(0.0), - SDFcondStart_(NULL), - SDFcondEnd_(NULL), - SDFcond_(NULL) + SDFcondStart_(nullptr), + SDFcondEnd_(nullptr), + SDFcond_(nullptr) { Init(); } diff --git a/src/odb/src/lef/lef/lefiMisc.cpp b/src/odb/src/lef/lef/lefiMisc.cpp index 0784a2bca31..d801bd5df2d 100644 --- a/src/odb/src/lef/lef/lefiMisc.cpp +++ b/src/odb/src/lef/lef/lefiMisc.cpp @@ -57,8 +57,8 @@ void lefiGeometries::Init() items_ = (void**) lefMalloc(sizeof(void*) * 2); numPoints_ = 0; pointsAllocated_ = 0; - x_ = 0; - y_ = 0; + x_ = nullptr; + y_ = nullptr; xStart_ = -1; yStart_ = -1; xStep_ = -1; @@ -214,8 +214,8 @@ void lefiGeometries::addPath(int colorMask) p->y[i] = y_[i]; } } else { - p->x = 0; - p->y = 0; + p->x = nullptr; + p->y = nullptr; } p->colorMask = colorMask; @@ -239,8 +239,8 @@ void lefiGeometries::addPathIter(int colorMask) p->y[i] = y_[i]; } } else { - p->x = 0; - p->y = 0; + p->x = nullptr; + p->y = nullptr; } p->colorMask = colorMask; @@ -306,8 +306,8 @@ void lefiGeometries::addPolygon(int colorMask) p->y[i] = y_[i]; } } else { - p->x = 0; - p->y = 0; + p->x = nullptr; + p->y = nullptr; } p->colorMask = colorMask; @@ -332,8 +332,8 @@ void lefiGeometries::addPolygonIter(int colorMask) p->y[i] = y_[i]; } } else { - p->x = 0; - p->y = 0; + p->x = nullptr; + p->y = nullptr; } p->xStart = xStart_; @@ -465,7 +465,7 @@ lefiGeomRect* lefiGeometries::getRect(int index) const index, numItems_); lefiError(0, 1361, msg); - return 0; + return nullptr; } return (lefiGeomRect*) (items_[index]); } @@ -480,7 +480,7 @@ lefiGeomRectIter* lefiGeometries::getRectIter(int index) const index, numItems_); lefiError(0, 1362, msg); - return 0; + return nullptr; } return (lefiGeomRectIter*) (items_[index]); } @@ -495,7 +495,7 @@ lefiGeomPath* lefiGeometries::getPath(int index) const index, numItems_); lefiError(0, 1363, msg); - return 0; + return nullptr; } return (lefiGeomPath*) (items_[index]); } @@ -510,7 +510,7 @@ lefiGeomPathIter* lefiGeometries::getPathIter(int index) const index, numItems_); lefiError(0, 1364, msg); - return 0; + return nullptr; } return (lefiGeomPathIter*) (items_[index]); } @@ -525,7 +525,7 @@ char* lefiGeometries::getLayer(int index) const index, numItems_); lefiError(0, 1365, msg); - return 0; + return nullptr; } return (char*) (items_[index]); } @@ -601,7 +601,7 @@ lefiGeomPolygon* lefiGeometries::getPolygon(int index) const index, numItems_); lefiError(0, 1370, msg); - return 0; + return nullptr; } return (lefiGeomPolygon*) (items_[index]); } @@ -616,7 +616,7 @@ lefiGeomPolygonIter* lefiGeometries::getPolygonIter(int index) const index, numItems_); lefiError(0, 1371, msg); - return 0; + return nullptr; } return (lefiGeomPolygonIter*) (items_[index]); } @@ -631,7 +631,7 @@ char* lefiGeometries::getClass(int index) const index, numItems_); lefiError(0, 1372, msg); - return 0; + return nullptr; } return (char*) (items_[index]); } @@ -646,7 +646,7 @@ lefiGeomVia* lefiGeometries::getVia(int index) const index, numItems_); lefiError(0, 1373, msg); - return 0; + return nullptr; } return (lefiGeomVia*) (items_[index]); } @@ -661,7 +661,7 @@ lefiGeomViaIter* lefiGeometries::getViaIter(int index) const index, numItems_); lefiError(0, 1374, msg); - return 0; + return nullptr; } return (lefiGeomViaIter*) (items_[index]); } @@ -1132,8 +1132,8 @@ void lefiSite::Init() name_ = (char*) lefMalloc(16); numRowPattern_ = 0; rowPatternAllocated_ = 0; - siteNames_ = 0; - siteOrients_ = 0; + siteNames_ = nullptr; + siteOrients_ = nullptr; } void lefiSite::Destroy() @@ -1469,7 +1469,7 @@ void lefiTrackPattern::Destroy() if (name_) lefFree(name_); clear(); - name_ = 0; + name_ = nullptr; start_ = 0; numTracks_ = 0; space_ = 0; @@ -1565,7 +1565,7 @@ const char* lefiTrackPattern::layerName(int index) const index, numLayers_); lefiError(0, 1377, msg); - return 0; + return nullptr; } return layerNames_[index]; } @@ -1609,7 +1609,7 @@ void lefiGcellPattern::Destroy() { if (name_) lefFree(name_); - name_ = 0; + name_ = nullptr; start_ = 0; numCRs_ = 0; space_ = 0; @@ -1679,7 +1679,7 @@ lefiUseMinSpacing::lefiUseMinSpacing() void lefiUseMinSpacing::Init() { - name_ = 0; + name_ = nullptr; value_ = 0; } @@ -1723,8 +1723,8 @@ void lefiUseMinSpacing::print(FILE* f) const lefiMaxStackVia::lefiMaxStackVia() { - bottomLayer_ = 0; - topLayer_ = 0; + bottomLayer_ = nullptr; + topLayer_ = nullptr; Init(); } @@ -1736,8 +1736,8 @@ void lefiMaxStackVia::Init() lefFree(bottomLayer_); // call this function before calling if (topLayer_) // setMaxStackViaRange when more than 1 lef lefFree(topLayer_); // files are parse. C++ skips this function - bottomLayer_ = 0; - topLayer_ = 0; + bottomLayer_ = nullptr; + topLayer_ = nullptr; } void lefiMaxStackVia::Destroy() @@ -1746,8 +1746,8 @@ void lefiMaxStackVia::Destroy() lefFree(bottomLayer_); if (topLayer_) lefFree(topLayer_); - bottomLayer_ = 0; - topLayer_ = 0; + bottomLayer_ = nullptr; + topLayer_ = nullptr; hasRange_ = 0; value_ = 0; } diff --git a/src/odb/src/lef/lef/lefiNonDefault.cpp b/src/odb/src/lef/lef/lefiNonDefault.cpp index d3f80cb94bb..71054c77ff2 100644 --- a/src/odb/src/lef/lef/lefiNonDefault.cpp +++ b/src/odb/src/lef/lef/lefiNonDefault.cpp @@ -54,47 +54,47 @@ BEGIN_LEFDEF_PARSER_NAMESPACE lefiNonDefault::lefiNonDefault() : nameSize_(0), - name_(NULL), + name_(nullptr), numLayers_(0), layersAllocated_(0), - layerName_(NULL), - width_(NULL), - spacing_(NULL), - wireExtension_(NULL), - hasWidth_(NULL), - hasSpacing_(NULL), - hasWireExtension_(NULL), - resistance_(NULL), - capacitance_(NULL), - edgeCap_(NULL), - hasResistance_(NULL), - hasCapacitance_(NULL), - hasEdgeCap_(NULL), - diagWidth_(NULL), - hasDiagWidth_(NULL), + layerName_(nullptr), + width_(nullptr), + spacing_(nullptr), + wireExtension_(nullptr), + hasWidth_(nullptr), + hasSpacing_(nullptr), + hasWireExtension_(nullptr), + resistance_(nullptr), + capacitance_(nullptr), + edgeCap_(nullptr), + hasResistance_(nullptr), + hasCapacitance_(nullptr), + hasEdgeCap_(nullptr), + diagWidth_(nullptr), + hasDiagWidth_(nullptr), numVias_(0), allocatedVias_(0), - viaRules_(NULL), + viaRules_(nullptr), numSpacing_(0), allocatedSpacing_(0), - spacingRules_(NULL), + spacingRules_(nullptr), hardSpacing_(0), numUseVias_(0), allocatedUseVias_(0), - useViaName_(NULL), + useViaName_(nullptr), numUseViaRules_(0), allocatedUseViaRules_(0), - useViaRuleName_(NULL), + useViaRuleName_(nullptr), numMinCuts_(0), allocatedMinCuts_(0), - cutLayerName_(NULL), - numCuts_(NULL), + cutLayerName_(nullptr), + numCuts_(nullptr), numProps_(0), propsAllocated_(0), - names_(NULL), - values_(NULL), - dvalues_(NULL), - types_(NULL) + names_(nullptr), + values_(nullptr), + dvalues_(nullptr), + types_(nullptr) { Init(); } @@ -207,21 +207,21 @@ void lefiNonDefault::clear() numProps_ = 0; for (i = 0; i < numLayers_; i++) { lefFree(layerName_[i]); - layerName_[i] = 0; + layerName_[i] = nullptr; } numLayers_ = 0; for (i = 0; i < numVias_; i++) { vr = viaRules_[i]; vr->Destroy(); lefFree((char*) (viaRules_[i])); - viaRules_[i] = 0; + viaRules_[i] = nullptr; } numVias_ = 0; for (i = 0; i < numSpacing_; i++) { sr = spacingRules_[i]; sr->Destroy(); lefFree((char*) (spacingRules_[i])); - spacingRules_[i] = 0; + spacingRules_[i] = nullptr; } numSpacing_ = 0; @@ -557,7 +557,7 @@ void lefiNonDefault::end() // lefrSetSpacingEndCbk(oldSpacingEndCbk); // pcr 909010 - global var lefData->nd is used to pass nondefault rule data // lefrSetUserData(oldUserData_); - lefData->nd = 0; + lefData->nd = nullptr; } int lefiNonDefault::numLayers() const @@ -575,7 +575,7 @@ const char* lefiNonDefault::layerName(int index) const index, numLayers_); lefiError(0, 1402, msg); - return 0; + return nullptr; } return layerName_[index]; } @@ -805,7 +805,7 @@ lefiVia* lefiNonDefault::viaRule(int index) const index, numVias_); lefiError(0, 1403, msg); - return 0; + return nullptr; } return viaRules_[index]; } @@ -825,7 +825,7 @@ lefiSpacing* lefiNonDefault::spacingRule(int index) const index, numSpacing_); lefiError(0, 1404, msg); - return 0; + return nullptr; } return spacingRules_[index]; } @@ -855,7 +855,7 @@ const char* lefiNonDefault::viaName(int index) const index, numUseVias_); lefiError(0, 1405, msg); - return 0; + return nullptr; } return useViaName_[index]; } @@ -875,7 +875,7 @@ const char* lefiNonDefault::viaRuleName(int index) const index, numUseViaRules_); lefiError(0, 1406, msg); - return 0; + return nullptr; } return useViaRuleName_[index]; } @@ -895,7 +895,7 @@ const char* lefiNonDefault::cutLayerName(int index) const index, numMinCuts_); lefiError(0, 1407, msg); - return 0; + return nullptr; } return cutLayerName_[index]; } @@ -1067,7 +1067,7 @@ const char* lefiNonDefault::propName(int index) const index, numProps_); lefiError(0, 1408, msg); - return 0; + return nullptr; } return names_[index]; } @@ -1082,7 +1082,7 @@ const char* lefiNonDefault::propValue(int index) const index, numProps_); lefiError(0, 1408, msg); - return 0; + return nullptr; } return values_[index]; } diff --git a/src/odb/src/lef/lef/lefiProp.cpp b/src/odb/src/lef/lef/lefiProp.cpp index 0dd3ca8b3df..5e2dffcfd0a 100644 --- a/src/odb/src/lef/lef/lefiProp.cpp +++ b/src/odb/src/lef/lef/lefiProp.cpp @@ -38,14 +38,14 @@ BEGIN_LEFDEF_PARSER_NAMESPACE lefiProp::lefiProp() - : propType_(NULL), - propName_(NULL), + : propType_(nullptr), + propName_(nullptr), nameSize_(0), hasRange_(0), hasNumber_(0), hasNameMapString_(0), dataType_(0), - stringData_(NULL), + stringData_(nullptr), stringLength_(0), left_(0.0), right_(0.0), @@ -187,7 +187,7 @@ void lefiProp::clear() *(stringData_) = '\0'; if (stringData_) *(propName_) = '\0'; - propType_ = 0; + propType_ = nullptr; hasRange_ = 0; hasNumber_ = 0; hasNameMapString_ = 0; diff --git a/src/odb/src/lef/lef/lefiPropType.cpp b/src/odb/src/lef/lef/lefiPropType.cpp index 05a2df20d18..f3e3c15908b 100644 --- a/src/odb/src/lef/lef/lefiPropType.cpp +++ b/src/odb/src/lef/lef/lefiPropType.cpp @@ -40,8 +40,8 @@ BEGIN_LEFDEF_PARSER_NAMESPACE lefiPropType::lefiPropType() : numProperties_(0), propertiesAllocated_(0), - propNames_(NULL), - propTypes_(NULL) + propNames_(nullptr), + propTypes_(nullptr) { Init(); } @@ -50,8 +50,8 @@ void lefiPropType::Init() { numProperties_ = 0; propertiesAllocated_ = 0; - propNames_ = 0; - propTypes_ = 0; + propNames_ = nullptr; + propTypes_ = nullptr; } void lefiPropType::Clear() diff --git a/src/odb/src/lef/lef/lefiUnits.cpp b/src/odb/src/lef/lef/lefiUnits.cpp index d070b7d9828..b166fcf9bdb 100644 --- a/src/odb/src/lef/lef/lefiUnits.cpp +++ b/src/odb/src/lef/lef/lefiUnits.cpp @@ -50,7 +50,7 @@ lefiUnits::lefiUnits() hasCurrent_(0), hasVoltage_(0), hasFrequency_(0), - databaseName_(NULL), + databaseName_(nullptr), databaseNumber_(0.0), capacitance_(0.0), resistance_(0.0), @@ -99,7 +99,7 @@ void lefiUnits::clear() hasVoltage_ = 0; hasDatabase_ = 0; hasFrequency_ = 0; - databaseName_ = 0; + databaseName_ = nullptr; } void lefiUnits::setTime(double num) diff --git a/src/odb/src/lef/lef/lefiVia.cpp b/src/odb/src/lef/lef/lefiVia.cpp index 3e0ffcfc135..323b5c67680 100644 --- a/src/odb/src/lef/lef/lefiVia.cpp +++ b/src/odb/src/lef/lef/lefiVia.cpp @@ -43,25 +43,25 @@ BEGIN_LEFDEF_PARSER_NAMESPACE // ***************************************************************************** lefiViaLayer::lefiViaLayer() - : name_(NULL), - rectColorMask_(NULL), - polyColorMask_(NULL), + : name_(nullptr), + rectColorMask_(nullptr), + polyColorMask_(nullptr), numRects_(0), rectsAllocated_(0), - xl_(NULL), - yl_(NULL), - xh_(NULL), - yh_(NULL), + xl_(nullptr), + yl_(nullptr), + xh_(nullptr), + yh_(nullptr), numPolys_(0), polysAllocated_(0), - polygons_(NULL) + polygons_(nullptr) { Init(); } void lefiViaLayer::Init() { - name_ = 0; + name_ = nullptr; rectsAllocated_ = 2; numRects_ = 0; rectColorMask_ = (int*) lefMalloc(sizeof(int) * 2); @@ -93,7 +93,7 @@ void lefiViaLayer::Destroy() } lefFree((char*) (polygons_)); - polygons_ = 0; + polygons_ = nullptr; numPolys_ = 0; } @@ -230,11 +230,11 @@ lefiViaLayer* lefiViaLayer::clone() vl->rectColorMask_[i] = rectColorMask_[i]; } } else { - vl->xl_ = 0; - vl->yl_ = 0; - vl->xh_ = 0; - vl->yh_ = 0; - vl->rectColorMask_ = 0; + vl->xl_ = nullptr; + vl->yl_ = nullptr; + vl->xh_ = nullptr; + vl->yh_ = nullptr; + vl->rectColorMask_ = nullptr; vl->numRects_ = numRects_; vl->rectsAllocated_ = rectsAllocated_; } @@ -247,7 +247,7 @@ lefiViaLayer* lefiViaLayer::clone() if (numPolys_ > 0) { vl->polyColorMask_ = (int*) lefMalloc(sizeof(int) * numPolys_); } else { - vl->polyColorMask_ = 0; + vl->polyColorMask_ = nullptr; } for (i = 0; i < numPolys_; i++) { @@ -382,7 +382,7 @@ lefiGeomPolygon* lefiViaLayer::getPolygon(int index) const // ***************************************************************************** lefiVia::lefiVia() - : name_(NULL), + : name_(nullptr), nameSize_(0), hasDefault_(0), hasGenerated_(0), @@ -391,24 +391,24 @@ lefiVia::lefiVia() hasTopOfStack_(0), numProps_(0), propsAllocated_(0), - propName_(NULL), - propValue_(NULL), - propDValue_(NULL), - propType_(NULL), + propName_(nullptr), + propValue_(nullptr), + propDValue_(nullptr), + propType_(nullptr), numLayers_(0), layersAllocated_(0), - layers_(NULL), + layers_(nullptr), resistance_(0.0), - foreign_(NULL), + foreign_(nullptr), foreignX_(0.0), foreignY_(0.0), foreignOrient_(0), - viaRuleName_(NULL), + viaRuleName_(nullptr), xSize_(0.0), ySize_(0.0), - botLayer_(NULL), - cutLayer_(NULL), - topLayer_(NULL), + botLayer_(nullptr), + cutLayer_(nullptr), + topLayer_(nullptr), xSpacing_(0.0), ySpacing_(0.0), xBotEnc_(0.0), @@ -423,7 +423,7 @@ lefiVia::lefiVia() yBotOs_(0.0), xTopOs_(0.0), yTopOs_(0.0), - cutPattern_(NULL) + cutPattern_(nullptr) { Init(); } @@ -432,14 +432,14 @@ void lefiVia::Init() { nameSize_ = 16; name_ = (char*) lefMalloc(16); - foreign_ = 0; + foreign_ = nullptr; numProps_ = 0; propsAllocated_ = 0; layersAllocated_ = 3; layers_ = (lefiViaLayer**) lefMalloc(sizeof(lefiViaLayer*) * 3); numLayers_ = 0; clear(); - viaRuleName_ = 0; + viaRuleName_ = nullptr; } void lefiVia::Destroy() @@ -448,7 +448,7 @@ void lefiVia::Destroy() lefFree(name_); if (layers_) lefFree((char*) (layers_)); - layers_ = 0; + layers_ = nullptr; if (propName_) lefFree((char*) (propName_)); if (propValue_) @@ -467,15 +467,15 @@ void lefiVia::Destroy() lefFree((char*) (topLayer_)); if (cutPattern_) lefFree((char*) (cutPattern_)); - propName_ = 0; - propValue_ = 0; - propDValue_ = 0; - propType_ = 0; - viaRuleName_ = 0; - botLayer_ = 0; - cutLayer_ = 0; - topLayer_ = 0; - cutPattern_ = 0; + propName_ = nullptr; + propValue_ = nullptr; + propDValue_ = nullptr; + propType_ = nullptr; + viaRuleName_ = nullptr; + botLayer_ = nullptr; + cutLayer_ = nullptr; + topLayer_ = nullptr; + cutPattern_ = nullptr; } lefiVia::~lefiVia() @@ -491,7 +491,7 @@ lefiVia* lefiVia::clone() v->nameSize_ = strlen(name_) + 1; v->name_ = (char*) lefMalloc(v->nameSize_); strcpy(v->name_, name_); - v->foreign_ = 0; + v->foreign_ = nullptr; if (hasForeign()) { v->setForeign( foreign_, hasForeignPnt(), foreignX_, foreignY_, foreignOrient_); @@ -517,15 +517,15 @@ lefiVia* lefiVia::clone() v->propValue_[i] = (char*) lefMalloc(strlen(propValue_[i]) + 1); strcpy(v->propValue_[i], propValue_[i]); } else - v->propValue_[i] = 0; + v->propValue_[i] = nullptr; v->propDValue_[i] = propDValue_[i]; v->propType_[i] = propType_[i]; } } else { - v->propName_ = 0; - v->propValue_ = 0; - v->propDValue_ = 0; - v->propType_ = 0; + v->propName_ = nullptr; + v->propValue_ = nullptr; + v->propDValue_ = nullptr; + v->propType_ = nullptr; } v->layersAllocated_ = layersAllocated_; v->numLayers_ = numLayers_; @@ -543,11 +543,11 @@ lefiVia* lefiVia::clone() else v->foreignOrient_ = foreignOrient_; - v->viaRuleName_ = 0; - v->botLayer_ = 0; - v->cutLayer_ = 0; - v->topLayer_ = 0; - v->cutPattern_ = 0; + v->viaRuleName_ = nullptr; + v->botLayer_ = nullptr; + v->cutLayer_ = nullptr; + v->topLayer_ = nullptr; + v->cutPattern_ = nullptr; if (viaRuleName_) v->viaRuleName_ = strdup(viaRuleName_); v->xSize_ = xSize_; @@ -586,7 +586,7 @@ void lefiVia::clear() *(name_) = '\0'; if (foreign_) lefFree(foreign_); - foreign_ = 0; + foreign_ = nullptr; hasDefault_ = 0; hasGenerated_ = 0; hasResistance_ = 0; @@ -596,10 +596,10 @@ void lefiVia::clear() for (i = 0; i < numProps_; i++) { lefFree(propName_[i]); - propName_[i] = 0; + propName_[i] = nullptr; if (propValue_[i]) lefFree(propValue_[i]); - propValue_[i] = 0; + propValue_[i] = nullptr; propType_[i] = ' '; } numProps_ = 0; @@ -607,13 +607,13 @@ void lefiVia::clear() for (i = 0; i < numLayers_; i++) { layers_[i]->Destroy(); lefFree((char*) (layers_[i])); - layers_[i] = 0; + layers_[i] = nullptr; } numLayers_ = 0; if (viaRuleName_) lefFree(viaRuleName_); - viaRuleName_ = 0; + viaRuleName_ = nullptr; xSize_ = 0; ySize_ = 0; if (botLayer_) @@ -622,9 +622,9 @@ void lefiVia::clear() lefFree(cutLayer_); if (topLayer_) lefFree(topLayer_); - botLayer_ = 0; - cutLayer_ = 0; - topLayer_ = 0; + botLayer_ = nullptr; + cutLayer_ = nullptr; + topLayer_ = nullptr; xSpacing_ = 0; ySpacing_ = 0; xBotEnc_ = 0; @@ -641,7 +641,7 @@ void lefiVia::clear() yTopOs_ = 0; if (cutPattern_) lefFree(cutPattern_); - cutPattern_ = 0; + cutPattern_ = nullptr; } void lefiVia::setName(const char* name, int viaType) @@ -963,7 +963,7 @@ char* lefiVia::layerName(int layerNum) const layerNum, numLayers_); lefiError(0, 1421, msg); - return 0; + return nullptr; } vl = layers_[layerNum]; return vl->name(); @@ -1118,8 +1118,8 @@ lefiGeomPolygon lefiVia::getPolygon(int layerNum, int polyNum) const lefiGeomPolygon tempPoly; tempPoly.numPoints = 0; - tempPoly.x = 0; - tempPoly.y = 0; + tempPoly.x = nullptr; + tempPoly.y = nullptr; tempPoly.colorMask = 0; if (layerNum < 0 || layerNum >= numLayers_) { @@ -1164,7 +1164,7 @@ char* lefiVia::propName(int index) const index, numLayers_); lefiError(0, 1422, msg); - return 0; + return nullptr; } return propName_[index]; } @@ -1179,7 +1179,7 @@ char* lefiVia::propValue(int index) const index, numLayers_); lefiError(0, 1422, msg); - return 0; + return nullptr; } return propValue_[index]; } diff --git a/src/odb/src/lef/lef/lefiViaRule.cpp b/src/odb/src/lef/lef/lefiViaRule.cpp index 6c444ddd989..a66cd14caef 100644 --- a/src/odb/src/lef/lef/lefiViaRule.cpp +++ b/src/odb/src/lef/lef/lefiViaRule.cpp @@ -43,7 +43,7 @@ BEGIN_LEFDEF_PARSER_NAMESPACE // ***************************************************************************** lefiViaRuleLayer::lefiViaRuleLayer() - : name_(NULL), + : name_(nullptr), direction_(0), overhang1_(0.0), overhang2_(0.0), @@ -70,7 +70,7 @@ lefiViaRuleLayer::lefiViaRuleLayer() void lefiViaRuleLayer::Init() { - name_ = 0; + name_ = nullptr; overhang1_ = -1; overhang2_ = -1; } @@ -339,20 +339,20 @@ void lefiViaRuleLayer::print(FILE* f) const // ***************************************************************************** lefiViaRule::lefiViaRule() - : name_(NULL), + : name_(nullptr), nameSize_(0), hasGenerate_(0), hasDefault_(0), numLayers_(0), numVias_(0), viasAllocated_(0), - vias_(NULL), + vias_(nullptr), numProps_(0), propsAllocated_(0), - names_(NULL), - values_(NULL), - dvalues_(NULL), - types_(NULL) + names_(nullptr), + values_(nullptr), + dvalues_(nullptr), + types_(nullptr) { Init(); } @@ -547,7 +547,7 @@ int lefiViaRule::numLayers() const lefiViaRuleLayer* lefiViaRule::layer(int index) const { if (index < 0 || index > 2) - return 0; + return nullptr; return (lefiViaRuleLayer*) &(layers_[index]); } @@ -581,7 +581,7 @@ int lefiViaRule::numVias() const char* lefiViaRule::viaName(int index) const { if (index < 0 || index >= numVias_) - return 0; + return nullptr; return vias_[index]; } @@ -693,7 +693,7 @@ const char* lefiViaRule::propName(int i) const i, numProps_); lefiError(0, 1431, msg); - return 0; + return nullptr; } return names_[i]; } @@ -708,7 +708,7 @@ const char* lefiViaRule::propValue(int i) const i, numProps_); lefiError(0, 1431, msg); - return 0; + return nullptr; } return values_[i]; } diff --git a/src/odb/src/lef/lef/lefrCallbacks.cpp b/src/odb/src/lef/lef/lefrCallbacks.cpp index e0b4aa0b2f9..12a074982a2 100644 --- a/src/odb/src/lef/lef/lefrCallbacks.cpp +++ b/src/odb/src/lef/lef/lefrCallbacks.cpp @@ -34,68 +34,68 @@ BEGIN_LEFDEF_PARSER_NAMESPACE lefrCallbacks::lefrCallbacks() - : AntennaInoutCbk(0), - AntennaInputCbk(0), - AntennaOutputCbk(0), - ArrayBeginCbk(0), - ArrayCbk(0), - ArrayEndCbk(0), - BusBitCharsCbk(0), - CaseSensitiveCbk(0), - ClearanceMeasureCbk(0), - CorrectionTableCbk(0), - DensityCbk(0), - DielectricCbk(0), - DividerCharCbk(0), - EdgeRateScaleFactorCbk(0), - EdgeRateThreshold1Cbk(0), - EdgeRateThreshold2Cbk(0), - ExtensionCbk(0), - FixedMaskCbk(0), - IRDropBeginCbk(0), - IRDropCbk(0), - IRDropEndCbk(0), - InoutAntennaCbk(0), - InputAntennaCbk(0), - LayerCbk(0), - LibraryEndCbk(0), - MacroBeginCbk(0), - MacroCbk(0), - MacroClassTypeCbk(0), - MacroEndCbk(0), - MacroFixedMaskCbk(0), - MacroOriginCbk(0), - MacroSiteCbk(0), - MacroForeignCbk(0), - MacroSizeCbk(0), - ManufacturingCbk(0), - MaxStackViaCbk(0), - MinFeatureCbk(0), - NoWireExtensionCbk(0), - NoiseMarginCbk(0), - NoiseTableCbk(0), - NonDefaultCbk(0), - ObstructionCbk(0), - OutputAntennaCbk(0), - PinCbk(0), - PropBeginCbk(0), - PropCbk(0), - PropEndCbk(0), - SiteCbk(0), - SpacingBeginCbk(0), - SpacingCbk(0), - SpacingEndCbk(0), - TimingCbk(0), - UnitsCbk(0), - UseMinSpacingCbk(0), - VersionCbk(0), - VersionStrCbk(0), - ViaCbk(0), - ViaRuleCbk(0) + : AntennaInoutCbk(nullptr), + AntennaInputCbk(nullptr), + AntennaOutputCbk(nullptr), + ArrayBeginCbk(nullptr), + ArrayCbk(nullptr), + ArrayEndCbk(nullptr), + BusBitCharsCbk(nullptr), + CaseSensitiveCbk(nullptr), + ClearanceMeasureCbk(nullptr), + CorrectionTableCbk(nullptr), + DensityCbk(nullptr), + DielectricCbk(nullptr), + DividerCharCbk(nullptr), + EdgeRateScaleFactorCbk(nullptr), + EdgeRateThreshold1Cbk(nullptr), + EdgeRateThreshold2Cbk(nullptr), + ExtensionCbk(nullptr), + FixedMaskCbk(nullptr), + IRDropBeginCbk(nullptr), + IRDropCbk(nullptr), + IRDropEndCbk(nullptr), + InoutAntennaCbk(nullptr), + InputAntennaCbk(nullptr), + LayerCbk(nullptr), + LibraryEndCbk(nullptr), + MacroBeginCbk(nullptr), + MacroCbk(nullptr), + MacroClassTypeCbk(nullptr), + MacroEndCbk(nullptr), + MacroFixedMaskCbk(nullptr), + MacroOriginCbk(nullptr), + MacroSiteCbk(nullptr), + MacroForeignCbk(nullptr), + MacroSizeCbk(nullptr), + ManufacturingCbk(nullptr), + MaxStackViaCbk(nullptr), + MinFeatureCbk(nullptr), + NoWireExtensionCbk(nullptr), + NoiseMarginCbk(nullptr), + NoiseTableCbk(nullptr), + NonDefaultCbk(nullptr), + ObstructionCbk(nullptr), + OutputAntennaCbk(nullptr), + PinCbk(nullptr), + PropBeginCbk(nullptr), + PropCbk(nullptr), + PropEndCbk(nullptr), + SiteCbk(nullptr), + SpacingBeginCbk(nullptr), + SpacingCbk(nullptr), + SpacingEndCbk(nullptr), + TimingCbk(nullptr), + UnitsCbk(nullptr), + UseMinSpacingCbk(nullptr), + VersionCbk(nullptr), + VersionStrCbk(nullptr), + ViaCbk(nullptr), + ViaRuleCbk(nullptr) { } -lefrCallbacks* lefCallbacks = NULL; +lefrCallbacks* lefCallbacks = nullptr; void lefrCallbacks::reset() { diff --git a/src/odb/src/lef/lef/lefrData.cpp b/src/odb/src/lef/lef/lefrData.cpp index a815c9b32e0..783f8bbab27 100644 --- a/src/odb/src/lef/lef/lefrData.cpp +++ b/src/odb/src/lef/lef/lefrData.cpp @@ -40,27 +40,27 @@ BEGIN_LEFDEF_PARSER_NAMESPACE extern void* lefMalloc(size_t lef_size); -lefrData* lefData = NULL; +lefrData* lefData = nullptr; lefrData::lefrData() - : lefrFile(0), - lefrLog(0), + : lefrFile(nullptr), + lefrLog(nullptr), lefPropDefType('\0'), - arrayName(NULL), - last(NULL), - layerName(NULL), - lefch(NULL), - lefrFileName(NULL), - macroName(NULL), - ndName(0), - next(NULL), - nonDefaultRuleName(NULL), - outMsg(NULL), - pinName(NULL), - shiftBuf(0), - siteName(NULL), - viaName(NULL), - viaRuleName(NULL), + arrayName(nullptr), + last(nullptr), + layerName(nullptr), + lefch(nullptr), + lefrFileName(nullptr), + macroName(nullptr), + ndName(nullptr), + next(nullptr), + nonDefaultRuleName(nullptr), + outMsg(nullptr), + pinName(nullptr), + shiftBuf(nullptr), + siteName(nullptr), + viaName(nullptr), + viaRuleName(nullptr), layerCutSpacing(0), lef_save_x(0.0), lef_save_y(0.0), @@ -195,12 +195,12 @@ lefrData::lefrData() viaRuleWarnings(0), viaWarnings(0), antennaType(lefiAntennaAR), - lefrAntennaPWLPtr(0), + lefrAntennaPWLPtr(nullptr), lefrArray(), lefrCorrectionTable(), lefrDensity(), - lefrGcellPatternPtr(0), - lefrGeometriesPtr(0), + lefrGcellPatternPtr(nullptr), + lefrGeometriesPtr(nullptr), lefrIRDrop(), lefrLayer(), lefrMacro(), @@ -209,16 +209,16 @@ lefrData::lefrData() lefrNoiseMargin(), lefrNoiseTable(), lefrNonDefault(), - nd(0), + nd(nullptr), macroNum(), lefrObstruction(), lefrPin(), lefrProp(), lefrSite(), - lefrSitePatternPtr(0), + lefrSitePatternPtr(nullptr), lefrSpacing(), lefrTiming(), - lefrTrackPatternPtr(0), + lefrTrackPatternPtr(nullptr), lefrUnits(), lefrUseMinSpacing(), lefrVia(), @@ -293,7 +293,7 @@ lefrData::~lefrData() /* Close the file */ if (lefrLog) { fclose(lefrLog); - lefrLog = 0; + lefrLog = nullptr; } // destroyRingBuffer(); diff --git a/src/odb/src/lef/lef/lefrReader.cpp b/src/odb/src/lef/lef/lefrReader.cpp index 91757f7798e..0cbb6b41a32 100644 --- a/src/odb/src/lef/lef/lefrReader.cpp +++ b/src/odb/src/lef/lef/lefrReader.cpp @@ -46,16 +46,16 @@ BEGIN_LEFDEF_PARSER_NAMESPACE #include "lef_parser.hpp" -static const char* init_call_func = NULL; +static const char* init_call_func = nullptr; void lef_init(const char* func) { - if (lefSettings == NULL) { + if (lefSettings == nullptr) { lefrSettings::reset(); init_call_func = func; } - if (lefCallbacks == NULL) { + if (lefCallbacks == nullptr) { lefrCallbacks::reset(); init_call_func = func; } @@ -79,7 +79,7 @@ double convert_name2num(const char* versionName) { char majorNm[80]; char minorNm[80]; - char* subMinorNm = NULL; + char* subMinorNm = nullptr; char* versionNm = strdup(versionName); @@ -220,7 +220,7 @@ int lefrInit() int lefrInitSession(int startSession) { if (startSession) { - if (init_call_func != NULL) { + if (init_call_func != nullptr) { fprintf(stderr, "ERROR: Attempt to call configuration function '%s' in LEF " "parser before lefrInit() call in session-based mode.\n", @@ -231,11 +231,11 @@ int lefrInitSession(int startSession) lefrCallbacks::reset(); lefrSettings::reset(); } else { - if (lefCallbacks == NULL) { + if (lefCallbacks == nullptr) { lefrCallbacks::reset(); } - if (lefSettings == NULL) { + if (lefSettings == nullptr) { lefrSettings::reset(); } } @@ -252,13 +252,13 @@ int lefrReset() int lefrClear() { delete lefData; - lefData = NULL; + lefData = nullptr; delete lefCallbacks; - lefCallbacks = NULL; + lefCallbacks = nullptr; delete lefSettings; - lefSettings = NULL; + lefSettings = nullptr; return 0; } @@ -305,136 +305,137 @@ void lefrSetUnusedCallbacks(lefrVoidCbkFnType func) // the given function. LEF_INIT; - if (lefCallbacks->ArrayBeginCbk == 0) + if (lefCallbacks->ArrayBeginCbk == nullptr) lefCallbacks->ArrayBeginCbk = (lefrStringCbkFnType) func; - if (lefCallbacks->ArrayCbk == 0) + if (lefCallbacks->ArrayCbk == nullptr) lefCallbacks->ArrayCbk = (lefrArrayCbkFnType) func; - if (lefCallbacks->ArrayEndCbk == 0) + if (lefCallbacks->ArrayEndCbk == nullptr) lefCallbacks->ArrayEndCbk = (lefrStringCbkFnType) func; - if (lefCallbacks->DividerCharCbk == 0) + if (lefCallbacks->DividerCharCbk == nullptr) lefCallbacks->DividerCharCbk = (lefrStringCbkFnType) func; - if (lefCallbacks->BusBitCharsCbk == 0) + if (lefCallbacks->BusBitCharsCbk == nullptr) lefCallbacks->BusBitCharsCbk = (lefrStringCbkFnType) func; - if (lefCallbacks->CaseSensitiveCbk == 0) + if (lefCallbacks->CaseSensitiveCbk == nullptr) lefCallbacks->CaseSensitiveCbk = (lefrIntegerCbkFnType) func; - if (lefCallbacks->NoWireExtensionCbk == 0) + if (lefCallbacks->NoWireExtensionCbk == nullptr) lefCallbacks->NoWireExtensionCbk = (lefrStringCbkFnType) func; - if (lefCallbacks->CorrectionTableCbk == 0) + if (lefCallbacks->CorrectionTableCbk == nullptr) lefCallbacks->CorrectionTableCbk = (lefrCorrectionTableCbkFnType) func; - if (lefCallbacks->DielectricCbk == 0) + if (lefCallbacks->DielectricCbk == nullptr) lefCallbacks->DielectricCbk = (lefrDoubleCbkFnType) func; - if (lefCallbacks->EdgeRateScaleFactorCbk == 0) + if (lefCallbacks->EdgeRateScaleFactorCbk == nullptr) lefCallbacks->EdgeRateScaleFactorCbk = (lefrDoubleCbkFnType) func; - if (lefCallbacks->EdgeRateThreshold1Cbk == 0) + if (lefCallbacks->EdgeRateThreshold1Cbk == nullptr) lefCallbacks->EdgeRateThreshold1Cbk = (lefrDoubleCbkFnType) func; - if (lefCallbacks->EdgeRateThreshold2Cbk == 0) + if (lefCallbacks->EdgeRateThreshold2Cbk == nullptr) lefCallbacks->EdgeRateThreshold2Cbk = (lefrDoubleCbkFnType) func; - if (lefCallbacks->IRDropBeginCbk == 0) + if (lefCallbacks->IRDropBeginCbk == nullptr) lefCallbacks->IRDropBeginCbk = (lefrVoidCbkFnType) func; - if (lefCallbacks->IRDropCbk == 0) + if (lefCallbacks->IRDropCbk == nullptr) lefCallbacks->IRDropCbk = (lefrIRDropCbkFnType) func; - if (lefCallbacks->IRDropEndCbk == 0) + if (lefCallbacks->IRDropEndCbk == nullptr) lefCallbacks->IRDropEndCbk = (lefrVoidCbkFnType) func; - if (lefCallbacks->LayerCbk == 0) + if (lefCallbacks->LayerCbk == nullptr) lefCallbacks->LayerCbk = (lefrLayerCbkFnType) func; - if (lefCallbacks->LibraryEndCbk == 0) + if (lefCallbacks->LibraryEndCbk == nullptr) lefCallbacks->LibraryEndCbk = (lefrVoidCbkFnType) func; - if (lefCallbacks->MacroBeginCbk == 0) + if (lefCallbacks->MacroBeginCbk == nullptr) lefCallbacks->MacroBeginCbk = (lefrStringCbkFnType) func; - if (lefCallbacks->MacroCbk == 0) + if (lefCallbacks->MacroCbk == nullptr) lefCallbacks->MacroCbk = (lefrMacroCbkFnType) func; - if (lefCallbacks->MacroClassTypeCbk == 0) + if (lefCallbacks->MacroClassTypeCbk == nullptr) lefCallbacks->MacroClassTypeCbk = (lefrStringCbkFnType) func; - if (lefCallbacks->MacroOriginCbk == 0) + if (lefCallbacks->MacroOriginCbk == nullptr) lefCallbacks->MacroOriginCbk = (lefrMacroNumCbkFnType) func; - if (lefCallbacks->MacroSiteCbk == 0) + if (lefCallbacks->MacroSiteCbk == nullptr) lefCallbacks->MacroSiteCbk = (lefrMacroSiteCbkFnType) func; - if (lefCallbacks->MacroForeignCbk == 0) + if (lefCallbacks->MacroForeignCbk == nullptr) lefCallbacks->MacroForeignCbk = (lefrMacroForeignCbkFnType) func; - if (lefCallbacks->MacroSizeCbk == 0) + if (lefCallbacks->MacroSizeCbk == nullptr) lefCallbacks->MacroSizeCbk = (lefrMacroNumCbkFnType) func; - if (lefCallbacks->MacroFixedMaskCbk == 0) + if (lefCallbacks->MacroFixedMaskCbk == nullptr) lefCallbacks->MacroFixedMaskCbk = (lefrIntegerCbkFnType) func; - if (lefCallbacks->TimingCbk == 0) + if (lefCallbacks->TimingCbk == nullptr) lefCallbacks->TimingCbk = (lefrTimingCbkFnType) func; - if (lefCallbacks->MinFeatureCbk == 0) + if (lefCallbacks->MinFeatureCbk == nullptr) lefCallbacks->MinFeatureCbk = (lefrMinFeatureCbkFnType) func; - if (lefCallbacks->NoiseMarginCbk == 0) + if (lefCallbacks->NoiseMarginCbk == nullptr) lefCallbacks->NoiseMarginCbk = (lefrNoiseMarginCbkFnType) func; - if (lefCallbacks->NoiseTableCbk == 0) + if (lefCallbacks->NoiseTableCbk == nullptr) lefCallbacks->NoiseTableCbk = (lefrNoiseTableCbkFnType) func; - if (lefCallbacks->NonDefaultCbk == 0) + if (lefCallbacks->NonDefaultCbk == nullptr) lefCallbacks->NonDefaultCbk = (lefrNonDefaultCbkFnType) func; - if (lefCallbacks->ObstructionCbk == 0) + if (lefCallbacks->ObstructionCbk == nullptr) lefCallbacks->ObstructionCbk = (lefrObstructionCbkFnType) func; - if (lefCallbacks->PinCbk == 0) + if (lefCallbacks->PinCbk == nullptr) lefCallbacks->PinCbk = (lefrPinCbkFnType) func; - if (lefCallbacks->PropBeginCbk == 0) + if (lefCallbacks->PropBeginCbk == nullptr) lefCallbacks->PropBeginCbk = (lefrVoidCbkFnType) func; - if (lefCallbacks->PropCbk == 0) + if (lefCallbacks->PropCbk == nullptr) lefCallbacks->PropCbk = (lefrPropCbkFnType) func; - if (lefCallbacks->PropEndCbk == 0) + if (lefCallbacks->PropEndCbk == nullptr) lefCallbacks->PropEndCbk = (lefrVoidCbkFnType) func; - if (lefCallbacks->SiteCbk == 0) + if (lefCallbacks->SiteCbk == nullptr) lefCallbacks->SiteCbk = (lefrSiteCbkFnType) func; - if (lefCallbacks->SpacingBeginCbk == 0) + if (lefCallbacks->SpacingBeginCbk == nullptr) lefCallbacks->SpacingBeginCbk = (lefrVoidCbkFnType) func; - if (lefCallbacks->SpacingCbk == 0) + if (lefCallbacks->SpacingCbk == nullptr) lefCallbacks->SpacingCbk = (lefrSpacingCbkFnType) func; - if (lefCallbacks->SpacingEndCbk == 0) + if (lefCallbacks->SpacingEndCbk == nullptr) lefCallbacks->SpacingEndCbk = (lefrVoidCbkFnType) func; - if (lefCallbacks->UnitsCbk == 0) + if (lefCallbacks->UnitsCbk == nullptr) lefCallbacks->UnitsCbk = (lefrUnitsCbkFnType) func; - if ((lefCallbacks->VersionCbk == 0) && (lefCallbacks->VersionStrCbk == 0)) { + if ((lefCallbacks->VersionCbk == nullptr) + && (lefCallbacks->VersionStrCbk == nullptr)) { // both version callbacks weren't set, if either one is set, it is ok lefCallbacks->VersionCbk = (lefrDoubleCbkFnType) func; lefCallbacks->VersionStrCbk = (lefrStringCbkFnType) func; } - if (lefCallbacks->ViaCbk == 0) + if (lefCallbacks->ViaCbk == nullptr) lefCallbacks->ViaCbk = (lefrViaCbkFnType) func; - if (lefCallbacks->ViaRuleCbk == 0) + if (lefCallbacks->ViaRuleCbk == nullptr) lefCallbacks->ViaRuleCbk = (lefrViaRuleCbkFnType) func; - if (lefCallbacks->InputAntennaCbk == 0) + if (lefCallbacks->InputAntennaCbk == nullptr) lefCallbacks->InputAntennaCbk = (lefrDoubleCbkFnType) func; - if (lefCallbacks->OutputAntennaCbk == 0) + if (lefCallbacks->OutputAntennaCbk == nullptr) lefCallbacks->OutputAntennaCbk = (lefrDoubleCbkFnType) func; - if (lefCallbacks->InoutAntennaCbk == 0) + if (lefCallbacks->InoutAntennaCbk == nullptr) lefCallbacks->InoutAntennaCbk = (lefrDoubleCbkFnType) func; // NEW CALLBACK - Add a line here for each new callback routine - if (lefCallbacks->AntennaInputCbk == 0) + if (lefCallbacks->AntennaInputCbk == nullptr) lefCallbacks->AntennaInputCbk = (lefrDoubleCbkFnType) func; - if (lefCallbacks->AntennaInoutCbk == 0) + if (lefCallbacks->AntennaInoutCbk == nullptr) lefCallbacks->AntennaInoutCbk = (lefrDoubleCbkFnType) func; - if (lefCallbacks->AntennaOutputCbk == 0) + if (lefCallbacks->AntennaOutputCbk == nullptr) lefCallbacks->AntennaOutputCbk = (lefrDoubleCbkFnType) func; - if (lefCallbacks->ManufacturingCbk == 0) + if (lefCallbacks->ManufacturingCbk == nullptr) lefCallbacks->ManufacturingCbk = (lefrDoubleCbkFnType) func; - if (lefCallbacks->UseMinSpacingCbk == 0) + if (lefCallbacks->UseMinSpacingCbk == nullptr) lefCallbacks->UseMinSpacingCbk = (lefrUseMinSpacingCbkFnType) func; - if (lefCallbacks->ClearanceMeasureCbk == 0) + if (lefCallbacks->ClearanceMeasureCbk == nullptr) lefCallbacks->ClearanceMeasureCbk = (lefrStringCbkFnType) func; - if (lefCallbacks->MacroClassTypeCbk == 0) + if (lefCallbacks->MacroClassTypeCbk == nullptr) lefCallbacks->MacroClassTypeCbk = (lefrStringCbkFnType) func; - if (lefCallbacks->MacroOriginCbk == 0) + if (lefCallbacks->MacroOriginCbk == nullptr) lefCallbacks->MacroOriginCbk = (lefrMacroNumCbkFnType) func; - if (lefCallbacks->MacroSiteCbk == 0) + if (lefCallbacks->MacroSiteCbk == nullptr) lefCallbacks->MacroSiteCbk = (lefrMacroSiteCbkFnType) func; - if (lefCallbacks->MacroForeignCbk == 0) + if (lefCallbacks->MacroForeignCbk == nullptr) lefCallbacks->MacroForeignCbk = (lefrMacroForeignCbkFnType) func; - if (lefCallbacks->MacroSizeCbk == 0) + if (lefCallbacks->MacroSizeCbk == nullptr) lefCallbacks->MacroSizeCbk = (lefrMacroNumCbkFnType) func; - if (lefCallbacks->MacroFixedMaskCbk == 0) + if (lefCallbacks->MacroFixedMaskCbk == nullptr) lefCallbacks->MacroFixedMaskCbk = (lefrIntegerCbkFnType) func; - if (lefCallbacks->MacroEndCbk == 0) + if (lefCallbacks->MacroEndCbk == nullptr) lefCallbacks->MacroEndCbk = (lefrStringCbkFnType) func; - if (lefCallbacks->MaxStackViaCbk == 0) + if (lefCallbacks->MaxStackViaCbk == nullptr) lefCallbacks->MaxStackViaCbk = (lefrMaxStackViaCbkFnType) func; - if (lefCallbacks->ExtensionCbk == 0) + if (lefCallbacks->ExtensionCbk == nullptr) lefCallbacks->ExtensionCbk = (lefrStringCbkFnType) func; - if (lefCallbacks->DensityCbk == 0) + if (lefCallbacks->DensityCbk == nullptr) lefCallbacks->DensityCbk = (lefrDensityCbkFnType) func; - if (lefCallbacks->FixedMaskCbk == 0) + if (lefCallbacks->FixedMaskCbk == nullptr) lefCallbacks->FixedMaskCbk = (lefrIntegerCbkFnType) func; } @@ -689,348 +690,348 @@ void lefrUnsetCallbacks() void lefrUnsetAntennaInoutCbk() { LEF_INIT; - lefCallbacks->AntennaInoutCbk = 0; + lefCallbacks->AntennaInoutCbk = nullptr; } void lefrUnsetAntennaInputCbk() { LEF_INIT; - lefCallbacks->AntennaInputCbk = 0; + lefCallbacks->AntennaInputCbk = nullptr; } void lefrUnsetAntennaOutputCbk() { LEF_INIT; - lefCallbacks->AntennaOutputCbk = 0; + lefCallbacks->AntennaOutputCbk = nullptr; } void lefrUnsetArrayBeginCbk() { LEF_INIT; - lefCallbacks->ArrayBeginCbk = 0; + lefCallbacks->ArrayBeginCbk = nullptr; } void lefrUnsetArrayCbk() { LEF_INIT; - lefCallbacks->ArrayCbk = 0; + lefCallbacks->ArrayCbk = nullptr; } void lefrUnsetArrayEndCbk() { LEF_INIT; - lefCallbacks->ArrayEndCbk = 0; + lefCallbacks->ArrayEndCbk = nullptr; } void lefrUnsetBusBitCharsCbk() { LEF_INIT; - lefCallbacks->BusBitCharsCbk = 0; + lefCallbacks->BusBitCharsCbk = nullptr; } void lefrUnsetCaseSensitiveCbk() { LEF_INIT; - lefCallbacks->CaseSensitiveCbk = 0; + lefCallbacks->CaseSensitiveCbk = nullptr; } void lefrUnsetClearanceMeasureCbk() { LEF_INIT; - lefCallbacks->ClearanceMeasureCbk = 0; + lefCallbacks->ClearanceMeasureCbk = nullptr; } void lefrUnsetCorrectionTableCbk() { LEF_INIT; - lefCallbacks->CorrectionTableCbk = 0; + lefCallbacks->CorrectionTableCbk = nullptr; } void lefrUnsetDensityCbk() { LEF_INIT; - lefCallbacks->DensityCbk = 0; + lefCallbacks->DensityCbk = nullptr; } void lefrUnsetDielectricCbk() { LEF_INIT; - lefCallbacks->DielectricCbk = 0; + lefCallbacks->DielectricCbk = nullptr; } void lefrUnsetDividerCharCbk() { LEF_INIT; - lefCallbacks->DividerCharCbk = 0; + lefCallbacks->DividerCharCbk = nullptr; } void lefrUnsetEdgeRateScaleFactorCbk() { LEF_INIT; - lefCallbacks->EdgeRateScaleFactorCbk = 0; + lefCallbacks->EdgeRateScaleFactorCbk = nullptr; } void lefrUnsetEdgeRateThreshold1Cbk() { LEF_INIT; - lefCallbacks->EdgeRateThreshold1Cbk = 0; + lefCallbacks->EdgeRateThreshold1Cbk = nullptr; } void lefrUnsetEdgeRateThreshold2Cbk() { LEF_INIT; - lefCallbacks->EdgeRateThreshold2Cbk = 0; + lefCallbacks->EdgeRateThreshold2Cbk = nullptr; } void lefrUnsetExtensionCbk() { LEF_INIT; - lefCallbacks->ExtensionCbk = 0; + lefCallbacks->ExtensionCbk = nullptr; } void lefrUnsetFixedMaskCbk() { LEF_INIT; - lefCallbacks->FixedMaskCbk = 0; + lefCallbacks->FixedMaskCbk = nullptr; } void lefrUnsetIRDropBeginCbk() { LEF_INIT; - lefCallbacks->IRDropBeginCbk = 0; + lefCallbacks->IRDropBeginCbk = nullptr; } void lefrUnsetIRDropCbk() { LEF_INIT; - lefCallbacks->IRDropCbk = 0; + lefCallbacks->IRDropCbk = nullptr; } void lefrUnsetIRDropEndCbk() { LEF_INIT; - lefCallbacks->IRDropEndCbk = 0; + lefCallbacks->IRDropEndCbk = nullptr; } void lefrUnsetInoutAntennaCbk() { LEF_INIT; - lefCallbacks->InoutAntennaCbk = 0; + lefCallbacks->InoutAntennaCbk = nullptr; } void lefrUnsetInputAntennaCbk() { LEF_INIT; - lefCallbacks->InputAntennaCbk = 0; + lefCallbacks->InputAntennaCbk = nullptr; } void lefrUnsetLayerCbk() { LEF_INIT; - lefCallbacks->LayerCbk = 0; + lefCallbacks->LayerCbk = nullptr; } void lefrUnsetLibraryEndCbk() { LEF_INIT; - lefCallbacks->LibraryEndCbk = 0; + lefCallbacks->LibraryEndCbk = nullptr; } void lefrUnsetMacroBeginCbk() { LEF_INIT; - lefCallbacks->MacroBeginCbk = 0; + lefCallbacks->MacroBeginCbk = nullptr; } void lefrUnsetMacroCbk() { LEF_INIT; - lefCallbacks->MacroCbk = 0; + lefCallbacks->MacroCbk = nullptr; } void lefrUnsetMacroClassTypeCbk() { LEF_INIT; - lefCallbacks->MacroClassTypeCbk = 0; + lefCallbacks->MacroClassTypeCbk = nullptr; } void lefrUnsetMacroEndCbk() { LEF_INIT; - lefCallbacks->MacroEndCbk = 0; + lefCallbacks->MacroEndCbk = nullptr; } void lefrUnsetMacroFixedMaskCbk() { LEF_INIT; - lefCallbacks->MacroFixedMaskCbk = 0; + lefCallbacks->MacroFixedMaskCbk = nullptr; } void lefrUnsetMacroOriginCbk() { LEF_INIT; - lefCallbacks->MacroOriginCbk = 0; + lefCallbacks->MacroOriginCbk = nullptr; } void lefrUnsetMacroSiteCbk() { LEF_INIT; - lefCallbacks->MacroSiteCbk = 0; + lefCallbacks->MacroSiteCbk = nullptr; } void lefrUnsetMacroForeignCbk() { LEF_INIT; - lefCallbacks->MacroForeignCbk = 0; + lefCallbacks->MacroForeignCbk = nullptr; } void lefrUnsetMacroSizeCbk() { LEF_INIT; - lefCallbacks->MacroSizeCbk = 0; + lefCallbacks->MacroSizeCbk = nullptr; } void lefrUnsetManufacturingCbk() { LEF_INIT; - lefCallbacks->ManufacturingCbk = 0; + lefCallbacks->ManufacturingCbk = nullptr; } void lefrUnsetMaxStackViaCbk() { LEF_INIT; - lefCallbacks->MaxStackViaCbk = 0; + lefCallbacks->MaxStackViaCbk = nullptr; } void lefrUnsetMinFeatureCbk() { LEF_INIT; - lefCallbacks->MinFeatureCbk = 0; + lefCallbacks->MinFeatureCbk = nullptr; } void lefrUnsetNoWireExtensionCbk() { LEF_INIT; - lefCallbacks->NoWireExtensionCbk = 0; + lefCallbacks->NoWireExtensionCbk = nullptr; } void lefrUnsetNoiseMarginCbk() { LEF_INIT; - lefCallbacks->NoiseMarginCbk = 0; + lefCallbacks->NoiseMarginCbk = nullptr; } void lefrUnsetNoiseTableCbk() { LEF_INIT; - lefCallbacks->NoiseTableCbk = 0; + lefCallbacks->NoiseTableCbk = nullptr; } void lefrUnsetNonDefaultCbk() { LEF_INIT; - lefCallbacks->NonDefaultCbk = 0; + lefCallbacks->NonDefaultCbk = nullptr; } void lefrUnsetObstructionCbk() { LEF_INIT; - lefCallbacks->ObstructionCbk = 0; + lefCallbacks->ObstructionCbk = nullptr; } void lefrUnsetOutputAntennaCbk() { LEF_INIT; - lefCallbacks->OutputAntennaCbk = 0; + lefCallbacks->OutputAntennaCbk = nullptr; } void lefrUnsetPinCbk() { LEF_INIT; - lefCallbacks->PinCbk = 0; + lefCallbacks->PinCbk = nullptr; } void lefrUnsetPropBeginCbk() { LEF_INIT; - lefCallbacks->PropBeginCbk = 0; + lefCallbacks->PropBeginCbk = nullptr; } void lefrUnsetPropCbk() { LEF_INIT; - lefCallbacks->PropCbk = 0; + lefCallbacks->PropCbk = nullptr; } void lefrUnsetPropEndCbk() { LEF_INIT; - lefCallbacks->PropEndCbk = 0; + lefCallbacks->PropEndCbk = nullptr; } void lefrUnsetSiteCbk() { LEF_INIT; - lefCallbacks->SiteCbk = 0; + lefCallbacks->SiteCbk = nullptr; } void lefrUnsetSpacingBeginCbk() { LEF_INIT; - lefCallbacks->SpacingBeginCbk = 0; + lefCallbacks->SpacingBeginCbk = nullptr; } void lefrUnsetSpacingCbk() { LEF_INIT; - lefCallbacks->SpacingCbk = 0; + lefCallbacks->SpacingCbk = nullptr; } void lefrUnsetSpacingEndCbk() { LEF_INIT; - lefCallbacks->SpacingEndCbk = 0; + lefCallbacks->SpacingEndCbk = nullptr; } void lefrUnsetTimingCbk() { LEF_INIT; - lefCallbacks->TimingCbk = 0; + lefCallbacks->TimingCbk = nullptr; } void lefrUnsetUnitsCbk() { LEF_INIT; - lefCallbacks->UnitsCbk = 0; + lefCallbacks->UnitsCbk = nullptr; } void lefrUnsetUseMinSpacingCbk() { LEF_INIT; - lefCallbacks->UseMinSpacingCbk = 0; + lefCallbacks->UseMinSpacingCbk = nullptr; } void lefrUnsetVersionCbk() { LEF_INIT; - lefCallbacks->VersionCbk = 0; + lefCallbacks->VersionCbk = nullptr; } void lefrUnsetVersionStrCbk() { LEF_INIT; - lefCallbacks->VersionStrCbk = 0; + lefCallbacks->VersionStrCbk = nullptr; } void lefrUnsetViaCbk() { LEF_INIT; - lefCallbacks->ViaCbk = 0; + lefCallbacks->ViaCbk = nullptr; } void lefrUnsetViaRuleCbk() { LEF_INIT; - lefCallbacks->ViaRuleCbk = 0; + lefCallbacks->ViaRuleCbk = nullptr; } // Setting of user data. @@ -1508,7 +1509,7 @@ void lefrSetReadFunction(LEFI_READ_FUNCTION f) void lefrUnsetReadFunction() { LEF_INIT; - lefSettings->ReadFunction = 0; + lefSettings->ReadFunction = nullptr; } // Set the maximum number of warnings diff --git a/src/odb/src/lef/lef/lefrSettings.cpp b/src/odb/src/lef/lef/lefrSettings.cpp index 5a780ce4832..a5f5bda74fa 100644 --- a/src/odb/src/lef/lef/lefrSettings.cpp +++ b/src/odb/src/lef/lef/lefrSettings.cpp @@ -42,11 +42,11 @@ const char* lefrSettings::lefOxides[] = { "OXIDE22", "OXIDE23", "OXIDE24", "OXIDE25", "OXIDE26", "OXIDE27", "OXIDE28", "OXIDE29", "OXIDE30", "OXIDE31", "OXIDE32"}; -lefrSettings* lefSettings = NULL; +lefrSettings* lefSettings = nullptr; lefrSettings::lefrSettings() - : LineNumberFunction(0), - ReadFunction(0), + : LineNumberFunction(nullptr), + ReadFunction(nullptr), AntennaInoutWarnings(999), AntennaInputWarnings(999), AntennaOutputWarnings(999), @@ -88,15 +88,15 @@ lefrSettings::lefrSettings() UseMinSpacingWarnings(999), ViaRuleWarnings(999), ViaWarnings(999), - UserData(NULL), + UserData(nullptr), dAllMsgs(0), VersionNum(0.0), - MallocFunction(0), - ReallocFunction(0), - FreeFunction(0), - ErrorLogFunction(0), - SetLogFunction(0), - WarningLogFunction(0) + MallocFunction(nullptr), + ReallocFunction(nullptr), + FreeFunction(nullptr), + ErrorLogFunction(nullptr), + SetLogFunction(nullptr), + WarningLogFunction(nullptr) { memset(MsgLimit, 0, MAX_LEF_MSGS * sizeof(int)); init_symbol_table(); diff --git a/src/odb/src/lef/lef/lefwWriter.cpp b/src/odb/src/lef/lef/lefwWriter.cpp index ddaf9229bd0..fd0b4857207 100644 --- a/src/odb/src/lef/lef/lefwWriter.cpp +++ b/src/odb/src/lef/lef/lefwWriter.cpp @@ -205,7 +205,7 @@ typedef void (*LEFI_WARNING_LOG_FUNCTION)(const char*); LEFI_LOG_FUNCTION lefwErrorLogFunction; LEFI_WARNING_LOG_FUNCTION lefwWarningLogFunction; -FILE* lefwFile = 0; // File to write to. +FILE* lefwFile = nullptr; // File to write to. int lefwSynArray[MAXSYN]; // array of syntax int lefwLines = 0; // number of lines written int lefwState = LEFW_UNINIT; // Current state of writer @@ -699,7 +699,7 @@ int lefwBusBitChars(const char* busBitChars) return LEFW_BAD_ORDER; // not of the ENDs if (lefwSynArray[LEFW_BUSBITCHARS]) return LEFW_ALREADY_DEFINED; - if (busBitChars && busBitChars != 0 && *busBitChars != 0) { + if (busBitChars && busBitChars != nullptr && *busBitChars != 0) { if (lefwWriteEncrypt) encPrint(lefwFile, (char*) "BUSBITCHARS \"%s\" ;\n", busBitChars); else @@ -720,7 +720,7 @@ int lefwDividerChar(const char* dividerChar) return LEFW_BAD_ORDER; // not of the ENDs if (lefwSynArray[LEFW_DIVIDERCHAR]) return LEFW_ALREADY_DEFINED; - if (dividerChar && dividerChar != 0 && *dividerChar != 0) { + if (dividerChar && dividerChar != nullptr && *dividerChar != 0) { if (lefwWriteEncrypt) encPrint(lefwFile, (char*) "DIVIDERCHAR \"%s\" ;\n", dividerChar); else @@ -1579,7 +1579,7 @@ int lefwLayerRouting(const char* direction, double width) prtSemiColon = 0; } if (lefwWriteEncrypt) { - if (!direction || direction == 0 || *direction == 0) { + if (!direction || direction == nullptr || *direction == 0) { encPrint(lefwFile, (char*) "DIRECTION is required in Layer(Routing).\n"); return LEFW_BAD_DATA; } @@ -1593,7 +1593,7 @@ int lefwLayerRouting(const char* direction, double width) encPrint(lefwFile, (char*) " DIRECTION %s ;\n", direction); encPrint(lefwFile, (char*) " WIDTH %.11g ;\n", width); } else { - if (!direction || direction == 0 || *direction == 0) { + if (!direction || direction == nullptr || *direction == 0) { fprintf(lefwFile, "DIRECTION is required in Layer(Routing).\n"); return LEFW_BAD_DATA; } @@ -2364,7 +2364,7 @@ int lefwLayerRoutingResistance(const char* resistance) return LEFW_BAD_ORDER; if (!lefwIsRouting) return LEFW_BAD_DATA; // only routing calls this func - if (!resistance || resistance == 0 || *resistance == 0) + if (!resistance || resistance == nullptr || *resistance == 0) return LEFW_BAD_DATA; if (prtSemiColon) { // the previous statement hasn't written the ; yet @@ -2398,7 +2398,7 @@ int lefwLayerRoutingCapacitance(const char* capacitance) fprintf(lefwFile, ";\n"); prtSemiColon = 0; } - if (!capacitance || capacitance == 0 || *capacitance == 0) + if (!capacitance || capacitance == nullptr || *capacitance == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " CAPACITANCE CPERSQDIST %s ;\n", capacitance); @@ -3940,8 +3940,8 @@ int lefwIntPropDef(const char* objType, /* if ((! objType && ! *objType) || (! propName && ! *propName)) */ - if (((objType == 0) || (*objType == 0)) - || ((propName == 0) || (*propName == 0))) + if (((objType == nullptr) || (*objType == 0)) + || ((propName == nullptr) || (*propName == 0))) return LEFW_BAD_DATA; if (strcmp(objType, "LIBRARY") && strcmp(objType, "VIA") @@ -3986,8 +3986,8 @@ int lefwRealPropDef(const char* objType, return LEFW_UNINITIALIZED; if (lefwState != LEFW_PROPERTYDEF_START && lefwState != LEFW_PROPERTYDEF) return LEFW_BAD_ORDER; - if (((objType == 0) || (*objType == 0)) - || ((propName == 0) || (*propName == 0))) // require + if (((objType == nullptr) || (*objType == 0)) + || ((propName == nullptr) || (*propName == 0))) // require return LEFW_BAD_DATA; if (strcmp(objType, "LIBRARY") && strcmp(objType, "VIA") @@ -4032,8 +4032,8 @@ int lefwStringPropDef(const char* objType, return LEFW_UNINITIALIZED; if (lefwState != LEFW_PROPERTYDEF_START && lefwState != LEFW_PROPERTYDEF) return LEFW_BAD_ORDER; - if (((objType == 0) || (*objType == 0)) - || ((propName == 0) || (*propName == 0))) + if (((objType == nullptr) || (*objType == 0)) + || ((propName == nullptr) || (*propName == 0))) return LEFW_BAD_DATA; if (strcmp(objType, "LIBRARY") && strcmp(objType, "VIA") @@ -4612,7 +4612,7 @@ int lefwViaRulePrtLayer(const char* layerName, double metalOverhang) { lefwObsoleteNum = LEFW_VIARULEGENERATE; - if (!layerName || layerName == 0 || *layerName == 0) + if (!layerName || layerName == nullptr || *layerName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " LAYER %s ;\n", layerName); @@ -4678,7 +4678,7 @@ int lefwStartViaRule(const char* viaRuleName) if (lefwState != LEFW_INIT && lefwState < LEFW_END) return LEFW_BAD_ORDER; // not of the ENDs - if (!viaRuleName || viaRuleName == 0 || *viaRuleName == 0) + if (!viaRuleName || viaRuleName == nullptr || *viaRuleName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) "VIARULE %s\n", viaRuleName); @@ -4768,7 +4768,7 @@ int lefwStartViaRuleGen(const char* viaRuleName) if (lefwState != LEFW_INIT && lefwState < LEFW_END) return LEFW_BAD_ORDER; // not of the ENDs - if (!viaRuleName || viaRuleName == 0 || *viaRuleName == 0) + if (!viaRuleName || viaRuleName == nullptr || *viaRuleName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) "VIARULE %s GENERATE", viaRuleName); @@ -4844,7 +4844,7 @@ int lefwViaRuleGenLayerEnclosure(const char* layerName, if (lefwNumViaRuleLayers >= 2) return LEFW_BAD_ORDER; - if (!layerName || layerName == 0 || *layerName == 0) + if (!layerName || layerName == nullptr || *layerName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) "\n LAYER %s ;\n", layerName); @@ -4895,7 +4895,7 @@ int lefwViaRuleGenLayer3(const char* layerName, return LEFW_BAD_ORDER; if (lefwNumViaRuleLayers != 2) // this routine has to be after two layers return LEFW_BAD_ORDER; // be written - if (!layerName || layerName == 0 || *layerName == 0) + if (!layerName || layerName == nullptr || *layerName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) { encPrint(lefwFile, (char*) " LAYER %s ;\n", layerName); @@ -4956,7 +4956,7 @@ int lefwStartNonDefaultRule(const char* ruleName) if (lefwState != LEFW_INIT && lefwState < LEFW_END) return LEFW_BAD_ORDER; // not of the ENDs - if (!ruleName || ruleName == 0 || *ruleName == 0) + if (!ruleName || ruleName == nullptr || *ruleName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) "NONDEFAULTRULE %s\n", ruleName); @@ -5099,7 +5099,8 @@ int lefwNonDefaultRuleLayer(const char* routingLayerName, if (lefwState != LEFW_NONDEFAULTRULE_START && lefwState != LEFW_NONDEFAULTRULE) return LEFW_BAD_ORDER; - if (!routingLayerName || routingLayerName == 0 || *routingLayerName == 0) + if (!routingLayerName || routingLayerName == nullptr + || *routingLayerName == 0) return LEFW_BAD_DATA; if (versionNum >= 5.6 && (resist || capacitance || edgeCap)) return LEFW_OBSOLETE; @@ -5208,9 +5209,9 @@ int lefwSpacing(const char* layerName1, return LEFW_UNINITIALIZED; if (lefwState != LEFW_SPACING_START && lefwState != LEFW_SPACING) return LEFW_BAD_ORDER; - if (!layerName1 || layerName1 == 0 || *layerName1 == 0) + if (!layerName1 || layerName1 == nullptr || *layerName1 == 0) return LEFW_BAD_DATA; - if (!layerName2 || layerName2 == 0 || *layerName2 == 0) + if (!layerName2 || layerName2 == nullptr || *layerName2 == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) { encPrint(lefwFile, @@ -5595,9 +5596,9 @@ int lefwIrdropTable(const char* tableName, const char* currentsNvolts) return LEFW_UNINITIALIZED; if (lefwState != LEFW_IRDROP_START && lefwState != LEFW_IRDROP) return LEFW_BAD_ORDER; - if (!tableName || tableName == 0 || *tableName == 0) + if (!tableName || tableName == nullptr || *tableName == 0) return LEFW_BAD_DATA; - if (!currentsNvolts || currentsNvolts == 0 || *currentsNvolts == 0) + if (!currentsNvolts || currentsNvolts == nullptr || *currentsNvolts == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " TABLE %s %s ;\n", tableName, currentsNvolts); @@ -5640,7 +5641,7 @@ int lefwSite(const char* siteName, return LEFW_BAD_ORDER; if (lefwState != LEFW_INIT && lefwState < LEFW_END) return LEFW_BAD_ORDER; // not of the ENDs - if (!siteName || siteName == 0 || *siteName == 0) + if (!siteName || siteName == nullptr || *siteName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) { encPrint(lefwFile, (char*) "SITE %s\n", siteName); @@ -5675,7 +5676,7 @@ int lefwSiteRowPattern(const char* siteName, int orient) return LEFW_UNINITIALIZED; if (lefwState != LEFW_SITE) return LEFW_BAD_ORDER; - if (!siteName || siteName == 0 || *siteName == 0) + if (!siteName || siteName == nullptr || *siteName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, @@ -5695,9 +5696,9 @@ int lefwSiteRowPatternStr(const char* siteName, const char* orient) return LEFW_UNINITIALIZED; if (lefwState != LEFW_SITE) return LEFW_BAD_ORDER; - if (!siteName || siteName == 0 || *siteName == 0) + if (!siteName || siteName == nullptr || *siteName == 0) return LEFW_BAD_DATA; - if (!orient || orient == 0 || *orient == 0) + if (!orient || orient == nullptr || *orient == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " ROWPATTERN %s %s ;\n", siteName, orient); @@ -5734,7 +5735,7 @@ int lefwStartArray(const char* arrayName) return LEFW_BAD_ORDER; if (lefwState != LEFW_INIT && lefwState < LEFW_END) return LEFW_BAD_ORDER; // not of the ENDs - if (!arrayName || arrayName == 0 || *arrayName == 0) + if (!arrayName || arrayName == nullptr || *arrayName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) "ARRAY %s\n", arrayName); @@ -5762,7 +5763,7 @@ int lefwArraySite(const char* name, return LEFW_UNINITIALIZED; if (lefwState != LEFW_ARRAY_START && lefwState != LEFW_ARRAY) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) @@ -5800,7 +5801,7 @@ int lefwArraySiteStr(const char* name, return LEFW_UNINITIALIZED; if (lefwState != LEFW_ARRAY_START && lefwState != LEFW_ARRAY) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) @@ -5838,7 +5839,7 @@ int lefwArrayCanplace(const char* name, return LEFW_UNINITIALIZED; if (lefwState != LEFW_ARRAY_START && lefwState != LEFW_ARRAY) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) @@ -5877,7 +5878,7 @@ int lefwArrayCanplaceStr(const char* name, return LEFW_UNINITIALIZED; if (lefwState != LEFW_ARRAY_START && lefwState != LEFW_ARRAY) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) @@ -5916,7 +5917,7 @@ int lefwArrayCannotoccupy(const char* name, return LEFW_UNINITIALIZED; if (lefwState != LEFW_ARRAY_START && lefwState != LEFW_ARRAY) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) @@ -5955,7 +5956,7 @@ int lefwArrayCannotoccupyStr(const char* name, return LEFW_UNINITIALIZED; if (lefwState != LEFW_ARRAY_START && lefwState != LEFW_ARRAY) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) @@ -5991,11 +5992,11 @@ int lefwArrayTracks(const char* xy, return LEFW_UNINITIALIZED; if (lefwState != LEFW_ARRAY_START && lefwState != LEFW_ARRAY) return LEFW_BAD_ORDER; - if (!xy || xy == 0 || *xy == 0) + if (!xy || xy == nullptr || *xy == 0) return LEFW_BAD_DATA; if (strcmp(xy, "X") && strcmp(xy, "Y")) return LEFW_BAD_DATA; - if (!layers || layers == 0 || *layers == 0) + if (!layers || layers == nullptr || *layers == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, @@ -6029,7 +6030,7 @@ int lefwStartArrayFloorplan(const char* name) return LEFW_BAD_ORDER; if (lefwIsArrayFloorp) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " FLOORPLAN %s\n", name); @@ -6138,7 +6139,7 @@ int lefwEndArrayFloorplan(const char* name) return LEFW_UNINITIALIZED; if (!lefwIsArrayFloorp) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " END %s\n\n", name); @@ -6159,7 +6160,7 @@ int lefwArrayGcellgrid(const char* xy, return LEFW_UNINITIALIZED; if (lefwState != LEFW_ARRAY_START && lefwState != LEFW_ARRAY) return LEFW_BAD_ORDER; - if (!xy || xy == 0 || *xy == 0) + if (!xy || xy == nullptr || *xy == 0) return LEFW_BAD_DATA; if (strcmp(xy, "X") && strcmp(xy, "Y")) return LEFW_BAD_DATA; @@ -6242,7 +6243,7 @@ int lefwEndArray(const char* arrayName) return LEFW_UNINITIALIZED; if (lefwState != LEFW_ARRAY_START && lefwState != LEFW_ARRAY) return LEFW_BAD_ORDER; - if (!arrayName || arrayName == 0 || *arrayName == 0) + if (!arrayName || arrayName == nullptr || *arrayName == 0) return LEFW_BAD_DATA; if (lefwIsFloorp || lefwIsArrayDef) return LEFW_BAD_ORDER; @@ -6262,7 +6263,7 @@ int lefwStartMacro(const char* macroName) return LEFW_UNINITIALIZED; if (lefwState == LEFW_MACRO_START || lefwState == LEFW_MACRO) return LEFW_BAD_ORDER; - if (!macroName || macroName == 0 || *macroName == 0) + if (!macroName || macroName == nullptr || *macroName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) "MACRO %s\n", macroName); @@ -6286,7 +6287,7 @@ int lefwMacroClass(const char* value1, const char* value2) return LEFW_BAD_ORDER; if (lefwState != LEFW_MACRO_START && lefwState != LEFW_MACRO) return LEFW_BAD_ORDER; - if (!value1 || value1 == 0 || *value1 == 0) + if (!value1 || value1 == nullptr || *value1 == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) { if (strcmp(value1, "RING") == 0) @@ -6427,7 +6428,7 @@ int lefwMacroSource(const char* value1) return LEFW_BAD_ORDER; if (versionNum >= 5.6) return LEFW_OBSOLETE; - if (!value1 || value1 == 0 || *value1 == 0) + if (!value1 || value1 == nullptr || *value1 == 0) return LEFW_BAD_DATA; if (strcmp(value1, "USER") == 0 || strcmp(value1, "GENERATE") == 0 || strcmp(value1, "BLOCK") == 0) @@ -6451,7 +6452,7 @@ int lefwMacroForeign(const char* name, double xl, double yl, int orient) return LEFW_BAD_ORDER; if (lefwState != LEFW_MACRO_START && lefwState != LEFW_MACRO) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) { encPrint(lefwFile, (char*) " FOREIGN %s ", name); @@ -6493,7 +6494,7 @@ int lefwMacroForeignStr(const char* name, return LEFW_BAD_ORDER; if (lefwState != LEFW_MACRO_START && lefwState != LEFW_MACRO) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) { encPrint(lefwFile, (char*) " FOREIGN %s ", name); @@ -6550,7 +6551,7 @@ int lefwMacroEEQ(const char* macroName) return LEFW_BAD_ORDER; if (lefwState != LEFW_MACRO_START && lefwState != LEFW_MACRO) return LEFW_BAD_ORDER; - if (!macroName || macroName == 0 || *macroName == 0) + if (!macroName || macroName == nullptr || *macroName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " EEQ %s ;\n", macroName); @@ -6573,7 +6574,7 @@ int lefwMacroLEQ(const char* macroName) return LEFW_BAD_ORDER; if (versionNum >= 5.6) return LEFW_OBSOLETE; - if (!macroName || macroName == 0 || *macroName == 0) + if (!macroName || macroName == nullptr || *macroName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " LEQ %s ;\n", macroName); @@ -6611,7 +6612,7 @@ int lefwMacroSymmetry(const char* symmetry) return LEFW_BAD_ORDER; if (lefwState != LEFW_MACRO_START && lefwState != LEFW_MACRO) return LEFW_BAD_ORDER; - if (!symmetry || symmetry == 0 || *symmetry == 0) + if (!symmetry || symmetry == nullptr || *symmetry == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " SYMMETRY %s ;\n", symmetry); @@ -6631,7 +6632,7 @@ int lefwMacroSite(const char* siteName) return LEFW_BAD_ORDER; if (lefwState != LEFW_MACRO_START && lefwState != LEFW_MACRO) return LEFW_BAD_ORDER; - if (!siteName || siteName == 0 || *siteName == 0) + if (!siteName || siteName == nullptr || *siteName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " SITE %s ;\n", siteName); @@ -6658,7 +6659,7 @@ int lefwMacroSitePattern(const char* name, return LEFW_BAD_ORDER; if (lefwState != LEFW_MACRO_START && lefwState != LEFW_MACRO) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) { encPrint(lefwFile, (char*) " SITE %s ", name); @@ -6712,7 +6713,7 @@ int lefwMacroSitePatternStr(const char* name, return LEFW_BAD_ORDER; if (lefwState != LEFW_MACRO_START && lefwState != LEFW_MACRO) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) { encPrint(lefwFile, (char*) " SITE %s ", name); @@ -6774,7 +6775,7 @@ int lefwEndMacro(const char* macroName) return LEFW_UNINITIALIZED; if (lefwState != LEFW_MACRO_START && lefwState != LEFW_MACRO) return LEFW_BAD_ORDER; - if (!macroName || macroName == 0 || *macroName == 0) + if (!macroName || macroName == nullptr || *macroName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) "END %s\n\n", macroName); @@ -6794,7 +6795,7 @@ int lefwStartMacroDensity(const char* layerName) return LEFW_BAD_ORDER; if (lefwIsMacroDensity) return LEFW_BAD_ORDER; - if (!layerName || layerName == 0 || *layerName == 0) + if (!layerName || layerName == nullptr || *layerName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " DENSITY %s\n", layerName); @@ -6862,7 +6863,7 @@ int lefwStartMacroPin(const char* pinName) return LEFW_BAD_ORDER; if (lefwIsMacroPin) return LEFW_BAD_ORDER; - if (!pinName || pinName == 0 || *pinName == 0) + if (!pinName || pinName == nullptr || *pinName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " PIN %s\n", pinName); @@ -6886,7 +6887,7 @@ int lefwMacroPinTaperRule(const char* ruleName) return LEFW_BAD_ORDER; if (!lefwIsMacroPin) return LEFW_BAD_ORDER; - if (!ruleName || ruleName == 0 || *ruleName == 0) + if (!ruleName || ruleName == nullptr || *ruleName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " TAPERRULE %s ;\n", ruleName); @@ -6909,7 +6910,7 @@ int lefwMacroPinForeign(const char* name, double xl, double yl, int orient) return LEFW_BAD_ORDER; if (versionNum >= 5.6) return LEFW_OBSOLETE; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) { encPrint(lefwFile, (char*) " FOREIGN %s ", name); @@ -6954,7 +6955,7 @@ int lefwMacroPinForeignStr(const char* name, return LEFW_BAD_ORDER; if (versionNum >= 5.6) return LEFW_OBSOLETE; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) { encPrint(lefwFile, (char*) " FOREIGN %s ", name); @@ -6996,7 +6997,7 @@ int lefwMacroPinLEQ(const char* pinName) return LEFW_BAD_ORDER; if (versionNum >= 5.6) return LEFW_OBSOLETE; - if (!pinName || pinName == 0 || *pinName == 0) + if (!pinName || pinName == nullptr || *pinName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " LEQ %s ;\n", pinName); @@ -7016,7 +7017,7 @@ int lefwMacroPinDirection(const char* direction) return LEFW_BAD_ORDER; if (!lefwIsMacroPin) return LEFW_BAD_ORDER; - if (!direction || direction == 0 || *direction == 0) + if (!direction || direction == nullptr || *direction == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " DIRECTION %s ;\n", direction); @@ -7036,7 +7037,7 @@ int lefwMacroPinUse(const char* use) return LEFW_BAD_ORDER; if (!lefwIsMacroPin) return LEFW_BAD_ORDER; - if (!use || use == 0 || *use == 0) + if (!use || use == nullptr || *use == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " USE %s ;\n", use); @@ -7057,12 +7058,12 @@ int lefwMacroPinShape(const char* name) if (!lefwIsMacroPin) return LEFW_BAD_ORDER; if (lefwWriteEncrypt) { - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) encPrint(lefwFile, (char*) " SHAPE ;\n"); else encPrint(lefwFile, (char*) " SHAPE %s ;\n", name); } else { - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) fprintf(lefwFile, " SHAPE ;\n"); else fprintf(lefwFile, " SHAPE %s ;\n", name); @@ -7081,7 +7082,7 @@ int lefwMacroPinMustjoin(const char* name) return LEFW_BAD_ORDER; if (!lefwIsMacroPin) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " MUSTJOIN %s ;\n", name); @@ -7101,7 +7102,7 @@ int lefwMacroPinNetExpr(const char* name) return LEFW_BAD_ORDER; if (!lefwIsMacroPin) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " NETEXPR \"%s\" ;\n", name); @@ -7121,7 +7122,7 @@ int lefwMacroPinSupplySensitivity(const char* pinName) return LEFW_BAD_ORDER; if (!lefwIsMacroPin) return LEFW_BAD_ORDER; - if (!pinName || pinName == 0 || *pinName == 0) + if (!pinName || pinName == nullptr || *pinName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " SUPPLYSENSITIVITY %s ;\n", pinName); @@ -7141,7 +7142,7 @@ int lefwMacroPinGroundSensitivity(const char* pinName) return LEFW_BAD_ORDER; if (!lefwIsMacroPin) return LEFW_BAD_ORDER; - if (!pinName || pinName == 0 || *pinName == 0) + if (!pinName || pinName == nullptr || *pinName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " GROUNDSENSITIVITY %s ;\n", pinName); @@ -7519,7 +7520,7 @@ int lefwMacroPinCurrentsource(const char* name) return LEFW_BAD_ORDER; if (!lefwIsMacroPin) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (versionNum >= 5.4) return LEFW_OBSOLETE; @@ -7546,9 +7547,9 @@ int lefwMacroPinIV_Tables(const char* lowName, const char* highName) return LEFW_BAD_ORDER; if (versionNum >= 5.4) return LEFW_OBSOLETE; - if (!lowName || lowName == 0 || *lowName == 0) + if (!lowName || lowName == nullptr || *lowName == 0) return LEFW_BAD_DATA; - if (!highName || highName == 0 || *highName == 0) + if (!highName || highName == nullptr || *highName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " IV_TABLES %s %s ;\n", lowName, highName); @@ -7928,7 +7929,7 @@ int lefwEndMacroPin(const char* pinName) { if (!lefwIsMacroPin) return LEFW_BAD_ORDER; - if (!pinName || pinName == 0 || *pinName == 0) + if (!pinName || pinName == nullptr || *pinName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) " END %s\n\n", pinName); @@ -7982,7 +7983,7 @@ int lefwMacroPinPortLayer(const char* layerName, double spacing) return LEFW_BAD_ORDER; if (!lefwIsMacroPinPort) return LEFW_BAD_ORDER; - if (!layerName || layerName == 0 || *layerName == 0) + if (!layerName || layerName == nullptr || *layerName == 0) return LEFW_BAD_DATA; if (lefwWidthVal) return LEFW_BAD_DATA; @@ -8012,7 +8013,7 @@ int lefwMacroPinPortDesignRuleWidth(const char* layerName, double width) return LEFW_BAD_ORDER; if (!lefwIsMacroPinPort) return LEFW_BAD_ORDER; - if (!layerName || layerName == 0 || *layerName == 0) + if (!layerName || layerName == nullptr || *layerName == 0) return LEFW_BAD_DATA; if (lefwSpacingVal) return LEFW_BAD_DATA; @@ -8399,7 +8400,7 @@ int lefwMacroPinPortVia(double xl, return LEFW_BAD_ORDER; if (!lefwIsMacroPinPort) return LEFW_BAD_ORDER; - if (!viaName || viaName == 0 || *viaName == 0) + if (!viaName || viaName == nullptr || *viaName == 0) return LEFW_BAD_DATA; if (mask && versionNum < 5.8) { return LEFW_WRONG_VERSION; @@ -8518,7 +8519,7 @@ int lefwMacroObsLayer(const char* layerName, double spacing) return LEFW_BAD_ORDER; if (!lefwIsMacroObs) return LEFW_BAD_ORDER; - if (!layerName || layerName == 0 || *layerName == 0) + if (!layerName || layerName == nullptr || *layerName == 0) return LEFW_BAD_DATA; if (lefwWidthVal) return LEFW_BAD_DATA; @@ -8548,7 +8549,7 @@ int lefwMacroObsDesignRuleWidth(const char* layerName, double width) return LEFW_BAD_ORDER; if (!lefwIsMacroObs) return LEFW_BAD_ORDER; - if (!layerName || layerName == 0 || *layerName == 0) + if (!layerName || layerName == nullptr || *layerName == 0) return LEFW_BAD_DATA; if (lefwSpacingVal) return LEFW_BAD_DATA; @@ -8580,7 +8581,7 @@ int lefwMacroExceptPGNet(const char* layerName) return LEFW_BAD_ORDER; if (!lefwIsMacroObs) return LEFW_BAD_ORDER; - if (!layerName || layerName == 0 || *layerName == 0) + if (!layerName || layerName == nullptr || *layerName == 0) return LEFW_BAD_DATA; if (lefwSpacingVal) return LEFW_BAD_DATA; @@ -8957,7 +8958,7 @@ int lefwMacroObsVia(double xl, return LEFW_BAD_ORDER; if (!lefwIsMacroObs) return LEFW_BAD_ORDER; - if (!viaName || viaName == 0 || *viaName == 0) + if (!viaName || viaName == nullptr || *viaName == 0) return LEFW_BAD_DATA; if (mask && versionNum < 5.8) { return LEFW_WRONG_VERSION; @@ -9348,7 +9349,7 @@ int lefwAntenna(const char* type, double value) return LEFW_BAD_ORDER; if (lefwState != LEFW_INIT && lefwState < LEFW_END) return LEFW_BAD_ORDER; // not of the ENDs - if (!type || type == 0 || *type == 0) + if (!type || type == nullptr || *type == 0) return LEFW_BAD_DATA; if (strcmp(type, "INPUTPINANTENNASIZE") && strcmp(type, "OUTPUTPINANTENNASIZE") @@ -9439,7 +9440,7 @@ int lefwStartBeginext(const char* name) return LEFW_BAD_ORDER; if (lefwState == LEFW_BEGINEXT_START || lefwState == LEFW_BEGINEXT) return LEFW_BAD_ORDER; - if (!name || name == 0 || *name == 0) + if (!name || name == nullptr || *name == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) "BEGINEXT \"%s\"", name); @@ -9460,7 +9461,7 @@ int lefwBeginextCreator(const char* creatorName) return LEFW_BAD_ORDER; if (lefwState != LEFW_BEGINEXT_START && lefwState != LEFW_BEGINEXT) return LEFW_BAD_ORDER; - if (!creatorName || creatorName == 0 || *creatorName == 0) + if (!creatorName || creatorName == nullptr || *creatorName == 0) return LEFW_BAD_DATA; if (lefwWriteEncrypt) encPrint(lefwFile, (char*) "\n CREATOR \"%s\"", creatorName); @@ -9484,7 +9485,7 @@ int lefwBeginextDate() if (lefwState != LEFW_BEGINEXT_START && lefwState != LEFW_BEGINEXT) return LEFW_BAD_ORDER; - todayTime = time(NULL); // time in UTC + todayTime = time(nullptr); // time in UTC rettime = ctime(&todayTime); // convert to string rettime[strlen(rettime) - 1] = '\0'; // replace \n with \0 if (lefwWriteEncrypt) diff --git a/src/odb/src/lef/lef/lefwWriterCalls.cpp b/src/odb/src/lef/lef/lefwWriterCalls.cpp index 9ef00f75339..5a3ddf0c630 100644 --- a/src/odb/src/lef/lef/lefwWriterCalls.cpp +++ b/src/odb/src/lef/lef/lefwWriterCalls.cpp @@ -97,8 +97,8 @@ extern int lefwHasInitCbk; // Global variables // ***************************************************************************** -lefiUserData lefwUserData = 0; -static char* lefwFileName = 0; +lefiUserData lefwUserData = nullptr; +static char* lefwFileName = nullptr; static int lefwRegisterUnused = 0; extern FILE* lefwFile; @@ -110,37 +110,37 @@ extern FILE* lefwFile; // ***************************************************************************** // The callback routines lefwVoidCbkFnType lefwCallbacksSeq[MAXCBS] = { - 0, // lefwVersionCbk - 0, // lefwCaseSensitiveCbk - 0, // lefwNoWireExtensionCbk - 0, // lefwBusBitCharsCbk - 0, // lefwDividerCharCbk - 0, // lefwManufacturingGridCbk - 0, // lefwUseMinSpacingCbk - 0, // lefwClearanceMeasureCbk - 0, // lefwUnitsCbk - 0, // lefwAntennaInputGateAreaCbk - 0, // lefwAntennaInOutDiffAreaCbk - 0, // lefwAntennaOutputDiffAreaCbk - 0, // lefwPropDefCbk - 0, // lefwLayerCbk - 0, // lefwViaCbk - 0, // lefwViaRuleCbk - 0, // lefwNonDefaultCbk - 0, // lefwCrossTalkCbk - 0, // lefwNoiseTableCbk - 0, // lefwCorrectionTableCbk - 0, // lefwSpacingCbk - 0, // lefwMinFeatureCbk - 0, // lefwDielectricCbk - 0, // lefwIRDropCbk - 0, // lefwSiteCbk - 0, // lefwArrayCbk - 0, // lefwMacroCbk - 0, // lefwAntennaCbk - 0, // lefwExtCbk - 0, // lefwEndLibCbk - // Add NEW CALLBACK here + nullptr, // lefwVersionCbk + nullptr, // lefwCaseSensitiveCbk + nullptr, // lefwNoWireExtensionCbk + nullptr, // lefwBusBitCharsCbk + nullptr, // lefwDividerCharCbk + nullptr, // lefwManufacturingGridCbk + nullptr, // lefwUseMinSpacingCbk + nullptr, // lefwClearanceMeasureCbk + nullptr, // lefwUnitsCbk + nullptr, // lefwAntennaInputGateAreaCbk + nullptr, // lefwAntennaInOutDiffAreaCbk + nullptr, // lefwAntennaOutputDiffAreaCbk + nullptr, // lefwPropDefCbk + nullptr, // lefwLayerCbk + nullptr, // lefwViaCbk + nullptr, // lefwViaRuleCbk + nullptr, // lefwNonDefaultCbk + nullptr, // lefwCrossTalkCbk + nullptr, // lefwNoiseTableCbk + nullptr, // lefwCorrectionTableCbk + nullptr, // lefwSpacingCbk + nullptr, // lefwMinFeatureCbk + nullptr, // lefwDielectricCbk + nullptr, // lefwIRDropCbk + nullptr, // lefwSiteCbk + nullptr, // lefwArrayCbk + nullptr, // lefwMacroCbk + nullptr, // lefwAntennaCbk + nullptr, // lefwExtCbk + nullptr, // lefwEndLibCbk + // Add NEW CALLBACK here }; // the optional and required callbacks @@ -274,7 +274,7 @@ int lefwWrite(FILE* f, const char* fName, lefiUserData uData) // callback routines if any are set for (i = 0; i < MAXCBS; i++) { - if (lefwCallbacksSeq[i] != 0) { // user has set a callback function + if (lefwCallbacksSeq[i] != nullptr) { // user has set a callback function WRITER_CALLBACK(lefwCallbacksSeq[i], lefwCallbacksType[i]); } else if (lefwCallbacksReq[i]) { // it is required but user hasn't set up fprintf(f, @@ -297,7 +297,7 @@ void lefwSetUnusedCallbacks(lefwVoidCbkFnType func) int i; for (i = 0; i < MAXCBS; i++) { - if (lefwCallbacksSeq[i] == 0) + if (lefwCallbacksSeq[i] == nullptr) lefwCallbacksSeq[i] = (lefwVoidCbkFnType) func; } } diff --git a/src/odb/src/lef/lefdiff/diffLefRW.cpp b/src/odb/src/lef/lefdiff/diffLefRW.cpp index 5fa3b4e54c1..4e03a8ccf15 100644 --- a/src/odb/src/lef/lefdiff/diffLefRW.cpp +++ b/src/odb/src/lef/lefdiff/diffLefRW.cpp @@ -2572,12 +2572,12 @@ int diffLefReadFile(char* inFile, char* outFile) lefrSetViaCbk(viaCB); lefrSetViaRuleCbk(viaRuleCB); - if ((f = fopen(inFile, "r")) == 0) { + if ((f = fopen(inFile, "r")) == nullptr) { fprintf(stderr, "Couldn't open input file '%s'\n", inFile); return (2); } - if ((fout = fopen(outFile, "w")) == 0) { + if ((fout = fopen(outFile, "w")) == nullptr) { fprintf(stderr, "Couldn't open output file '%s'\n", outFile); fclose(f); return (2); diff --git a/src/odb/src/lef/lefrw/lefrw.cpp b/src/odb/src/lef/lefrw/lefrw.cpp index 8d6916792ea..3825f3a1ee6 100644 --- a/src/odb/src/lef/lefrw/lefrw.cpp +++ b/src/odb/src/lef/lefrw/lefrw.cpp @@ -2587,7 +2587,7 @@ int main(int argc, char** argv) argv++; argc--; outFile = *argv; - if ((fout = fopen(outFile, "w")) == 0) { + if ((fout = fopen(outFile, "w")) == nullptr) { fprintf(stderr, "ERROR: could not open output file\n"); return 2; } @@ -2781,7 +2781,7 @@ int main(int argc, char** argv) for (fileCt = 0; fileCt < numInFile; fileCt++) { lefrReset(); - if ((f = fopen(inFile[fileCt], "r")) == 0) { + if ((f = fopen(inFile[fileCt], "r")) == nullptr) { fprintf(stderr, "Couldn't open input file '%s'\n", inFile[fileCt]); return (2); } @@ -2842,7 +2842,7 @@ int main(int argc, char** argv) lefrSetLimitPerMsg(2007, 2); } - if ((f = fopen(inFile[fileCt], "r")) == 0) { + if ((f = fopen(inFile[fileCt], "r")) == nullptr) { fprintf(stderr, "Couldn't open input file '%s'\n", inFile[fileCt]); return (2); } @@ -2870,7 +2870,7 @@ int main(int argc, char** argv) for (fileCt = 0; fileCt < numInFile; fileCt++) { lefrReset(); - if ((f = fopen(inFile[fileCt], "r")) == 0) { + if ((f = fopen(inFile[fileCt], "r")) == nullptr) { fprintf(stderr, "Couldn't open input file '%s'\n", inFile[fileCt]); return (2); } diff --git a/src/odb/src/lef/lefwrite/lefwrite.cpp b/src/odb/src/lef/lefwrite/lefwrite.cpp index 5241258917e..e78c5816306 100644 --- a/src/odb/src/lef/lefwrite/lefwrite.cpp +++ b/src/odb/src/lef/lefwrite/lefwrite.cpp @@ -77,7 +77,7 @@ int main(int argc, char** argv) argv++; argc--; outfile = *argv; - if ((fout = fopen(outfile, "w")) == 0) { + if ((fout = fopen(outfile, "w")) == nullptr) { fprintf(stderr, "ERROR: could not open output file\n"); return 2; } @@ -157,37 +157,37 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = lefwRealPropDef("LIBRARY", "realNum", 0, 0, 21.22); CHECK_STATUS(status); - status = lefwStringPropDef("PIN", "TYPE", 0, 0, 0); + status = lefwStringPropDef("PIN", "TYPE", 0, 0, nullptr); CHECK_STATUS(status); status = lefwIntPropDef("PIN", "intProp", 0, 0, 0); CHECK_STATUS(status); status = lefwRealPropDef("PIN", "realProp", 0, 0, 0); CHECK_STATUS(status); - status = lefwStringPropDef("MACRO", "stringProp", 0, 0, 0); + status = lefwStringPropDef("MACRO", "stringProp", 0, 0, nullptr); CHECK_STATUS(status); status = lefwIntPropDef("MACRO", "integerProp", 0, 0, 0); CHECK_STATUS(status); status = lefwRealPropDef("MACRO", "WEIGHT", 1.0, 100.0, 0); CHECK_STATUS(status); - status = lefwStringPropDef("VIA", "stringProperty", 0, 0, 0); + status = lefwStringPropDef("VIA", "stringProperty", 0, 0, nullptr); CHECK_STATUS(status); status = lefwRealPropDef("VIA", "realProp", 0, 0, 0); CHECK_STATUS(status); status = lefwIntPropDef("VIA", "COUNT", 1, 100, 0); CHECK_STATUS(status); - status = lefwStringPropDef("LAYER", "lsp", 0, 0, 0); + status = lefwStringPropDef("LAYER", "lsp", 0, 0, nullptr); CHECK_STATUS(status); status = lefwIntPropDef("LAYER", "lip", 0, 0, 0); CHECK_STATUS(status); status = lefwRealPropDef("LAYER", "lrp", 0, 0, 0); CHECK_STATUS(status); - status = lefwStringPropDef("VIARULE", "vrsp", 0, 0, 0); + status = lefwStringPropDef("VIARULE", "vrsp", 0, 0, nullptr); CHECK_STATUS(status); status = lefwRealPropDef("VIARULE", "vrip", 0, 0, 0); CHECK_STATUS(status); status = lefwIntPropDef("VIARULE", "vrrp", 0, 0, 0); CHECK_STATUS(status); - status = lefwStringPropDef("NONDEFAULTRULE", "ndrsp", 0, 0, 0); + status = lefwStringPropDef("NONDEFAULTRULE", "ndrsp", 0, 0, nullptr); CHECK_STATUS(status); status = lefwIntPropDef("NONDEFAULTRULE", "ndrip", 0, 0, 0); CHECK_STATUS(status); @@ -423,7 +423,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = lefwLayerAntennaDiffAreaRatio(6.5); CHECK_STATUS(status); - status = lefwLayerAntennaAreaFactor(5.4, 0); + status = lefwLayerAntennaAreaFactor(5.4, nullptr); CHECK_STATUS(status); status = lefwLayerAntennaCumDiffAreaRatio(4.5); CHECK_STATUS(status); @@ -556,7 +556,7 @@ int main(int argc, char** argv) ratios[1] = 6.1; status = lefwLayerAntennaCumDiffAreaRatioPwl(2, diffs, ratios); CHECK_STATUS(status); - status = lefwLayerAntennaAreaFactor(4.5, 0); + status = lefwLayerAntennaAreaFactor(4.5, nullptr); CHECK_STATUS(status); status = lefwLayerAntennaSideAreaRatio(6.5); CHECK_STATUS(status); @@ -616,7 +616,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = lefwLayerEnclosure("", 0.02, 0.02, 1.0); CHECK_STATUS(status); - status = lefwLayerEnclosure(NULL, 0.05, 0.05, 2.0); + status = lefwLayerEnclosure(nullptr, 0.05, 0.05, 2.0); CHECK_STATUS(status); status = lefwLayerEnclosure("BELOW", 0.07, 0.07, 1.0); CHECK_STATUS(status); @@ -875,9 +875,9 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = lefwLayerRoutingMinstep(0.05); CHECK_STATUS(status); - status = lefwLayerRoutingMinstepWithOptions(0.05, NULL, 0.08); + status = lefwLayerRoutingMinstepWithOptions(0.05, nullptr, 0.08); CHECK_STATUS(status); - status = lefwLayerRoutingMinstepWithOptions(0.05, NULL, 0.16); + status = lefwLayerRoutingMinstepWithOptions(0.05, nullptr, 0.16); CHECK_STATUS(status); status = lefwLayerRoutingMinstepWithOptions(0.05, "INSDECORNER", 0); CHECK_STATUS(status); @@ -976,15 +976,15 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = lefwLayerCutSpacingEnd(); // 5.7 CHECK_STATUS(status); - status = lefwLayerEnclosure(0, .05, .01, 0); // 5.7 + status = lefwLayerEnclosure(nullptr, .05, .01, 0); // 5.7 CHECK_STATUS(status); - status = lefwLayerEnclosureLength(0, .05, 0, 0.7); // 5.7 + status = lefwLayerEnclosureLength(nullptr, .05, 0, 0.7); // 5.7 CHECK_STATUS(status); status = lefwLayerEnclosure("BELOW", .07, .07, 1.0); // 5.7 CHECK_STATUS(status); status = lefwLayerEnclosure("ABOVE", .09, .09, 1.0); // 5.7 CHECK_STATUS(status); - status = lefwLayerEnclosureWidth(0, .03, .03, 1.0, 0.2); // 5.7 + status = lefwLayerEnclosureWidth(nullptr, .03, .03, 1.0, 0.2); // 5.7 CHECK_STATUS(status); status = lefwEndLayer("via34"); // 5.7 CHECK_STATUS(status); @@ -1146,7 +1146,7 @@ int main(int argc, char** argv) status = lefwEndVia("PC"); CHECK_STATUS(status); - status = lefwStartVia("M2_M3_PWR", NULL); + status = lefwStartVia("M2_M3_PWR", nullptr); CHECK_STATUS(status); status = lefwViaResistance(0.4); CHECK_STATUS(status); @@ -1171,7 +1171,7 @@ int main(int argc, char** argv) xl = (double*) malloc(sizeof(double) * 6); yl = (double*) malloc(sizeof(double) * 6); - status = lefwStartVia("IN1X", 0); + status = lefwStartVia("IN1X", nullptr); CHECK_STATUS(status); // status = lefwViaTopofstackonly(); 5.6 // CHECK_STATUS(status); @@ -1240,7 +1240,7 @@ int main(int argc, char** argv) status = lefwEndVia("IN1X"); CHECK_STATUS(status); - status = lefwStartVia("myBlockVia", NULL); + status = lefwStartVia("myBlockVia", nullptr); CHECK_STATUS(status); status = lefwViaViarule("DEFAULT", 0.1, @@ -1266,7 +1266,7 @@ int main(int argc, char** argv) status = lefwEndVia("myBlockVia"); CHECK_STATUS(status); - status = lefwStartVia("myVia23", NULL); + status = lefwStartVia("myVia23", nullptr); CHECK_STATUS(status); status = lefwViaLayer("metal2"); CHECK_STATUS(status); @@ -1295,9 +1295,9 @@ int main(int argc, char** argv) // CHECK_STATUS(status); // status = lefwViaRuleLayer("M2", "HORIZONTAL", 3.0, 3.0, 0, 0); 5.6 // CHECK_STATUS(status); - status = lefwViaRuleLayer("M1", NULL, 9.0, 9.6, 0, 0); + status = lefwViaRuleLayer("M1", nullptr, 9.0, 9.6, 0, 0); CHECK_STATUS(status); - status = lefwViaRuleLayer("M2", NULL, 3.0, 3.0, 0, 0); + status = lefwViaRuleLayer("M2", nullptr, 3.0, 3.0, 0, 0); CHECK_STATUS(status); status = lefwViaRuleVia("VIACENTER12"); CHECK_STATUS(status); @@ -1320,9 +1320,9 @@ int main(int argc, char** argv) // CHECK_STATUS(status); // status = lefwViaRuleGenLayer("M2", "HORIZONTAL", 0, 0, 1.4, 0); 5.6 // CHECK_STATUS(status); - status = lefwViaRuleGenLayer("M1", NULL, 0.1, 19, 0, 0); + status = lefwViaRuleGenLayer("M1", nullptr, 0.1, 19, 0, 0); CHECK_STATUS(status); - status = lefwViaRuleGenLayer("M2", NULL, 0, 0, 0, 0); + status = lefwViaRuleGenLayer("M2", nullptr, 0, 0, 0, 0); CHECK_STATUS(status); status = lefwViaRuleGenLayer3("V1", -0.8, -0.8, 0.8, 0.8, 5.6, 6.0, 0.2); CHECK_STATUS(status); @@ -1361,7 +1361,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = lefwNonDefaultRuleLayer("M1", 10.0, 2.2, 0, 0, 0, 0); CHECK_STATUS(status); - status = lefwStartVia("nd1VARX0", NULL); + status = lefwStartVia("nd1VARX0", nullptr); CHECK_STATUS(status); status = lefwViaResistance(0.2); CHECK_STATUS(status); @@ -1478,7 +1478,7 @@ int main(int argc, char** argv) // SPACING status = lefwStartSpacing(); CHECK_STATUS(status); - status = lefwSpacing("CUT01", "CA", 1.5, NULL); + status = lefwSpacing("CUT01", "CA", 1.5, nullptr); CHECK_STATUS(status); status = lefwSpacing("CA", "V1", 1.5, "STACK"); CHECK_STATUS(status); @@ -1535,7 +1535,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); lefwEndSite("MRCORE"); CHECK_STATUS(status); - status = lefwSite("IOWIRED", "PAD", NULL, 57.6, 432); + status = lefwSite("IOWIRED", "PAD", nullptr, 57.6, 432); CHECK_STATUS(status); lefwEndSite("IOWIRED"); CHECK_STATUS(status); @@ -1620,7 +1620,7 @@ int main(int argc, char** argv) // MACRO status = lefwStartMacro("CHK3A"); CHECK_STATUS(status); - status = lefwMacroClass("RING", NULL); + status = lefwMacroClass("RING", nullptr); CHECK_STATUS(status); status = lefwMacroFixedMask(); CHECK_STATUS(status); @@ -1655,7 +1655,7 @@ int main(int argc, char** argv) status = lefwMacroPinAntennaMetalArea(3, "M1"); CHECK_STATUS(status); // MACRO - PIN - status = lefwStartMacroPinPort(NULL); + status = lefwStartMacroPinPort(nullptr); CHECK_STATUS(status); // status = lefwMacroPinForeign("GROUND", 4, 7, 6); 5.6 // CHECK_STATUS(status); @@ -1693,7 +1693,7 @@ int main(int argc, char** argv) status = lefwMacroPinNetExpr("power2 VDD2"); CHECK_STATUS(status); // MACRO - PIN - PORT - status = lefwStartMacroPinPort(NULL); + status = lefwStartMacroPinPort(nullptr); CHECK_STATUS(status); status = lefwMacroPinPortLayer("M1", 0); CHECK_STATUS(status); @@ -1760,7 +1760,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = lefwMacroPinAntennaGateArea(1, "M1"); CHECK_STATUS(status); - status = lefwMacroPinAntennaGateArea(2, 0); + status = lefwMacroPinAntennaGateArea(2, nullptr); CHECK_STATUS(status); status = lefwMacroPinAntennaGateArea(3, "M3"); CHECK_STATUS(status); @@ -1768,17 +1768,17 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = lefwMacroPinAntennaMaxAreaCar(1, "L1"); CHECK_STATUS(status); - status = lefwMacroPinAntennaMaxSideAreaCar(1, 0); + status = lefwMacroPinAntennaMaxSideAreaCar(1, nullptr); CHECK_STATUS(status); - status = lefwMacroPinAntennaPartialCutArea(1, 0); + status = lefwMacroPinAntennaPartialCutArea(1, nullptr); CHECK_STATUS(status); status = lefwMacroPinAntennaPartialCutArea(2, "M2"); CHECK_STATUS(status); - status = lefwMacroPinAntennaPartialCutArea(3, 0); + status = lefwMacroPinAntennaPartialCutArea(3, nullptr); CHECK_STATUS(status); status = lefwMacroPinAntennaPartialCutArea(4, "M4"); CHECK_STATUS(status); - status = lefwMacroPinAntennaMaxCutCar(1, 0); + status = lefwMacroPinAntennaMaxCutCar(1, nullptr); CHECK_STATUS(status); status = lefwStartMacroPinPort("CORE"); CHECK_STATUS(status); @@ -1790,7 +1790,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = lefwEndMacroPinPort(); CHECK_STATUS(status); - status = lefwStartMacroPinPort(NULL); + status = lefwStartMacroPinPort(nullptr); CHECK_STATUS(status); status = lefwMacroPinPortLayer("PC", 0); CHECK_STATUS(status); @@ -1798,7 +1798,7 @@ int main(int argc, char** argv) CHECK_STATUS(status); status = lefwEndMacroPinPort(); CHECK_STATUS(status); - status = lefwStartMacroPinPort(NULL); + status = lefwStartMacroPinPort(nullptr); CHECK_STATUS(status); status = lefwMacroPinPortDesignRuleWidth("PC", 2); CHECK_STATUS(status); @@ -1903,7 +1903,7 @@ int main(int argc, char** argv) */ status = lefwMacroPinAntennaModel("OXIDE1"); CHECK_STATUS(status); - status = lefwStartMacroPinPort(NULL); + status = lefwStartMacroPinPort(nullptr); CHECK_STATUS(status); status = lefwMacroPinPortLayer("M2", 0); CHECK_STATUS(status); @@ -2048,7 +2048,7 @@ int main(int argc, char** argv) status = lefwStartMacro("DFF5"); CHECK_STATUS(status); - status = lefwMacroClass("COVER", NULL); + status = lefwMacroClass("COVER", nullptr); CHECK_STATUS(status); status = lefwMacroForeignStr("DFF3S", 0, 0, ""); CHECK_STATUS(status); @@ -2089,7 +2089,7 @@ int main(int argc, char** argv) status = lefwStartMacro("myTest"); CHECK_STATUS(status); - status = lefwMacroClass("CORE", NULL); + status = lefwMacroClass("CORE", nullptr); CHECK_STATUS(status); status = lefwMacroSize(10.0, 14.0); CHECK_STATUS(status); diff --git a/src/odb/src/lef/lefwrite/lefwriteCbs.cpp b/src/odb/src/lef/lefwrite/lefwriteCbs.cpp index b4039dbebe8..3aedd60d57d 100644 --- a/src/odb/src/lef/lefwrite/lefwriteCbs.cpp +++ b/src/odb/src/lef/lefwrite/lefwriteCbs.cpp @@ -132,41 +132,41 @@ int propDefCB(lefwCallbackType_e c, lefiUserData ud) CHECK_STATUS(status); status = lefwRealPropDef("LIBRARY", "realNum", 0, 0, 21.22); CHECK_STATUS(status); - status = lefwStringPropDef("PIN", "TYPE", 0, 0, NULL); + status = lefwStringPropDef("PIN", "TYPE", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwIntPropDef("PIN", "intProp", 0, 0, NULL); + status = lefwIntPropDef("PIN", "intProp", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwRealPropDef("PIN", "realProp", 0, 0, NULL); + status = lefwRealPropDef("PIN", "realProp", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwStringPropDef("MACRO", "stringProp", 0, 0, NULL); + status = lefwStringPropDef("MACRO", "stringProp", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwIntPropDef("MACRO", "integerProp", 0, 0, NULL); + status = lefwIntPropDef("MACRO", "integerProp", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwRealPropDef("MACRO", "WEIGHT", 1.0, 100.0, NULL); + status = lefwRealPropDef("MACRO", "WEIGHT", 1.0, 100.0, nullptr); CHECK_STATUS(status); - status = lefwStringPropDef("VIA", "stringProperty", 0, 0, NULL); + status = lefwStringPropDef("VIA", "stringProperty", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwRealPropDef("VIA", "realProp", 0, 0, NULL); + status = lefwRealPropDef("VIA", "realProp", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwIntPropDef("VIA", "COUNT", 1, 100, NULL); + status = lefwIntPropDef("VIA", "COUNT", 1, 100, nullptr); CHECK_STATUS(status); - status = lefwStringPropDef("LAYER", "lsp", 0, 0, NULL); + status = lefwStringPropDef("LAYER", "lsp", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwIntPropDef("LAYER", "lip", 0, 0, NULL); + status = lefwIntPropDef("LAYER", "lip", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwRealPropDef("LAYER", "lrp", 0, 0, NULL); + status = lefwRealPropDef("LAYER", "lrp", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwStringPropDef("VIARULE", "vrsp", 0, 0, NULL); + status = lefwStringPropDef("VIARULE", "vrsp", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwRealPropDef("VIARULE", "vrip", 0, 0, NULL); + status = lefwRealPropDef("VIARULE", "vrip", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwIntPropDef("VIARULE", "vrrp", 0, 0, NULL); + status = lefwIntPropDef("VIARULE", "vrrp", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwStringPropDef("NONDEFAULTRULE", "ndrsp", 0, 0, NULL); + status = lefwStringPropDef("NONDEFAULTRULE", "ndrsp", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwIntPropDef("NONDEFAULTRULE", "ndrip", 0, 0, NULL); + status = lefwIntPropDef("NONDEFAULTRULE", "ndrip", 0, 0, nullptr); CHECK_STATUS(status); - status = lefwRealPropDef("NONDEFAULTRULE", "ndrrp", 0, 0, NULL); + status = lefwRealPropDef("NONDEFAULTRULE", "ndrrp", 0, 0, nullptr); CHECK_STATUS(status); status = lefwEndPropDef(); return 0; @@ -509,7 +509,7 @@ int viaCB(lefwCallbackType_e c, lefiUserData ud) status = lefwEndVia("RX_PC"); CHECK_STATUS(status); - status = lefwStartVia("M2_M3_PWR", NULL); + status = lefwStartVia("M2_M3_PWR", nullptr); CHECK_STATUS(status); status = lefwViaResistance(0.4); CHECK_STATUS(status); @@ -532,7 +532,7 @@ int viaCB(lefwCallbackType_e c, lefiUserData ud) status = lefwEndVia("M2_M3_PWR"); CHECK_STATUS(status); - status = lefwStartVia("IN1X", NULL); + status = lefwStartVia("IN1X", nullptr); CHECK_STATUS(status); status = lefwViaLayer("CUT01"); CHECK_STATUS(status); @@ -555,9 +555,9 @@ int viaRuleCB(lefwCallbackType_e c, lefiUserData ud) CHECK_STATUS(status); lefwAddComment("Break up the old lefwViaRule into 2 routines"); lefwAddComment("lefwViaRuleLayer and lefwViaRuleVia"); - status = lefwViaRuleLayer("M1", NULL, 9.0, 9.6, 0, 0); + status = lefwViaRuleLayer("M1", nullptr, 9.0, 9.6, 0, 0); CHECK_STATUS(status); - status = lefwViaRuleLayer("M2", NULL, 3.0, 3.0, 0, 0); + status = lefwViaRuleLayer("M2", nullptr, 3.0, 3.0, 0, 0); CHECK_STATUS(status); status = lefwViaRuleVia("VIACENTER12"); CHECK_STATUS(status); @@ -576,9 +576,9 @@ int viaRuleCB(lefwCallbackType_e c, lefiUserData ud) lefwAddComment("lefwViaRuleGenLayer3, and lefwEndViaRuleGen"); status = lefwStartViaRuleGen("VIAGEN12"); CHECK_STATUS(status); - status = lefwViaRuleGenLayer("M1", NULL, 0.1, 19, 0, 0); + status = lefwViaRuleGenLayer("M1", nullptr, 0.1, 19, 0, 0); CHECK_STATUS(status); - status = lefwViaRuleGenLayer("M2", NULL, 0, 0, 0, 0); + status = lefwViaRuleGenLayer("M2", nullptr, 0, 0, 0, 0); CHECK_STATUS(status); status = lefwViaRuleGenLayer3("V1", -0.8, -0.8, 0.8, 0.8, 5.6, 6.0, 0.2); CHECK_STATUS(status); @@ -601,7 +601,7 @@ int nonDefaultCB(lefwCallbackType_e c, lefiUserData ud) CHECK_STATUS(status); status = lefwNonDefaultRuleLayer("M1", 10.0, 2.2, 0, 0, 0, 0); CHECK_STATUS(status); - status = lefwStartVia("nd1VARX0", NULL); + status = lefwStartVia("nd1VARX0", nullptr); CHECK_STATUS(status); status = lefwViaResistance(0.2); CHECK_STATUS(status); @@ -659,7 +659,7 @@ int siteCB(lefwCallbackType_e c, lefiUserData ud) CHECK_STATUS(status); lefwEndSite("MRCORE"); CHECK_STATUS(status); - status = lefwSite("IOWIRED", "PAD", NULL, 57.6, 432); + status = lefwSite("IOWIRED", "PAD", nullptr, 57.6, 432); CHECK_STATUS(status); lefwEndSite("IOWIRED"); CHECK_STATUS(status); @@ -676,7 +676,7 @@ int macroCB(lefwCallbackType_e c, lefiUserData ud) checkType(c); status = lefwStartMacro("CHK3A"); CHECK_STATUS(status); - status = lefwMacroClass("RING", NULL); + status = lefwMacroClass("RING", nullptr); CHECK_STATUS(status); status = lefwMacroOrigin(0.9, 0.9); CHECK_STATUS(status); @@ -697,7 +697,7 @@ int macroCB(lefwCallbackType_e c, lefiUserData ud) status = lefwMacroPinShape("ABUTMENT"); CHECK_STATUS(status); // MACRO - PIN - status = lefwStartMacroPinPort(NULL); + status = lefwStartMacroPinPort(nullptr); CHECK_STATUS(status); status = lefwMacroPinPortLayer("M1", 0); CHECK_STATUS(status); @@ -726,7 +726,7 @@ int macroCB(lefwCallbackType_e c, lefiUserData ud) status = lefwMacroPinShape("ABUTMENT"); CHECK_STATUS(status); // MACRO - PIN - PORT - status = lefwStartMacroPinPort(NULL); + status = lefwStartMacroPinPort(nullptr); CHECK_STATUS(status); status = lefwMacroPinPortLayer("M1", 0); CHECK_STATUS(status); @@ -748,7 +748,7 @@ int macroCB(lefwCallbackType_e c, lefiUserData ud) CHECK_STATUS(status); status = lefwMacroPinDirection("INPUT"); CHECK_STATUS(status); - status = lefwStartMacroPinPort(NULL); + status = lefwStartMacroPinPort(nullptr); CHECK_STATUS(status); status = lefwMacroPinPortLayer("M1", 0); CHECK_STATUS(status); @@ -758,7 +758,7 @@ int macroCB(lefwCallbackType_e c, lefiUserData ud) CHECK_STATUS(status); status = lefwEndMacroPinPort(); CHECK_STATUS(status); - status = lefwStartMacroPinPort(NULL); + status = lefwStartMacroPinPort(nullptr); CHECK_STATUS(status); status = lefwMacroPinPortLayer("PC", 0); CHECK_STATUS(status); @@ -766,7 +766,7 @@ int macroCB(lefwCallbackType_e c, lefiUserData ud) CHECK_STATUS(status); status = lefwEndMacroPinPort(); CHECK_STATUS(status); - status = lefwStartMacroPinPort(NULL); + status = lefwStartMacroPinPort(nullptr); CHECK_STATUS(status); status = lefwMacroPinPortLayer("PC", 0); CHECK_STATUS(status); @@ -809,7 +809,7 @@ int macroCB(lefwCallbackType_e c, lefiUserData ud) // 2nd MACRO status = lefwStartMacro("INV"); CHECK_STATUS(status); - status = lefwMacroClass("CORE", NULL); + status = lefwMacroClass("CORE", nullptr); CHECK_STATUS(status); status = lefwMacroForeign("INVS", 0, 0, -1); CHECK_STATUS(status); @@ -827,7 +827,7 @@ int macroCB(lefwCallbackType_e c, lefiUserData ud) CHECK_STATUS(status); status = lefwMacroPinShape("ABUTMENT"); CHECK_STATUS(status); - status = lefwStartMacroPinPort(NULL); + status = lefwStartMacroPinPort(nullptr); CHECK_STATUS(status); status = lefwMacroPinPortLayer("M2", 5.6); CHECK_STATUS(status); @@ -960,7 +960,7 @@ main(int argc, char** argv) argv++; argc--; outfile = *argv; - if ((fout = fopen(outfile, "w")) == 0) { + if ((fout = fopen(outfile, "w")) == nullptr) { fprintf(stderr, "ERROR: could not open output file\n"); return 2; } diff --git a/src/odb/src/lef/lefzlib/lefzlib.cpp b/src/odb/src/lef/lefzlib/lefzlib.cpp index 5ac17904b1c..c662351bb18 100644 --- a/src/odb/src/lef/lefzlib/lefzlib.cpp +++ b/src/odb/src/lef/lefzlib/lefzlib.cpp @@ -54,7 +54,7 @@ size_t lefGZip_read(FILE* file, char* buf, size_t len) lefGZFile lefGZipOpen(const char* gzipPath, const char* mode) { if (!gzipPath) - return NULL; + return nullptr; lefGZFile fptr = gzopen(gzipPath, mode); if (fptr) { @@ -63,7 +63,7 @@ lefGZFile lefGZipOpen(const char* gzipPath, const char* mode) lefrSetReadFunction(lefGZip_read); return (lefGZFile) fptr; } else - return NULL; + return nullptr; } int lefGZipClose(lefGZFile filePtr) diff --git a/src/odb/src/lefin/lefin.cpp b/src/odb/src/lefin/lefin.cpp index 7029766d67a..5b6bce83598 100644 --- a/src/odb/src/lefin/lefin.cpp +++ b/src/odb/src/lefin/lefin.cpp @@ -2343,7 +2343,7 @@ dbLib* lefin::createTechAndLib(const char* tech_name, _logger->warn( utl::ODB, 231, "Error: technology {} already exists", tech_name); ++_errors; - return NULL; + return nullptr; }; _tech = dbTech::create(_db, tech_name, _dbu_per_micron);