Fixing cppcheck issues.
This commit is contained in:
@@ -102,8 +102,6 @@ CleanerConfig::CleanerConfig()
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
string userDir = configFileName.c_str();
|
|
||||||
|
|
||||||
ostringstream tempIntToString;
|
ostringstream tempIntToString;
|
||||||
tempIntToString << configRev;
|
tempIntToString << configRev;
|
||||||
|
|
||||||
@@ -507,7 +505,6 @@ list<int> CleanerConfig::readConfigIntList(string varName) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
istringstream isst;
|
istringstream isst;
|
||||||
string tempString;
|
|
||||||
int tempInt;
|
int tempInt;
|
||||||
list<string>::iterator it;
|
list<string>::iterator it;
|
||||||
for(it = tempStringList.begin(); it != tempStringList.end(); ++it) {
|
for(it = tempStringList.begin(); it != tempStringList.end(); ++it) {
|
||||||
@@ -527,7 +524,6 @@ void CleanerConfig::writeConfigInt(string varName, int varCont)
|
|||||||
{
|
{
|
||||||
|
|
||||||
size_t i;
|
size_t i;
|
||||||
string tempString;
|
|
||||||
ostringstream intToString;
|
ostringstream intToString;
|
||||||
|
|
||||||
for (i=0; i<configBufferList.size(); i++) {
|
for (i=0; i<configBufferList.size(); i++) {
|
||||||
@@ -550,7 +546,6 @@ void CleanerConfig::writeConfigIntList(string varName, list<int> varCont)
|
|||||||
for (i=0; i<configBufferList.size(); i++) {
|
for (i=0; i<configBufferList.size(); i++) {
|
||||||
|
|
||||||
if (configBufferList[i].name == varName) {
|
if (configBufferList[i].name == varName) {
|
||||||
string tempString;
|
|
||||||
list<int>::iterator it;
|
list<int>::iterator it;
|
||||||
for(it = varCont.begin(); it != varCont.end(); ++it) {
|
for(it = varCont.begin(); it != varCont.end(); ++it) {
|
||||||
|
|
||||||
@@ -569,7 +564,6 @@ void CleanerConfig::writeConfigStringList(string varName, list<string> varCont)
|
|||||||
{
|
{
|
||||||
|
|
||||||
size_t i;
|
size_t i;
|
||||||
list<string> stringList;
|
|
||||||
|
|
||||||
for (i=0; i<configBufferList.size(); i++) {
|
for (i=0; i<configBufferList.size(); i++) {
|
||||||
|
|
||||||
|
|||||||
@@ -697,7 +697,6 @@ list<int> ConfigFile::readConfigIntList(string varName) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
istringstream isst;
|
istringstream isst;
|
||||||
string tempString;
|
|
||||||
int tempInt;
|
int tempInt;
|
||||||
list<string>::iterator it;
|
list<string>::iterator it;
|
||||||
for(it = tempStringList.begin(); it != tempStringList.end(); ++it) {
|
for(it = tempStringList.begin(); it != tempStringList.end(); ++it) {
|
||||||
@@ -734,7 +733,6 @@ void ConfigFile::writeConfigInt(string varName, int varCont)
|
|||||||
boost::recursive_mutex::scoped_lock lock(m_configMutex);
|
boost::recursive_mutex::scoped_lock lock(m_configMutex);
|
||||||
|
|
||||||
size_t i;
|
size_t i;
|
||||||
string tempString;
|
|
||||||
ostringstream intToString;
|
ostringstream intToString;
|
||||||
|
|
||||||
for (i=0; i<configBufferList.size(); i++) {
|
for (i=0; i<configBufferList.size(); i++) {
|
||||||
@@ -757,7 +755,6 @@ void ConfigFile::writeConfigIntList(string varName, list<int> varCont)
|
|||||||
for (i=0; i<configBufferList.size(); i++) {
|
for (i=0; i<configBufferList.size(); i++) {
|
||||||
|
|
||||||
if (configBufferList[i].name == varName) {
|
if (configBufferList[i].name == varName) {
|
||||||
string tempString;
|
|
||||||
list<int>::iterator it;
|
list<int>::iterator it;
|
||||||
for(it = varCont.begin(); it != varCont.end(); ++it) {
|
for(it = varCont.begin(); it != varCont.end(); ++it) {
|
||||||
|
|
||||||
|
|||||||
@@ -159,7 +159,6 @@ void LocalBeRo::run()
|
|||||||
|
|
||||||
bool allHighestSet = true;
|
bool allHighestSet = true;
|
||||||
|
|
||||||
PlayerListIterator it;
|
|
||||||
PlayerListIterator it_c;
|
PlayerListIterator it_c;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -405,7 +405,6 @@ void LocalHand::assignButtons()
|
|||||||
|
|
||||||
size_t i;
|
size_t i;
|
||||||
PlayerListIterator it;
|
PlayerListIterator it;
|
||||||
PlayerListConstIterator it_c;
|
|
||||||
|
|
||||||
// delete all buttons
|
// delete all buttons
|
||||||
for (it=seatsList->begin(); it!=seatsList->end(); ++it) {
|
for (it=seatsList->begin(); it!=seatsList->end(); ++it) {
|
||||||
|
|||||||
@@ -1876,13 +1876,13 @@ void gameTableImpl::meInAction()
|
|||||||
myActionIsRaise = 0;
|
myActionIsRaise = 0;
|
||||||
myActionIsBet = 0;
|
myActionIsBet = 0;
|
||||||
|
|
||||||
if(myConfig->readConfigInt("ShowStatusbarMessages")) {
|
/* if(myConfig->readConfigInt("ShowStatusbarMessages")) {
|
||||||
if ( myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ) {
|
if ( myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ) {
|
||||||
// // statusBar()->showMessage(tr("F1 - Fold | F2 - Check/Call | F3 - Bet/Raise | F4 - All-In"), 15000);
|
// // statusBar()->showMessage(tr("F1 - Fold | F2 - Check/Call | F3 - Bet/Raise | F4 - All-In"), 15000);
|
||||||
} else {
|
} else {
|
||||||
// statusBar()->showMessage(tr("F1 - All-In | F2 - Bet/Raise | F3 - Check/Call | F4 - Fold"), 15000);
|
// statusBar()->showMessage(tr("F1 - All-In | F2 - Bet/Raise | F3 - Check/Call | F4 - Fold"), 15000);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
QString lastPushButtonFoldString = pushButton_Fold->text();
|
QString lastPushButtonFoldString = pushButton_Fold->text();
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,6 @@ void MyAvatarLabel::setPlayerRating(QString playerInfo)
|
|||||||
int found=0;
|
int found=0;
|
||||||
QStringList playerInfoList=playerInfo.split("\"", QString::KeepEmptyParts, Qt::CaseSensitive), tipInfo;
|
QStringList playerInfoList=playerInfo.split("\"", QString::KeepEmptyParts, Qt::CaseSensitive), tipInfo;
|
||||||
boost::shared_ptr<Game> currentGame = myW->myStartWindow->getSession()->getCurrentGame();
|
boost::shared_ptr<Game> currentGame = myW->myStartWindow->getSession()->getCurrentGame();
|
||||||
PlayerListConstIterator it_c;
|
|
||||||
PlayerList seatsList = currentGame->getSeatsList();
|
PlayerList seatsList = currentGame->getSeatsList();
|
||||||
std::list<std::string> tipsList = myW->getMyConfig()->readConfigStringList("PlayerTooltips");
|
std::list<std::string> tipsList = myW->getMyConfig()->readConfigStringList("PlayerTooltips");
|
||||||
std::list<std::string> result;
|
std::list<std::string> result;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ struct IrcContext {
|
|||||||
|
|
||||||
void irc_auto_rename_nick(irc_session_t *session)
|
void irc_auto_rename_nick(irc_session_t *session)
|
||||||
{
|
{
|
||||||
IrcContext *context = (IrcContext *) irc_get_ctx(session);
|
IrcContext *context = static_cast<IrcContext *>(irc_get_ctx(session));
|
||||||
|
|
||||||
if (context->renameTries <= IRC_MAX_RENAME_TRIES) { // Limit number of rename tries.
|
if (context->renameTries <= IRC_MAX_RENAME_TRIES) { // Limit number of rename tries.
|
||||||
// Automatically rename the nick on collision.
|
// Automatically rename the nick on collision.
|
||||||
@@ -85,7 +85,7 @@ void irc_auto_rename_nick(irc_session_t *session)
|
|||||||
|
|
||||||
void irc_notify_player_list(irc_session_t *session, const char *players)
|
void irc_notify_player_list(irc_session_t *session, const char *players)
|
||||||
{
|
{
|
||||||
IrcContext *context = (IrcContext *) irc_get_ctx(session);
|
IrcContext *context = static_cast<IrcContext *>(irc_get_ctx(session));
|
||||||
|
|
||||||
istringstream input(players);
|
istringstream input(players);
|
||||||
string name;
|
string name;
|
||||||
@@ -98,7 +98,7 @@ void irc_notify_player_list(irc_session_t *session, const char *players)
|
|||||||
|
|
||||||
void irc_handle_server_error(irc_session_t *session, unsigned irc_error_code)
|
void irc_handle_server_error(irc_session_t *session, unsigned irc_error_code)
|
||||||
{
|
{
|
||||||
IrcContext *context = (IrcContext *) irc_get_ctx(session);
|
IrcContext *context = static_cast<IrcContext *>(irc_get_ctx(session));
|
||||||
|
|
||||||
context->ircThread.GetCallback().SignalIrcServerError(irc_error_code);
|
context->ircThread.GetCallback().SignalIrcServerError(irc_error_code);
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,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 = static_cast<IrcContext *>(irc_get_ctx(session));
|
||||||
|
|
||||||
context->ircThread.GetCallback().SignalIrcConnect(origin);
|
context->ircThread.GetCallback().SignalIrcConnect(origin);
|
||||||
irc_cmd_join(session, context->channel.c_str(), context->channelPassword.c_str());
|
irc_cmd_join(session, context->channel.c_str(), context->channelPassword.c_str());
|
||||||
@@ -116,7 +116,7 @@ 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 = static_cast<IrcContext *>(irc_get_ctx(session));
|
||||||
|
|
||||||
if (context->nick == origin)
|
if (context->nick == origin)
|
||||||
context->ircThread.GetCallback().SignalIrcSelfJoined(context->nick, context->channel);
|
context->ircThread.GetCallback().SignalIrcSelfJoined(context->nick, context->channel);
|
||||||
@@ -128,7 +128,7 @@ 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 = static_cast<IrcContext *>(irc_get_ctx(session));
|
||||||
|
|
||||||
if (count && 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)
|
||||||
@@ -141,7 +141,7 @@ 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 = static_cast<IrcContext *>(irc_get_ctx(session));
|
||||||
|
|
||||||
string byWhom(origin);
|
string byWhom(origin);
|
||||||
string who;
|
string who;
|
||||||
@@ -159,7 +159,7 @@ 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 = static_cast<IrcContext *>(irc_get_ctx(session));
|
||||||
|
|
||||||
context->ircThread.GetCallback().SignalIrcPlayerLeft(origin);
|
context->ircThread.GetCallback().SignalIrcPlayerLeft(origin);
|
||||||
}
|
}
|
||||||
@@ -167,7 +167,7 @@ irc_event_leave(irc_session_t *session, const char * /*irc_event*/, const char *
|
|||||||
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 = static_cast<IrcContext *>(irc_get_ctx(session));
|
||||||
|
|
||||||
if (count >= 2 && boost::algorithm::iequals(context->channel, params[0])) { // check whether this message is for our channel
|
if (count >= 2 && boost::algorithm::iequals(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.
|
||||||
@@ -179,7 +179,7 @@ irc_event_channel(irc_session_t *session, const char * /*irc_event*/, const char
|
|||||||
void
|
void
|
||||||
irc_event_unknown(irc_session_t *session, const char * irc_event, const char * /*origin*/, const char ** /*params*/, unsigned /*count*/)
|
irc_event_unknown(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 = static_cast<IrcContext *>(irc_get_ctx(session));
|
||||||
|
|
||||||
if (boost::algorithm::iequals(irc_event, "PONG")) {
|
if (boost::algorithm::iequals(irc_event, "PONG")) {
|
||||||
context->sendingBlocked = false;
|
context->sendingBlocked = false;
|
||||||
|
|||||||
@@ -253,11 +253,11 @@ ServerLobbyThread::AddConnection(boost::shared_ptr<tcp::socket> sock)
|
|||||||
sessionData->StartTimerGlobalTimeout(SERVER_SESSION_FORCED_TIMEOUT_SEC);
|
sessionData->StartTimerGlobalTimeout(SERVER_SESSION_FORCED_TIMEOUT_SEC);
|
||||||
sessionData->StartTimerActivityTimeout(SERVER_SESSION_ACTIVITY_TIMEOUT_SEC, SERVER_TIMEOUT_WARNING_REMAINING_SEC);
|
sessionData->StartTimerActivityTimeout(SERVER_SESSION_ACTIVITY_TIMEOUT_SEC, SERVER_TIMEOUT_WARNING_REMAINING_SEC);
|
||||||
|
|
||||||
bool hasClientIp = false;
|
|
||||||
unsigned numLobbySessions = m_sessionManager.GetRawSessionCount();
|
unsigned numLobbySessions = m_sessionManager.GetRawSessionCount();
|
||||||
unsigned numGameSessions = m_gameSessionManager.GetRawSessionCount();
|
unsigned numGameSessions = m_gameSessionManager.GetRawSessionCount();
|
||||||
if (numLobbySessions <= SERVER_MAX_NUM_LOBBY_SESSIONS
|
if (numLobbySessions <= SERVER_MAX_NUM_LOBBY_SESSIONS
|
||||||
&& numLobbySessions + numGameSessions <= SERVER_MAX_NUM_TOTAL_SESSIONS) {
|
&& numLobbySessions + numGameSessions <= SERVER_MAX_NUM_TOTAL_SESSIONS) {
|
||||||
|
bool hasClientIp = false;
|
||||||
boost::system::error_code errCode;
|
boost::system::error_code errCode;
|
||||||
tcp::endpoint clientEndpoint = sock->remote_endpoint(errCode);
|
tcp::endpoint clientEndpoint = sock->remote_endpoint(errCode);
|
||||||
if (!errCode) {
|
if (!errCode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user