diff options
| author | Tatiana Borisova <tatiana.borisova@qt.io> | 2024-07-25 11:59:02 +0200 |
|---|---|---|
| committer | Ivan Solovev <ivan.solovev@qt.io> | 2024-07-30 12:00:33 +0000 |
| commit | b4b90bfbaf8edfa7a2084adbaff0a2c0bc68acd1 (patch) | |
| tree | 740e523464de142483e0ac4a6bf931f8c9b1c3b0 /src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp | |
| parent | 7a90ed1238e543f1db1c4e5be5b53f3f07ec679e (diff) | |
Use q20::{cmp_{equal,not_equal,{less,greater}{,_equal}} around the code
- edited a few places that compare signed and unsigned integer
variables, using C-style casts. The cmp_<name> functions allow
to do such comparisons in a convenient way.
Task-number: QTBUG-105464
Change-Id: I912893a47a1c93d163b0fbeccb61602adca80dd2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp')
| -rw-r--r-- | src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp index e2826f39461..1096090eff6 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp @@ -6,6 +6,7 @@ #include <QtFbSupport/private/qfbwindow_p.h> #include <QtCore/QFile> #include <QtCore/QRegularExpression> +#include <QtCore/q20utility.h> #include <QtGui/QPainter> #include <private/qcore_unix_p.h> // overrides QT_OPEN @@ -69,16 +70,16 @@ static QRect determineGeometry(const fb_var_screeninfo &vinfo, const QRect &user if (userGeometry.isValid()) { w = userGeometry.width(); h = userGeometry.height(); - if ((uint)w > vinfo.xres) + if (q20::cmp_greater(w, vinfo.xres)) w = vinfo.xres; - if ((uint)h > vinfo.yres) + if (q20::cmp_greater(h, vinfo.yres)) h = vinfo.yres; int xxoff = userGeometry.x(), yyoff = userGeometry.y(); if (xxoff != 0 || yyoff != 0) { - if (xxoff < 0 || xxoff + w > (int)(vinfo.xres)) + if (xxoff < 0 || q20::cmp_greater(xxoff + w, vinfo.xres)) xxoff = vinfo.xres - w; - if (yyoff < 0 || yyoff + h > (int)(vinfo.yres)) + if (yyoff < 0 || q20::cmp_greater(yyoff + h, vinfo.yres)) yyoff = vinfo.yres - h; xoff += xxoff; yoff += yyoff; |
