diff --git a/src/gui/generic/serverguiwrapper.cpp b/src/gui/generic/serverguiwrapper.cpp index e3a93592..6a992278 100644 --- a/src/gui/generic/serverguiwrapper.cpp +++ b/src/gui/generic/serverguiwrapper.cpp @@ -33,7 +33,7 @@ ServerGuiWrapper::~ServerGuiWrapper() { } -void ServerGuiWrapper::initGui(int speed) {} +void ServerGuiWrapper::initGui(int /*speed*/) {} Session &ServerGuiWrapper::getSession() { @@ -50,21 +50,21 @@ void ServerGuiWrapper::refreshSet() 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::refreshAll() 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::refreshButton() const {} -void ServerGuiWrapper::refreshGameLabels(GameState state) const {} +void ServerGuiWrapper::refreshGameLabels(GameState /*state*/) const {} void ServerGuiWrapper::waitForGuiUpdateDone() const {} -void ServerGuiWrapper::dealBeRoCards(int myBeRoID) {} +void ServerGuiWrapper::dealBeRoCards(int /*myBeRoID*/) {} void ServerGuiWrapper::dealHoleCards() {} void ServerGuiWrapper::dealFlopCards() {} void ServerGuiWrapper::dealTurnCard() {} @@ -72,7 +72,7 @@ void ServerGuiWrapper::dealRiverCard() {} void ServerGuiWrapper::nextPlayerAnimation() {} -void ServerGuiWrapper::beRoAnimation2(int myBeRoID) {} +void ServerGuiWrapper::beRoAnimation2(int /*myBeRoID*/) {} void ServerGuiWrapper::preflopAnimation1() {} void ServerGuiWrapper::preflopAnimation2() {} @@ -95,15 +95,15 @@ void ServerGuiWrapper::nextRoundCleanGui() {} void ServerGuiWrapper::meInAction() {} void ServerGuiWrapper::disableMyButtons() {} -void ServerGuiWrapper::startTimeoutAnimation(int playerId, int timeoutSec) {} -void ServerGuiWrapper::stopTimeoutAnimation(int playerId) {} +void ServerGuiWrapper::startTimeoutAnimation(int /*playerId*/, int /*timeoutSec*/) {} +void ServerGuiWrapper::stopTimeoutAnimation(int /*playerId*/) {} -void ServerGuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) {} -void ServerGuiWrapper::logNewGameHandMsg(int gameID, int handID) {} -void ServerGuiWrapper::logPlayerWinsMsg(int playerID, int pot) {} -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::logPlayerWinGame(std::string playerName, int gameID) {} +void ServerGuiWrapper::logPlayerActionMsg(string /*playerName*/, int /*action*/, int /*setValue*/) {} +void ServerGuiWrapper::logNewGameHandMsg(int /*gameID*/, int /*handID*/) {} +void ServerGuiWrapper::logPlayerWinsMsg(int /*playerID*/, int /*pot*/) {} +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::logPlayerWinGame(std::string /*playerName*/, int /*gameID*/) {} void ServerGuiWrapper::SignalNetClientConnect(int actionID) { if (myClientcb) myClientcb->SignalNetClientConnect(actionID); } void ServerGuiWrapper::SignalNetClientGameInfo(int actionID) { if (myClientcb) myClientcb->SignalNetClientGameInfo(actionID); } diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index 4aec0991..aa76c0d8 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -513,4 +513,4 @@ void gameLobbyDialogImpl::hideShowGameDescription(bool show) { label_gameDesc4->hide(); label_gameDesc5->hide(); } -} \ No newline at end of file +} diff --git a/src/gui/qt/qttools/qthelper/qthelper.cpp b/src/gui/qt/qttools/qthelper/qthelper.cpp index 1a8e747b..7b8a6bc4 100644 --- a/src/gui/qt/qttools/qthelper/qthelper.cpp +++ b/src/gui/qt/qttools/qthelper/qthelper.cpp @@ -82,4 +82,4 @@ std::string QtHelper::getDataPathStdString(const std::string &appPath) return (QDir::cleanPath(path) + "/").toUtf8().constData(); -} \ No newline at end of file +} diff --git a/src/net/common/ircthread.cpp b/src/net/common/ircthread.cpp index 3e47109c..21cfcd32 100644 --- a/src/net/common/ircthread.cpp +++ b/src/net/common/ircthread.cpp @@ -31,11 +31,12 @@ using namespace std; struct IrcContext { - IrcContext(IrcThread &t) : ircThread(t), session(NULL), serverPort(0) {} + IrcContext(IrcThread &t) : ircThread(t), session(NULL), serverPort(0), useIPv6(false) {} IrcThread &ircThread; irc_session_t *session; string serverAddress; unsigned serverPort; + bool useIPv6; string nick; string channel; }; @@ -87,7 +88,7 @@ void irc_handle_server_error(irc_session_t *session, unsigned irc_error_code) } 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); @@ -96,7 +97,7 @@ irc_event_connect(irc_session_t *session, const char *irc_event, const char *ori } 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. 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 -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 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) context->nick = params[0]; @@ -122,7 +123,7 @@ irc_event_nick(irc_session_t *session, const char *irc_event, const char *origin } 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 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 -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. 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 -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); - 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. - if (params[1] && *params[1] != 0) + if (*params[1] != 0) context->ircThread.GetCallback().SignalIrcChatMsg(origin, params[1]); } } 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) { @@ -254,6 +255,7 @@ IrcThread::Init(const std::string &serverAddress, unsigned serverPort, bool ipv6 context.serverAddress = serverAddress; context.serverPort = serverPort; + context.useIPv6 = ipv6; context.nick = nick; context.channel = channel; diff --git a/src/net/common/servergamestate.cpp b/src/net/common/servergamestate.cpp index 06f2812c..552e21fe 100644 --- a/src/net/common/servergamestate.cpp +++ b/src/net/common/servergamestate.cpp @@ -862,7 +862,7 @@ ServerGameStateComputerAction::Process(ServerGameThread &server) } int -ServerGameStateComputerAction::InternalProcess(ServerGameThread &server, SessionWrapper session, boost::shared_ptr packet) +ServerGameStateComputerAction::InternalProcess(ServerGameThread &/*server*/, SessionWrapper /*session*/, boost::shared_ptr /*packet*/) { return MSG_SOCK_INTERNAL_PENDING; } @@ -917,7 +917,7 @@ ServerGameStateDealCardsDelay::Process(ServerGameThread &server) } int -ServerGameStateDealCardsDelay::InternalProcess(ServerGameThread &server, SessionWrapper session, boost::shared_ptr packet) +ServerGameStateDealCardsDelay::InternalProcess(ServerGameThread &/*server*/, SessionWrapper /*session*/, boost::shared_ptr /*packet*/) { return MSG_SOCK_INTERNAL_PENDING; } @@ -961,7 +961,7 @@ ServerGameStateShowCardsDelay::Process(ServerGameThread &server) } int -ServerGameStateShowCardsDelay::InternalProcess(ServerGameThread &server, SessionWrapper session, boost::shared_ptr packet) +ServerGameStateShowCardsDelay::InternalProcess(ServerGameThread &/*server*/, SessionWrapper /*session*/, boost::shared_ptr /*packet*/) { return MSG_SOCK_INTERNAL_PENDING; } @@ -999,7 +999,7 @@ ServerGameStateNextHandDelay::Process(ServerGameThread &server) } int -ServerGameStateNextHandDelay::InternalProcess(ServerGameThread &server, SessionWrapper session, boost::shared_ptr packet) +ServerGameStateNextHandDelay::InternalProcess(ServerGameThread &/*server*/, SessionWrapper /*session*/, boost::shared_ptr /*packet*/) { return MSG_SOCK_INTERNAL_PENDING; } @@ -1060,7 +1060,7 @@ ServerGameStateNextGameDelay::Process(ServerGameThread &server) } int -ServerGameStateNextGameDelay::InternalProcess(ServerGameThread &server, SessionWrapper session, boost::shared_ptr packet) +ServerGameStateNextGameDelay::InternalProcess(ServerGameThread &/*server*/, SessionWrapper /*session*/, boost::shared_ptr /*packet*/) { return MSG_SOCK_INTERNAL_PENDING; } @@ -1087,7 +1087,7 @@ ServerGameStateFinal::~ServerGameStateFinal() } int -ServerGameStateFinal::InternalProcess(ServerGameThread &server, SessionWrapper session, boost::shared_ptr packet) +ServerGameStateFinal::InternalProcess(ServerGameThread &/*server*/, SessionWrapper /*session*/, boost::shared_ptr /*packet*/) { return MSG_SOCK_INTERNAL_PENDING; } diff --git a/src/net/common/servergamethread.cpp b/src/net/common/servergamethread.cpp index f42e838e..de427521 100644 --- a/src/net/common/servergamethread.cpp +++ b/src/net/common/servergamethread.cpp @@ -40,7 +40,7 @@ public: ServerSenderCallback(ServerGameThread &server) : m_server(server) {} 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. // A serious send error should trigger a read error or a read diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index 5f45d08b..1d7108ad 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -42,7 +42,7 @@ public: ServerSenderCallback(ServerLobbyThread &server) : m_server(server) {} 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. // A serious send error should trigger a read error or a read diff --git a/src/net/linux/socket_helper.cpp b/src/net/linux/socket_helper.cpp index 32275abe..13d23c07 100644 --- a/src/net/linux/socket_helper.cpp +++ b/src/net/linux/socket_helper.cpp @@ -1,42 +1,42 @@ -/*************************************************************************** - * Copyright (C) 2007 by Lothar May * - * * - * 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 * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifdef _WIN32 -#error This source code is not for Win32. -#endif - -#include - - -bool -socket_string_to_addr(const char *str, int addrFamily, struct sockaddr * addr, int addrLen) -{ - if (addrFamily == AF_INET) - return (inet_pton(addrFamily, str, &((struct sockaddr_in *)addr)->sin_addr) == 1); - else if (addrFamily == AF_INET6) - return (inet_pton(addrFamily, str, &((struct sockaddr_in6 *)addr)->sin6_addr) == 1); - else - return false; -} - -bool -socket_resolve(const char *str, const char *port, int addrFamily, int sockType, int protocol, struct sockaddr *addr, int addrLen) -{ +/*************************************************************************** + * Copyright (C) 2007 by Lothar May * + * * + * 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 * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifdef _WIN32 +#error This source code is not for Win32. +#endif + +#include + + +bool +socket_string_to_addr(const char *str, int addrFamily, struct sockaddr *addr, int /*addrLen*/) +{ + if (addrFamily == AF_INET) + return (inet_pton(addrFamily, str, &((struct sockaddr_in *)addr)->sin_addr) == 1); + else if (addrFamily == AF_INET6) + return (inet_pton(addrFamily, str, &((struct sockaddr_in6 *)addr)->sin6_addr) == 1); + else + return false; +} + +bool +socket_resolve(const char *str, const char *port, int addrFamily, int sockType, int protocol, struct sockaddr *addr, int addrLen) +{ bool retVal = false; if (str && *str != 0) @@ -64,5 +64,5 @@ socket_resolve(const char *str, const char *port, int addrFamily, int sockType, } } return retVal; -} - +} + diff --git a/src/pokerth_server.cpp b/src/pokerth_server.cpp index 2c0e4111..21549c39 100644 --- a/src/pokerth_server.cpp +++ b/src/pokerth_server.cpp @@ -51,7 +51,7 @@ using namespace std; volatile int g_pokerthTerminate = 0; void -TerminateHandler(int signal) +TerminateHandler(int /*signal*/) { g_pokerthTerminate = 1; }