Message handlers should return void.

Also fix up some return values and stuff to use bool (or void if
nothing). I just did it whilst I was here.

According to jilles, the return value used to signify whether or not the
client had exited. This was error-prone and was fixed a long, long time
ago, but the return value was left int for historical reasons.

Since the return type is not used (and has no clear use case anyway),
it's safe to just get rid of it.
This commit is contained in:
Elizabeth Myers 2016-03-09 01:37:03 -06:00
parent eeabf33a7c
commit 3c7d6fcce7
99 changed files with 1339 additions and 1691 deletions

View file

@ -39,9 +39,9 @@
static const char help_desc[] =
"Provides the help facility for commands, modes, and server concepts";
static int m_help(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static int mo_help(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static int mo_uhelp(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static void m_help(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static void mo_help(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static void mo_uhelp(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static void dohelp(struct Client *, int, const char *);
struct Message help_msgtab = {
@ -60,33 +60,29 @@ DECLARE_MODULE_AV2(help, NULL, NULL, help_clist, NULL, NULL, NULL, NULL, help_de
/*
* m_help - HELP message handler
*/
static int
static void
m_help(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
dohelp(source_p, HELP_USER, parc > 1 ? parv[1] : NULL);
return 0;
}
/*
* mo_help - HELP message handler
*/
static int
static void
mo_help(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
dohelp(source_p, HELP_OPER, parc > 1 ? parv[1] : NULL);
return 0;
}
/*
* mo_uhelp - HELP message handler
* This is used so that opers can view the user help file without deopering
*/
static int
static void
mo_uhelp(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
dohelp(source_p, HELP_USER, parc > 1 ? parv[1] : NULL);
return 0;
}
static void
@ -127,5 +123,4 @@ dohelp(struct Client *source_p, int flags, const char *topic)
sendto_one(source_p, form_str(RPL_ENDOFHELP),
me.name, source_p->name, topic);
return;
}