0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 15:30:52 +01:00

Convert 2.8 style ToUpper/ToLower names to irctoupper/irctolower

This commit is contained in:
Elizabeth Myers 2016-03-07 19:04:24 -06:00
parent 3a29f678cf
commit 7e6b5384b3
6 changed files with 22 additions and 22 deletions

View file

@ -81,11 +81,11 @@ extern char *canonize(char *);
/*
* character macros
*/
extern const unsigned char ToLowerTab[];
#define ToLower(c) (ToLowerTab[(unsigned char)(c)])
extern const unsigned char irctolower_tab[];
#define irctolower(c) (irctolower_tab[(unsigned char)(c)])
extern const unsigned char ToUpperTab[];
#define ToUpper(c) (ToUpperTab[(unsigned char)(c)])
extern const unsigned char irctoupper_tab[];
#define irctoupper(c) (irctoupper_tab[(unsigned char)(c)])
extern const unsigned int CharAttrs[];
@ -143,7 +143,7 @@ static inline void irccasecanon(char *str)
{
while (*str)
{
*str = ToUpper(*str);
*str = irctoupper(*str);
str++;
}
return;

View file

@ -401,7 +401,7 @@ pretty_mask(const char *idmask)
*t = '~';
if (*t == '~')
t++;
*t = ToLower(*t);
*t = irctolower(*t);
return mask_buf + old_mask_pos;
}

View file

@ -42,7 +42,7 @@ match_extban(const char *banstr, struct Client *client_p, struct Channel *chptr,
invert = 1;
p++;
}
f = extban_table[(unsigned char) ToLower(*p)];
f = extban_table[(unsigned char) irctolower(*p)];
if (*p != '\0')
{
p++;
@ -74,7 +74,7 @@ valid_extban(const char *banstr, struct Client *client_p, struct Channel *chptr,
p = banstr + 1;
if (*p == '~')
p++;
f = extban_table[(unsigned char) ToLower(*p)];
f = extban_table[(unsigned char) irctolower(*p)];
if (*p != '\0')
{
p++;
@ -99,7 +99,7 @@ get_extban_string(void)
j = 0;
for (i = 1; i < 256; i++)
if (i == ToLower(i) && extban_table[i])
if (i == irctolower(i) && extban_table[i])
e[j++] = i;
e[j] = 0;
return e;

View file

@ -78,7 +78,7 @@ fnv_hash_upper(const unsigned char *s, int bits)
while (*s)
{
h ^= ToUpper(*s++);
h ^= irctoupper(*s++);
h += (h<<1) + (h<<4) + (h<<7) + (h << 8) + (h << 24);
}
if (bits < 32)
@ -123,7 +123,7 @@ fnv_hash_upper_len(const unsigned char *s, int bits, int len)
const unsigned char *x = s + len;
while (*s && s < x)
{
h ^= ToUpper(*s++);
h ^= irctoupper(*s++);
h += (h<<1) + (h<<4) + (h<<7) + (h << 8) + (h << 24);
}
if (bits < 32)

View file

@ -178,7 +178,7 @@ hash_text(const char *start)
while(*p)
{
h = (h << 4) - (h + (unsigned char) ToLower(*p++));
h = (h << 4) - (h + (unsigned char) irctolower(*p++));
}
return (h & (ATABLE_SIZE - 1));

View file

@ -88,14 +88,14 @@ int match(const char *mask, const char *name)
else
{
m_tmp = m;
for (n_tmp = n; *n && ToLower(*n) != ToLower(*m); n++);
for (n_tmp = n; *n && irctolower(*n) != irctolower(*m); n++);
}
}
/* and fall through */
default:
if (!*n)
return (*m != '\0' ? 0 : 1);
if (ToLower(*m) != ToLower(*n))
if (irctolower(*m) != irctolower(*n))
goto backtrack;
m++;
n++;
@ -160,14 +160,14 @@ int mask_match(const char *mask, const char *name)
else
{
m_tmp = m;
for (n_tmp = n; *n && ToLower(*n) != ToLower(*m); n++);
for (n_tmp = n; *n && irctolower(*n) != irctolower(*m); n++);
}
}
/* and fall through */
default:
if (!*n)
return (*m != '\0' ? 0 : 1);
if (ToLower(*m) != ToLower(*n))
if (irctolower(*m) != irctolower(*n))
goto backtrack;
m++;
n++;
@ -281,7 +281,7 @@ match_esc(const char *mask, const char *name)
}
if(quote)
match1 = *m == 's' ? *n == ' ' : ToLower(*m) == ToLower(*n);
match1 = *m == 's' ? *n == ' ' : irctolower(*m) == irctolower(*n);
else if(*m == '?')
match1 = 1;
else if(*m == '@')
@ -289,7 +289,7 @@ match_esc(const char *mask, const char *name)
else if(*m == '#')
match1 = IsDigit(*n);
else
match1 = ToLower(*m) == ToLower(*n);
match1 = irctolower(*m) == irctolower(*n);
if(match1)
{
if(*m)
@ -565,7 +565,7 @@ int irccmp(const char *s1, const char *s2)
s_assert(s1 != NULL);
s_assert(s2 != NULL);
while ((res = ToUpper(*str1) - ToUpper(*str2)) == 0)
while ((res = irctoupper(*str1) - irctoupper(*str2)) == 0)
{
if (*str1 == '\0')
return 0;
@ -583,7 +583,7 @@ int ircncmp(const char *s1, const char *s2, int n)
s_assert(s1 != NULL);
s_assert(s2 != NULL);
while ((res = ToUpper(*str1) - ToUpper(*str2)) == 0)
while ((res = irctoupper(*str1) - irctoupper(*str2)) == 0)
{
str1++;
str2++;
@ -594,7 +594,7 @@ int ircncmp(const char *s1, const char *s2, int n)
return (res);
}
const unsigned char ToLowerTab[] = {
const unsigned char irctolower_tab[] = {
0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa,
0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
@ -629,7 +629,7 @@ const unsigned char ToLowerTab[] = {
0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
};
const unsigned char ToUpperTab[] = {
const unsigned char irctoupper_tab[] = {
0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa,
0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,