Convert lookup_userlevelc() to accept const char * parameters

Also converted dependant functions check_channel_match() and
find_bestmatch() to use const char *.
This commit is contained in:
Kevin Easton
2015-10-20 23:12:33 +11:00
parent 51ecdb8d1b
commit a24f1d12ec
3 changed files with 21 additions and 21 deletions

View File

@@ -23,7 +23,7 @@ HashEntry UserListByChannel_Table[USERCHAN_HASHSIZE];
UserList *user_list = NULL;
static long hash_name(char *str, unsigned int size)
static long hash_name(const char *str, unsigned int size)
{
const unsigned char *p = (const unsigned char *)str;
unsigned long g, hash = 0;
@@ -359,26 +359,26 @@ UserHist *next_userlist(UserList *uptr, int *size)
}
#endif
static inline int check_best_passwd(char *passwd, char *test)
static inline int check_best_passwd(const char *passwd, const char *test)
{
if (passwd && test)
return !checkpass(test, passwd) ? 1 : 0;
return !checkpass(test, passwd);
/* return !strcmp(passwd, test) ? 1 : 0;*/
return 0;
}
UserList *find_bestmatch(char *nick, char *userhost, char *channel, char *passwd)
UserList *find_bestmatch(const char *nick, const char *userhost, const char *channel, const char *passwd)
{
UserList *best = NULL;
UserList *best_passwd = NULL;
register UserList *tmp;
long hvalue = 0;
int best_user_match = 0,
best_chan_match = 0;
int chan_match,
user_match,
passwd_match = 0;
char *check;
UserList *best = NULL;
UserList *best_passwd = NULL;
UserList *tmp;
long hvalue = 0;
int best_user_match = 0,
best_chan_match = 0;
int chan_match,
user_match,
passwd_match = 0;
const char *check;
/*check = clear_server_flags(userhost);*/
check = userhost;