From f31186656c7958652dba65c80fb6c2051e15a94c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 20 Sep 2010 13:46:08 +0000 Subject: [PATCH] (trunk qt) silence a couple of gcc warnings by adding reasonable defaults at the bottom of a switch statement in case bad tr_ratiolimits or FilterModes get used in the switch --- qt/torrent-filter.cc | 6 +++--- qt/torrent.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qt/torrent-filter.cc b/qt/torrent-filter.cc index ed620e140..c97ee15a8 100644 --- a/qt/torrent-filter.cc +++ b/qt/torrent-filter.cc @@ -144,9 +144,6 @@ TorrentFilter :: activityFilterAcceptsTorrent( const Torrent * tor, const Filter switch( m.mode( ) ) { - case FilterMode::SHOW_ALL: - accepts = true; - break; case FilterMode::SHOW_ACTIVE: accepts = tor->peersWeAreUploadingTo( ) > 0 || tor->peersWeAreDownloadingFrom( ) > 0 || tor->isVerifying( ); break; @@ -171,6 +168,9 @@ TorrentFilter :: activityFilterAcceptsTorrent( const Torrent * tor, const Filter case FilterMode::SHOW_ERROR: accepts = tor->hasError( ); break; + default: // FilterMode::SHOW_ALL + accepts = true; + break; } return accepts; diff --git a/qt/torrent.cc b/qt/torrent.cc index f396ce13e..f8884d4d4 100644 --- a/qt/torrent.cc +++ b/qt/torrent.cc @@ -342,7 +342,7 @@ Torrent :: getSeedRatio( double& ratio ) const ratio = myPrefs.getDouble( Prefs :: RATIO ); break; - case TR_RATIOLIMIT_UNLIMITED: + default: // TR_RATIOLIMIT_UNLIMITED: isLimited = false; break; } -- 2.40.0