diff options
author | Peter Powell <petpow@saberuk.com> | 2019-08-13 20:11:11 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-08-13 20:11:11 +0100 |
commit | 2d35c3396a1f00375d45b874dafb9e0bdb520a9b (patch) | |
tree | ba19a394ea07799ea94ec31da6c85646fe3bd6eb /src | |
parent | 0827c5c7425a17b6a569a9f706b5b3dea8fa345a (diff) |
Fix some remaining uses of ato[il].
Diffstat (limited to 'src')
-rw-r--r-- | src/coremods/core_channel/cmode_l.cpp | 2 | ||||
-rw-r--r-- | src/hashcomp.cpp | 10 | ||||
-rw-r--r-- | src/modules/extra/m_pgsql.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_delaymsg.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_xline_db.cpp | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/src/coremods/core_channel/cmode_l.cpp b/src/coremods/core_channel/cmode_l.cpp index d3b806956..7e3135eac 100644 --- a/src/coremods/core_channel/cmode_l.cpp +++ b/src/coremods/core_channel/cmode_l.cpp @@ -32,7 +32,7 @@ ModeChannelLimit::ModeChannelLimit(Module* Creator) bool ModeChannelLimit::ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel*) { /* When TS is equal, the higher channel limit wins */ - return (atoi(their_param.c_str()) < atoi(our_param.c_str())); + return ConvToNum<intptr_t>(their_param) < ConvToNum<intptr_t>(our_param); } ModeAction ModeChannelLimit::OnSet(User* user, Channel* chan, std::string& parameter) diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 4fee9fd55..ae9cf6e76 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -340,7 +340,7 @@ long irc::portparser::GetToken() if (x.empty()) return 0; - while (Overlaps(atoi(x.c_str()))) + while (Overlaps(ConvToNum<long>(x))) { if (!sep.GetToken(x)) return 0; @@ -350,8 +350,8 @@ long irc::portparser::GetToken() if (dash != std::string::npos) { std::string sbegin(x, 0, dash); - range_begin = atoi(sbegin.c_str()); - range_end = atoi(x.c_str()+dash+1); + range_begin = ConvToNum<long>(sbegin); + range_end = ConvToNum<long>(x.c_str() + dash + 1); if ((range_begin > 0) && (range_end > 0) && (range_begin < 65536) && (range_end < 65536) && (range_begin < range_end)) { @@ -361,11 +361,11 @@ long irc::portparser::GetToken() else { /* Assume its just the one port */ - return atoi(sbegin.c_str()); + return ConvToNum<long>(sbegin); } } else { - return atoi(x.c_str()); + return ConvToNum<long>(x); } } diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index 5d059ec9c..37cf92704 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -103,7 +103,7 @@ class PgSQLresult : public SQL::Result { rows = PQntuples(res); if (!rows) - rows = atoi(PQcmdTuples(res)); + rows = ConvToNum<int>(PQcmdTuples(res)); } ~PgSQLresult() diff --git a/src/modules/m_delaymsg.cpp b/src/modules/m_delaymsg.cpp index 04d4119c7..cf26df8c1 100644 --- a/src/modules/m_delaymsg.cpp +++ b/src/modules/m_delaymsg.cpp @@ -34,7 +34,7 @@ class DelayMsgMode : public ParamMode<DelayMsgMode, LocalIntExt> bool ResolveModeConflict(std::string& their_param, const std::string& our_param, Channel*) CXX11_OVERRIDE { - return (atoi(their_param.c_str()) < atoi(our_param.c_str())); + return ConvToNum<intptr_t>(their_param) < ConvToNum<intptr_t>(our_param); } ModeAction OnSet(User* source, Channel* chan, std::string& parameter) CXX11_OVERRIDE; diff --git a/src/modules/m_xline_db.cpp b/src/modules/m_xline_db.cpp index 00605f259..97531aae8 100644 --- a/src/modules/m_xline_db.cpp +++ b/src/modules/m_xline_db.cpp @@ -211,8 +211,8 @@ class ModuleXLineDB continue; } - XLine* xl = xlf->Generate(ServerInstance->Time(), atoi(command_p[5].c_str()), command_p[3], command_p[6], command_p[2]); - xl->SetCreateTime(atoi(command_p[4].c_str())); + XLine* xl = xlf->Generate(ServerInstance->Time(), ConvToNum<unsigned long>(command_p[5]), command_p[3], command_p[6], command_p[2]); + xl->SetCreateTime(ConvToNum<time_t>(command_p[4])); if (ServerInstance->XLines->AddLine(xl, NULL)) { |