diff options
author | Simon Rettberg | 2016-11-15 12:13:40 +0100 |
---|---|---|
committer | Simon Rettberg | 2016-11-15 12:13:40 +0100 |
commit | eaebc23452813a8709d2bbb4d17fddb1b4f29d91 (patch) | |
tree | 956155fc2fc5b58498a4c494cc59b7adc68bc76a /src/server/mainwindow | |
parent | [server] Rewrite positioning logic of connection frames (diff) | |
download | pvs2-eaebc23452813a8709d2bbb4d17fddb1b4f29d91.tar.gz pvs2-eaebc23452813a8709d2bbb4d17fddb1b4f29d91.tar.xz pvs2-eaebc23452813a8709d2bbb4d17fddb1b4f29d91.zip |
Increase compiler warnings, fix a lot of those instances
- Add explicit casts
- Comment out unused params
- Remove ignored const return types
Diffstat (limited to 'src/server/mainwindow')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 87ecca4..0a77240 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -228,10 +228,10 @@ int distance(QPoint a, QPoint b) int distance(QPointF a, QPointF b) { - const int dx = a.x() - b.x(); - const int dy = a.y() - b.y(); - const int sum = dx * dx + dy * dy; - return sum; + const qreal dx = a.x() - b.x(); + const qreal dy = a.y() - b.y(); + const qreal sum = dx * dx + dy * dy; + return (int)sum; } /***************************************************************************//** @@ -300,12 +300,12 @@ endLoop: ; } endSearch: ; /* among all the free positions, find the closest */ - float min_distance = 1000000; + int min_distance = 1000000; QPoint bestPosition = QPoint(0, 0); for (QPoint freePos : freePositions) { const QPoint freePosPx( freePos.x() * getTileWidthPx(), freePos.y() * getTileHeightPx() ); - const float dist = distance(freePosPx, preferredPixels); + const int dist = distance(freePosPx, preferredPixels); if (dist < min_distance) { min_distance = dist; bestPosition = freePos; @@ -478,7 +478,7 @@ AspectStatus checkAspectRatio(const QSize& frameSize, const QSize& gridSize) * Resize event. * @param e */ -void MainWindow::resizeEvent(QResizeEvent* e) +void MainWindow::resizeEvent(QResizeEvent* /* e */ ) { if (ui->frmRoom->size().width() < 100 || ui->frmRoom->size().height() < 100) { return; |