From 0d1984357f9bc8aac671e8907208a8581a1f42db Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 26 Jul 2018 16:11:31 +0200 Subject: [*] Convert old C-Style casts Primitive types now use type(x) instead of (type)x, pointers should use appropriate long versions --- src/server/mainwindow/mainwindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') 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; -- cgit v1.2.3-55-g7522