linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #04757
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2662: silence some incomplete-switch-cases warnings
------------------------------------------------------------
revno: 2662
committer: cologic <ne5@xxxxxxxxxxx>
branch nick: dcplusplus
timestamp: Fri 2011-11-04 12:30:55 -0400
message:
silence some incomplete-switch-cases warnings
modified:
win32/DirectoryListingFrame.cpp
win32/Mapper_NATPMP.cpp
win32/PropPage.cpp
win32/QueueFrame.cpp
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'win32/DirectoryListingFrame.cpp'
--- win32/DirectoryListingFrame.cpp 2011-10-20 14:14:24 +0000
+++ win32/DirectoryListingFrame.cpp 2011-11-04 16:30:55 +0000
@@ -577,6 +577,7 @@
switch(ii->type) {
case ItemInfo::FILE: paths = dl->getLocalPaths(ii->file); break;
case ItemInfo::DIRECTORY: paths = dl->getLocalPaths(ii->dir); break;
+ case ItemInfo::USER: break;
}
if(!paths.empty())
ShellMenuPaths.insert(ShellMenuPaths.end(), paths.begin(), paths.end());
@@ -1200,6 +1201,7 @@
switch(mouseEvent.ButtonPressed) {
case dwt::MouseEvent::X1: back(); break;
case dwt::MouseEvent::X2: forward(); break;
+ default: break;
}
return true;
}
=== modified file 'win32/Mapper_NATPMP.cpp'
--- win32/Mapper_NATPMP.cpp 2011-10-22 16:41:13 +0000
+++ win32/Mapper_NATPMP.cpp 2011-11-04 16:30:55 +0000
@@ -51,16 +51,20 @@
namespace {
int reqType(Mapper::Protocol protocol) {
- switch(protocol) {
- case Mapper::PROTOCOL_TCP: return NATPMP_PROTOCOL_TCP;
- case Mapper::PROTOCOL_UDP: return NATPMP_PROTOCOL_UDP;
+ if (protocol == Mapper::PROTOCOL_TCP) {
+ return NATPMP_PROTOCOL_TCP;
+ } else {
+ dcassert(protocol == Mapper::PROTOCOL_UDP);
+ return NATPMP_PROTOCOL_UDP;
}
}
int respType(Mapper::Protocol protocol) {
- switch(protocol) {
- case Mapper::PROTOCOL_TCP: return NATPMP_RESPTYPE_TCPPORTMAPPING;
- case Mapper::PROTOCOL_UDP: return NATPMP_RESPTYPE_UDPPORTMAPPING;
+ if (protocol == Mapper::PROTOCOL_TCP) {
+ return NATPMP_RESPTYPE_TCPPORTMAPPING;
+ } else {
+ dcassert(protocol == Mapper::PROTOCOL_UDP);
+ return NATPMP_RESPTYPE_UDPPORTMAPPING;
}
}
=== modified file 'win32/PropPage.cpp'
--- win32/PropPage.cpp 2011-10-06 19:43:04 +0000
+++ win32/PropPage.cpp 2011-11-04 16:30:55 +0000
@@ -78,6 +78,8 @@
case T_BOOL:
static_cast<CheckBoxPtr>(i->widget)->setChecked(settings->getBool((SettingsManager::IntSetting)i->setting));
break;
+ case T_END:
+ dcassert(false); break;
}
}
}
@@ -116,6 +118,8 @@
case T_BOOL:
settings->set((SettingsManager::IntSetting)i->setting, static_cast<CheckBoxPtr>(i->widget)->getChecked());
break;
+ case T_END:
+ dcassert(false); break;
}
}
}
=== modified file 'win32/QueueFrame.cpp'
--- win32/QueueFrame.cpp 2011-10-17 19:39:46 +0000
+++ win32/QueueFrame.cpp 2011-11-04 16:30:55 +0000
@@ -785,6 +785,7 @@
case QueueItem::LOW: p = inc ? QueueItem::NORMAL : QueueItem::LOWEST; break;
case QueueItem::LOWEST: p = inc ? QueueItem::LOW : QueueItem::PAUSED; break;
case QueueItem::PAUSED: p = inc ? QueueItem::LOWEST : QueueItem::PAUSED; break;
+ default: dcassert(false); break;
}
QueueManager::getInstance()->setPriority(ii->getTarget(), p);