From 8adda0dca4cb94be6a071e67b3e3c89a22375aca Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 18 Mar 2025 13:12:28 +0000 Subject: Add a formatting overload of the ModuleException constructor. --- src/mode.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/mode.cpp') diff --git a/src/mode.cpp b/src/mode.cpp index 48d2663f6..125506ffc 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -563,7 +563,7 @@ ModeHandler::Id ModeParser::AllocateModeId(ModeHandler* mh) void ModeParser::AddMode(ModeHandler* mh) { if (!ModeParser::IsModeChar(mh->GetModeChar())) - throw ModuleException(mh->creator, INSP_FORMAT("Mode letter for {} is invalid: {}", mh->name, mh->GetModeChar())); + throw ModuleException(mh->creator, "Mode letter for {} is invalid: {}", mh->name, mh->GetModeChar()); /* A mode prefix of ',' is not acceptable, it would fuck up server to server. * A mode prefix of ':' will fuck up both server to server, and client to server. @@ -573,21 +573,21 @@ void ModeParser::AddMode(ModeHandler* mh) if (pm) { if ((pm->GetPrefix() > 126) || (pm->GetPrefix() == ',') || (pm->GetPrefix() == ':') || ServerInstance->Channels.IsPrefix(pm->GetPrefix())) - throw ModuleException(mh->creator, INSP_FORMAT("Mode prefix for {} is invalid: {}", mh->name, pm->GetPrefix())); + throw ModuleException(mh->creator, "Mode prefix for {} is invalid: {}", mh->name, pm->GetPrefix()); PrefixMode* otherpm = FindPrefix(pm->GetPrefix()); if (otherpm) { - throw ModuleException(mh->creator, INSP_FORMAT("Mode prefix for {} already used by {} from {}: {}", - mh->name, otherpm->name, otherpm->creator->ModuleFile, pm->GetPrefix())); + throw ModuleException(mh->creator, "Mode prefix for {} already used by {} from {}: {}", + mh->name, otherpm->name, otherpm->creator->ModuleFile, pm->GetPrefix()); } } ModeHandler*& slot = modehandlers[mh->GetModeType()][ModeParser::GetModeIndex(mh->GetModeChar())]; if (slot) { - throw ModuleException(mh->creator, INSP_FORMAT("Mode letter for {} already used by {} from {}: {}", - mh->name, slot->name, slot->creator->ModuleFile, mh->GetModeChar())); + throw ModuleException(mh->creator, "Mode letter for {} already used by {} from {}: {}", + mh->name, slot->name, slot->creator->ModuleFile, mh->GetModeChar()); } // The mode needs an id if it is either a user mode, a simple mode (flag) or a parameter mode. @@ -600,8 +600,8 @@ void ModeParser::AddMode(ModeHandler* mh) if (!res.second) { ModeHandler* othermh = res.first->second; - throw ModuleException(mh->creator, INSP_FORMAT("Mode name {} already used by {} from {}", - mh->name, othermh->GetModeChar(), othermh->creator->ModuleFile)); + throw ModuleException(mh->creator, "Mode name {} already used by {} from {}", + mh->name, othermh->GetModeChar(), othermh->creator->ModuleFile); } // Everything is fine, add the mode -- cgit v1.3.1-10-gc9f91