]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix Windows build and most MSVC warnings
authorAttila Molnar <attilamolnar@hush.com>
Fri, 2 Sep 2016 17:58:44 +0000 (19:58 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Fri, 2 Sep 2016 17:58:44 +0000 (19:58 +0200)
include/modules/cap.h
src/coremods/core_stats.cpp
src/modules/m_cap.cpp
src/modules/m_clearchan.cpp

index e6f9340e83b0177669d3d398bd1acfd7a32c79e7..86a60c4459ad0e10f63c56253883eb3e982e009c 100644 (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.
index ee0c50db2c5378068a04d2d41a27c152c0a9cb7a..a282089e37de65ce106024be53775124687e7e73 100644 (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
                }
index e6e01570d83153a0aff3410041f9cca2a1a82260..868294fe4d6fb436a2a3189231e7bfc70bae026f 100644 (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);
index 5fcec36f1777d9567a7dc8d9b9d2a41fe97d665d..4142f81d1709c01864a764b503036966eb964b32 100644 (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;