mirror of
https://github.com/anope/anope.git
synced 2026-07-01 06:16:38 +02:00
Removed some unnecessary casts, used C++-style casts over C-style casts, fixed a few warnings (one possibly fatal one).
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2655 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+3
-3
@@ -3,8 +3,8 @@
|
||||
static bool match_internal(const unsigned char *str, const unsigned char *mask, bool case_sensitive)
|
||||
{
|
||||
unsigned char *cp = NULL, *mp = NULL;
|
||||
unsigned char* string = (unsigned char*)str;
|
||||
unsigned char* wild = (unsigned char*)mask;
|
||||
unsigned char *string = const_cast<unsigned char *>(str); // XXX: unsafe cast
|
||||
unsigned char *wild = const_cast<unsigned char *>(mask); // XXX: unsafe cast
|
||||
|
||||
while ((*string) && (*wild != '*'))
|
||||
{
|
||||
@@ -77,5 +77,5 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask,
|
||||
|
||||
CoreExport bool Anope::Match(const std::string &str, const std::string &mask, bool case_sensitive)
|
||||
{
|
||||
return match_internal((const unsigned char *)str.c_str(), (const unsigned char *)mask.c_str(), case_sensitive);
|
||||
return match_internal(reinterpret_cast<const unsigned char *>(str.c_str()), reinterpret_cast<const unsigned char *>(mask.c_str()), case_sensitive);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user