diff options
author | Sadie Powell <sadie@witchery.services> | 2023-11-16 21:49:48 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2023-11-16 21:49:48 +0000 |
commit | 70d72b62df3045590297eceba5649b8417dc3f4a (patch) | |
tree | 2f2d10eb8c1d8207d0fe8b8e27cd90b3d7b76908 | |
parent | 46209895e3f46f183a293fe26e26bdfdc2423e8d (diff) |
Avoid needing to cast CurrentUplink by changing it to a size_t.
-rw-r--r-- | include/anope.h | 2 | ||||
-rw-r--r-- | src/main.cpp | 2 | ||||
-rw-r--r-- | src/uplink.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/include/anope.h b/include/anope.h index 22094cf1d..4a2c1074e 100644 --- a/include/anope.h +++ b/include/anope.h @@ -384,7 +384,7 @@ namespace Anope /** The uplink we are currently connected to */ - extern CoreExport int CurrentUplink; + extern CoreExport size_t CurrentUplink; /** Various methods to determine the Anope version running */ diff --git a/src/main.cpp b/src/main.cpp index b41c591d7..e8e1a6a41 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,7 +39,7 @@ static Anope::string BinaryDir; /* Full path to services bin directory */ time_t Anope::StartTime = time(NULL); time_t Anope::CurTime = time(NULL); -int Anope::CurrentUplink = -1; +size_t Anope::CurrentUplink = -1; class UpdateTimer : public Timer { diff --git a/src/uplink.cpp b/src/uplink.cpp index 67599c2d6..4d49b93d6 100644 --- a/src/uplink.cpp +++ b/src/uplink.cpp @@ -43,7 +43,7 @@ void Uplink::Connect() return; } - if (static_cast<unsigned>(++Anope::CurrentUplink) >= Config->Uplinks.size()) + if (++Anope::CurrentUplink >= Config->Uplinks.size()) Anope::CurrentUplink = 0; Configuration::Uplink &u = Config->Uplinks[Anope::CurrentUplink]; |