clang6 fix from upstream/FreeBSD

This commit is contained in:
rsadowski 2018-04-22 10:25:33 +00:00
parent 68852789da
commit 3098e5bc51
5 changed files with 135 additions and 9 deletions

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-libk3b_projects_k3bcdrdaowriter_cpp,v 1.1 2018/04/22 10:25:33 rsadowski Exp $
Index: libk3b/projects/k3bcdrdaowriter.cpp
--- libk3b/projects/k3bcdrdaowriter.cpp.orig
+++ libk3b/projects/k3bcdrdaowriter.cpp
@@ -908,7 +908,7 @@ void K3b::CdrdaoWriter::parseCdrdaoWrote( const QStrin
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;

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-libk3b_tools_k3bwavefilewriter_cpp,v 1.1 2018/04/22 10:25:33 rsadowski Exp $
Index: libk3b/tools/k3bwavefilewriter.cpp
--- libk3b/tools/k3bwavefilewriter.cpp.orig
+++ libk3b/tools/k3bwavefilewriter.cpp
@@ -109,7 +109,7 @@ void K3b::WaveFileWriter::write( const char* data, int
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 );
}

View File

@ -1,7 +1,8 @@
$OpenBSD: patch-libk3bdevice_k3bdevice_cpp,v 1.1.1.1 2014/07/09 16:40:41 zhuk Exp $
--- libk3bdevice/k3bdevice.cpp.orig Sat Jan 19 19:40:37 2013
+++ libk3bdevice/k3bdevice.cpp Sat Jan 19 20:02:21 2013
@@ -69,28 +69,27 @@ typedef unsigned char u8;
$OpenBSD: patch-libk3bdevice_k3bdevice_cpp,v 1.2 2018/04/22 10:25:33 rsadowski Exp $
Index: libk3bdevice/k3bdevice.cpp
--- libk3bdevice/k3bdevice.cpp.orig
+++ libk3bdevice/k3bdevice.cpp
@@ -72,28 +72,27 @@ typedef unsigned char u8;
#define CD_FRAMESIZE_RAW 2352
#endif
@ -39,7 +40,7 @@ $OpenBSD: patch-libk3bdevice_k3bdevice_cpp,v 1.1.1.1 2014/07/09 16:40:41 zhuk Ex
//
// Very evil hacking: force the speed values to be acurate
@@ -165,7 +164,7 @@ K3b::Device::Device::Handle K3b::Device::openDevice( c
@@ -168,7 +167,7 @@ K3b::Device::Device::Handle K3b::Device::openDevice( c
#endif
@ -48,7 +49,7 @@ $OpenBSD: patch-libk3bdevice_k3bdevice_cpp,v 1.1.1.1 2014/07/09 16:40:41 zhuk Ex
K3b::Device::Device::Handle K3b::Device::openDevice( const char* name, bool write )
{
K3b::Device::Device::Handle fd = HANDLE_DEFAULT_VALUE;
@@ -1631,7 +1630,7 @@ bool K3b::Device::Device::block( bool b ) const
@@ -1644,7 +1643,7 @@ bool K3b::Device::Device::block( bool b ) const
usageUnlock();
if ( success )
return success;
@ -57,7 +58,7 @@ $OpenBSD: patch-libk3bdevice_k3bdevice_cpp,v 1.1.1.1 2014/07/09 16:40:41 zhuk Ex
bool success = false;
bool needToClose = !isOpen();
int arg = b ? 1 : 0;
@@ -1679,14 +1678,18 @@ bool K3b::Device::Device::rewritable() const
@@ -1692,14 +1691,18 @@ bool K3b::Device::Device::rewritable() const
bool K3b::Device::Device::eject() const
{
@ -77,7 +78,7 @@ $OpenBSD: patch-libk3bdevice_k3bdevice_cpp,v 1.1.1.1 2014/07/09 16:40:41 zhuk Ex
success = true;
if( needToClose )
close();
@@ -1724,7 +1727,7 @@ bool K3b::Device::Device::eject() const
@@ -1737,7 +1740,7 @@ bool K3b::Device::Device::eject() const
bool K3b::Device::Device::load() const
{
@ -86,7 +87,7 @@ $OpenBSD: patch-libk3bdevice_k3bdevice_cpp,v 1.1.1.1 2014/07/09 16:40:41 zhuk Ex
bool success = false;
bool needToClose = !isOpen();
int arg = 0;
@@ -3768,7 +3771,7 @@ QByteArray K3b::Device::Device::mediaId( int mediaType
@@ -3781,7 +3784,7 @@ QByteArray K3b::Device::Device::mediaId( int mediaType
// int K3b::Device::Device::ioctl( int request, ... ) const
// {
// int r = -1;

View File

@ -0,0 +1,56 @@
$OpenBSD: patch-plugins_decoder_ffmpeg_k3bffmpegwrapper_cpp,v 1.5 2018/04/22 10:25:33 rsadowski Exp $
commit 1777236203f21eed7a9baade632472094c8081d3
Author: Pino Toscano <pino@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.
Index: plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
--- plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp.orig
+++ plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
@@ -240,12 +240,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 && ade->value[0] != '\0' ? QString::fromLocal8Bit( ade->value ) : QString();
}
@@ -253,12 +248,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 && ade->value[0] != '\0' ? QString::fromLocal8Bit( ade->value ) : QString();
}
@@ -266,12 +256,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 && ade->value[0] != '\0' ? QString::fromLocal8Bit( ade->value ) : QString();
}

View File

@ -0,0 +1,32 @@
$OpenBSD: patch-plugins_encoder_external_k3bexternalencoder_cpp,v 1.1 2018/04/22 10:25:33 rsadowski Exp $
Index: plugins/encoder/external/k3bexternalencoder.cpp
--- plugins/encoder/external/k3bexternalencoder.cpp.orig
+++ plugins/encoder/external/k3bexternalencoder.cpp
@@ -37,7 +37,7 @@ K3B_EXPORT_PLUGIN(k3bexternalencoder, K3bExternalEncod
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;
}