Fixing gcc compiler warnings.
This commit is contained in:
@@ -1671,7 +1671,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
|
||||
isBigBlind = true;
|
||||
} else { // no blind -> log
|
||||
if (netActionDone.playeraction()) {
|
||||
assert(netActionDone.totalplayerbet() >= tmpPlayer->getMySet());
|
||||
assert((int)netActionDone.totalplayerbet() >= tmpPlayer->getMySet());
|
||||
client->GetGui().logPlayerActionMsg(
|
||||
tmpPlayer->getMyName(),
|
||||
netActionDone.playeraction(),
|
||||
@@ -1736,7 +1736,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
|
||||
throw ClientException(__FILE__, __LINE__, ERR_NET_UNKNOWN_PLAYER_ID, 0);
|
||||
|
||||
// Set round.
|
||||
if (curGame->getCurrentHand()->getCurrentRound() != netPlayersTurn.gamestate()) {
|
||||
if (curGame->getCurrentHand()->getCurrentRound() != static_cast<GameState>(netPlayersTurn.gamestate())) {
|
||||
ResetPlayerActions(*curGame);
|
||||
curGame->getCurrentHand()->setCurrentRound(static_cast<GameState>(netPlayersTurn.gamestate()));
|
||||
client->GetClientLog()->setCurrentRound(static_cast<GameState>(netPlayersTurn.gamestate()));
|
||||
|
||||
@@ -82,7 +82,7 @@ ReceiveBuffer::ScanPackets()
|
||||
// several packets may be received at once.
|
||||
if (recvBufUsed >= NET_HEADER_SIZE) {
|
||||
// Read the size of the packet (first 4 bytes in network byte order).
|
||||
size_t packetSize = ntohl(*((uint32_t *)recvBuf));
|
||||
size_t packetSize = ntohl(*((uint32_t *)&recvBuf[0]));
|
||||
if (recvBufUsed >= packetSize + NET_HEADER_SIZE)
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -1420,7 +1420,7 @@ ServerGameStateWaitPlayerAction::InternalProcessPacket(boost::shared_ptr<ServerG
|
||||
|
||||
// Check whether this is the correct round.
|
||||
PlayerActionCode code = ACTION_CODE_VALID;
|
||||
if (curGame.getCurrentHand()->getCurrentRound() != netMyAction->gamestate())
|
||||
if (curGame.getCurrentHand()->getCurrentRound() != static_cast<GameState>(netMyAction->gamestate()))
|
||||
code = ACTION_CODE_INVALID_STATE;
|
||||
|
||||
// Check whether this is the correct player.
|
||||
@@ -1431,13 +1431,13 @@ ServerGameStateWaitPlayerAction::InternalProcessPacket(boost::shared_ptr<ServerG
|
||||
}
|
||||
|
||||
// If the client omitted some values, fill them in.
|
||||
if (netMyAction->myaction() == PLAYER_ACTION_CALL && netMyAction->myrelativebet() == 0) {
|
||||
if (netMyAction->myaction() == actionCall && netMyAction->myrelativebet() == 0) {
|
||||
if (curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() >= tmpPlayer->getMySet() + tmpPlayer->getMyCash())
|
||||
netMyAction->set_myaction(actionAllIn);
|
||||
else
|
||||
netMyAction->set_myrelativebet(curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() - tmpPlayer->getMySet());
|
||||
}
|
||||
if (netMyAction->myaction() == PLAYER_ACTION_ALLIN && netMyAction->myrelativebet() == 0)
|
||||
if (netMyAction->myaction() == actionAllIn && netMyAction->myrelativebet() == 0)
|
||||
netMyAction->set_myrelativebet(tmpPlayer->getMyCash());
|
||||
|
||||
// Check whether the action is valid.
|
||||
|
||||
Reference in New Issue
Block a user