opnsense-ports/sysutils/k3b-kde4/files/patch-git_d5b1016
Franco Fichtner a666fd8efe */*: sync with upstream
Taken from: HardenedBSD
2018-01-23 23:00:43 +01:00

93 lines
3.7 KiB
Text

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@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()
kDebug() << "(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 ) {
kDebug() << "(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 ) {
kDebug() << "(K3bExternalEncoder) failed to write wave header.";
return false;
}