Merge pull request #51 from mattkelly/master

Resolve all compiler warnings
This commit is contained in:
Gavin Bisesi 2014-02-11 11:00:34 -05:00
commit cf26ecb8a1
4 changed files with 1928 additions and 1944 deletions

19
TODO.md
View file

@ -28,7 +28,6 @@ Note that "improve" and "write" always also means: "document and comment"
* Rename the picture filenames to something more meaningful.
* Create an index, lists of tables/figures/...
## Storage
* Find a better place for sets.xml than doc.
@ -41,24 +40,6 @@ Note that "improve" and "write" always also means: "document and comment"
* Document everything!1!!
* Coding guidelines
##Fix compile warnings
* (CMAKE_VERBOSE_MAKEFILE, compile with clang++), this could indicate missing program functionality:
```
cockatrice/src/abstractclient.cpp:72:12: warning: enumeration value 'SessionEvent_SessionEventType_SERVER_COMPLETE_LIST' not handled in switch [-Wswitch]
switch ((SessionEvent::SessionEventType) getPbExtension(event)) {
```
```
cockatrice/Cockatrice.VanNostrand/cockatrice/src/player.cpp:1725:12: warning: 4 enumeration values not handled in switch: 'cmMoveToTopLibrary', 'cmMoveToBottomLibrary', 'cmMoveToGraveyard'... [-Wswitch]
switch (static_cast<CardMenuActionType>(a->data().toInt())) {
```
```
cockatrice/src/cardzone.cpp:127:11: warning: enumeration values 'CaseTopCardsOfZone', 'CaseRevealZone', and 'CaseShuffleZone' not handled in switch [-Wswitch]
switch (gc) {
```
##Else
* Update SFMT library (http://www.math.sci.hiroshima-u.ac.jp/~m-mat@math.sci.hiroshima-u.ac.jp/MT/SFMT/) in common/sfmt and adapt common/rng_sfmt.cpp

View file

@ -82,6 +82,7 @@ void AbstractClient::processProtocolItem(const ServerMessage &item)
case SessionEvent::USER_LEFT: emit userLeftEventReceived(event.GetExtension(Event_UserLeft::ext)); break;
case SessionEvent::GAME_JOINED: emit gameJoinedEventReceived(event.GetExtension(Event_GameJoined::ext)); break;
case SessionEvent::REPLAY_ADDED: emit replayAddedEventReceived(event.GetExtension(Event_ReplayAdded::ext)); break;
default: break;
}
break;
}

View file

@ -143,6 +143,7 @@ QString CardZone::getTranslatedName(bool hisOwn, GrammaticalCase gc) const
? tr("his sideboard", "nominative, male owner")
: tr("%1's sideboard", "nominative, male owner").arg(ownerName)
);
default: break;
}
return QString();
}

View file

@ -1514,8 +1514,8 @@ void Player::playCard(CardItem *c, bool faceDown, bool tapped)
CardInfo *ci = c->getInfo();
if ((!settingsCache->getPlayToStack() && ci->getTableRow() == 3) ||
(settingsCache->getPlayToStack() && ci->getTableRow() != 0) &&
c->getZone()->getName().toStdString() != "stack") {
((settingsCache->getPlayToStack() && ci->getTableRow() != 0) &&
c->getZone()->getName().toStdString() != "stack")) {
cmd.set_target_zone("stack");
cmd.set_x(0);
cmd.set_y(0);
@ -1784,6 +1784,7 @@ void Player::cardMenuAction()
commandList.append(cmd);
break;
}
default: break;
}
}
else {