]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix various problems detected by Clang 3.4.
authorPeter Powell <petpow@saberuk.com>
Mon, 10 Feb 2014 20:08:56 +0000 (20:08 +0000)
committerPeter Powell <petpow@saberuk.com>
Tue, 11 Feb 2014 08:20:01 +0000 (08:20 +0000)
- cidr.cpp: remove inverted_bits; unused since 9fad3ecb9215a0034bf407f192926b04cb5efaed.
- cmd_stats.cpp: remove needless inversion and comparison to 0.
- inspircd.cpp: remove needless comparison to 0.
- socket.cpp: remove all_zero; unused since 03a1bf15b1da7643b237c22db1a478916a976ccf.

src/cidr.cpp
src/commands/cmd_stats.cpp
src/inspircd.cpp
src/socket.cpp

index 54f7b83e98d389304b1ca3d545ee55cb75261b93..050a3549da281111ea4ada286058db1f09268032 100644 (file)
 
 #include "inspircd.h"
 
-/* Used when comparing CIDR masks for the modulus bits left over.
- * A lot of ircd's seem to do this:
- * ((-1) << (8 - (mask % 8)))
- * But imho, it sucks in comparison to a nice neat lookup table.
- */
-const unsigned char inverted_bits[8] = {       0x00, /* 00000000 - 0 bits - never actually used */
-                               0x80, /* 10000000 - 1 bits */
-                               0xC0, /* 11000000 - 2 bits */
-                               0xE0, /* 11100000 - 3 bits */
-                               0xF0, /* 11110000 - 4 bits */
-                               0xF8, /* 11111000 - 5 bits */
-                               0xFC, /* 11111100 - 6 bits */
-                               0xFE  /* 11111110 - 7 bits */
-};
-
-
 /* Match CIDR strings, e.g. 127.0.0.1 to 127.0.0.0/8 or 3ffe:1:5:6::8 to 3ffe:1::0/32
- * If you have a lot of hosts to match, youre probably better off building your mask once
- * and then using the lower level MatchCIDRBits directly.
  *
  * This will also attempt to match any leading usernames or nicknames on the mask, using
  * match(), when match_with_username is true.
index 898e89a7d8bbf7828694a49e02ff76bf5412219c..23143442af5726b4a68dbc18ff6c662bd58792c2 100644 (file)
@@ -217,7 +217,7 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results)
                        results.push_back(sn+" 249 "+user->nick+" :Channels: "+ConvToStr(ServerInstance->chanlist->size()));
                        results.push_back(sn+" 249 "+user->nick+" :Commands: "+ConvToStr(ServerInstance->Parser->cmdlist.size()));
 
-                       if (!ServerInstance->Config->WhoWasGroupSize == 0 && !ServerInstance->Config->WhoWasMaxGroups == 0)
+                       if (ServerInstance->Config->WhoWasGroupSize && ServerInstance->Config->WhoWasMaxGroups)
                        {
                                Module* whowas = ServerInstance->Modules->Find("cmd_whowas.so");
                                if (whowas)
index b201e38c6e6e5c71bf0600f61898fa9a4255670b..766aeaf8ef05d92cb4979252aac8423ce7825a0c 100644 (file)
@@ -476,7 +476,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        /* Set the finished argument values */
        Config->cmdline.nofork = (do_nofork != 0);
        Config->cmdline.forcedebug = (do_debug != 0);
-       Config->cmdline.writelog = (!do_nolog != 0);
+       Config->cmdline.writelog = !do_nolog;
        Config->cmdline.TestSuite = (do_testsuite != 0);
 
        if (do_debug)
index a695f8c7328fc3dc8b39dd42fb192dc9d87b6594..e73d01af9c37ed37fbdd1909b95dd83dbba0e5af 100644 (file)
@@ -217,8 +217,6 @@ bool irc::sockets::satoap(const irc::sockets::sockaddrs& sa, std::string& addr,
        return !addr.empty();
 }
 
-static const char all_zero[16] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 };
-
 std::string irc::sockets::sockaddrs::str() const
 {
        char buffer[MAXBUF];