Skip to content

Commit

Permalink
Convert to the C++17 standard fallthrough attribute.
Browse files Browse the repository at this point in the history
The prior "clang::fallthrough" attribute was a pre-standard value that
was acceptable to both the GCC and Clang compilers.  Use the C++17
standard value now that MythTV requires a C++17 compiler.
  • Loading branch information
linuxdude42 committed May 15, 2023
1 parent 01a3268 commit a1e4f54
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/searchview.cpp
Expand Up @@ -373,7 +373,7 @@ void SearchView::updateTracksList(void)
case 5: // tags
{
//TODO add tag query. Remove fallthrough once added.
[[clang::fallthrough]];
[[fallthrough]];
}
case 0: // all fields
default:
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audio/volumebase.cpp
Expand Up @@ -44,7 +44,7 @@ class VolumeWriteBackThread : public MThread
break;
case kFinished:
wait();
[[clang::fallthrough]];
[[fallthrough]];
case kStopped:
m_state = kRunning;
start();
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmyth/mythcontext.cpp
Expand Up @@ -916,12 +916,12 @@ QString MythContextPrivate::TestDBconnection(bool prompt)
break;
}
startupState = st_dbAwake;
[[clang::fallthrough]];
[[fallthrough]];
case st_dbAwake:
if (!checkPort(host, port, useTimeout))
break;
startupState = st_dbStarted;
[[clang::fallthrough]];
[[fallthrough]];
case st_dbStarted:
// If the database is connecting with link-local
// address, it may have changed
Expand All @@ -942,7 +942,7 @@ QString MythContextPrivate::TestDBconnection(bool prompt)
break;
}
startupState = st_dbConnects;
[[clang::fallthrough]];
[[fallthrough]];
case st_dbConnects:
if (m_needsBackend)
{
Expand Down Expand Up @@ -972,7 +972,7 @@ QString MythContextPrivate::TestDBconnection(bool prompt)
backendIP = gCoreContext->GetSettingOnHost
("BackendServerAddr", masterserver);
backendPort = MythCoreContext::GetMasterServerPort();
[[clang::fallthrough]];
[[fallthrough]];
case st_beWOL:
if (!beWOLCmd.isEmpty())
{
Expand All @@ -982,12 +982,12 @@ QString MythContextPrivate::TestDBconnection(bool prompt)
break;
}
startupState = st_beAwake;
[[clang::fallthrough]];
[[fallthrough]];
case st_beAwake:
if (!checkPort(backendIP, backendPort, useTimeout))
break;
startupState = st_success;
[[clang::fallthrough]];
[[fallthrough]];
case st_success:
// Quiet compiler warning.
break;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythfreemheg/Groups.cpp
Expand Up @@ -903,7 +903,7 @@ void MHSetTimer::Perform(MHEngine *engine)
break; // We treat an absolute time of -1 as "cancel"
case ST_TimerAbsolute:
fAbsolute = m_absFlag.GetValue(engine);
[[clang::fallthrough]];
[[fallthrough]];
case ST_TimerRelative:
newTime = m_timerValue.GetValue(engine);
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythfreemheg/ParseText.cpp
Expand Up @@ -391,7 +391,7 @@ void MHParseText::NextSym()
{
case '\n':
m_lineCount++;
[[clang::fallthrough]];
[[fallthrough]];
case ' ':
case '\r':
case '\t':
Expand Down
Expand Up @@ -216,13 +216,13 @@ bool FileServerHandler::HandleAnnounce(MythSocket *socket,
{
case 6:
timeout = std::chrono::milliseconds(commands[5].toInt());
[[clang::fallthrough]];
[[fallthrough]];
case 5:
usereadahead = (commands[4].toInt() != 0);
[[clang::fallthrough]];
[[fallthrough]];
case 4:
writemode = (commands[3].toInt() != 0);
[[clang::fallthrough]];
[[fallthrough]];
default:
hostname = commands[2];
}
Expand Down Expand Up @@ -671,11 +671,11 @@ bool FileServerHandler::HandleQueryFileHash(SocketHandler *socket,
case 4:
if (!slist[3].isEmpty())
hostname = slist[3];
[[clang::fallthrough]];
[[fallthrough]];
case 3:
if (!slist[2].isEmpty())
storageGroup = slist[2];
[[clang::fallthrough]];
[[fallthrough]];
case 2:
filename = slist[1];
if (filename.isEmpty() ||
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/recorders/audioinputalsa.cpp
Expand Up @@ -93,11 +93,11 @@ int AudioInputALSA::GetSamples(void* buf, uint nbytes)
if (!recov)
break;
}
[[clang::fallthrough]];
[[fallthrough]];
case SND_PCM_STATE_PREPARED:
if (AlsaBad(snd_pcm_start(m_pcmHandle), "pcm start failed"))
break;
[[clang::fallthrough]];
[[fallthrough]];
case SND_PCM_STATE_RUNNING:
bytes_read = PcmRead(buf, nbytes);
break;
Expand Down Expand Up @@ -311,7 +311,7 @@ bool AudioInputALSA::Recovery(int err)
#if ESTRPIPE != EPIPE
case -ESTRPIPE:
suspense = true;
[[clang::fallthrough]];
[[fallthrough]];
#endif
case -EPIPE:
{
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/visualisations/goom/goom_core.cpp
Expand Up @@ -317,7 +317,7 @@ guint32 * goom_update (GoomDualData& data, int forceMode) {
s_zfd.hypercosEffect = iRAND (2);
// Checked Fedora26 get-plugins-good sources.
// No break statement there.
[[clang::fallthrough]];
[[fallthrough]];
case 13:
case 20:
case 21:
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythupnp/httprequest.cpp
Expand Up @@ -332,7 +332,7 @@ qint64 HTTPRequest::SendResponse( void )
// Let SendResponseFile try or send a 404
m_eResponseType = ResponseTypeFile;
}
[[clang::fallthrough]];
[[fallthrough]];
case ResponseTypeFile: // Binary files
LOG(VB_HTTP, LOG_INFO,
QString("HTTPRequest::SendResponse( File ) :%1 -> %2:")
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythupnp/websocket.cpp
Expand Up @@ -646,7 +646,7 @@ void WebSocketWorker::ProcessFrames(QTcpSocket *socket)
}
else
break;
[[clang::fallthrough]];
[[fallthrough]];
case WebSocketFrame::kOpTextFrame:
case WebSocketFrame::kOpBinaryFrame:
HandleDataFrame(frame);
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythbackend/mainserver.cpp
Expand Up @@ -3683,11 +3683,11 @@ void MainServer::HandleQueryFileHash(QStringList &slist, PlaybackSock *pbs)
case 4:
if (!slist[3].isEmpty())
hostname = slist[3];
[[clang::fallthrough]];
[[fallthrough]];
case 3:
if (slist[2].isEmpty())
storageGroup = slist[2];
[[clang::fallthrough]];
[[fallthrough]];
case 2:
filename = slist[1];
if (filename.isEmpty() ||
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythtranscode/external/replex/pes.cpp
Expand Up @@ -199,7 +199,7 @@ void get_pes (pes_in_t *p, uint8_t *buf, int count, void (*func)(pes_in_t *p))
case DSM_CC_STREAM :
case ISO13522_STREAM:
p->done = true;
[[clang::fallthrough]];
[[fallthrough]];
case PRIVATE_STREAM1:
case VIDEO_STREAM_S ... VIDEO_STREAM_E:
case AUDIO_STREAM_S ... AUDIO_STREAM_E:
Expand Down

0 comments on commit a1e4f54

Please sign in to comment.