Skip to content

Commit

Permalink
Merge pull request #6442 from The-OpenROAD-Project-staging/ct1
Browse files Browse the repository at this point in the history
various: more clang-tidy
  • Loading branch information
maliberty authored Dec 29, 2024
2 parents 43e602d + 67c7e42 commit a288d5b
Show file tree
Hide file tree
Showing 38 changed files with 122 additions and 132 deletions.
6 changes: 3 additions & 3 deletions src/grt/src/fastroute/include/FastRoute.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions src/grt/src/fastroute/src/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -2002,7 +2002,7 @@ void FastRouteCore::copyBR(void)
}
}

void FastRouteCore::freeRR(void)
void FastRouteCore::freeRR()
{
int edgeID, numEdges;
if (!sttrees_bk_.empty()) {
Expand Down
4 changes: 2 additions & 2 deletions src/gui/include/gui/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Selected(void)>;
using ActionCallback = std::function<Selected()>;
struct Action
{
std::string name;
Expand Down Expand Up @@ -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<void(void)>;
using DisplayControlCallback = std::function<void()>;
struct DisplayControl
{
bool visibility;
Expand Down
12 changes: 6 additions & 6 deletions src/gui/include/gui/heatMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ class HeatMapDataSource
{
std::string name;
std::string label;
std::function<bool(void)> getter;
std::function<bool()> getter;
std::function<void(bool)> setter;
};
struct MapSettingMultiChoice
{
std::string name;
std::string label;
std::function<std::vector<std::string>(void)> choices;
std::function<const std::string(void)> getter;
std::function<std::vector<std::string>()> choices;
std::function<const std::string()> getter;
std::function<void(const std::string&)> setter;
};

Expand Down Expand Up @@ -189,13 +189,13 @@ class HeatMapDataSource
protected:
void addBooleanSetting(const std::string& name,
const std::string& label,
const std::function<bool(void)>& getter,
const std::function<bool()>& getter,
const std::function<void(bool)>& setter);
void addMultipleChoiceSetting(
const std::string& name,
const std::string& label,
const std::function<std::vector<std::string>(void)>& choices,
const std::function<std::string(void)>& getter,
const std::function<std::vector<std::string>()>& choices,
const std::function<std::string()>& getter,
const std::function<void(std::string)>& setter);

void setupMap();
Expand Down
11 changes: 4 additions & 7 deletions src/gui/src/dbDescriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -1638,9 +1637,8 @@ odb::dbObject* DbNetDescriptor::getSink(const std::any& object) const

//////////////////////////////////////////////////

DbITermDescriptor::DbITermDescriptor(
odb::dbDatabase* db,
std::function<bool(void)> usingPolyDecompView)
DbITermDescriptor::DbITermDescriptor(odb::dbDatabase* db,
std::function<bool()> usingPolyDecompView)
: BaseDbDescriptor<odb::dbITerm>(db),
usingPolyDecompView_(std::move(usingPolyDecompView))
{
Expand Down Expand Up @@ -1952,9 +1950,8 @@ bool DbBPinDescriptor::getAllObjects(SelectionSet& objects) const

//////////////////////////////////////////////////

DbMTermDescriptor::DbMTermDescriptor(
odb::dbDatabase* db,
std::function<bool(void)> usingPolyDecompView)
DbMTermDescriptor::DbMTermDescriptor(odb::dbDatabase* db,
std::function<bool()> usingPolyDecompView)
: BaseDbDescriptor<odb::dbMTerm>(db),
usingPolyDecompView_(std::move(usingPolyDecompView))
{
Expand Down
8 changes: 4 additions & 4 deletions src/gui/src/dbDescriptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class DbITermDescriptor : public BaseDbDescriptor<odb::dbITerm>
{
public:
DbITermDescriptor(odb::dbDatabase* db,
std::function<bool(void)> usingPolyDecompView);
std::function<bool()> usingPolyDecompView);

std::string getName(std::any object) const override;
std::string getShortName(std::any object) const override;
Expand All @@ -255,7 +255,7 @@ class DbITermDescriptor : public BaseDbDescriptor<odb::dbITerm>
Properties getDBProperties(odb::dbITerm* iterm) const override;

private:
std::function<bool(void)> usingPolyDecompView_;
std::function<bool()> usingPolyDecompView_;
};

class DbBTermDescriptor : public BaseDbDescriptor<odb::dbBTerm>
Expand Down Expand Up @@ -299,7 +299,7 @@ class DbMTermDescriptor : public BaseDbDescriptor<odb::dbMTerm>
{
public:
DbMTermDescriptor(odb::dbDatabase* db,
std::function<bool(void)> usingPolyDecompView);
std::function<bool()> usingPolyDecompView);

std::string getName(std::any object) const override;
std::string getShortName(std::any object) const override;
Expand All @@ -314,7 +314,7 @@ class DbMTermDescriptor : public BaseDbDescriptor<odb::dbMTerm>
Properties getDBProperties(odb::dbMTerm* mterm) const override;

private:
std::function<bool(void)> usingPolyDecompView_;
std::function<bool()> usingPolyDecompView_;
};

class DbViaDescriptor : public BaseDbDescriptor<odb::dbVia>
Expand Down
6 changes: 3 additions & 3 deletions src/gui/src/displayControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

Q_DECLARE_METATYPE(odb::dbTechLayer*);
Q_DECLARE_METATYPE(odb::dbSite*);
Q_DECLARE_METATYPE(std::function<void(void)>);
Q_DECLARE_METATYPE(std::function<void()>);

namespace gui {

Expand Down Expand Up @@ -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<std::function<void(void)>>();
auto callback = data.value<std::function<void()>>();
callback();
emit changed();
}
Expand Down Expand Up @@ -1348,7 +1348,7 @@ void DisplayControls::makeLeafItem(ModelRow& row,

void DisplayControls::setNameItemDoubleClickAction(
ModelRow& row,
const std::function<void(void)>& callback)
const std::function<void()>& callback)
{
row.name->setData(QVariant::fromValue(callback), doubleclick_item_idx_);

Expand Down
2 changes: 1 addition & 1 deletion src/gui/src/displayControls.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class DisplayControls : public QDockWidget,
void saveRendererState(Renderer* renderer);

void setNameItemDoubleClickAction(ModelRow& row,
const std::function<void(void)>& callback);
const std::function<void()>& callback);
void setItemExclusivity(ModelRow& row,
const std::set<std::string>& exclusivity);

Expand Down
6 changes: 3 additions & 3 deletions src/gui/src/heatMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool(void)>& getter,
const std::function<bool()>& getter,
const std::function<void(bool)>& setter)
{
settings_.emplace_back(MapSettingBoolean{name, label, getter, setter});
Expand All @@ -275,8 +275,8 @@ void HeatMapDataSource::addBooleanSetting(
void HeatMapDataSource::addMultipleChoiceSetting(
const std::string& name,
const std::string& label,
const std::function<std::vector<std::string>(void)>& choices,
const std::function<std::string(void)>& getter,
const std::function<std::vector<std::string>()>& choices,
const std::function<std::string()>& getter,
const std::function<void(std::string)>& setter)
{
settings_.emplace_back(
Expand Down
10 changes: 5 additions & 5 deletions src/gui/src/layoutTabs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ LayoutTabs::LayoutTabs(Options* options,
const HighlightSet& highlighted,
const std::vector<std::unique_ptr<Ruler>>& rulers,
Gui* gui,
std::function<bool(void)> usingDBU,
std::function<bool(void)> usingPolyDecompView,
std::function<bool(void)> showRulerAsEuclidian,
std::function<bool(void)> default_mouse_wheel_zoom,
std::function<int(void)> arrow_keys_scroll_step,
std::function<bool()> usingDBU,
std::function<bool()> usingPolyDecompView,
std::function<bool()> showRulerAsEuclidian,
std::function<bool()> default_mouse_wheel_zoom,
std::function<int()> arrow_keys_scroll_step,
QWidget* parent)
: QTabWidget(parent),
options_(options),
Expand Down
20 changes: 10 additions & 10 deletions src/gui/src/layoutTabs.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ class LayoutTabs : public QTabWidget
const HighlightSet& highlighted,
const std::vector<std::unique_ptr<Ruler>>& rulers,
Gui* gui,
std::function<bool(void)> usingDBU,
std::function<bool(void)> usingPolyDecompView,
std::function<bool(void)> showRulerAsEuclidian,
std::function<bool(void)> default_mouse_wheel_zoom,
std::function<int(void)> arrow_keys_scroll_step,
std::function<bool()> usingDBU,
std::function<bool()> usingPolyDecompView,
std::function<bool()> showRulerAsEuclidian,
std::function<bool()> default_mouse_wheel_zoom,
std::function<int()> arrow_keys_scroll_step,
QWidget* parent = nullptr);

LayoutViewer* getCurrent() const { return current_viewer_; }
Expand Down Expand Up @@ -142,11 +142,11 @@ class LayoutTabs : public QTabWidget
const std::vector<std::unique_ptr<Ruler>>& rulers_;
std::map<odb::dbModule*, LayoutViewer::ModuleSettings> modules_;
Gui* gui_;
std::function<bool(void)> usingDBU_;
std::function<bool(void)> usingPolyDecompView_;
std::function<bool(void)> showRulerAsEuclidian_;
std::function<bool(void)> default_mouse_wheel_zoom_;
std::function<int(void)> arrow_keys_scroll_step_;
std::function<bool()> usingDBU_;
std::function<bool()> usingPolyDecompView_;
std::function<bool()> showRulerAsEuclidian_;
std::function<bool()> default_mouse_wheel_zoom_;
std::function<int()> arrow_keys_scroll_step_;
utl::Logger* logger_;
bool command_executing_ = false;

Expand Down
10 changes: 5 additions & 5 deletions src/gui/src/layoutViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ LayoutViewer::LayoutViewer(
const std::set<odb::dbNet*>& route_guides,
const std::set<odb::dbNet*>& net_tracks,
Gui* gui,
const std::function<bool(void)>& usingDBU,
const std::function<bool(void)>& showRulerAsEuclidian,
const std::function<bool(void)>& showDBView,
const std::function<bool()>& usingDBU,
const std::function<bool()>& showRulerAsEuclidian,
const std::function<bool()>& showDBView,
QWidget* parent)
: QWidget(parent),
block_(nullptr),
Expand Down Expand Up @@ -2464,8 +2464,8 @@ void LayoutViewer::resetCache()
////// LayoutScroll ///////
LayoutScroll::LayoutScroll(
LayoutViewer* viewer,
const std::function<bool(void)>& default_mouse_wheel_zoom,
const std::function<int(void)>& arrow_keys_scroll_step,
const std::function<bool()>& default_mouse_wheel_zoom,
const std::function<int()>& arrow_keys_scroll_step,
QWidget* parent)
: QScrollArea(parent),
default_mouse_wheel_zoom_(std::move(default_mouse_wheel_zoom)),
Expand Down
20 changes: 10 additions & 10 deletions src/gui/src/layoutViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ class LayoutViewer : public QWidget
const std::set<odb::dbNet*>& route_guides,
const std::set<odb::dbNet*>& net_tracks,
Gui* gui,
const std::function<bool(void)>& usingDBU,
const std::function<bool(void)>& showRulerAsEuclidian,
const std::function<bool(void)>& showDBView,
const std::function<bool()>& usingDBU,
const std::function<bool()>& showRulerAsEuclidian,
const std::function<bool()>& showDBView,
QWidget* parent = nullptr);

odb::dbBlock* getBlock() const { return block_; }
Expand Down Expand Up @@ -394,9 +394,9 @@ class LayoutViewer : public QWidget
bool is_view_dragging_;
Gui* gui_;

std::function<bool(void)> usingDBU_;
std::function<bool(void)> showRulerAsEuclidian_;
std::function<bool(void)> showDBView_;
std::function<bool()> usingDBU_;
std::function<bool()> showRulerAsEuclidian_;
std::function<bool()> showDBView_;

const std::map<odb::dbModule*, ModuleSettings>& modules_;

Expand Down Expand Up @@ -468,8 +468,8 @@ class LayoutScroll : public QScrollArea
Q_OBJECT
public:
LayoutScroll(LayoutViewer* viewer,
const std::function<bool(void)>& default_mouse_wheel_zoom,
const std::function<int(void)>& arrow_keys_scroll_step,
const std::function<bool()>& default_mouse_wheel_zoom,
const std::function<int()>& arrow_keys_scroll_step,
QWidget* parent = nullptr);
bool isScrollingWithCursor();
signals:
Expand All @@ -488,8 +488,8 @@ class LayoutScroll : public QScrollArea
void keyPressEvent(QKeyEvent* event) override;

private:
std::function<bool(void)> default_mouse_wheel_zoom_;
std::function<int(void)> arrow_keys_scroll_step_;
std::function<bool()> default_mouse_wheel_zoom_;
std::function<int()> arrow_keys_scroll_step_;
LayoutViewer* viewer_;

bool scrolling_with_cursor_;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/src/scriptWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ ScriptWidget::~ScriptWidget()
void ScriptWidget::setupTcl(Tcl_Interp* interp,
bool interactive,
bool do_init_openroad,
const std::function<void(void)>& post_or_init)
const std::function<void()>& post_or_init)
{
is_interactive_ = interactive;
input_->setTclInterp(interp, do_init_openroad, post_or_init);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/src/scriptWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ScriptWidget : public QDockWidget
void setupTcl(Tcl_Interp* interp,
bool interactive,
bool do_init_openroad,
const std::function<void(void)>& post_or_init);
const std::function<void()>& post_or_init);

void setWidgetFont(const QFont& font);

Expand Down
6 changes: 3 additions & 3 deletions src/gui/src/stub_heatMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ void HeatMapDataSource::redraw()
void HeatMapDataSource::addBooleanSetting(
const std::string& name,
const std::string& label,
const std::function<bool(void)>& getter,
const std::function<bool()>& getter,
const std::function<void(bool)>& setter)
{
}

void HeatMapDataSource::addMultipleChoiceSetting(
const std::string& name,
const std::string& label,
const std::function<std::vector<std::string>(void)>& choices,
const std::function<std::string(void)>& getter,
const std::function<std::vector<std::string>()>& choices,
const std::function<std::string()>& getter,
const std::function<void(std::string)>& setter)
{
}
Expand Down
7 changes: 3 additions & 4 deletions src/gui/src/tclCmdInputWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void(void)>& post_or_init)
void TclCmdInputWidget::setTclInterp(Tcl_Interp* interp,
bool do_init_openroad,
const std::function<void()>& post_or_init)
{
interp_ = interp;

Expand Down
Loading

0 comments on commit a288d5b

Please sign in to comment.