Add fallthrough comments and remove -Wimplicit-fallthrough=0

Signed-off-by: Jonas Kvinge <jonas@jkvinge.net>
This commit is contained in:
Jonas Kvinge 2019-09-16 21:20:12 +02:00
parent cf9f48d8da
commit bdc089290d
11 changed files with 22 additions and 11 deletions

View File

@ -8,7 +8,7 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Woverloaded-virtual -Wno-sign-compare -fpermissive")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wimplicit-fallthrough=0 -Wpedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wpedantic")
endif()
if(CMAKE_VERSION VERSION_GREATER 3.0)

View File

@ -5,7 +5,7 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Woverloaded-virtual -Wno-sign-compare -fpermissive")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wimplicit-fallthrough=0 -Wpedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wpedantic")
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -8,7 +8,7 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Woverloaded-virtual -Wno-sign-compare -fpermissive")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wimplicit-fallthrough=0 -Wpedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wpedantic")
endif()
set(SOURCES

View File

@ -10,7 +10,7 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Woverloaded-virtual -Wno-sign-compare -fpermissive")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wimplicit-fallthrough=0 -Wpedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wpedantic")
endif()
set(MESSAGES

View File

@ -12,7 +12,7 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Woverloaded-virtual -Wno-sign-compare -fpermissive")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wimplicit-fallthrough=0 -Wpedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wpedantic")
endif()
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})

View File

@ -19,7 +19,7 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Woverloaded-virtual -Wno-sign-compare -fpermissive")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wimplicit-fallthrough=0 -Wpedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wpedantic")
endif()
option(BUILD_WERROR "Build with -Werror" OFF)

View File

@ -1239,10 +1239,17 @@ CollectionItem *CollectionModel::ItemFromSong(GroupBy type, bool signal, bool cr
item->sort_text = SortTextForNumber(year) + " ";
break;
}
case GroupBy_Composer: if (item->key.isNull()) item->key = s.composer();
case GroupBy_Performer: if (item->key.isNull()) item->key = s.performer();
case GroupBy_Grouping: if (item->key.isNull()) item->key = s.grouping();
case GroupBy_Genre: if (item->key.isNull()) item->key = s.genre();
case GroupBy_Composer:
if (item->key.isNull()) item->key = s.composer();
// fallthrough
case GroupBy_Performer:
if (item->key.isNull()) item->key = s.performer();
// fallthrough
case GroupBy_Grouping:
if (item->key.isNull()) item->key = s.grouping();
// fallthrough
case GroupBy_Genre:
if (item->key.isNull()) item->key = s.genre();
item->display_text = TextOrUnknown(item->key);
item->sort_text = SortTextForArtist(item->key);
break;

View File

@ -514,6 +514,7 @@ bool ContextView::eventFilter(QObject *object, QEvent *event) {
case QEvent::Paint:{
handlePaintEvent(object, event);
}
// fallthrough
default:{
return QObject::eventFilter(object, event);
}

View File

@ -552,6 +552,7 @@ void Player::EngineStateChanged(Engine::State state) {
break;
case Engine::Error:
emit Error();
// fallthrough
case Engine::Empty:
case Engine::Idle:
emit Stopped();

View File

@ -150,6 +150,7 @@ void ScrobblingAPI20::Authenticate(const bool https) {
messagebox_error.setTextFormat(Qt::RichText);
messagebox_error.exec();
}
// fallthrough
case QMessageBox::Save:
QApplication::clipboard()->setText(url.toString());
break;

View File

@ -867,11 +867,12 @@ void TidalRequest::SongsFinishCheck(const qint64 artist_id, const qint64 album_i
AddSongsRequest(offset_next);
break;
case QueryType_SearchSongs:
// If artist_id and album_id isn't zero it means that it's a songs search where we fetch all albums too. So pass through.
// If artist_id and album_id isn't zero it means that it's a songs search where we fetch all albums too. So fallthrough.
if (artist_id == 0 && album_id == 0) {
AddSongsSearchRequest(offset_next);
break;
}
// fallthrough
case QueryType_Artists:
case QueryType_SearchArtists:
case QueryType_Albums: