]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix function type cast warning in libunbound context callback type.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 3 May 2018 14:12:19 +0000 (14:12 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 3 May 2018 14:12:19 +0000 (14:12 +0000)
git-svn-id: file:///svn/unbound/trunk@4676 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
libunbound/context.c
libunbound/context.h
libunbound/libunbound.c

index 47b3a7c072dd35f97a08ff935be82d54d2c34197..cf044e813eceb3299d9df6304ae67f1b77adabde 100644 (file)
@@ -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.
index 8bff713bca30601ccdae6f3c9a1b4482e88e5201..9dddb9d3cd25c6ed98c21d6fc8a45504864cf8da 100644 (file)
@@ -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;
index 684d11effbc4c06ebc9daa3f9b36a2a2e0fd489f..5375f0423e711825cae03910190c3bdb4647e467 100644 (file)
@@ -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.
index b4cd7fa0bcc20394b3bee2afb99e9cca41365381..30f63431ad66ab323c93bed29692118daa32259b 100644 (file)
@@ -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;