From 246c99e62ed3d13c688cdf18c4b4210b81eab929 Mon Sep 17 00:00:00 2001 From: lotodore Date: Thu, 10 Feb 2011 13:54:53 +0000 Subject: [PATCH] Trying to fix more cppcheck messages. --- src/game.cpp | 4 +++- src/gamedata.h | 3 ++- src/gui/qt/gametable/mystatuslabel.cpp | 2 +- src/net/chatcleanermanager.h | 2 +- src/net/common/chatcleanermanager.cpp | 1 - src/net/common/serveradminbot.cpp | 1 + src/net/common/serverlobbybot.cpp | 1 + src/net/common/sessiondata.cpp | 8 +++++--- src/net/internalchatcleanerpacket.h | 4 +++- 9 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 88b473e1..b0e3f299 100755 --- a/src/game.cpp +++ b/src/game.cpp @@ -35,7 +35,9 @@ Game::Game(GuiInterface* gui, boost::shared_ptr factory, const StartData &startData, int gameId, Log* log) : myFactory(factory), myGui(gui), myLog(log), startQuantityPlayers(startData.numberOfPlayers), startCash(gameData.startMoney), startSmallBlind(gameData.firstSmallBlind), - myGameID(gameId), currentSmallBlind(gameData.firstSmallBlind), currentHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData) + myGameID(gameId), currentSmallBlind(gameData.firstSmallBlind), currentHandID(0), dealerPosition(0), + lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData), + blindsTimer(boost::posix_time::time_duration(0, 0, 0), boost::timers::portable::second_timer::manual_start) { blindsList = myGameData.manualBlindsList; diff --git a/src/gamedata.h b/src/gamedata.h index e9799019..0fb04dc5 100644 --- a/src/gamedata.h +++ b/src/gamedata.h @@ -109,7 +109,8 @@ struct VoteKickData { VoteKickData() : petitionId(0), kickPlayerId(0), numVotesToKick(0), - numVotesInFavourOfKicking(0), numVotesAgainstKicking(0), timeLimitSec(0) {} + numVotesInFavourOfKicking(0), numVotesAgainstKicking(0), timeLimitSec(0), + voteTimer(boost::posix_time::time_duration(0, 0, 0), boost::timers::portable::microsec_timer::auto_start) {} unsigned petitionId; unsigned kickPlayerId; int numVotesToKick; diff --git a/src/gui/qt/gametable/mystatuslabel.cpp b/src/gui/qt/gametable/mystatuslabel.cpp index bf74bdaa..9ba930e9 100755 --- a/src/gui/qt/gametable/mystatuslabel.cpp +++ b/src/gui/qt/gametable/mystatuslabel.cpp @@ -16,7 +16,7 @@ using namespace std; MyStatusLabel::MyStatusLabel(QGroupBox* parent) - : QLabel(parent) { + : QLabel(parent), myW(NULL), mousePress(false) { mousePress = FALSE; diff --git a/src/net/chatcleanermanager.h b/src/net/chatcleanermanager.h index eec1495f..8eac1540 100644 --- a/src/net/chatcleanermanager.h +++ b/src/net/chatcleanermanager.h @@ -24,8 +24,8 @@ #include #include #include -#include #include +#include class EncodedPacket; diff --git a/src/net/common/chatcleanermanager.cpp b/src/net/common/chatcleanermanager.cpp index 75401989..2dc8e397 100644 --- a/src/net/common/chatcleanermanager.cpp +++ b/src/net/common/chatcleanermanager.cpp @@ -18,7 +18,6 @@ ***************************************************************************/ #include -#include #include #include #include diff --git a/src/net/common/serveradminbot.cpp b/src/net/common/serveradminbot.cpp index dd91c336..f28e9fdc 100644 --- a/src/net/common/serveradminbot.cpp +++ b/src/net/common/serveradminbot.cpp @@ -34,6 +34,7 @@ using namespace std; ServerAdminBot::ServerAdminBot() +: m_ircRestartTimer(boost::posix_time::time_duration(0, 0, 0), boost::timers::portable::microsec_timer::auto_start) { } diff --git a/src/net/common/serverlobbybot.cpp b/src/net/common/serverlobbybot.cpp index de79d73d..92e291b6 100644 --- a/src/net/common/serverlobbybot.cpp +++ b/src/net/common/serverlobbybot.cpp @@ -34,6 +34,7 @@ using namespace std; ServerLobbyBot::ServerLobbyBot() +: m_ircRestartTimer(boost::posix_time::time_duration(0, 0, 0), boost::timers::portable::microsec_timer::auto_start) { } diff --git a/src/net/common/sessiondata.cpp b/src/net/common/sessiondata.cpp index 1eb4213e..d1d7da55 100644 --- a/src/net/common/sessiondata.cpp +++ b/src/net/common/sessiondata.cpp @@ -23,9 +23,11 @@ using namespace std; SessionData::SessionData(boost::shared_ptr sock, SessionId id, SessionDataCallback &cb) -: m_socket(sock), m_id(id), m_gameId(0), m_state(SessionData::Init), m_readyFlag(false), - m_wantsLobbyMsg(true), m_activityTimeoutNoticeSent(false), m_callback(cb), - m_authSession(NULL), m_curAuthStep(0) +: m_socket(sock), m_id(id), m_gameId(0), m_state(SessionData::Init), m_readyFlag(false), m_wantsLobbyMsg(true), + m_activityTimer(boost::posix_time::time_duration(0, 0, 0), boost::timers::portable::microsec_timer::auto_start), + m_activityTimeoutNoticeSent(false), + m_autoDisconnectTimer(boost::posix_time::time_duration(0, 0, 0), boost::timers::portable::microsec_timer::auto_start), + m_callback(cb), m_authSession(NULL), m_curAuthStep(0) { } diff --git a/src/net/internalchatcleanerpacket.h b/src/net/internalchatcleanerpacket.h index efe80387..83e0782a 100644 --- a/src/net/internalchatcleanerpacket.h +++ b/src/net/internalchatcleanerpacket.h @@ -24,7 +24,9 @@ #define CLEANER_PROTOCOL_VERSION 2 #define MAX_CLEANER_PACKET_SIZE 384 -typedef struct ChatCleanerMessage ChatCleanerMessage_t; +#ifndef ChatCleanerMessage_t + typedef struct ChatCleanerMessage ChatCleanerMessage_t; +#endif class InternalChatCleanerPacket {