Fixed a bunch of compiler warnings.

This commit is contained in:
lotodore
2007-09-30 18:50:46 +00:00
parent 0e11228a95
commit 0d1650e9a9
9 changed files with 79 additions and 77 deletions
+14 -14
View File
@@ -33,7 +33,7 @@ ServerGuiWrapper::~ServerGuiWrapper()
{ {
} }
void ServerGuiWrapper::initGui(int speed) {} void ServerGuiWrapper::initGui(int /*speed*/) {}
Session &ServerGuiWrapper::getSession() Session &ServerGuiWrapper::getSession()
{ {
@@ -50,21 +50,21 @@ void ServerGuiWrapper::refreshSet() const {}
void ServerGuiWrapper::refreshCash() const {} void ServerGuiWrapper::refreshCash() const {}
void ServerGuiWrapper::refreshAction(int playerID, int playerAction) const {} void ServerGuiWrapper::refreshAction(int /*playerID*/, int /*playerAction*/) const {}
void ServerGuiWrapper::refreshChangePlayer() const {} void ServerGuiWrapper::refreshChangePlayer() const {}
void ServerGuiWrapper::refreshAll() const {} void ServerGuiWrapper::refreshAll() const {}
void ServerGuiWrapper::refreshPot() const {} void ServerGuiWrapper::refreshPot() const {}
void ServerGuiWrapper::refreshGroupbox(int playerID, int status) const {} void ServerGuiWrapper::refreshGroupbox(int /*playerID*/, int /*status*/) const {}
void ServerGuiWrapper::refreshPlayerName() const {} void ServerGuiWrapper::refreshPlayerName() const {}
void ServerGuiWrapper::refreshButton() const {} void ServerGuiWrapper::refreshButton() const {}
void ServerGuiWrapper::refreshGameLabels(GameState state) const {} void ServerGuiWrapper::refreshGameLabels(GameState /*state*/) const {}
void ServerGuiWrapper::waitForGuiUpdateDone() const {} void ServerGuiWrapper::waitForGuiUpdateDone() const {}
void ServerGuiWrapper::dealBeRoCards(int myBeRoID) {} void ServerGuiWrapper::dealBeRoCards(int /*myBeRoID*/) {}
void ServerGuiWrapper::dealHoleCards() {} void ServerGuiWrapper::dealHoleCards() {}
void ServerGuiWrapper::dealFlopCards() {} void ServerGuiWrapper::dealFlopCards() {}
void ServerGuiWrapper::dealTurnCard() {} void ServerGuiWrapper::dealTurnCard() {}
@@ -72,7 +72,7 @@ void ServerGuiWrapper::dealRiverCard() {}
void ServerGuiWrapper::nextPlayerAnimation() {} void ServerGuiWrapper::nextPlayerAnimation() {}
void ServerGuiWrapper::beRoAnimation2(int myBeRoID) {} void ServerGuiWrapper::beRoAnimation2(int /*myBeRoID*/) {}
void ServerGuiWrapper::preflopAnimation1() {} void ServerGuiWrapper::preflopAnimation1() {}
void ServerGuiWrapper::preflopAnimation2() {} void ServerGuiWrapper::preflopAnimation2() {}
@@ -95,15 +95,15 @@ void ServerGuiWrapper::nextRoundCleanGui() {}
void ServerGuiWrapper::meInAction() {} void ServerGuiWrapper::meInAction() {}
void ServerGuiWrapper::disableMyButtons() {} void ServerGuiWrapper::disableMyButtons() {}
void ServerGuiWrapper::startTimeoutAnimation(int playerId, int timeoutSec) {} void ServerGuiWrapper::startTimeoutAnimation(int /*playerId*/, int /*timeoutSec*/) {}
void ServerGuiWrapper::stopTimeoutAnimation(int playerId) {} void ServerGuiWrapper::stopTimeoutAnimation(int /*playerId*/) {}
void ServerGuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) {} void ServerGuiWrapper::logPlayerActionMsg(string /*playerName*/, int /*action*/, int /*setValue*/) {}
void ServerGuiWrapper::logNewGameHandMsg(int gameID, int handID) {} void ServerGuiWrapper::logNewGameHandMsg(int /*gameID*/, int /*handID*/) {}
void ServerGuiWrapper::logPlayerWinsMsg(int playerID, int pot) {} void ServerGuiWrapper::logPlayerWinsMsg(int /*playerID*/, int /*pot*/) {}
void ServerGuiWrapper::logDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int card4, int card5) {} void ServerGuiWrapper::logDealBoardCardsMsg(int /*roundID*/, int /*card1*/, int /*card2*/, int /*card3*/, int /*card4*/, int /*card5*/) {}
void ServerGuiWrapper::logFlipHoleCardsMsg(std::string playerName, int card1, int card2, int cardsValueInt, std::string showHas) {} void ServerGuiWrapper::logFlipHoleCardsMsg(std::string /*playerName*/, int /*card1*/, int /*card2*/, int /*cardsValueInt*/, std::string /*showHas*/) {}
void ServerGuiWrapper::logPlayerWinGame(std::string playerName, int gameID) {} void ServerGuiWrapper::logPlayerWinGame(std::string /*playerName*/, int /*gameID*/) {}
void ServerGuiWrapper::SignalNetClientConnect(int actionID) { if (myClientcb) myClientcb->SignalNetClientConnect(actionID); } void ServerGuiWrapper::SignalNetClientConnect(int actionID) { if (myClientcb) myClientcb->SignalNetClientConnect(actionID); }
void ServerGuiWrapper::SignalNetClientGameInfo(int actionID) { if (myClientcb) myClientcb->SignalNetClientGameInfo(actionID); } void ServerGuiWrapper::SignalNetClientGameInfo(int actionID) { if (myClientcb) myClientcb->SignalNetClientGameInfo(actionID); }
@@ -513,4 +513,4 @@ void gameLobbyDialogImpl::hideShowGameDescription(bool show) {
label_gameDesc4->hide(); label_gameDesc4->hide();
label_gameDesc5->hide(); label_gameDesc5->hide();
} }
} }
+1 -1
View File
@@ -82,4 +82,4 @@ std::string QtHelper::getDataPathStdString(const std::string &appPath)
return (QDir::cleanPath(path) + "/").toUtf8().constData(); return (QDir::cleanPath(path) + "/").toUtf8().constData();
} }
+13 -11
View File
@@ -31,11 +31,12 @@ using namespace std;
struct IrcContext struct IrcContext
{ {
IrcContext(IrcThread &t) : ircThread(t), session(NULL), serverPort(0) {} IrcContext(IrcThread &t) : ircThread(t), session(NULL), serverPort(0), useIPv6(false) {}
IrcThread &ircThread; IrcThread &ircThread;
irc_session_t *session; irc_session_t *session;
string serverAddress; string serverAddress;
unsigned serverPort; unsigned serverPort;
bool useIPv6;
string nick; string nick;
string channel; string channel;
}; };
@@ -87,7 +88,7 @@ void irc_handle_server_error(irc_session_t *session, unsigned irc_error_code)
} }
void void
irc_event_connect(irc_session_t *session, const char *irc_event, const char *origin, const char **params, unsigned count) irc_event_connect(irc_session_t *session, const char */*irc_event*/, const char *origin, const char **/*params*/, unsigned /*count*/)
{ {
IrcContext *context = (IrcContext *) irc_get_ctx(session); IrcContext *context = (IrcContext *) irc_get_ctx(session);
@@ -96,7 +97,7 @@ irc_event_connect(irc_session_t *session, const char *irc_event, const char *ori
} }
void void
irc_event_join(irc_session_t *session, const char *irc_event, const char *origin, const char **params, unsigned count) irc_event_join(irc_session_t *session, const char */*irc_event*/, const char *origin, const char **/*params*/, unsigned /*count*/)
{ {
// someone joined the channel. // someone joined the channel.
IrcContext *context = (IrcContext *) irc_get_ctx(session); IrcContext *context = (IrcContext *) irc_get_ctx(session);
@@ -108,12 +109,12 @@ irc_event_join(irc_session_t *session, const char *irc_event, const char *origin
} }
void void
irc_event_nick(irc_session_t *session, const char *irc_event, const char *origin, const char **params, unsigned count) irc_event_nick(irc_session_t *session, const char */*irc_event*/, const char *origin, const char **params, unsigned count)
{ {
// someone changed his/her nick // someone changed his/her nick
IrcContext *context = (IrcContext *) irc_get_ctx(session); IrcContext *context = (IrcContext *) irc_get_ctx(session);
if (context->nick != params[0]) // only act if this was not an auto-rename if (count && context->nick != params[0]) // only act if this was not an auto-rename
{ {
if (context->nick == origin) if (context->nick == origin)
context->nick = params[0]; context->nick = params[0];
@@ -122,7 +123,7 @@ irc_event_nick(irc_session_t *session, const char *irc_event, const char *origin
} }
void void
irc_event_kick(irc_session_t *session, const char *irc_event, const char *origin, const char **params, unsigned count) irc_event_kick(irc_session_t *session, const char */*irc_event*/, const char *origin, const char **params, unsigned count)
{ {
// someone got kicked // someone got kicked
IrcContext *context = (IrcContext *) irc_get_ctx(session); IrcContext *context = (IrcContext *) irc_get_ctx(session);
@@ -140,7 +141,7 @@ irc_event_kick(irc_session_t *session, const char *irc_event, const char *origin
} }
void void
irc_event_leave(irc_session_t *session, const char *irc_event, const char *origin, const char **params, unsigned count) irc_event_leave(irc_session_t *session, const char */*irc_event*/, const char *origin, const char **/*params*/, unsigned /*count*/)
{ {
// someone left the channel. // someone left the channel.
IrcContext *context = (IrcContext *) irc_get_ctx(session); IrcContext *context = (IrcContext *) irc_get_ctx(session);
@@ -149,20 +150,20 @@ irc_event_leave(irc_session_t *session, const char *irc_event, const char *origi
} }
void void
irc_event_channel(irc_session_t *session, const char *irc_event, const char *origin, const char **params, unsigned count) irc_event_channel(irc_session_t *session, const char */*irc_event*/, const char *origin, const char **params, unsigned count)
{ {
IrcContext *context = (IrcContext *) irc_get_ctx(session); IrcContext *context = (IrcContext *) irc_get_ctx(session);
if (context->channel == params[0]) // check whether this message is for our channel if (count >= 2 && context->channel == params[0]) // check whether this message is for our channel
{ {
// Signal the message (if any) to GUI. // Signal the message (if any) to GUI.
if (params[1] && *params[1] != 0) if (*params[1] != 0)
context->ircThread.GetCallback().SignalIrcChatMsg(origin, params[1]); context->ircThread.GetCallback().SignalIrcChatMsg(origin, params[1]);
} }
} }
void void
irc_event_numeric(irc_session_t * session, unsigned irc_event, const char *origin, const char **params, unsigned count) irc_event_numeric(irc_session_t * session, unsigned irc_event, const char */*origin*/, const char **params, unsigned count)
{ {
switch (irc_event) switch (irc_event)
{ {
@@ -254,6 +255,7 @@ IrcThread::Init(const std::string &serverAddress, unsigned serverPort, bool ipv6
context.serverAddress = serverAddress; context.serverAddress = serverAddress;
context.serverPort = serverPort; context.serverPort = serverPort;
context.useIPv6 = ipv6;
context.nick = nick; context.nick = nick;
context.channel = channel; context.channel = channel;
+6 -6
View File
@@ -862,7 +862,7 @@ ServerGameStateComputerAction::Process(ServerGameThread &server)
} }
int int
ServerGameStateComputerAction::InternalProcess(ServerGameThread &server, SessionWrapper session, boost::shared_ptr<NetPacket> packet) ServerGameStateComputerAction::InternalProcess(ServerGameThread &/*server*/, SessionWrapper /*session*/, boost::shared_ptr<NetPacket> /*packet*/)
{ {
return MSG_SOCK_INTERNAL_PENDING; return MSG_SOCK_INTERNAL_PENDING;
} }
@@ -917,7 +917,7 @@ ServerGameStateDealCardsDelay::Process(ServerGameThread &server)
} }
int int
ServerGameStateDealCardsDelay::InternalProcess(ServerGameThread &server, SessionWrapper session, boost::shared_ptr<NetPacket> packet) ServerGameStateDealCardsDelay::InternalProcess(ServerGameThread &/*server*/, SessionWrapper /*session*/, boost::shared_ptr<NetPacket> /*packet*/)
{ {
return MSG_SOCK_INTERNAL_PENDING; return MSG_SOCK_INTERNAL_PENDING;
} }
@@ -961,7 +961,7 @@ ServerGameStateShowCardsDelay::Process(ServerGameThread &server)
} }
int int
ServerGameStateShowCardsDelay::InternalProcess(ServerGameThread &server, SessionWrapper session, boost::shared_ptr<NetPacket> packet) ServerGameStateShowCardsDelay::InternalProcess(ServerGameThread &/*server*/, SessionWrapper /*session*/, boost::shared_ptr<NetPacket> /*packet*/)
{ {
return MSG_SOCK_INTERNAL_PENDING; return MSG_SOCK_INTERNAL_PENDING;
} }
@@ -999,7 +999,7 @@ ServerGameStateNextHandDelay::Process(ServerGameThread &server)
} }
int int
ServerGameStateNextHandDelay::InternalProcess(ServerGameThread &server, SessionWrapper session, boost::shared_ptr<NetPacket> packet) ServerGameStateNextHandDelay::InternalProcess(ServerGameThread &/*server*/, SessionWrapper /*session*/, boost::shared_ptr<NetPacket> /*packet*/)
{ {
return MSG_SOCK_INTERNAL_PENDING; return MSG_SOCK_INTERNAL_PENDING;
} }
@@ -1060,7 +1060,7 @@ ServerGameStateNextGameDelay::Process(ServerGameThread &server)
} }
int int
ServerGameStateNextGameDelay::InternalProcess(ServerGameThread &server, SessionWrapper session, boost::shared_ptr<NetPacket> packet) ServerGameStateNextGameDelay::InternalProcess(ServerGameThread &/*server*/, SessionWrapper /*session*/, boost::shared_ptr<NetPacket> /*packet*/)
{ {
return MSG_SOCK_INTERNAL_PENDING; return MSG_SOCK_INTERNAL_PENDING;
} }
@@ -1087,7 +1087,7 @@ ServerGameStateFinal::~ServerGameStateFinal()
} }
int int
ServerGameStateFinal::InternalProcess(ServerGameThread &server, SessionWrapper session, boost::shared_ptr<NetPacket> packet) ServerGameStateFinal::InternalProcess(ServerGameThread &/*server*/, SessionWrapper /*session*/, boost::shared_ptr<NetPacket> /*packet*/)
{ {
return MSG_SOCK_INTERNAL_PENDING; return MSG_SOCK_INTERNAL_PENDING;
} }
+1 -1
View File
@@ -40,7 +40,7 @@ public:
ServerSenderCallback(ServerGameThread &server) : m_server(server) {} ServerSenderCallback(ServerGameThread &server) : m_server(server) {}
virtual ~ServerSenderCallback() {} virtual ~ServerSenderCallback() {}
virtual void SignalNetError(SOCKET sock, int errorID, int osErrorID) virtual void SignalNetError(SOCKET /*sock*/, int /*errorID*/, int /*osErrorID*/)
{ {
// We just ignore send errors for now, on server side. // We just ignore send errors for now, on server side.
// A serious send error should trigger a read error or a read // A serious send error should trigger a read error or a read
+1 -1
View File
@@ -42,7 +42,7 @@ public:
ServerSenderCallback(ServerLobbyThread &server) : m_server(server) {} ServerSenderCallback(ServerLobbyThread &server) : m_server(server) {}
virtual ~ServerSenderCallback() {} virtual ~ServerSenderCallback() {}
virtual void SignalNetError(SOCKET sock, int errorID, int osErrorID) virtual void SignalNetError(SOCKET /*sock*/, int /*errorID*/, int /*osErrorID*/)
{ {
// We just ignore send errors for now, on server side. // We just ignore send errors for now, on server side.
// A serious send error should trigger a read error or a read // A serious send error should trigger a read error or a read
+41 -41
View File
@@ -1,42 +1,42 @@
/*************************************************************************** /***************************************************************************
* Copyright (C) 2007 by Lothar May * * Copyright (C) 2007 by Lothar May *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/ ***************************************************************************/
#ifdef _WIN32 #ifdef _WIN32
#error This source code is not for Win32. #error This source code is not for Win32.
#endif #endif
#include <net/socket_helper.h> #include <net/socket_helper.h>
bool bool
socket_string_to_addr(const char *str, int addrFamily, struct sockaddr * addr, int addrLen) socket_string_to_addr(const char *str, int addrFamily, struct sockaddr *addr, int /*addrLen*/)
{ {
if (addrFamily == AF_INET) if (addrFamily == AF_INET)
return (inet_pton(addrFamily, str, &((struct sockaddr_in *)addr)->sin_addr) == 1); return (inet_pton(addrFamily, str, &((struct sockaddr_in *)addr)->sin_addr) == 1);
else if (addrFamily == AF_INET6) else if (addrFamily == AF_INET6)
return (inet_pton(addrFamily, str, &((struct sockaddr_in6 *)addr)->sin6_addr) == 1); return (inet_pton(addrFamily, str, &((struct sockaddr_in6 *)addr)->sin6_addr) == 1);
else else
return false; return false;
} }
bool bool
socket_resolve(const char *str, const char *port, int addrFamily, int sockType, int protocol, struct sockaddr *addr, int addrLen) socket_resolve(const char *str, const char *port, int addrFamily, int sockType, int protocol, struct sockaddr *addr, int addrLen)
{ {
bool retVal = false; bool retVal = false;
if (str && *str != 0) if (str && *str != 0)
@@ -64,5 +64,5 @@ socket_resolve(const char *str, const char *port, int addrFamily, int sockType,
} }
} }
return retVal; return retVal;
} }
+1 -1
View File
@@ -51,7 +51,7 @@ using namespace std;
volatile int g_pokerthTerminate = 0; volatile int g_pokerthTerminate = 0;
void void
TerminateHandler(int signal) TerminateHandler(int /*signal*/)
{ {
g_pokerthTerminate = 1; g_pokerthTerminate = 1;
} }