From: Wouter Wijngaards Date: Thu, 3 May 2018 14:12:19 +0000 (+0000) Subject: - Fix function type cast warning in libunbound context callback type. X-Git-Tag: release-1.7.2rc1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f886fc6dda526ebaca614a27f0b5247fb1e1469;p=thirdparty%2Funbound.git - Fix function type cast warning in libunbound context callback type. git-svn-id: file:///svn/unbound/trunk@4676 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 47b3a7c07..cf044e813 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 3 May 2018: Wouter - Fix that configure --with-libhiredis also turns on cachedb. - Fix gcc 8 buffer warning in testcode. + - Fix function type cast warning in libunbound context callback type. 2 May 2018: Wouter - Fix fail to reject dead peers in forward-zone, with ssl-upstream. diff --git a/libunbound/context.c b/libunbound/context.c index 8bff713bc..9dddb9d3c 100644 --- a/libunbound/context.c +++ b/libunbound/context.c @@ -130,7 +130,7 @@ find_id(struct ub_ctx* ctx, int* id) struct ctx_query* context_new(struct ub_ctx* ctx, const char* name, int rrtype, int rrclass, - ub_callback_type cb, void* cbarg) + void* cb, void* cbarg) { struct ctx_query* q = (struct ctx_query*)calloc(1, sizeof(*q)); if(!q) return NULL; diff --git a/libunbound/context.h b/libunbound/context.h index 684d11eff..5375f0423 100644 --- a/libunbound/context.h +++ b/libunbound/context.h @@ -148,8 +148,9 @@ struct ctx_query { /** was this query cancelled (for bg worker) */ int cancelled; - /** for async query, the callback function */ - ub_callback_type cb; + /** for async query, the callback function of type ub_callback_type + * for event callbacks the type is ub_event_callback_type */ + void* cb; /** for async query, the callback user arg */ void* cb_arg; @@ -242,7 +243,7 @@ void context_query_delete(struct ctx_query* q); * @return new ctx_query or NULL for malloc failure. */ struct ctx_query* context_new(struct ub_ctx* ctx, const char* name, int rrtype, - int rrclass, ub_callback_type cb, void* cbarg); + int rrclass, void* cb, void* cbarg); /** * Get a new alloc. Creates a new one or uses a cached one. diff --git a/libunbound/libunbound.c b/libunbound/libunbound.c index b4cd7fa0b..30f63431a 100644 --- a/libunbound/libunbound.c +++ b/libunbound/libunbound.c @@ -747,8 +747,7 @@ ub_resolve_event(struct ub_ctx* ctx, const char* name, int rrtype, ub_comm_base_now(ctx->event_worker->base); /* create new ctx_query and attempt to add to the list */ - q = context_new(ctx, name, rrtype, rrclass, (ub_callback_type)callback, - mydata); + q = context_new(ctx, name, rrtype, rrclass, callback, mydata); if(!q) return UB_NOMEM;