Fix Windows build and most MSVC warnings

This commit is contained in:
Attila Molnar 2016-09-02 19:58:44 +02:00
parent f673caf8a8
commit 65667e7cc2
4 changed files with 5 additions and 4 deletions

View File

@ -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.

View File

@ -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
}

View File

@ -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);

View File

@ -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;