]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Add and use event_call_callbacks_noargs() helper
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 5 Sep 2019 08:58:48 +0000 (11:58 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 5 Sep 2019 13:29:28 +0000 (13:29 +0000)
src/lib/lib-event.c

index 108b35b30a6e19e36109bf59eaba1c902c36229a..1351bde51365382a83b9b22319f7bbea9ab504fb 100644 (file)
@@ -74,16 +74,17 @@ event_call_callbacks(struct event *event, enum event_callback_type type,
        return TRUE;
 }
 
-static void event_send_free(struct event *event, ...)
+static void
+event_call_callbacks_noargs(struct event *event,
+                           enum event_callback_type type, ...)
 {
        va_list args;
 
        /* the args are empty and not used for anything, but there doesn't seem
           to be any nice and standard way of passing an initialized va_list
           as a parameter without va_start(). */
-       va_start(args, event);
-       (void)event_call_callbacks(event, EVENT_CALLBACK_TYPE_FREE,
-                                  NULL, NULL, args);
+       va_start(args, type);
+       (void)event_call_callbacks(event, type, NULL, NULL, args);
        va_end(args);
 }
 
@@ -381,7 +382,7 @@ void event_unref(struct event **_event)
                return;
        i_assert(event != current_global_event);
 
-       event_send_free(event);
+       event_call_callbacks_noargs(event, EVENT_CALLBACK_TYPE_FREE);
 
        if (last_passthrough_event() == event)
                event_last_passthrough = NULL;