From a6d2f5186f82331d37be86209a843b3f2e160f36 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 9 Nov 2015 16:10:04 +0800 Subject: [PATCH 1/2] Avoid falling through the switch case --- src/gui/properties/propertieswidget.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index 5d6f7adc0..49ff7e1d4 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -453,19 +453,19 @@ void PropertiesWidget::loadDynamicData() { showPiecesAvailability(false); } - return; + break; } case PropTabBar::TRACKERS_TAB: { // Trackers trackerList->loadTrackers(); - return; + break; } case PropTabBar::PEERS_TAB: { // Load peers peersList->loadPeers(m_torrent); - return; + break; } case PropTabBar::FILES_TAB: { @@ -480,10 +480,10 @@ void PropertiesWidget::loadDynamicData() { // PropListModel->model()->updateFilesPriorities(h.file_priorities()); filesList->setUpdatesEnabled(true); } + break; } - default: - return; + default:; } } From fadb20829957d0637cbddd95c675141799e056dd Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 9 Nov 2015 16:11:58 +0800 Subject: [PATCH 2/2] Fix compile warning: warning: enumeration value 'Unknown' not handled in switch [-Wswitch] --- src/core/net/private/geoipdatabase.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/net/private/geoipdatabase.cpp b/src/core/net/private/geoipdatabase.cpp index a8d886c7e..3c8ed6cce 100644 --- a/src/core/net/private/geoipdatabase.cpp +++ b/src/core/net/private/geoipdatabase.cpp @@ -392,6 +392,8 @@ QVariant GeoIPDatabase::readDataField(quint32 &offset) const else qDebug() << "* Invalid field size for type: Float"; break; + default: + qDebug() << "* Unsupported data type: Unknown"; } if (!usePointer)