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.
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
}
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);
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;