From 85110f7880e32d298ee2853b4c055c7aaa22662f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 5 Jan 2018 16:53:09 +0100 Subject: Fix and suppress most of the warnings --- qtmips_gui/coreview/alu.cpp | 2 +- qtmips_gui/coreview/connection.cpp | 4 ++-- qtmips_gui/coreview/latch.cpp | 4 ++-- qtmips_gui/coreview/memory.cpp | 2 +- qtmips_gui/coreview/multiplexer.cpp | 2 +- qtmips_gui/coreview/programcounter.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'qtmips_gui/coreview') 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); } -- cgit v1.2.3