Merged find_orphaned_cflags and construct_noparam_modes in one function

as there's no reason to use them separetly
This commit is contained in:
Valery V Yatsko 2008-06-25 07:13:58 +04:00
parent c3f71f606e
commit 57d299acbd
1 changed files with 18 additions and 28 deletions

View File

@ -66,36 +66,12 @@ static int mode_limit_simple;
static int mask_pos;
int chmode_flags[256];
void
find_orphaned_cflags(void)
{
int i;
static int prev_chmode_flags[256];
for (i = 0; i < 256; i++)
{
if (prev_chmode_flags[i] != 0 && prev_chmode_flags[i] != chmode_flags[i])
{
if (chmode_flags[i] == 0)
{
chmode_table[i].set_func = chm_orphaned;
sendto_realops_snomask(SNO_DEBUG, L_ALL, "Cmode +%c is now orphaned", i);
}
else
{
sendto_realops_snomask(SNO_DEBUG, L_ALL, "Orphaned cmode +%c is picked up by module", i);
}
chmode_flags[i] = prev_chmode_flags[i];
}
else
prev_chmode_flags[i] = chmode_flags[i];
}
}
/* OPTIMIZE ME! -- dwr */
void
construct_noparam_modes(void)
{
int i;
static int prev_chmode_flags[256];
for(i = 0; i < 256; i++)
{
@ -113,9 +89,23 @@ construct_noparam_modes(void)
{
chmode_flags[i] = 0;
}
if (prev_chmode_flags[i] != 0 && prev_chmode_flags[i] != chmode_flags[i])
{
if (chmode_flags[i] == 0)
{
chmode_table[i].set_func = chm_orphaned;
sendto_realops_snomask(SNO_DEBUG, L_ALL, "Cmode +%c is now orphaned", i);
}
else
{
sendto_realops_snomask(SNO_DEBUG, L_ALL, "Orphaned cmode +%c is picked up by module", i);
}
chmode_flags[i] = prev_chmode_flags[i];
}
else
prev_chmode_flags[i] = chmode_flags[i];
}
find_orphaned_cflags();
}
/*