File gcc7-fixes.patch of Package kdenlive
From 16cbb711d035c8f83542a3da09f6d18f632da484 Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wbauer@tmo.at>
Date: Mon, 29 May 2017 10:52:35 +0200
Subject: [PATCH] Fix build with gcc7
This fixes the following errors when building with gcc7:
/home/abuild/rpmbuild/BUILD/kdenlive-17.04.1/src/scopes/audioscopes/spectrogram.cpp:244:113:
error: call of overloaded 'abs(unsigned int)' is ambiguous
fixed by casting leftDist to int
/home/abuild/rpmbuild/BUILD/kdenlive-17.04.1/src/profiles/tree/profiletreemodel.cpp:
In constructor 'ProfileTreeModel::ProfileTreeModel(QObject*)':
/home/abuild/rpmbuild/BUILD/kdenlive-17.04.1/src/profiles/tree/profiletreemodel.cpp:146:21:
error: 'function' is not a member of 'std'
fixed by adding a missing "#include <functional>"
BUG: 375647
BUG: 379688
Differential Revision: https://phabricator.kde.org/D6006
---
src/profiles/tree/profiletreemodel.cpp | 1 +
src/scopes/audioscopes/spectrogram.cpp | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/profiles/tree/profiletreemodel.cpp b/src/profiles/tree/profiletreemodel.cpp
index 47a580703..912279494 100644
--- a/src/profiles/tree/profiletreemodel.cpp
+++ b/src/profiles/tree/profiletreemodel.cpp
@@ -26,6 +26,7 @@
#include <vector>
#include <QVector>
#include <array>
+#include <functional>
#include <KLocalizedString>
diff --git a/src/scopes/audioscopes/spectrogram.cpp b/src/scopes/audioscopes/spectrogram.cpp
index 1d3a0a2fd..e9fed0338 100644
--- a/src/scopes/audioscopes/spectrogram.cpp
+++ b/src/scopes/audioscopes/spectrogram.cpp
@@ -241,7 +241,7 @@ QImage Spectrogram::renderHUD(uint)
x = leftDist + (m_innerScopeRect.width() - 1) * ((float)hz) / m_freqMax;
// Hide text if it would overlap with the text drawn at the mouse position
- hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x - (leftDist + mouseX + 20)) < (int) minDistX + 16
+ hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x - (static_cast<int>(leftDist) + mouseX + 20)) < (int) minDistX + 16
&& mouseX < m_innerScopeRect.width() && mouseX >= 0;
if (x <= rightBorder) {
@@ -268,7 +268,7 @@ QImage Spectrogram::renderHUD(uint)
}
// Draw the line at the very right (maximum frequency)
x = leftDist + m_innerScopeRect.width() - 1;
- hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x - (leftDist + mouseX + 30)) < (int) minDistX
+ hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x - (static_cast<int>(leftDist) + mouseX + 30)) < (int) minDistX
&& mouseX < m_innerScopeRect.width() && mouseX >= 0;
davinci.drawLine(x, topDist, x, topDist + m_innerScopeRect.height() + 6);
if (!hideText) {
--
2.12.0