From 48a2b7c1825ba6ef3e65426b53668772d8faca65 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sat, 20 Feb 2016 17:44:13 -0600 Subject: [PATCH] hook: allow hook_data to have non-const arguments, add hook_cdata for arguments that must be treated const --- include/hook.h | 9 ++++++++- modules/m_links.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/hook.h b/include/hook.h index 83aadd45a..f7a6e2319 100644 --- a/include/hook.h +++ b/include/hook.h @@ -42,12 +42,19 @@ void add_hook(const char *name, hookfn fn); void remove_hook(const char *name, hookfn fn); void call_hook(int id, void *arg); +typedef struct +{ + struct Client *client; + void *arg1; + void *arg2; +} hook_data; + typedef struct { struct Client *client; const void *arg1; const void *arg2; -} hook_data; +} hook_cdata; typedef struct { diff --git a/modules/m_links.c b/modules/m_links.c index 03e79571b..3893e4022 100644 --- a/modules/m_links.c +++ b/modules/m_links.c @@ -82,7 +82,7 @@ mo_links(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source const char *mask = ""; struct Client *target_p; char clean_mask[2 * HOSTLEN + 4]; - hook_data hd; + hook_cdata hd; rb_dlink_node *ptr;