From 67c7e42adf958eee2d6e27e6a6a6e2f10186d636 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Sun, 29 Dec 2024 04:34:48 +0000 Subject: [PATCH] various: more clang-tidy Signed-off-by: Matt Liberty --- src/grt/src/fastroute/include/FastRoute.h | 6 ++--- src/grt/src/fastroute/src/utility.cpp | 6 ++--- src/gui/include/gui/gui.h | 4 +-- src/gui/include/gui/heatMap.h | 12 ++++----- src/gui/src/dbDescriptors.cpp | 11 +++----- src/gui/src/dbDescriptors.h | 8 +++--- src/gui/src/displayControls.cpp | 6 ++--- src/gui/src/displayControls.h | 2 +- src/gui/src/heatMap.cpp | 6 ++--- src/gui/src/layoutTabs.cpp | 10 ++++---- src/gui/src/layoutTabs.h | 20 +++++++-------- src/gui/src/layoutViewer.cpp | 10 ++++---- src/gui/src/layoutViewer.h | 20 +++++++-------- src/gui/src/scriptWidget.cpp | 2 +- src/gui/src/scriptWidget.h | 2 +- src/gui/src/stub_heatMap.cpp | 6 ++--- src/gui/src/tclCmdInputWidget.cpp | 7 +++-- src/gui/src/tclCmdInputWidget.h | 2 +- src/mpl/src/ParquetFP/src/SolveMulti.cxx | 4 +-- src/odb/include/odb/cdl.h | 2 +- src/odb/include/odb/dbBlockSet.h | 3 ++- src/odb/include/odb/dbCCSegSet.h | 3 ++- src/odb/include/odb/dbCompare.h | 2 ++ src/odb/include/odb/dbNetSet.h | 3 ++- src/odb/include/odb/lefin.h | 4 +-- src/odb/src/db/dbBlock.cpp | 8 +++--- src/odb/src/db/dbWireCodec.cpp | 2 +- src/odb/src/def/cdef/defwWriter.h | 2 +- src/odb/src/def/def/def_keywords.cpp | 6 ++--- src/odb/src/def/def/defwWriter.hpp | 24 ++++++++--------- src/odb/src/def/defwrite/defwrite.cpp | 2 +- src/odb/src/defout/defout_impl.cpp | 4 +-- src/odb/src/lef/lef/lefwWriterCalls.hpp | 2 +- src/odb/src/lefin/MetalWidthViaMapParser.cpp | 5 ++-- src/odb/src/lefin/lefLayerPropParser.h | 27 ++++++++------------ src/odb/src/swig/common/odb.i | 7 +---- src/pad/src/RDLRoute.cpp | 2 +- src/rcx/src/grids.cpp | 2 +- 38 files changed, 122 insertions(+), 132 deletions(-) diff --git a/src/grt/src/fastroute/include/FastRoute.h b/src/grt/src/fastroute/include/FastRoute.h index 5844a764f77..ff1df552d28 100644 --- a/src/grt/src/fastroute/include/FastRoute.h +++ b/src/grt/src/fastroute/include/FastRoute.h @@ -554,9 +554,9 @@ class FastRouteCore */ void verify3DEdgesUsage(); void layerAssignment(); - void copyBR(void); - void copyRS(void); - void freeRR(void); + void copyBR(); + void copyRS(); + void freeRR(); int edgeShift(Tree& t, int net); int edgeShiftNew(Tree& t, int net); diff --git a/src/grt/src/fastroute/src/utility.cpp b/src/grt/src/fastroute/src/utility.cpp index ea19a71377f..a8da2825662 100644 --- a/src/grt/src/fastroute/src/utility.cpp +++ b/src/grt/src/fastroute/src/utility.cpp @@ -1816,7 +1816,7 @@ bool FastRouteCore::checkRoute2DTree(int netID) } // Copy Routing Solution for the best routing solution so far -void FastRouteCore::copyRS(void) +void FastRouteCore::copyRS() { int i, j, edgeID, numEdges, numNodes; @@ -1880,7 +1880,7 @@ void FastRouteCore::copyRS(void) } } -void FastRouteCore::copyBR(void) +void FastRouteCore::copyBR() { int i, j, edgeID, numEdges, numNodes, min_y, min_x, edgeCost; @@ -2002,7 +2002,7 @@ void FastRouteCore::copyBR(void) } } -void FastRouteCore::freeRR(void) +void FastRouteCore::freeRR() { int edgeID, numEdges; if (!sttrees_bk_.empty()) { diff --git a/src/gui/include/gui/gui.h b/src/gui/include/gui/gui.h index fdddd429b69..4127b9da5c0 100644 --- a/src/gui/include/gui/gui.h +++ b/src/gui/include/gui/gui.h @@ -297,7 +297,7 @@ class Descriptor // An action is a name and a callback function, the function should return // the next object to select (when deleting the object just return Selected()) - using ActionCallback = std::function; + using ActionCallback = std::function; struct Action { std::string name; @@ -471,7 +471,7 @@ class Renderer // Used to register display controls for this renderer. // DisplayControls is a map with the name of the control and the initial // setting for the control - using DisplayControlCallback = std::function; + using DisplayControlCallback = std::function; struct DisplayControl { bool visibility; diff --git a/src/gui/include/gui/heatMap.h b/src/gui/include/gui/heatMap.h index c1c8115f9c3..d7d9111d4e5 100644 --- a/src/gui/include/gui/heatMap.h +++ b/src/gui/include/gui/heatMap.h @@ -64,15 +64,15 @@ class HeatMapDataSource { std::string name; std::string label; - std::function getter; + std::function getter; std::function setter; }; struct MapSettingMultiChoice { std::string name; std::string label; - std::function(void)> choices; - std::function getter; + std::function()> choices; + std::function getter; std::function setter; }; @@ -189,13 +189,13 @@ class HeatMapDataSource protected: void addBooleanSetting(const std::string& name, const std::string& label, - const std::function& getter, + const std::function& getter, const std::function& setter); void addMultipleChoiceSetting( const std::string& name, const std::string& label, - const std::function(void)>& choices, - const std::function& getter, + const std::function()>& choices, + const std::function& getter, const std::function& setter); void setupMap(); diff --git a/src/gui/src/dbDescriptors.cpp b/src/gui/src/dbDescriptors.cpp index 0bf0786963f..75aaee05842 100644 --- a/src/gui/src/dbDescriptors.cpp +++ b/src/gui/src/dbDescriptors.cpp @@ -45,7 +45,6 @@ #include "db_sta/dbNetwork.hh" #include "db_sta/dbSta.hh" #include "odb/db.h" -#include "odb/dbCompare.h" #include "odb/dbShape.h" #include "sta/Liberty.hh" #include "utl/Logger.h" @@ -1638,9 +1637,8 @@ odb::dbObject* DbNetDescriptor::getSink(const std::any& object) const ////////////////////////////////////////////////// -DbITermDescriptor::DbITermDescriptor( - odb::dbDatabase* db, - std::function usingPolyDecompView) +DbITermDescriptor::DbITermDescriptor(odb::dbDatabase* db, + std::function usingPolyDecompView) : BaseDbDescriptor(db), usingPolyDecompView_(std::move(usingPolyDecompView)) { @@ -1952,9 +1950,8 @@ bool DbBPinDescriptor::getAllObjects(SelectionSet& objects) const ////////////////////////////////////////////////// -DbMTermDescriptor::DbMTermDescriptor( - odb::dbDatabase* db, - std::function usingPolyDecompView) +DbMTermDescriptor::DbMTermDescriptor(odb::dbDatabase* db, + std::function usingPolyDecompView) : BaseDbDescriptor(db), usingPolyDecompView_(std::move(usingPolyDecompView)) { diff --git a/src/gui/src/dbDescriptors.h b/src/gui/src/dbDescriptors.h index 894e1708005..4f3985e467f 100644 --- a/src/gui/src/dbDescriptors.h +++ b/src/gui/src/dbDescriptors.h @@ -238,7 +238,7 @@ class DbITermDescriptor : public BaseDbDescriptor { public: DbITermDescriptor(odb::dbDatabase* db, - std::function usingPolyDecompView); + std::function usingPolyDecompView); std::string getName(std::any object) const override; std::string getShortName(std::any object) const override; @@ -255,7 +255,7 @@ class DbITermDescriptor : public BaseDbDescriptor Properties getDBProperties(odb::dbITerm* iterm) const override; private: - std::function usingPolyDecompView_; + std::function usingPolyDecompView_; }; class DbBTermDescriptor : public BaseDbDescriptor @@ -299,7 +299,7 @@ class DbMTermDescriptor : public BaseDbDescriptor { public: DbMTermDescriptor(odb::dbDatabase* db, - std::function usingPolyDecompView); + std::function usingPolyDecompView); std::string getName(std::any object) const override; std::string getShortName(std::any object) const override; @@ -314,7 +314,7 @@ class DbMTermDescriptor : public BaseDbDescriptor Properties getDBProperties(odb::dbMTerm* mterm) const override; private: - std::function usingPolyDecompView_; + std::function usingPolyDecompView_; }; class DbViaDescriptor : public BaseDbDescriptor diff --git a/src/gui/src/displayControls.cpp b/src/gui/src/displayControls.cpp index f6ee66bb846..1f237f52935 100644 --- a/src/gui/src/displayControls.cpp +++ b/src/gui/src/displayControls.cpp @@ -53,7 +53,7 @@ Q_DECLARE_METATYPE(odb::dbTechLayer*); Q_DECLARE_METATYPE(odb::dbSite*); -Q_DECLARE_METATYPE(std::function); +Q_DECLARE_METATYPE(std::function); namespace gui { @@ -1011,7 +1011,7 @@ void DisplayControls::displayItemDblClicked(const QModelIndex& index) auto data = name_item->data(doubleclick_item_idx_); if (data.isValid()) { - auto callback = data.value>(); + auto callback = data.value>(); callback(); emit changed(); } @@ -1348,7 +1348,7 @@ void DisplayControls::makeLeafItem(ModelRow& row, void DisplayControls::setNameItemDoubleClickAction( ModelRow& row, - const std::function& callback) + const std::function& callback) { row.name->setData(QVariant::fromValue(callback), doubleclick_item_idx_); diff --git a/src/gui/src/displayControls.h b/src/gui/src/displayControls.h index aa7134e2b9d..462c1d2e3b2 100644 --- a/src/gui/src/displayControls.h +++ b/src/gui/src/displayControls.h @@ -477,7 +477,7 @@ class DisplayControls : public QDockWidget, void saveRendererState(Renderer* renderer); void setNameItemDoubleClickAction(ModelRow& row, - const std::function& callback); + const std::function& callback); void setItemExclusivity(ModelRow& row, const std::set& exclusivity); diff --git a/src/gui/src/heatMap.cpp b/src/gui/src/heatMap.cpp index d93bcb019c0..a9d849c717b 100644 --- a/src/gui/src/heatMap.cpp +++ b/src/gui/src/heatMap.cpp @@ -266,7 +266,7 @@ std::string HeatMapDataSource::formatValue(double value, bool legend) const void HeatMapDataSource::addBooleanSetting( const std::string& name, const std::string& label, - const std::function& getter, + const std::function& getter, const std::function& setter) { settings_.emplace_back(MapSettingBoolean{name, label, getter, setter}); @@ -275,8 +275,8 @@ void HeatMapDataSource::addBooleanSetting( void HeatMapDataSource::addMultipleChoiceSetting( const std::string& name, const std::string& label, - const std::function(void)>& choices, - const std::function& getter, + const std::function()>& choices, + const std::function& getter, const std::function& setter) { settings_.emplace_back( diff --git a/src/gui/src/layoutTabs.cpp b/src/gui/src/layoutTabs.cpp index 8a8fffde22e..f7da0cdf30e 100644 --- a/src/gui/src/layoutTabs.cpp +++ b/src/gui/src/layoutTabs.cpp @@ -46,11 +46,11 @@ LayoutTabs::LayoutTabs(Options* options, const HighlightSet& highlighted, const std::vector>& rulers, Gui* gui, - std::function usingDBU, - std::function usingPolyDecompView, - std::function showRulerAsEuclidian, - std::function default_mouse_wheel_zoom, - std::function arrow_keys_scroll_step, + std::function usingDBU, + std::function usingPolyDecompView, + std::function showRulerAsEuclidian, + std::function default_mouse_wheel_zoom, + std::function arrow_keys_scroll_step, QWidget* parent) : QTabWidget(parent), options_(options), diff --git a/src/gui/src/layoutTabs.h b/src/gui/src/layoutTabs.h index 6e25524fa4e..609fe58872c 100644 --- a/src/gui/src/layoutTabs.h +++ b/src/gui/src/layoutTabs.h @@ -58,11 +58,11 @@ class LayoutTabs : public QTabWidget const HighlightSet& highlighted, const std::vector>& rulers, Gui* gui, - std::function usingDBU, - std::function usingPolyDecompView, - std::function showRulerAsEuclidian, - std::function default_mouse_wheel_zoom, - std::function arrow_keys_scroll_step, + std::function usingDBU, + std::function usingPolyDecompView, + std::function showRulerAsEuclidian, + std::function default_mouse_wheel_zoom, + std::function arrow_keys_scroll_step, QWidget* parent = nullptr); LayoutViewer* getCurrent() const { return current_viewer_; } @@ -142,11 +142,11 @@ class LayoutTabs : public QTabWidget const std::vector>& rulers_; std::map modules_; Gui* gui_; - std::function usingDBU_; - std::function usingPolyDecompView_; - std::function showRulerAsEuclidian_; - std::function default_mouse_wheel_zoom_; - std::function arrow_keys_scroll_step_; + std::function usingDBU_; + std::function usingPolyDecompView_; + std::function showRulerAsEuclidian_; + std::function default_mouse_wheel_zoom_; + std::function arrow_keys_scroll_step_; utl::Logger* logger_; bool command_executing_ = false; diff --git a/src/gui/src/layoutViewer.cpp b/src/gui/src/layoutViewer.cpp index 0d3f5be7c86..2743ee3c2be 100644 --- a/src/gui/src/layoutViewer.cpp +++ b/src/gui/src/layoutViewer.cpp @@ -118,9 +118,9 @@ LayoutViewer::LayoutViewer( const std::set& route_guides, const std::set& net_tracks, Gui* gui, - const std::function& usingDBU, - const std::function& showRulerAsEuclidian, - const std::function& showDBView, + const std::function& usingDBU, + const std::function& showRulerAsEuclidian, + const std::function& showDBView, QWidget* parent) : QWidget(parent), block_(nullptr), @@ -2464,8 +2464,8 @@ void LayoutViewer::resetCache() ////// LayoutScroll /////// LayoutScroll::LayoutScroll( LayoutViewer* viewer, - const std::function& default_mouse_wheel_zoom, - const std::function& arrow_keys_scroll_step, + const std::function& default_mouse_wheel_zoom, + const std::function& arrow_keys_scroll_step, QWidget* parent) : QScrollArea(parent), default_mouse_wheel_zoom_(std::move(default_mouse_wheel_zoom)), diff --git a/src/gui/src/layoutViewer.h b/src/gui/src/layoutViewer.h index 0687e145087..cb479080499 100644 --- a/src/gui/src/layoutViewer.h +++ b/src/gui/src/layoutViewer.h @@ -148,9 +148,9 @@ class LayoutViewer : public QWidget const std::set& route_guides, const std::set& net_tracks, Gui* gui, - const std::function& usingDBU, - const std::function& showRulerAsEuclidian, - const std::function& showDBView, + const std::function& usingDBU, + const std::function& showRulerAsEuclidian, + const std::function& showDBView, QWidget* parent = nullptr); odb::dbBlock* getBlock() const { return block_; } @@ -394,9 +394,9 @@ class LayoutViewer : public QWidget bool is_view_dragging_; Gui* gui_; - std::function usingDBU_; - std::function showRulerAsEuclidian_; - std::function showDBView_; + std::function usingDBU_; + std::function showRulerAsEuclidian_; + std::function showDBView_; const std::map& modules_; @@ -468,8 +468,8 @@ class LayoutScroll : public QScrollArea Q_OBJECT public: LayoutScroll(LayoutViewer* viewer, - const std::function& default_mouse_wheel_zoom, - const std::function& arrow_keys_scroll_step, + const std::function& default_mouse_wheel_zoom, + const std::function& arrow_keys_scroll_step, QWidget* parent = nullptr); bool isScrollingWithCursor(); signals: @@ -488,8 +488,8 @@ class LayoutScroll : public QScrollArea void keyPressEvent(QKeyEvent* event) override; private: - std::function default_mouse_wheel_zoom_; - std::function arrow_keys_scroll_step_; + std::function default_mouse_wheel_zoom_; + std::function arrow_keys_scroll_step_; LayoutViewer* viewer_; bool scrolling_with_cursor_; diff --git a/src/gui/src/scriptWidget.cpp b/src/gui/src/scriptWidget.cpp index bb1f7711b8b..fa276103f15 100644 --- a/src/gui/src/scriptWidget.cpp +++ b/src/gui/src/scriptWidget.cpp @@ -175,7 +175,7 @@ ScriptWidget::~ScriptWidget() void ScriptWidget::setupTcl(Tcl_Interp* interp, bool interactive, bool do_init_openroad, - const std::function& post_or_init) + const std::function& post_or_init) { is_interactive_ = interactive; input_->setTclInterp(interp, do_init_openroad, post_or_init); diff --git a/src/gui/src/scriptWidget.h b/src/gui/src/scriptWidget.h index 0dbf407ea65..884584e1da9 100644 --- a/src/gui/src/scriptWidget.h +++ b/src/gui/src/scriptWidget.h @@ -70,7 +70,7 @@ class ScriptWidget : public QDockWidget void setupTcl(Tcl_Interp* interp, bool interactive, bool do_init_openroad, - const std::function& post_or_init); + const std::function& post_or_init); void setWidgetFont(const QFont& font); diff --git a/src/gui/src/stub_heatMap.cpp b/src/gui/src/stub_heatMap.cpp index 98a5015601c..87ec63e3b33 100644 --- a/src/gui/src/stub_heatMap.cpp +++ b/src/gui/src/stub_heatMap.cpp @@ -85,7 +85,7 @@ void HeatMapDataSource::redraw() void HeatMapDataSource::addBooleanSetting( const std::string& name, const std::string& label, - const std::function& getter, + const std::function& getter, const std::function& setter) { } @@ -93,8 +93,8 @@ void HeatMapDataSource::addBooleanSetting( void HeatMapDataSource::addMultipleChoiceSetting( const std::string& name, const std::string& label, - const std::function(void)>& choices, - const std::function& getter, + const std::function()>& choices, + const std::function& getter, const std::function& setter) { } diff --git a/src/gui/src/tclCmdInputWidget.cpp b/src/gui/src/tclCmdInputWidget.cpp index cee30811d23..4f68c4a118c 100644 --- a/src/gui/src/tclCmdInputWidget.cpp +++ b/src/gui/src/tclCmdInputWidget.cpp @@ -90,10 +90,9 @@ TclCmdInputWidget::~TclCmdInputWidget() Tcl_Eval(interp_, exit_rename.c_str()); } -void TclCmdInputWidget::setTclInterp( - Tcl_Interp* interp, - bool do_init_openroad, - const std::function& post_or_init) +void TclCmdInputWidget::setTclInterp(Tcl_Interp* interp, + bool do_init_openroad, + const std::function& post_or_init) { interp_ = interp; diff --git a/src/gui/src/tclCmdInputWidget.h b/src/gui/src/tclCmdInputWidget.h index 18446833f01..1105844b61f 100644 --- a/src/gui/src/tclCmdInputWidget.h +++ b/src/gui/src/tclCmdInputWidget.h @@ -70,7 +70,7 @@ class TclCmdInputWidget : public CmdInputWidget void setTclInterp(Tcl_Interp* interp, bool do_init_openroad, - const std::function& post_or_init); + const std::function& post_or_init); void readSettings(QSettings* settings); void writeSettings(QSettings* settings); diff --git a/src/mpl/src/ParquetFP/src/SolveMulti.cxx b/src/mpl/src/ParquetFP/src/SolveMulti.cxx index 0b9a3778b3a..e7b312bf1e5 100644 --- a/src/mpl/src/ParquetFP/src/SolveMulti.cxx +++ b/src/mpl/src/ParquetFP/src/SolveMulti.cxx @@ -287,7 +287,7 @@ void SolveMulti::go() _params->FPrep = "BTree"; annealer = new BTreeAreaWireAnnealer(_params, _newDB); } - } while (1); + } while (true); annealTime += annealer->annealTime; delete annealer; @@ -430,7 +430,7 @@ void SolveMulti::placeSubBlocks() satisfied = false; break; } - } while (1); + } while (true); if (!satisfied) // failed to satisfy constraints. save best soln { diff --git a/src/odb/include/odb/cdl.h b/src/odb/include/odb/cdl.h index fdb36f0db8f..f83824e3d00 100644 --- a/src/odb/include/odb/cdl.h +++ b/src/odb/include/odb/cdl.h @@ -53,7 +53,7 @@ class cdl dbBlock* block, const char* outFileName, const std::vector& mastersFileNames, - bool includeFillers = 0); + bool includeFillers = false); }; } // namespace odb diff --git a/src/odb/include/odb/dbBlockSet.h b/src/odb/include/odb/dbBlockSet.h index 5d93b7ea45f..5267bdeb629 100644 --- a/src/odb/include/odb/dbBlockSet.h +++ b/src/odb/include/odb/dbBlockSet.h @@ -32,8 +32,9 @@ #pragma once +// IWYU pragma: private, include "dbSet.h" + #include "dbObject.h" -#include "dbSet.h" namespace odb { diff --git a/src/odb/include/odb/dbCCSegSet.h b/src/odb/include/odb/dbCCSegSet.h index 0a1ebd0fe54..3638d908bbf 100644 --- a/src/odb/include/odb/dbCCSegSet.h +++ b/src/odb/include/odb/dbCCSegSet.h @@ -32,8 +32,9 @@ #pragma once +// IWYU pragma: private, include "dbSet.h" + #include "dbObject.h" -#include "dbSet.h" namespace odb { diff --git a/src/odb/include/odb/dbCompare.h b/src/odb/include/odb/dbCompare.h index 6ac50702e79..51ac12536a3 100644 --- a/src/odb/include/odb/dbCompare.h +++ b/src/odb/include/odb/dbCompare.h @@ -32,6 +32,8 @@ #pragma once +// IWYU pragma: private, include "db.h" + // Provide overloads of std::less for all instantiable, dbObject-derived types. // This avoids pointer comparison which is a frequent source of non-determinism. // diff --git a/src/odb/include/odb/dbNetSet.h b/src/odb/include/odb/dbNetSet.h index 212fd66051a..4ff5953921b 100644 --- a/src/odb/include/odb/dbNetSet.h +++ b/src/odb/include/odb/dbNetSet.h @@ -32,8 +32,9 @@ #pragma once +// IWYU pragma: private, include "dbSet.h" + #include "dbObject.h" -#include "dbSet.h" namespace odb { diff --git a/src/odb/include/odb/lefin.h b/src/odb/include/odb/lefin.h index b5ae6aaf291..5f6f538d569 100644 --- a/src/odb/include/odb/lefin.h +++ b/src/odb/include/odb/lefin.h @@ -184,12 +184,12 @@ class lefin void viaGenerateRule(lefiViaRule* viaRule); void done(void* ptr); template - inline void warning(int id, std::string msg, const Args&... args) + void warning(int id, std::string msg, const Args&... args) { _logger->warn(utl::ODB, id, msg, args...); } template - inline void errorTolerant(int id, std::string msg, const Args&... args) + void errorTolerant(int id, std::string msg, const Args&... args) { _logger->warn(utl::ODB, id, msg, args...); ++_errors; diff --git a/src/odb/src/db/dbBlock.cpp b/src/odb/src/db/dbBlock.cpp index cd67036ba2f..df62b153022 100644 --- a/src/odb/src/db/dbBlock.cpp +++ b/src/odb/src/db/dbBlock.cpp @@ -3799,7 +3799,7 @@ uint dbBlock::levelizeFromPrimaryInputs() return 0; } - while (1) { + while (true) { std::vector startingInsts = instsToBeLeveled; instsToBeLeveled.clear(); @@ -3829,7 +3829,7 @@ uint dbBlock::levelizeFromSequential() return 0; } - while (1) { + while (true) { std::vector startingInsts = instsToBeLeveled; instsToBeLeveled.clear(); @@ -3865,7 +3865,7 @@ int dbBlock::markBackwardsUser2(dbInst* firstInst, return 0; } - while (1) { + while (true) { std::vector startingInsts = instsToBeMarked; instsToBeMarked.clear(); @@ -4029,7 +4029,7 @@ int dbBlock::markBackwardsUser2(dbNet* net, return -1; } - while (1) { + while (true) { std::vector startingInsts = instsToBeMarked; instsToBeMarked.clear(); diff --git a/src/odb/src/db/dbWireCodec.cpp b/src/odb/src/db/dbWireCodec.cpp index 0e88baba56d..f2e39a4e32b 100644 --- a/src/odb/src/db/dbWireCodec.cpp +++ b/src/odb/src/db/dbWireCodec.cpp @@ -1253,7 +1253,7 @@ void dumpDecoder4Net(dbNet* innet) dbTechLayer* layer; dbWireType wtype; dbTechLayerRule* lyr_rule = nullptr; - while (1) { + while (true) { opcode = decoder.next(); if (opcode == dbWireDecoder::END_DECODE) { logger->info( diff --git a/src/odb/src/def/cdef/defwWriter.h b/src/odb/src/def/cdef/defwWriter.h index 1b564cb8af0..beee720ff06 100644 --- a/src/odb/src/def/cdef/defwWriter.h +++ b/src/odb/src/def/cdef/defwWriter.h @@ -1740,7 +1740,7 @@ EXTERN int defwCurrentLineNumber(); * extern void defwVError ( const char *, va_list ); * extern void defwVWarning ( const char *, va_list ); * extern int defwGetCurrentLineNumber (void); - * extern const char *defwGetCurrentFileName (void); + * extern const char *defwGetCurrentFileName(); */ /* This routine will print the error message. */ diff --git a/src/odb/src/def/def/def_keywords.cpp b/src/odb/src/def/def/def_keywords.cpp index 538c57c65ab..8352a537b99 100644 --- a/src/odb/src/def/def/def_keywords.cpp +++ b/src/odb/src/def/def/def_keywords.cpp @@ -784,7 +784,7 @@ int defrData::sublex(YYSTYPE* pYylval) int c; int prev; prev = ' '; - while (1) { + while (true) { c = GETC(); if (c == EOF) { @@ -808,7 +808,7 @@ int defrData::sublex(YYSTYPE* pYylval) int begQuote = 0; /* First make sure there is a name after BEGINEXT within quote */ /* BEGINEXT "name" */ - while (1) { + while (true) { cc = GETC(); if (cc == EOF) { @@ -850,7 +850,7 @@ int defrData::sublex(YYSTYPE* pYylval) /* We have handle with the tag, just read the rest until */ /* ENDEXT */ begQuote = 0; - while (1) { + while (true) { cc = GETC(); if (cc == EOF) { diff --git a/src/odb/src/def/def/defwWriter.hpp b/src/odb/src/def/def/defwWriter.hpp index 812d315e2f3..390c3cb0563 100644 --- a/src/odb/src/def/def/defwWriter.hpp +++ b/src/odb/src/def/def/defwWriter.hpp @@ -158,7 +158,7 @@ extern int defwHistory(const char* string); * This routine is optional. * Returns 0 if successful. * The routine can be called only once. */ -extern int defwStartPropDef(void); +extern int defwStartPropDef(); /* This routine must be called after defwStartPropDef. * This routine can be called multiple times. @@ -204,7 +204,7 @@ extern int defwStringPropDef( * If you called defwPropertyDefinitions then this routine is NOT optional. * Returns 0 if successful. * The routine can be called only once. */ -extern int defwEndPropDef(void); +extern int defwEndPropDef(); /* This routine can be called after defwRow, defwRegion, defwComponent, * defwPin, defwSpecialNet, defwNet, and defwGroup @@ -322,7 +322,7 @@ extern int defwDefaultCap(int pins, /* MINPINS */ * calls to DefaultCap then DEFW_BAD_DATA will return returned. * The routine can be called only once. * This api is obsolete in 5.4. */ -extern int defwEndDefaultCap(void); +extern int defwEndDefaultCap(); /* This routine must be called after the defwDefaultCap calls (if any). * The operation of the do is explained in the documentation. @@ -473,7 +473,7 @@ extern int defwOneViaEnd(); * If the count in StartVias is not the same as the number of * calls to Via or ViaPattern then DEFW_BAD_DATA will return returned. * The routine can be called only once. */ -extern int defwEndVias(void); +extern int defwEndVias(); /* This routine must be called after via section (if any). * This section of routines is optional. @@ -507,7 +507,7 @@ extern int defwRegionType(const char* type); /* FENCE | GUIDE */ * If the count in StartRegions is not the same as the number of * calls to Region or RegionPattern then DEFW_BAD_DATA will return returned. * The routine can be called only once. */ -extern int defwEndRegions(void); +extern int defwEndRegions(); /* This is a 5.8 syntax. * Returns 0 if successful. @@ -636,7 +636,7 @@ extern int defwComponentRouteHalo(int haloDist, * If the count in StartComponents is not the same as the number of * calls to Component then DEFW_BAD_DATA will return returned. * The routine can be called only once. */ -extern int defwEndComponents(void); +extern int defwEndComponents(); /* This routine must be called after the components section (if any). * This section of routines is optional. @@ -886,7 +886,7 @@ extern int defwPinAntennaPinMaxCutCar( * If the count in StartPins is not the same as the number of * calls to Pin then DEFW_BAD_DATA will return returned. * The routine can be called only once. */ -extern int defwEndPins(void); +extern int defwEndPins(); /* This routine must be called after the pin section (if any). * This section of routines is optional. @@ -910,7 +910,7 @@ extern int defwPinProperty(const char* name, /* compName | PIN */ * If the count in StartPins is not the same as the number of * calls to Pin then DEFW_BAD_DATA will return returned. * The routine can be called only once. */ -extern int defwEndPinProperties(void); +extern int defwEndPinProperties(); /* Routines to enter a special net or nets into the file. * You must first call defwStartSpecialNets with the number of @@ -1799,19 +1799,19 @@ extern int defwEndBeginext(); /* End the DEF file. * This routine IS NOT OPTIONAL. * The routine must be called LAST. */ -extern int defwEnd(void); +extern int defwEnd(); /* General routines that can be called anytime after the Init is called. */ -extern int defwCurrentLineNumber(void); +extern int defwCurrentLineNumber(); /* * extern void defwError ( const char *, ... ); * extern void defwWarning ( const char *, ... ); * extern void defwVError ( const char *, va_list ); * extern void defwVWarning ( const char *, va_list ); - * extern int defwGetCurrentLineNumber (void); - * extern const char *defwGetCurrentFileName (void); + * extern int defwGetCurrentLineNumber (); + * extern const char *defwGetCurrentFileName (); */ /* This routine will print the error message. */ diff --git a/src/odb/src/def/defwrite/defwrite.cpp b/src/odb/src/def/defwrite/defwrite.cpp index a7130e55608..0c68a8a0af5 100644 --- a/src/odb/src/def/defwrite/defwrite.cpp +++ b/src/odb/src/def/defwrite/defwrite.cpp @@ -90,7 +90,7 @@ int main(int argc, char** argv) fprintf(stderr, "Usage: defwrite [-o ] [-help]\n"); return 1; } else if (strncmp(*argv, "-g", 2) == 0) { // test of group init function. - groupInit = 1; + groupInit = true; } else { fprintf(stderr, "ERROR: Illegal command line option: '%s'\n", *argv); return 2; diff --git a/src/odb/src/defout/defout_impl.cpp b/src/odb/src/defout/defout_impl.cpp index a1a3fbdebef..2259354d825 100644 --- a/src/odb/src/defout/defout_impl.cpp +++ b/src/odb/src/defout/defout_impl.cpp @@ -1130,7 +1130,7 @@ void defout_impl::writeBPin(dbBPin* bpin, int cnt) fprintf(_out, "+ PORT"); } - bool isFirst = 1; + bool isFirst = true; int dw, dh, x = 0, y = 0; int xMin, yMin, xMax, yMax; @@ -1139,7 +1139,7 @@ void defout_impl::writeBPin(dbBPin* bpin, int cnt) dh = defdist(int(box->getDY() / 2)); if (isFirst) { - isFirst = 0; + isFirst = false; x = defdist(box->xMin()) + dw; y = defdist(box->yMin()) + dh; } diff --git a/src/odb/src/lef/lef/lefwWriterCalls.hpp b/src/odb/src/lef/lef/lefwWriterCalls.hpp index 3fac33f4f94..064cf0bb663 100644 --- a/src/odb/src/lef/lef/lefwWriterCalls.hpp +++ b/src/odb/src/lef/lef/lefwWriterCalls.hpp @@ -54,7 +54,7 @@ extern int lefwWrite(FILE* file, const char* fileName, lefiUserData userData); * that will add up how many times a given lef data type was ignored * (ie no callback was done). The statistics can later be printed out. */ -extern void lefwSetRegisterUnusedCallbacks(void); +extern void lefwSetRegisterUnusedCallbacks(); extern void lefwPrintUnusedCallbacks(FILE* f); /* diff --git a/src/odb/src/lefin/MetalWidthViaMapParser.cpp b/src/odb/src/lefin/MetalWidthViaMapParser.cpp index 1fa23f1d790..d40b8276c78 100644 --- a/src/odb/src/lefin/MetalWidthViaMapParser.cpp +++ b/src/odb/src/lefin/MetalWidthViaMapParser.cpp @@ -26,9 +26,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include #include +#include #include "boostParser.h" #include "lefLayerPropParser.h" @@ -59,7 +58,7 @@ void MetalWidthViaMapParser::addEntry( } via_map->setViaName(at_c<5>(params)); via_map->setViaCutClass(cut_class_); - incomplete_props_.push_back({via_map, layer_name}); + incomplete_props_.emplace_back(via_map, layer_name); } void MetalWidthViaMapParser::setCutClass() diff --git a/src/odb/src/lefin/lefLayerPropParser.h b/src/odb/src/lefin/lefLayerPropParser.h index 24455a9905a..ef1a55f7260 100644 --- a/src/odb/src/lefin/lefLayerPropParser.h +++ b/src/odb/src/lefin/lefLayerPropParser.h @@ -268,7 +268,7 @@ class ArraySpacingParser { public: ArraySpacingParser(dbTechLayer* layer, lefin* lefin) - : layer_(layer), lefin_(lefin), rule_(nullptr) + : layer_(layer), lefin_(lefin) { } bool parse(std::string); @@ -281,14 +281,14 @@ class ArraySpacingParser void setViaWidth(double width); dbTechLayer* layer_; lefin* lefin_; - dbTechLayerArraySpacingRule* rule_; + dbTechLayerArraySpacingRule* rule_{nullptr}; }; class WidthTableParser { public: WidthTableParser(dbTechLayer* layer, lefin* lefin) - : layer_(layer), lefin_(lefin), rule_(nullptr) + : layer_(layer), lefin_(lefin) { } void parse(const std::string&); @@ -298,14 +298,13 @@ class WidthTableParser bool parseSubRule(std::string s); dbTechLayer* layer_; lefin* lefin_; - dbTechLayerWidthTableRule* rule_; + dbTechLayerWidthTableRule* rule_{nullptr}; }; class MinCutParser { public: - MinCutParser(dbTechLayer* layer, lefin* lefin) - : layer_(layer), lefin_(lefin), rule_(nullptr) + MinCutParser(dbTechLayer* layer, lefin* lefin) : layer_(layer), lefin_(lefin) { } void parse(const std::string&); @@ -321,7 +320,7 @@ class MinCutParser void setAreaWithin(double); dbTechLayer* layer_; lefin* lefin_; - dbTechLayerMinCutRule* rule_; + dbTechLayerMinCutRule* rule_{nullptr}; }; class MetalWidthViaMapParser @@ -331,11 +330,7 @@ class MetalWidthViaMapParser dbTech* tech, lefin* lefin, std::vector>& incomplete_props) - : tech_(tech), - lefin_(lefin), - cut_class_(false), - incomplete_props_(incomplete_props), - via_map(nullptr) + : tech_(tech), lefin_(lefin), incomplete_props_(incomplete_props) { } void parse(const std::string&); @@ -352,16 +347,16 @@ class MetalWidthViaMapParser void setPGVia(); dbTech* tech_; lefin* lefin_; - bool cut_class_; + bool cut_class_{false}; std::vector>& incomplete_props_; - dbMetalWidthViaMap* via_map; + dbMetalWidthViaMap* via_map{nullptr}; }; class KeepOutZoneParser { public: KeepOutZoneParser(dbTechLayer* layer, lefin* lefin) - : layer_(layer), lefin_(lefin), rule_(nullptr) + : layer_(layer), lefin_(lefin) { } void parse(const std::string&); @@ -371,7 +366,7 @@ class KeepOutZoneParser void setInt(double val, void (odb::dbTechLayerKeepOutZoneRule::*func)(int)); dbTechLayer* layer_; lefin* lefin_; - dbTechLayerKeepOutZoneRule* rule_; + dbTechLayerKeepOutZoneRule* rule_{nullptr}; }; class MaxSpacingParser diff --git a/src/odb/src/swig/common/odb.i b/src/odb/src/swig/common/odb.i index 4735233a7db..8f82b85afba 100644 --- a/src/odb/src/swig/common/odb.i +++ b/src/odb/src/swig/common/odb.i @@ -36,10 +36,7 @@ #include "dbIterator.h" #include "dbTransform.h" #include "dbWireGraph.h" -#include "dbBlockSet.h" -#include "dbNetSet.h" #include "dbMap.h" -#include "dbCCSegSet.h" #include "dbSet.h" #include "dbTypes.h" #include "geom.h" @@ -97,9 +94,7 @@ using namespace odb; %include "odb/dbIterator.h" %include "odb/dbTransform.h" %include "odb/dbWireGraph.h" -%include "odb/dbBlockSet.h" -%include "odb/dbNetSet.h" -%include "odb/dbCCSegSet.h" +%include "odb/dbSet.h" %include "odb/wOrder.h" std::string generateMacroPlacementString(odb::dbBlock* block); diff --git a/src/pad/src/RDLRoute.cpp b/src/pad/src/RDLRoute.cpp index ddd71dc13e4..b465464e664 100644 --- a/src/pad/src/RDLRoute.cpp +++ b/src/pad/src/RDLRoute.cpp @@ -35,7 +35,7 @@ #include "RDLRoute.h" -#include "odb/dbCompare.h" +#include "odb/db.h" #include "odb/geom_boost.h" namespace pad { diff --git a/src/rcx/src/grids.cpp b/src/rcx/src/grids.cpp index 2b85f40efce..82a28916dd5 100644 --- a/src/rcx/src/grids.cpp +++ b/src/rcx/src/grids.cpp @@ -745,7 +745,7 @@ Ath__track* Ath__grid::getTrackPtr(uint ii, uint markerCnt, int base) } _subTrackCnt[ii]++; ntrack = _trackTable[ii]; - while (1) { + while (true) { if (ntrack->getBase() > base) { break; }