From f83687cc5e99d66153c296e7632b88de2594b79d Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 24 Jan 2014 20:36:45 +0100 Subject: reverse the order of the user modes bitfield; top bit = highest power mode --- bouncer/ircserver.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bouncer/ircserver.cpp b/bouncer/ircserver.cpp index f13a481..ecf5c64 100644 --- a/bouncer/ircserver.cpp +++ b/bouncer/ircserver.cpp @@ -359,14 +359,14 @@ void IRCServer::processISupport(const char *line) { uint32_t IRCServer::getUserFlag(char search, const char *array) const { - uint32_t flag = 1; + uint32_t flag = 0x80000000; // Is this character a valid prefix? while (*array != 0) { if (*array == search) return flag; - flag <<= 1; + flag >>= 1; ++array; } } @@ -393,7 +393,7 @@ int IRCServer::getChannelModeType(char mode) const { } char IRCServer::getEffectivePrefixChar(uint32_t modes) const { - uint32_t flag = 1; + uint32_t flag = 0x80000000; const char *prefixes = serverPrefix; while (*prefixes != 0) { @@ -401,7 +401,7 @@ char IRCServer::getEffectivePrefixChar(uint32_t modes) const { return *prefixes; ++prefixes; - flag <<= 1; + flag >>= 1; } return 0; -- cgit v1.2.3