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

@ -30,41 +30,41 @@
#include "modules.h"
#include "send.h"
static int mo_unreject(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static const char unreject_desc[] =
"Provides the UNREJECT command to remove an IP from the reject cache";
static void mo_unreject(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
struct Message unreject_msgtab = {
"UNREJECT", 0, 0, 0, 0,
{mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_unreject, 2}}
};
mapi_clist_av1 unreject_clist[] = { &unreject_msgtab, NULL };
DECLARE_MODULE_AV2(unreject, NULL, NULL, unreject_clist, NULL, NULL, NULL, NULL, unreject_desc);
/*
* mo_unreject
*/
static int
static void
mo_unreject(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
if(ConfigFileEntry.reject_after_count == 0 || ConfigFileEntry.reject_ban_time == 0 ||
ConfigFileEntry.reject_duration == 0)
{
sendto_one_notice(source_p, ":Reject cache is disabled");
return 0;
return;
}
if(!parse_netmask(parv[1], NULL, NULL))
{
sendto_one_notice(source_p, ":Unable to parse netmask %s", parv[1]);
return 0;
return;
}
if(remove_reject_ip(parv[1]))
sendto_one_notice(source_p, ":Removed reject for %s", parv[1]);
else
sendto_one_notice(source_p, ":Unable to remove reject for %s", parv[1]);
return 0;
}