tevent: use struct initializers for tevent_timer
authorStefan Metzmacher <metze@samba.org>
Thu, 23 Oct 2014 05:15:14 +0000 (07:15 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 11 Jul 2018 21:04:19 +0000 (23:04 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/tevent/tevent_timed.c

index 92f3ed17b26ee749de270af3b4411a79af21de86..ae1eb98d8b2a71227b5418fef7f98ad80af53350 100644 (file)
@@ -224,13 +224,14 @@ static struct tevent_timer *tevent_common_add_timer_internal(
        te = talloc(mem_ctx?mem_ctx:ev, struct tevent_timer);
        if (te == NULL) return NULL;
 
-       te->event_ctx           = ev;
-       te->next_event          = next_event;
-       te->handler             = handler;
-       te->private_data        = private_data;
-       te->handler_name        = handler_name;
-       te->location            = location;
-       te->additional_data     = NULL;
+       *te = (struct tevent_timer) {
+               .event_ctx      = ev,
+               .next_event     = next_event,
+               .handler        = handler,
+               .private_data   = private_data,
+               .handler_name   = handler_name,
+               .location       = location,
+       };
 
        if (ev->timer_events == NULL) {
                ev->last_zero_timer = NULL;