diff options
Diffstat (limited to 'qtmips_gui')
-rw-r--r-- | qtmips_gui/coreview.cpp | 2 | ||||
-rw-r--r-- | qtmips_gui/coreview/alu.cpp | 2 | ||||
-rw-r--r-- | qtmips_gui/coreview/connection.cpp | 4 | ||||
-rw-r--r-- | qtmips_gui/coreview/latch.cpp | 4 | ||||
-rw-r--r-- | qtmips_gui/coreview/memory.cpp | 2 | ||||
-rw-r--r-- | qtmips_gui/coreview/multiplexer.cpp | 2 | ||||
-rw-r--r-- | qtmips_gui/coreview/programcounter.cpp | 2 | ||||
-rw-r--r-- | qtmips_gui/mainwindow.cpp | 2 | ||||
-rw-r--r-- | qtmips_gui/registersdock.cpp | 4 |
9 files changed, 13 insertions, 11 deletions
diff --git a/qtmips_gui/coreview.cpp b/qtmips_gui/coreview.cpp index f7cc416..1750cc1 100644 --- a/qtmips_gui/coreview.cpp +++ b/qtmips_gui/coreview.cpp @@ -9,7 +9,7 @@ CoreView::CoreView(QWidget *parent) : QGraphicsView(parent) { //fitInView(0, 0, 201, 201, Qt::KeepAspectRatioByExpanding); } -void CoreView::resizeEvent(QResizeEvent *event) { +void CoreView::resizeEvent(QResizeEvent *event __attribute__((unused))) { // fitInView(0, 0, 201, 201, Qt::KeepAspectRatioByExpanding); } diff --git a/qtmips_gui/coreview/alu.cpp b/qtmips_gui/coreview/alu.cpp index 76cf8ad..bb48c7e 100644 --- a/qtmips_gui/coreview/alu.cpp +++ b/qtmips_gui/coreview/alu.cpp @@ -23,7 +23,7 @@ QRectF coreview::Alu::boundingRect() const { return QRectF(-PENW / 2, -PENW / 2, WIDTH + PENW, HEIGHT + PENW); } -void coreview::Alu::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { +void coreview::Alu::paint(QPainter *painter, const QStyleOptionGraphicsItem *option __attribute__((unused)), QWidget *widget __attribute__((unused))) { const QPointF poly[] = { QPointF(0, 0), QPointF(WIDTH, WIDTH), diff --git a/qtmips_gui/coreview/connection.cpp b/qtmips_gui/coreview/connection.cpp index ebca519..f2b730c 100644 --- a/qtmips_gui/coreview/connection.cpp +++ b/qtmips_gui/coreview/connection.cpp @@ -58,13 +58,13 @@ QRectF Connection::boundingRect() const { if (y > points[i+1].y()) y = points[i+1].y(); // TODO pen width - rect.united(QRectF(x - 0.5, y - 0.5, fabs(points[i].x() - points[i+1].x()) + 1, fabs(points[i].y() - points[i+1].y()) + 1)); + rect = rect.united(QRectF(x - 0.5, y - 0.5, fabs(points[i].x() - points[i+1].x()) + 1, fabs(points[i].y() - points[i+1].y()) + 1)); } //return rect; return QRectF(0, 0, 300, 300); } -void Connection::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { +void Connection::paint(QPainter *painter, const QStyleOptionGraphicsItem *option __attribute__((unused)), QWidget *widget __attribute__((unused))) { for (int i = 0; i < (points.size() - 1); i++) painter->drawLine(points[i], points[i+1]); // TODO meaby use QPath instead? diff --git a/qtmips_gui/coreview/latch.cpp b/qtmips_gui/coreview/latch.cpp index 0ad827a..5f2727b 100644 --- a/qtmips_gui/coreview/latch.cpp +++ b/qtmips_gui/coreview/latch.cpp @@ -16,7 +16,7 @@ QRectF Latch::boundingRect() const { return QRectF(-PENW / 2, -PENW / 2, WIDTH + PENW, height + PENW); } -void Latch::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { +void Latch::paint(QPainter *painter, const QStyleOptionGraphicsItem *option __attribute__((unused)), QWidget *widget __attribute__((unused))) { painter->drawRect(0, 0, WIDTH, height); // Now tick rectangle const QPointF tickPolygon[] = { @@ -29,7 +29,7 @@ void Latch::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi void Latch::setPos(qreal x, qreal y) { QGraphicsObject::setPos(x, y); - for (unsigned i = 0; i < connectors.size(); i++) { + for (int i = 0; i < connectors.size(); i++) { connectors[i].in->setPos(x, y + connectors_off[i]); connectors[i].out->setPos(x + WIDTH, y + connectors_off[i]); } diff --git a/qtmips_gui/coreview/memory.cpp b/qtmips_gui/coreview/memory.cpp index e6044fe..c732687 100644 --- a/qtmips_gui/coreview/memory.cpp +++ b/qtmips_gui/coreview/memory.cpp @@ -25,7 +25,7 @@ QRectF Memory::boundingRect() const { // TODO } -void Memory::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { +void Memory::paint(QPainter *painter, const QStyleOptionGraphicsItem *option __attribute__((unused)), QWidget *widget __attribute__((unused))) { // TODO } diff --git a/qtmips_gui/coreview/multiplexer.cpp b/qtmips_gui/coreview/multiplexer.cpp index 148c58d..6f6abe1 100644 --- a/qtmips_gui/coreview/multiplexer.cpp +++ b/qtmips_gui/coreview/multiplexer.cpp @@ -32,7 +32,7 @@ QRectF Multiplexer::boundingRect() const { return QRectF(-PENW / 2, -PENW / 2, WIDTH + PENW, (HEIGHT * size) + PENW); } -void Multiplexer::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { +void Multiplexer::paint(QPainter *painter, const QStyleOptionGraphicsItem *option __attribute__((unused)), QWidget *widget __attribute__((unused))) { const QPointF poly[] = { QPointF(0, 0), QPointF(WIDTH, WIDTH), diff --git a/qtmips_gui/coreview/programcounter.cpp b/qtmips_gui/coreview/programcounter.cpp index b25cbbe..a6565c7 100644 --- a/qtmips_gui/coreview/programcounter.cpp +++ b/qtmips_gui/coreview/programcounter.cpp @@ -25,7 +25,7 @@ QRectF ProgramCounter::boundingRect() const { return QRectF(-PENW / 2, -PENW / 2, WIDTH + PENW, HEIGHT + PENW); } -void ProgramCounter::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { +void ProgramCounter::paint(QPainter *painter, const QStyleOptionGraphicsItem *option __attribute__((unused)), QWidget *widget __attribute__((unused))) { painter->drawRect(0, 0, WIDTH, HEIGHT); } diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp index 92d1a74..6b8d19b 100644 --- a/qtmips_gui/mainwindow.cpp +++ b/qtmips_gui/mainwindow.cpp @@ -134,7 +134,7 @@ void MainWindow::set_speed() { machine->set_speed(0); } -void MainWindow::closeEvent(QCloseEvent *event) { +void MainWindow::closeEvent(QCloseEvent *event __attribute__((unused))) { settings->setValue("windowGeometry", saveGeometry()); settings->setValue("windowState", saveState()); settings->sync(); diff --git a/qtmips_gui/registersdock.cpp b/qtmips_gui/registersdock.cpp index 12690e2..8250321 100644 --- a/qtmips_gui/registersdock.cpp +++ b/qtmips_gui/registersdock.cpp @@ -27,7 +27,9 @@ RegistersDock::RegistersDock(QWidget *parent) : QDockWidget(parent) { } RegistersDock::~RegistersDock() { - delete pc, hi, lo; + delete pc; + delete hi; + delete lo; for (int i = 0; i < 32; i++) delete gp[i]; delete layout; |