From 960c65047877c72498d65ecc401371ab1552c82a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Thu, 28 Jun 2018 18:06:31 +0200 Subject: [PATCH] clangformat cleanup --- dummy/main.cc | 10 ++++------ gui/basewindow.cc | 8 ++++---- gui/designwidget.cc | 9 +++------ gui/fpgaviewwidget.cc | 6 ++---- gui/fpgaviewwidget.h | 1 + gui/ice40/mainwindow.cc | 12 ++++++------ gui/ice40/worker.cc | 6 +----- ice40/main.cc | 10 ++++------ 8 files changed, 25 insertions(+), 37 deletions(-) diff --git a/dummy/main.cc b/dummy/main.cc index d025d8d4..6f4774d1 100644 --- a/dummy/main.cc +++ b/dummy/main.cc @@ -75,18 +75,16 @@ int main(int argc, char *argv[]) } if (vm.count("help") || argc == 1) { - std::cout << boost::filesystem::basename(argv[0]) - << " -- Next Generation Place and Route (git " - "sha1 " GIT_COMMIT_HASH_STR ")\n"; + std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git " + "sha1 " GIT_COMMIT_HASH_STR ")\n"; std::cout << "\n"; std::cout << options << "\n"; return argc != 1; } if (vm.count("version")) { - std::cout << boost::filesystem::basename(argv[0]) - << " -- Next Generation Place and Route (git " - "sha1 " GIT_COMMIT_HASH_STR ")\n"; + std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git " + "sha1 " GIT_COMMIT_HASH_STR ")\n"; return 1; } diff --git a/gui/basewindow.cc b/gui/basewindow.cc index 2e8d7c85..5d2e21cc 100644 --- a/gui/basewindow.cc +++ b/gui/basewindow.cc @@ -67,8 +67,8 @@ BaseMainWindow::BaseMainWindow(QWidget *parent) : QMainWindow(parent), ctx(nullp designview->setMinimumWidth(300); designview->setMaximumWidth(300); splitter_h->addWidget(designview); - - connect(this, SIGNAL(contextChanged(Context*)), designview, SLOT(newContext(Context*))); + + connect(this, SIGNAL(contextChanged(Context *)), designview, SLOT(newContext(Context *))); connect(designview, SIGNAL(info(std::string)), this, SLOT(writeInfo(std::string))); @@ -76,7 +76,7 @@ BaseMainWindow::BaseMainWindow(QWidget *parent) : QMainWindow(parent), ctx(nullp #ifndef NO_PYTHON PythonTab *pythontab = new PythonTab(); tabWidget->addTab(pythontab, "Python"); - connect(this, SIGNAL(contextChanged(Context*)), pythontab, SLOT(newContext(Context*))); + connect(this, SIGNAL(contextChanged(Context *)), pythontab, SLOT(newContext(Context *))); #endif info = new InfoTab(); tabWidget->addTab(info, "Info"); @@ -85,7 +85,7 @@ BaseMainWindow::BaseMainWindow(QWidget *parent) : QMainWindow(parent), ctx(nullp FPGAViewWidget *fpgaView = new FPGAViewWidget(); centralTabWidget->addTab(fpgaView, "Graphics"); - connect(this, SIGNAL(contextChanged(Context*)), fpgaView, SLOT(newContext(Context*))); + connect(this, SIGNAL(contextChanged(Context *)), fpgaView, SLOT(newContext(Context *))); splitter_v->addWidget(centralTabWidget); splitter_v->addWidget(tabWidget); diff --git a/gui/designwidget.cc b/gui/designwidget.cc index a989080e..2168a673 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -135,8 +135,7 @@ void DesignWidget::newContext(Context *ctx) bel_root->setText(0, QString("Bels")); treeWidget->insertTopLevelItem(0, bel_root); QList bel_items; - if (ctx) - { + if (ctx) { for (auto bel : ctx->getBels()) { auto name = ctx->getBelName(bel); bel_items.append(new BelTreeItem(name, ElementType::BEL, QString(name.c_str(ctx)))); @@ -149,8 +148,7 @@ void DesignWidget::newContext(Context *ctx) QList wire_items; wire_root->setText(0, QString("Wires")); treeWidget->insertTopLevelItem(0, wire_root); - if (ctx) - { + if (ctx) { for (auto wire : ctx->getWires()) { auto name = ctx->getWireName(wire); wire_items.append(new WireTreeItem(name, ElementType::WIRE, QString(name.c_str(ctx)))); @@ -163,8 +161,7 @@ void DesignWidget::newContext(Context *ctx) QList pip_items; pip_root->setText(0, QString("Pips")); treeWidget->insertTopLevelItem(0, pip_root); - if (ctx) - { + if (ctx) { for (auto pip : ctx->getPips()) { auto name = ctx->getPipName(pip); pip_items.append(new PipTreeItem(name, ElementType::PIP, QString(name.c_str(ctx)))); diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc index a2691401..12d52c77 100644 --- a/gui/fpgaviewwidget.cc +++ b/gui/fpgaviewwidget.cc @@ -355,8 +355,7 @@ void FPGAViewWidget::paintGL() // Draw Bels. auto bels = LineShaderData(0.02f, QColor("#b000ba")); - if (ctx_) - { + if (ctx_) { for (auto bel : ctx_->getBels()) { for (auto &el : ctx_->getBelGraphics(bel)) drawElement(bels, el); @@ -366,8 +365,7 @@ void FPGAViewWidget::paintGL() // Draw Frame Graphics. auto frames = LineShaderData(0.02f, QColor("#0066ba")); - if (ctx_) - { + if (ctx_) { for (auto &el : ctx_->getFrameGraphics()) { drawElement(frames, el); } diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h index 1d878696..77735071 100644 --- a/gui/fpgaviewwidget.h +++ b/gui/fpgaviewwidget.h @@ -242,6 +242,7 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions void drawElement(LineShaderData &data, const GraphicElement &el); public Q_SLOTS: void newContext(Context *ctx); + private: QPoint lastPos_; float moveX_; diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc index 2563a767..c89b5d2d 100644 --- a/gui/ice40/mainwindow.cc +++ b/gui/ice40/mainwindow.cc @@ -58,8 +58,8 @@ MainWindow::MainWindow(QWidget *parent) : BaseMainWindow(parent), timing_driven( connect(task, SIGNAL(taskStarted()), this, SLOT(taskStarted())); connect(task, SIGNAL(taskPaused()), this, SLOT(taskPaused())); - connect(this, SIGNAL(contextChanged(Context*)), this, SLOT(newContext(Context*))); - connect(this, SIGNAL(contextChanged(Context*)), task, SIGNAL(contextChanged(Context*))); + connect(this, SIGNAL(contextChanged(Context *)), this, SLOT(newContext(Context *))); + connect(this, SIGNAL(contextChanged(Context *)), task, SIGNAL(contextChanged(Context *))); createMenu(); } @@ -184,10 +184,10 @@ void MainWindow::new_proj() ArchArgs chipArgs; chipArgs.type = ArchArgs::HX1K; chipArgs.package = "tq144"; - if (ctx) + if (ctx) delete ctx; ctx = new Context(chipArgs); - + Q_EMIT contextChanged(ctx); actionLoadJSON->setEnabled(true); @@ -352,7 +352,7 @@ void MainWindow::taskStarted() disableActions(); actionPause->setEnabled(true); actionStop->setEnabled(true); - + actionNew->setEnabled(false); actionOpen->setEnabled(false); } @@ -362,7 +362,7 @@ void MainWindow::taskPaused() disableActions(); actionPlay->setEnabled(true); actionStop->setEnabled(true); - + actionNew->setEnabled(false); actionOpen->setEnabled(false); } diff --git a/gui/ice40/worker.cc b/gui/ice40/worker.cc index c49b8769..ce513a05 100644 --- a/gui/ice40/worker.cc +++ b/gui/ice40/worker.cc @@ -56,10 +56,7 @@ Worker::Worker(TaskManager *parent) : ctx(nullptr) }; } -void Worker::newContext(Context *ctx_) -{ - ctx = ctx_; -} +void Worker::newContext(Context *ctx_) { ctx = ctx_; } void Worker::loadfile(const std::string &filename) { @@ -156,7 +153,6 @@ TaskManager::TaskManager() : toTerminate(false), toPause(false) connect(this, &TaskManager::place, worker, &Worker::place); connect(this, &TaskManager::route, worker, &Worker::route); - connect(this, &TaskManager::contextChanged, worker, &Worker::newContext); connect(worker, &Worker::log, this, &TaskManager::info); diff --git a/ice40/main.cc b/ice40/main.cc index 8f500efb..e30553b1 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -126,18 +126,16 @@ int main(int argc, char *argv[]) if (vm.count("help") || argc == 1) { help: - std::cout << boost::filesystem::basename(argv[0]) - << " -- Next Generation Place and Route (git " - "sha1 " GIT_COMMIT_HASH_STR ")\n"; + std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git " + "sha1 " GIT_COMMIT_HASH_STR ")\n"; std::cout << "\n"; std::cout << options << "\n"; return argc != 1; } if (vm.count("version")) { - std::cout << boost::filesystem::basename(argv[0]) - << " -- Next Generation Place and Route (git " - "sha1 " GIT_COMMIT_HASH_STR ")\n"; + std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git " + "sha1 " GIT_COMMIT_HASH_STR ")\n"; return 1; }