From: Magnus Jacobsson Date: Fri, 28 Aug 2020 07:20:43 +0000 (+0200) Subject: Remove 1 -Wbad-function-cast warning in agdtdelete X-Git-Tag: 2.46.0~20^2^2~93^2~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0ff8c636d284aa736eafc92c7e74f4b0f9c0bdd;p=graphviz Remove 1 -Wbad-function-cast warning in agdtdelete Changes the *internal* API by instead of casting the void pointer that dtdelete returns to long, returns an int which is 0 if the pointer is NULL and 1 otherwise. It doesn't really matter though, since the return value is not used anywhere today. --- diff --git a/lib/cgraph/cghdr.h b/lib/cgraph/cghdr.h index 10c63614c..db195d5db 100644 --- a/lib/cgraph/cghdr.h +++ b/lib/cgraph/cghdr.h @@ -106,7 +106,7 @@ uint64_t agnextseq(Agraph_t * g, int objtype); /* dict helper functions */ Dict_t *agdtopen(Agraph_t * g, Dtdisc_t * disc, Dtmethod_t * method); void agdtdisc(Agraph_t * g, Dict_t * dict, Dtdisc_t * disc); -long agdtdelete(Agraph_t * g, Dict_t * dict, void *obj); +int agdtdelete(Agraph_t * g, Dict_t * dict, void *obj); int agdtclose(Agraph_t * g, Dict_t * dict); void *agdictobjmem(Dict_t * dict, void * p, size_t size, Dtdisc_t * disc); diff --git a/lib/cgraph/utils.c b/lib/cgraph/utils.c index 24d76e296..bdfa84efc 100644 --- a/lib/cgraph/utils.c +++ b/lib/cgraph/utils.c @@ -64,10 +64,10 @@ Dict_t *agdtopen(Agraph_t * g, Dtdisc_t * disc, Dtmethod_t * method) return d; } -long agdtdelete(Agraph_t * g, Dict_t * dict, void *obj) +int agdtdelete(Agraph_t * g, Dict_t * dict, void *obj) { Ag_dictop_G = g; - return (long) dtdelete(dict, obj); + return dtdelete(dict, obj) != NULL; } int agobjfinalize(void * obj)