tags 853465 + patch
thanks
The attached patch fixes build failures with GCC 7.
--- a/src/k3bprojectmanager.cpp
+++ b/src/k3bprojectmanager.cpp
@@ -319,7 +319,7 @@
movixDoc->setEjectDisk( c.readEntry( "eject", false ) );
movixDoc->setRandomPlay( c.readEntry( "random_play", false ) );
movixDoc->setNoDma( c.readEntry( "no_dma", false ) );
- // fallthrough
+ __attribute__((fallthrough));
}
case K3b::Doc::DataProject: {
--- a/src/projects/kostore/KoStore.cpp
+++ b/src/projects/kostore/KoStore.cpp
@@ -123,6 +123,7 @@
case Directory:
kError(s_area) << "Can't create a Directory store for a memory buffer!" << endl;
// fallback
+ __attribute__((fallthrough));
case Zip:
#ifdef QCA2
if( automatic && mode == Read ) {
--- a/src/k3b.cpp
+++ b/src/k3b.cpp
@@ -966,6 +966,7 @@
case KMessageBox::Yes:
if ( !fileSave( doc ) )
return false;
+ __attribute__((fallthrough));
case KMessageBox::No:
return true;
default:
--- a/src/projects/k3bdataurladdingdialog.cpp
+++ b/src/projects/k3bdataurladdingdialog.cpp
@@ -477,11 +477,13 @@
KStandardGuiItem::cancel()) ) {
case 2:
m_bFolderLinksFollowAll = true;
+ __attribute__((fallthrough));
case 1:
followLink = true;
break;
case 4:
m_bFolderLinksAddAll = true;
+ __attribute__((fallthrough));
case 3:
followLink = false;
break;
--- a/libk3bdevice/k3bdevice.cpp
+++ b/libk3bdevice/k3bdevice.cpp
@@ -2173,6 +2173,7 @@
// done.
break;
}
+ __attribute__((fallthrough));
default:
case MEDIA_CD_ROM:
@@ -2196,6 +2197,8 @@
inf.d->usedCapacity = readToc().length();
}
}
+ __attribute__((fallthrough));
+
case MEDIA_DVD_ROM: {
K3b::Msf readCap;
@@ -2285,6 +2288,8 @@
case MEDIA_DVD_RW_OVWR:
inf.d->numSessions = 1;
+ __attribute__((fallthrough));
+
case MEDIA_DVD_RW:
case MEDIA_DVD_RW_SEQ:
// only one track on a DVD-RW media
--- a/libk3b/jobs/k3bdatatrackreader.cpp
+++ b/libk3b/jobs/k3bdatatrackreader.cpp
@@ -213,6 +213,8 @@
break;
case K3b::Device::Track::MODE2:
emit infoMessage( i18n("No support for reading formless Mode2 sectors."), K3b::Job::MessageError );
+ __attribute__((fallthrough));
+
default:
emit infoMessage( i18n("Unsupported sector type."), K3b::Job::MessageError );
d->device->close();
--- a/libk3b/jobs/k3bdvdcopyjob.cpp
+++ b/libk3b/jobs/k3bdvdcopyjob.cpp
@@ -253,6 +253,8 @@
}
}
}
+ __attribute__((fallthrough));
+
case K3b::Device::MEDIA_DVD_R:
case K3b::Device::MEDIA_DVD_R_SEQ:
case K3b::Device::MEDIA_DVD_RW:
--- a/libk3b/projects/datacd/k3bisoimager.cpp
+++ b/libk3b/projects/datacd/k3bisoimager.cpp
@@ -165,6 +165,7 @@
break;
}
// otherwise just fall through
+ __attribute__((fallthrough));
default:
if( !d->knownError && !mkisofsReadError() ) {
--- a/src/projects/k3baudioprojectmodel.cpp
+++ b/src/projects/k3baudioprojectmodel.cpp
@@ -287,8 +287,8 @@
f.setPointSize( f.pointSize() - 2 );
return f;
}
- break;
}
+ break;
case Qt::ForegroundRole:
if ( index.column() == FilenameColumn ) {
--- a/src/projects/k3bvcdburndialog.cpp
+++ b/src/projects/k3bvcdburndialog.cpp
@@ -62,12 +62,16 @@
switch ( m_vcdDoc->vcdType() ) {
case K3b::VcdDoc::VCD11:
vcdType = i18n( "Video CD (Version 1.1)" );
+ __attribute__((fallthrough));
case K3b::VcdDoc::VCD20:
vcdType = i18n( "Video CD (Version 2.0)" );
+ __attribute__((fallthrough));
case K3b::VcdDoc::SVCD10:
vcdType = i18n( "Super Video CD" );
+ __attribute__((fallthrough));
case K3b::VcdDoc::HQVCD:
vcdType = i18n( "High-Quality Video CD" );
+ __attribute__((fallthrough));
default:
vcdType = i18n( "Video CD" );
}
--- a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
+++ b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
@@ -261,7 +261,7 @@
AVDictionaryEntry *ade = av_dict_get( d->formatContext->metadata, "TITLE", NULL, 0 );
if( ade == NULL )
return QString();
- if( ade->value != '\0' )
+ if( ade->value != nullptr )
return QString::fromLocal8Bit( ade->value );
else
return QString();
@@ -274,7 +274,7 @@
AVDictionaryEntry *ade = av_dict_get( d->formatContext->metadata, "ARTIST", NULL, 0 );
if( ade == NULL )
return QString();
- if( ade->value != '\0' )
+ if( ade->value != nullptr )
return QString::fromLocal8Bit( ade->value );
else
return QString();
@@ -287,7 +287,7 @@
AVDictionaryEntry *ade = av_dict_get( d->formatContext->metadata, "COMMENT", NULL, 0 );
if( ade == NULL )
return QString();
- if( ade->value != '\0' )
+ if( ade->value != nullptr )
return QString::fromLocal8Bit( ade->value );
else
return QString();