svn commit: r459558 - head/sysutils/k3b-kde4/files
Raphael Kubo da Costa
rakuco at FreeBSD.org
Sat Jan 20 23:58:55 UTC 2018
Author: rakuco
Date: Sat Jan 20 23:58:54 2018
New Revision: 459558
URL: https://svnweb.freebsd.org/changeset/ports/459558
Log:
Backport a few upstream patches to fix the build with clang 6 (-std=gnu++14)
PR: 224945
Added:
head/sysutils/k3b-kde4/files/patch-git_1777236 (contents, props changed)
head/sysutils/k3b-kde4/files/patch-git_d5b1016 (contents, props changed)
Added: head/sysutils/k3b-kde4/files/patch-git_1777236
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/k3b-kde4/files/patch-git_1777236 Sat Jan 20 23:58:54 2018 (r459558)
@@ -0,0 +1,67 @@
+Fix the build with clang 6, which defaults to -std=gnu++14
+
+plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp:264:20: error: comparison between pointer and integer ('char *' and 'int')
+ if( ade->value != '\0' )
+ ~~~~~~~~~~ ^ ~~~~
+plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp:277:20: error: comparison between pointer and integer ('char *' and 'int')
+ if( ade->value != '\0' )
+ ~~~~~~~~~~ ^ ~~~~
+plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp:290:20: error: comparison between pointer and integer ('char *' and 'int')
+ if( ade->value != '\0' )
+ ~~~~~~~~~~ ^ ~~~~
+
+commit 1777236203f21eed7a9baade632472094c8081d3
+Author: Pino Toscano <pino at kde.org>
+Date: Sat Feb 4 10:48:45 2017 +0100
+
+ ffmpeg: fix/simplify metadata conversion to string
+
+ Comparing a pointer with an integer value is (correctly) an error with
+ GCC 7.
+
+diff --git a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
+index a4fc784b5..22928b279 100644
+--- plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
++++ plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
+@@ -259,12 +259,7 @@ QString K3bFFMpegFile::title() const
+ {
+ // FIXME: is this UTF8 or something??
+ AVDictionaryEntry *ade = av_dict_get( d->formatContext->metadata, "TITLE", NULL, 0 );
+- if( ade == NULL )
+- return QString();
+- if( ade->value != '\0' )
+- return QString::fromLocal8Bit( ade->value );
+- else
+- return QString();
++ return ade && ade->value[0] != '\0' ? QString::fromLocal8Bit( ade->value ) : QString();
+ }
+
+
+@@ -272,12 +267,7 @@ QString K3bFFMpegFile::author() const
+ {
+ // FIXME: is this UTF8 or something??
+ AVDictionaryEntry *ade = av_dict_get( d->formatContext->metadata, "ARTIST", NULL, 0 );
+- if( ade == NULL )
+- return QString();
+- if( ade->value != '\0' )
+- return QString::fromLocal8Bit( ade->value );
+- else
+- return QString();
++ return ade && ade->value[0] != '\0' ? QString::fromLocal8Bit( ade->value ) : QString();
+ }
+
+
+@@ -285,12 +275,7 @@ QString K3bFFMpegFile::comment() const
+ {
+ // FIXME: is this UTF8 or something??
+ AVDictionaryEntry *ade = av_dict_get( d->formatContext->metadata, "COMMENT", NULL, 0 );
+- if( ade == NULL )
+- return QString();
+- if( ade->value != '\0' )
+- return QString::fromLocal8Bit( ade->value );
+- else
+- return QString();
++ return ade && ade->value[0] != '\0' ? QString::fromLocal8Bit( ade->value ) : QString();
+ }
+
+
Added: head/sysutils/k3b-kde4/files/patch-git_d5b1016
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/k3b-kde4/files/patch-git_d5b1016 Sat Jan 20 23:58:54 2018 (r459558)
@@ -0,0 +1,93 @@
+Fix the build with clang 6, which defaults to -std=gnu++14
+
+(slightly adapted to v2.0.3)
+
+libk3b/tools/k3bwavefilewriter.cpp:120:19: error: constant expression evaluates to 172 which cannot be narrowed to type 'char' [-Wc++11-narrowing]
+ 0x44, 0xac, 0x00, 0x00, // 24
+ ^~~~
+libk3b/tools/k3bwavefilewriter.cpp:120:19: note: insert an explicit cast to silence this issue
+ 0x44, 0xac, 0x00, 0x00, // 24
+ ^~~~
+ static_cast<char>( )
+libk3b/tools/k3bwavefilewriter.cpp:121:19: error: constant expression evaluates to 177 which cannot be narrowed to type 'char' [-Wc++11-narrowing]
+ 0x10, 0xb1, 0x02, 0x00, // 28
+ ^~~~
+libk3b/tools/k3bwavefilewriter.cpp:121:19: note: insert an explicit cast to silence this issue
+ 0x10, 0xb1, 0x02, 0x00, // 28
+ ^~~~
+ static_cast<char>( )
+
+commit d5b1016e6a4c1dfcf681ce33ea9ffdd0dd5daf24
+Author: Armin K <krejzi at email.com>
+Date: Mon May 4 00:01:03 2015 +0200
+
+ Fix build failure when compiling with GCC 5
+
+ REVIEW: 123431
+
+diff --git a/libk3b/projects/k3bcdrdaowriter.cpp b/libk3b/projects/k3bcdrdaowriter.cpp
+index 0d144086d..dafb1bf69 100644
+--- libk3b/projects/k3bcdrdaowriter.cpp
++++ libk3b/projects/k3bcdrdaowriter.cpp
+@@ -918,7 +918,7 @@ void K3b::CdrdaoWriter::parseCdrdaoWrote( const QString& line )
+
+ void K3b::CdrdaoWriter::parseCdrdaoMessage()
+ {
+- static const char msgSync[] = { 0xff, 0x00, 0xff, 0x00 };
++ static const unsigned char msgSync[] = { 0xff, 0x00, 0xff, 0x00 };
+ unsigned int avail = m_comSock->bytesAvailable();
+ unsigned int msgs = avail / ( sizeof(msgSync)+d->progressMsgSize );
+ unsigned int count = 0;
+diff --git a/libk3b/tools/k3bwavefilewriter.cpp b/libk3b/tools/k3bwavefilewriter.cpp
+index 7aa6c1d67..25b425f50 100644
+--- libk3b/tools/k3bwavefilewriter.cpp
++++ libk3b/tools/k3bwavefilewriter.cpp
+@@ -109,7 +109,7 @@ void K3b::WaveFileWriter::write( const char* data, int len, Endianess e )
+
+ void K3b::WaveFileWriter::writeEmptyHeader()
+ {
+- static const char riffHeader[] =
++ static const unsigned char riffHeader[] =
+ {
+ 0x52, 0x49, 0x46, 0x46, // 0 "RIFF"
+ 0x00, 0x00, 0x00, 0x00, // 4 wavSize
+@@ -124,7 +124,7 @@ void K3b::WaveFileWriter::writeEmptyHeader()
+ 0x00, 0x00, 0x00, 0x00 // 40 byteCount
+ };
+
+- m_outputStream.writeRawData( riffHeader, 44 );
++ m_outputStream.writeRawData( (const char*) riffHeader, 44 );
+ }
+
+
+diff --git a/plugins/encoder/external/k3bexternalencoder.cpp b/plugins/encoder/external/k3bexternalencoder.cpp
+index df9c576d8..d68f2003b 100644
+--- plugins/encoder/external/k3bexternalencoder.cpp
++++ plugins/encoder/external/k3bexternalencoder.cpp
+@@ -37,7 +37,7 @@ K3B_EXPORT_PLUGIN(k3bexternalencoder, K3bExternalEncoder)
+ Q_DECLARE_METATYPE( QProcess::ExitStatus )
+
+
+-static const char s_riffHeader[] =
++static const unsigned char s_riffHeader[] =
+ {
+ 0x52, 0x49, 0x46, 0x46, // 0 "RIFF"
+ 0x00, 0x00, 0x00, 0x00, // 4 wavSize
+@@ -222,7 +222,7 @@ bool K3bExternalEncoder::writeWaveHeader()
+ qDebug() << "(K3bExternalEncoder) writing wave header";
+
+ // write the RIFF thing
+- if( d->process->write( s_riffHeader, 4 ) != 4 ) {
++ if( d->process->write( (const char*) s_riffHeader, 4 ) != 4 ) {
+ qDebug() << "(K3bExternalEncoder) failed to write riff header.";
+ return false;
+ }
+@@ -243,7 +243,7 @@ bool K3bExternalEncoder::writeWaveHeader()
+ }
+
+ // write static part of the header
+- if( d->process->write( s_riffHeader + 8, 32 ) != 32 ) {
++ if( d->process->write( (const char*) s_riffHeader + 8, 32 ) != 32 ) {
+ qDebug() << "(K3bExternalEncoder) failed to write wave header.";
+ return false;
+ }
More information about the svn-ports-all
mailing list