diff options
author | Simon Rettberg | 2018-07-26 16:11:31 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-07-26 16:11:31 +0200 |
commit | 0d1984357f9bc8aac671e8907208a8581a1f42db (patch) | |
tree | 09dd65975ff5e5074fdbc708504ab1d84b073c2b /src/server/mainwindow/mainwindow.cpp | |
parent | [server] Cleanup and simplify SslServer (diff) | |
download | pvs2-0d1984357f9bc8aac671e8907208a8581a1f42db.tar.gz pvs2-0d1984357f9bc8aac671e8907208a8581a1f42db.tar.xz pvs2-0d1984357f9bc8aac671e8907208a8581a1f42db.zip |
[*] Convert old C-Style casts
Primitive types now use type(x) instead of (type)x,
pointers should use appropriate long versions
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index dcf8973..73fcbaf 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -243,7 +243,7 @@ int distance(QPointF a, QPointF b) const qreal dx = a.x() - b.x(); const qreal dy = a.y() - b.y(); const qreal sum = dx * dx + dy * dy; - return (int)sum; + return int(sum); } /***************************************************************************//** @@ -460,13 +460,13 @@ enum AspectStatus { GRID_OK, GRID_TOO_WIDE, GRID_TOO_TALL }; * */ AspectStatus checkAspectRatio(const QSize& frameSize, const QSize& gridSize) { - float aspectRoom = ((float) gridSize.height()) / ((float) gridSize.width()); - float aspectFrame = ((float) frameSize.height()) / ((float) frameSize.width()); + float aspectRoom = float(gridSize.height()) / float(gridSize.width()); + float aspectFrame = float(frameSize.height()) / float(frameSize.width()); - if (aspectRoom / aspectFrame < 0.8) { + if (aspectRoom / aspectFrame < 0.8f) { return GRID_TOO_WIDE; } - if ( aspectFrame / aspectRoom < 0.8) { + if ( aspectFrame / aspectRoom < 0.8f) { return GRID_TOO_TALL; } return GRID_OK; |