From 49f6216e6a74c8e24d7dfc84b97e67f92ee06716 Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Sat, 18 Feb 2017 15:18:07 -0500 Subject: [PATCH] Add static_cast to show conversions --- src/ColorScheme.cpp | 6 +++--- src/Emulation.cpp | 2 +- src/ProcessInfo.cpp | 2 +- src/TerminalDisplay.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ColorScheme.cpp b/src/ColorScheme.cpp index af170777..68bba170 100644 --- a/src/ColorScheme.cpp +++ b/src/ColorScheme.cpp @@ -368,9 +368,9 @@ void ColorScheme::readColorEntry(const KConfig& config , int index) setColorTableEntry(index , entry); - const quint16 hue = configGroup.readEntry("MaxRandomHue", 0); - const quint8 value = configGroup.readEntry("MaxRandomValue", 0); - const quint8 saturation = configGroup.readEntry("MaxRandomSaturation", 0); + const quint16 hue = static_cast(configGroup.readEntry("MaxRandomHue", 0)); + const quint8 value = static_cast(configGroup.readEntry("MaxRandomValue", 0)); + const quint8 saturation = static_cast(configGroup.readEntry("MaxRandomSaturation", 0)); if (hue != 0 || value != 0 || saturation != 0) setRandomizationRange(index , hue , saturation , value); diff --git a/src/Emulation.cpp b/src/Emulation.cpp index f7ffcd67..43eb4d56 100644 --- a/src/Emulation.cpp +++ b/src/Emulation.cpp @@ -187,7 +187,7 @@ void Emulation::receiveChar(int c) case '\n' : _currentScreen->newLine(); break; case '\r' : _currentScreen->toStartOfLine(); break; case 0x07 : emit stateSet(NOTIFYBELL); break; - default : _currentScreen->displayCharacter(c); break; + default : _currentScreen->displayCharacter(static_cast(c)); break; } } diff --git a/src/ProcessInfo.cpp b/src/ProcessInfo.cpp index 2a4bf7a3..4a382137 100644 --- a/src/ProcessInfo.cpp +++ b/src/ProcessInfo.cpp @@ -406,7 +406,7 @@ protected: char path_buffer[MAXPATHLEN + 1]; path_buffer[MAXPATHLEN] = 0; QByteArray procCwd = QFile::encodeName(QStringLiteral("/proc/%1/cwd").arg(aPid)); - const int length = readlink(procCwd.constData(), path_buffer, MAXPATHLEN); + const int length = static_cast(readlink(procCwd.constData(), path_buffer, MAXPATHLEN)); if (length == -1) { setError(UnknownError); return false; diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index 925460f3..114fbc12 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -2512,7 +2512,7 @@ void TerminalDisplay::wheelEvent(QWheelEvent* ev) // of mouse wheel rotation. Mouse wheels typically move in steps of 15 degrees, // giving a scroll of 3 lines - const int lines = _scrollWheelState.consumeSteps(_fontHeight * qApp->devicePixelRatio(), ScrollState::degreesToAngle(5)); + const int lines = _scrollWheelState.consumeSteps(static_cast(_fontHeight * qApp->devicePixelRatio()), ScrollState::degreesToAngle(5)); const int keyCode = lines > 0 ? Qt::Key_Up : Qt::Key_Down; QKeyEvent keyEvent(QEvent::KeyPress, keyCode, Qt::NoModifier);