summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-05-24 16:51:33 +0100
committerSadie Powell <sadie@witchery.services>2025-05-24 16:54:49 +0100
commit23e72fc934eae5a5fadde21102ec342840956c1f (patch)
tree3e53a265383c88777badf9a9328774be80c77645
parente182519e4d2f35c9fed070c9fb5004276c865070 (diff)
Convert Anope::Debug to an unsigned value.
-rw-r--r--include/anope.h2
-rw-r--r--language/anope.en_US.po6
-rw-r--r--modules/operserv/os_set.cpp4
-rw-r--r--src/init.cpp7
-rw-r--r--src/main.cpp2
5 files changed, 10 insertions, 11 deletions
diff --git a/include/anope.h b/include/anope.h
index 618592090..3cc6b602d 100644
--- a/include/anope.h
+++ b/include/anope.h
@@ -379,7 +379,7 @@ namespace Anope
/** The debug level we are running at.
*/
- extern CoreExport int Debug;
+ extern CoreExport unsigned Debug;
/** Other command line options.
*/
diff --git a/language/anope.en_US.po b/language/anope.en_US.po
index e8c67f566..0cb1c20d7 100644
--- a/language/anope.en_US.po
+++ b/language/anope.en_US.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Anope\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-05-10 14:34+0100\n"
-"PO-Revision-Date: 2025-04-25 13:08+0100\n"
+"POT-Creation-Date: 2025-05-24 16:43+0100\n"
+"PO-Revision-Date: 2025-05-24 16:44+0100\n"
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
"Language-Team: English\n"
"Language: en_US\n"
@@ -4555,7 +4555,7 @@ msgid "Services are now at DEFCON %d."
msgstr ""
#, c-format
-msgid "Services are now in debug mode (level %d)."
+msgid "Services are now in debug mode (level %u)."
msgstr ""
msgid "Services are now in debug mode."
diff --git a/modules/operserv/os_set.cpp b/modules/operserv/os_set.cpp
index 16d319ab9..5eefebe4d 100644
--- a/modules/operserv/os_set.cpp
+++ b/modules/operserv/os_set.cpp
@@ -122,12 +122,12 @@ private:
}
else
{
- auto debug = Anope::TryConvert<int>(setting);
+ auto debug = Anope::TryConvert<unsigned>(setting);
if (debug.has_value())
{
Anope::Debug = debug.value();
Log(LOG_ADMIN, source, this) << "DEBUG " << Anope::Debug;
- source.Reply(_("Services are now in \002debug\002 mode (level %d)."), Anope::Debug);
+ source.Reply(_("Services are now in \002debug\002 mode (level %u)."), Anope::Debug);
return;
}
diff --git a/src/init.cpp b/src/init.cpp
index 89a946a98..282ec8957 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -390,11 +390,10 @@ bool Anope::Init(int ac, char **av)
{
if (!arg.empty())
{
- auto level = Anope::Convert<int>(arg, -1);
- if (level > 0)
- Anope::Debug = level;
- else
+ auto level = Anope::TryConvert<unsigned>(arg);
+ if (!level.has_value())
throw CoreException("Invalid option given to --debug");
+ Anope::Debug = level.value();
}
else
++Anope::Debug;
diff --git a/src/main.cpp b/src/main.cpp
index 283d7146e..fcb3efe89 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -23,7 +23,7 @@
#endif
/* Command-line options: */
-int Anope::Debug = 0;
+unsigned Anope::Debug = 0;
bool Anope::ReadOnly = false, Anope::NoFork = false, Anope::NoThird = false, Anope::NoPID = false, Anope::NoExpire = false, Anope::ProtocolDebug = false;
Anope::string Anope::ServicesDir;
Anope::string Anope::ServicesBin;