diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-06-22 22:45:25 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-06-22 22:56:24 +0200 |
commit | a2611cdc3c6d7c615ac7057087b3060cb46f9400 (patch) | |
tree | 2b52868bdb926562c611b78be412bdf2d12a3245 /kike.c | |
parent | 68bc2978099ba0e17045f943081f88fd84eddf92 (diff) | |
download | xK-a2611cdc3c6d7c615ac7057087b3060cb46f9400.tar.gz xK-a2611cdc3c6d7c615ac7057087b3060cb46f9400.tar.xz xK-a2611cdc3c6d7c615ac7057087b3060cb46f9400.zip |
Rework constructors/destructors
Diffstat (limited to 'kike.c')
-rw-r--r-- | kike.c | 20 |
1 files changed, 8 insertions, 12 deletions
@@ -1739,16 +1739,14 @@ struct mode_processor struct strv *output_params; ///< Similarly for "*_params" }; -static void -mode_processor_init (struct mode_processor *self) +static struct mode_processor +mode_processor_make (void) { - memset (self, 0, sizeof *self); - - self->added = str_make (); - self->removed = str_make (); - - self->added_params = strv_make (); - self->removed_params = strv_make (); + return (struct mode_processor) + { + .added = str_make (), .added_params = strv_make (), + .removed = str_make (), .removed_params = strv_make (), + }; } static void @@ -1990,9 +1988,7 @@ static void irc_handle_chan_mode_change (struct client *c, struct channel *chan, char *params[]) { - struct mode_processor p; - mode_processor_init (&p); - + struct mode_processor p = mode_processor_make (); p.params = params; p.channel = chan; p.c = c; |