aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-03-27 15:33:31 +0100
committerGravatar Sadie Powell2022-03-27 15:41:28 +0100
commited6e19bbd06cdec2a9d75e4c2c338d47d759eecf (patch)
tree29d90503a51c54eafd0ba87bd34b961908d45b48
parentMerge branch 'insp3' into master. (diff)
Fix unsigned/const keyword ordering, remove unnecessary consts.
-rw-r--r--include/hashcomp.h4
-rw-r--r--include/inspircd.h8
-rw-r--r--include/mode.h4
-rw-r--r--src/coremods/core_dns.cpp2
-rw-r--r--src/hashcomp.cpp2
-rw-r--r--src/inspircd.cpp2
-rw-r--r--src/mode.cpp4
-rw-r--r--src/modules/m_spanningtree/netburst.cpp2
-rw-r--r--src/wildcard.cpp10
9 files changed, 19 insertions, 19 deletions
diff --git a/include/hashcomp.h b/include/hashcomp.h
index 10ebd312e..24e66cfc9 100644
--- a/include/hashcomp.h
+++ b/include/hashcomp.h
@@ -49,13 +49,13 @@
* This is provided as a pointer so that modules can change it to their custom mapping tables,
* e.g. for national character support.
*/
-CoreExport extern unsigned const char *national_case_insensitive_map;
+CoreExport extern const unsigned char* national_case_insensitive_map;
/** Case insensitive map, ASCII rules.
* That is;
* [ != {, but A == a.
*/
-CoreExport extern unsigned const char ascii_case_insensitive_map[256];
+CoreExport extern const unsigned char ascii_case_insensitive_map[256];
/** The irc namespace contains a number of helper classes.
*/
diff --git a/include/inspircd.h b/include/inspircd.h
index 3baaa9626..65f6ef133 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -388,8 +388,8 @@ public:
* @param mask The glob pattern to match against.
* @param map The character map to use when matching.
*/
- static bool Match(const std::string& str, const std::string& mask, unsigned const char* map = NULL);
- static bool Match(const char* str, const char* mask, unsigned const char* map = NULL);
+ static bool Match(const std::string& str, const std::string& mask, const unsigned char* map = NULL);
+ static bool Match(const char* str, const char* mask, const unsigned char* map = NULL);
/** Match two strings using pattern matching, optionally, with a map
* to check case against (may be NULL). If map is null, match will be case insensitive.
@@ -398,8 +398,8 @@ public:
* @param mask The glob or CIDR pattern to match against.
* @param map The character map to use when matching.
*/
- static bool MatchCIDR(const std::string& str, const std::string& mask, unsigned const char* map = NULL);
- static bool MatchCIDR(const char* str, const char* mask, unsigned const char* map = NULL);
+ static bool MatchCIDR(const std::string& str, const std::string& mask, const unsigned char* map = NULL);
+ static bool MatchCIDR(const char* str, const char* mask, const unsigned char* map = NULL);
/** Matches a hostname and IP against a space delimited list of hostmasks.
* @param masks The space delimited masks to match against.
diff --git a/include/mode.h b/include/mode.h
index cbc57d57b..1d7437b9c 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -775,7 +775,7 @@ public:
* @param mt type of mode to search for, user or channel
* @returns a pointer to a ModeHandler class, or NULL of there isn't a handler for the given mode
*/
- ModeHandler* FindMode(unsigned const char modeletter, ModeType mt);
+ ModeHandler* FindMode(unsigned char modeletter, ModeType mt);
/** Find the mode handler for the given prefix mode
* @param modeletter The mode letter to search for
@@ -788,7 +788,7 @@ public:
* @param pfxletter The prefix to find, e.g. '@'
* @return The mode handler which handles this prefix, or NULL if there is none.
*/
- PrefixMode* FindPrefix(unsigned const char pfxletter);
+ PrefixMode* FindPrefix(unsigned char pfxletter);
/** Get a list of all mode handlers that inherit from ListModeBase
* @return A list containing ListModeBase modes
diff --git a/src/coremods/core_dns.cpp b/src/coremods/core_dns.cpp
index d8538c698..752766a76 100644
--- a/src/coremods/core_dns.cpp
+++ b/src/coremods/core_dns.cpp
@@ -272,7 +272,7 @@ public:
{
}
- void Fill(const unsigned char* input, const unsigned short len)
+ void Fill(const unsigned char* input, unsigned short len)
{
if (len < HEADER_LENGTH)
throw Exception(creator, "Unable to fill packet");
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp
index 6f68b615f..b9f5dc6d4 100644
--- a/src/hashcomp.cpp
+++ b/src/hashcomp.cpp
@@ -58,7 +58,7 @@
* A case insensitive mapping of characters from upper case to lower case for
* the ASCII character set.
*/
-unsigned const char ascii_case_insensitive_map[256] = {
+const unsigned char ascii_case_insensitive_map[256] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, // 0-9
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, // 10-19
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, // 20-29
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 10440e8fc..9ea707d97 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -60,7 +60,7 @@ InspIRCd* ServerInstance = NULL;
* This is provided as a pointer so that modules can change it to their custom mapping tables,
* e.g. for national character support.
*/
-unsigned const char* national_case_insensitive_map = ascii_case_insensitive_map;
+const unsigned char* national_case_insensitive_map = ascii_case_insensitive_map;
namespace
{
diff --git a/src/mode.cpp b/src/mode.cpp
index 5bd3ba213..17a46da3c 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -705,7 +705,7 @@ ModeHandler* ModeParser::FindMode(const std::string& modename, ModeType mt)
return NULL;
}
-ModeHandler* ModeParser::FindMode(unsigned const char modeletter, ModeType mt)
+ModeHandler* ModeParser::FindMode(unsigned char modeletter, ModeType mt)
{
if (!ModeParser::IsModeChar(modeletter))
return NULL;
@@ -721,7 +721,7 @@ PrefixMode* ModeParser::FindPrefixMode(unsigned char modeletter)
return mh->IsPrefixMode();
}
-PrefixMode* ModeParser::FindPrefix(unsigned const char pfxletter)
+PrefixMode* ModeParser::FindPrefix(unsigned char pfxletter)
{
for (const auto& pm : GetPrefixModes())
{
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp
index aa801dbfb..d4f4c588c 100644
--- a/src/modules/m_spanningtree/netburst.cpp
+++ b/src/modules/m_spanningtree/netburst.cpp
@@ -53,7 +53,7 @@ public:
/** Add a mode to the message
*/
- void push_mode(const char modeletter, const std::string& mask)
+ void push_mode(char modeletter, const std::string& mask)
{
push_raw(modeletter);
params.push_back(' ');
diff --git a/src/wildcard.cpp b/src/wildcard.cpp
index 364051cf1..932027c65 100644
--- a/src/wildcard.cpp
+++ b/src/wildcard.cpp
@@ -24,7 +24,7 @@
#include "inspircd.h"
-static bool MatchInternal(const unsigned char* str, const unsigned char* mask, unsigned const char* map)
+static bool MatchInternal(const unsigned char* str, const unsigned char* mask, const unsigned char* map)
{
const unsigned char* cp = nullptr;
const unsigned char* mp = nullptr;
@@ -76,7 +76,7 @@ static bool MatchInternal(const unsigned char* str, const unsigned char* mask, u
// Below here is all wrappers around MatchInternal
-bool InspIRCd::Match(const std::string& str, const std::string& mask, unsigned const char* map)
+bool InspIRCd::Match(const std::string& str, const std::string& mask, const unsigned char* map)
{
if (!map)
map = national_case_insensitive_map;
@@ -84,7 +84,7 @@ bool InspIRCd::Match(const std::string& str, const std::string& mask, unsigned c
return MatchInternal(reinterpret_cast<const unsigned char*>(str.c_str()), reinterpret_cast<const unsigned char*>(mask.c_str()), map);
}
-bool InspIRCd::Match(const char* str, const char* mask, unsigned const char* map)
+bool InspIRCd::Match(const char* str, const char* mask, const unsigned char* map)
{
if (!map)
map = national_case_insensitive_map;
@@ -92,7 +92,7 @@ bool InspIRCd::Match(const char* str, const char* mask, unsigned const char* map
return MatchInternal(reinterpret_cast<const unsigned char*>(str), reinterpret_cast<const unsigned char*>(mask), map);
}
-bool InspIRCd::MatchCIDR(const std::string& str, const std::string& mask, unsigned const char* map)
+bool InspIRCd::MatchCIDR(const std::string& str, const std::string& mask, const unsigned char* map)
{
if (irc::sockets::MatchCIDR(str, mask, true))
return true;
@@ -101,7 +101,7 @@ bool InspIRCd::MatchCIDR(const std::string& str, const std::string& mask, unsign
return InspIRCd::Match(str, mask, map);
}
-bool InspIRCd::MatchCIDR(const char* str, const char* mask, unsigned const char* map)
+bool InspIRCd::MatchCIDR(const char* str, const char* mask, const unsigned char* map)
{
if (irc::sockets::MatchCIDR(str, mask, true))
return true;