diff options
-rw-r--r-- | include/modules/cap.h | 2 | ||||
-rw-r--r-- | src/coremods/core_stats.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_cap.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_clearchan.cpp | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/include/modules/cap.h b/include/modules/cap.h index e6f9340e8..86a60c445 100644 --- a/include/modules/cap.h +++ b/include/modules/cap.h @@ -197,7 +197,7 @@ namespace Cap if (!IsRegistered()) return false; Ext caps = extitem->get(user); - return (caps & GetMask()); + return ((caps & GetMask()) != 0); } /** Turn the capability on/off for a user. If the cap is not registered this method has no effect. diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp index ee0c50db2..a282089e3 100644 --- a/src/coremods/core_stats.cpp +++ b/src/coremods/core_stats.cpp @@ -307,7 +307,7 @@ void CommandStats::DoStats(Stats::Context& stats) n_eaten = (double)(( (uint64_t)(KernelTime.dwHighDateTime) << 32 ) + (uint64_t)(KernelTime.dwLowDateTime))/100000; per = (n_eaten / n_elapsed); snprintf(percent, 30, "%03.5f%%", per); - stats.AddRow(249, std::string("CPU Use (total): ")+percent)); + stats.AddRow(249, std::string("CPU Use (total): ")+percent); } #endif } diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index e6e01570d..868294fe4 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -55,7 +55,8 @@ class Cap::ManagerImpl : public Cap::Manager, public ReloadModule::EventListener static bool CanRequest(LocalUser* user, Ext usercaps, Capability* cap, bool adding) { - if ((usercaps & cap->GetMask()) == adding) + const bool hascap = ((usercaps & cap->GetMask()) != 0); + if (hascap == adding) return true; return cap->OnRequest(user, adding); diff --git a/src/modules/m_clearchan.cpp b/src/modules/m_clearchan.cpp index 5fcec36f1..4142f81d1 100644 --- a/src/modules/m_clearchan.cpp +++ b/src/modules/m_clearchan.cpp @@ -119,7 +119,7 @@ class CommandClearChan : public Command mask = ((method[0] == 'Z') ? curr->GetIPString() : "*@" + curr->host); xline = xlf->Generate(ServerInstance->Time(), 60*60, user->nick, reason, mask); } - catch (ModuleException& ex) + catch (ModuleException&) { // Nothing, move on to the next user continue; |