From f9911dde529adf3dc03f4f14bbd70756ac2f665c Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 2 Mar 2025 14:51:02 +0000 Subject: Return references instead of pointers from the config system. We used to return NULL from these methods but now we return an empty block so this can never actually be null now. --- modules/encryption/enc_bcrypt.cpp | 6 +++--- modules/encryption/enc_sha2.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/encryption') diff --git a/modules/encryption/enc_bcrypt.cpp b/modules/encryption/enc_bcrypt.cpp index 648f95834..1ac37e1fe 100644 --- a/modules/encryption/enc_bcrypt.cpp +++ b/modules/encryption/enc_bcrypt.cpp @@ -165,11 +165,11 @@ public: } } - void OnReload(Configuration::Conf *conf) override + void OnReload(Configuration::Conf &conf) override { - auto *block = conf->GetModule(this); + auto &block = conf.GetModule(this); - auto rounds = block->Get("rounds", "10"); + auto rounds = block.Get("rounds", "10"); if (rounds < 10 || rounds > 32) { Log(this) << "Bcrypt rounds MUST be between 10 and 32 inclusive; using 10 instead of " << rounds << '.'; diff --git a/modules/encryption/enc_sha2.cpp b/modules/encryption/enc_sha2.cpp index 11c0e76f6..4e60d330d 100644 --- a/modules/encryption/enc_sha2.cpp +++ b/modules/encryption/enc_sha2.cpp @@ -126,9 +126,9 @@ public: }); } - void OnReload(Configuration::Conf *conf) override + void OnReload(Configuration::Conf &conf) override { - this->defaultprovider = GetAlgorithm(Config->GetModule(this)->Get("algorithm", "sha256")); + this->defaultprovider = GetAlgorithm(Config->GetModule(this).Get("algorithm", "sha256")); } EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) override -- cgit