From: Matthew Fernandez Date: Sun, 20 Feb 2022 23:25:03 +0000 (-0800) Subject: cdt: [nfc] remove unnecessary casts of the arguments to 'memoryf' X-Git-Tag: 3.0.0~9^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45cc490fcf8162426b89f8f4f2da8721aceb044a;p=graphviz cdt: [nfc] remove unnecessary casts of the arguments to 'memoryf' --- diff --git a/lib/cdt/dtclose.c b/lib/cdt/dtclose.c index e6beb82aa..e4208f165 100644 --- a/lib/cdt/dtclose.c +++ b/lib/cdt/dtclose.c @@ -28,14 +28,14 @@ int dtclose(Dt_t* dt) return -1; if(dt->data->ntab > 0) - (*dt->memoryf)(dt,(void*)dt->data->htab,0,disc); - (*dt->memoryf)(dt,(void*)dt->data,0,disc); + (*dt->memoryf)(dt, dt->data->htab, 0, disc); + (*dt->memoryf)(dt, dt->data, 0, disc); } if(dt->type == DT_MALLOC) free(dt); else if(ev == 0 && dt->type == DT_MEMORYF) - (*dt->memoryf)(dt, (void*)dt, 0, disc); + (*dt->memoryf)(dt, dt, 0, disc); if(disc->eventf) (void)(*disc->eventf)(dt, DT_ENDCLOSE, NULL, disc); diff --git a/lib/cdt/dthash.c b/lib/cdt/dthash.c index ef8602565..c9ec82819 100644 --- a/lib/cdt/dthash.c +++ b/lib/cdt/dthash.c @@ -107,7 +107,7 @@ static void* dthash(Dt_t* dt, void* obj, int type) if(disc->freef) (*disc->freef)(dt,_DTOBJ(t,lk),disc); if(disc->link < 0) - (*dt->memoryf)(dt,(void*)t,0,disc); + (*dt->memoryf)(dt, t, 0, disc); t = r; } } @@ -231,7 +231,7 @@ static void* dthash(Dt_t* dt, void* obj, int type) if(disc->freef && (type&DT_INSERT)) (*disc->freef)(dt,obj,disc); if(disc->link < 0) - (*disc->memoryf)(dt,(void*)r,0,disc); + (*disc->memoryf)(dt, r, 0, disc); return NULL; } s = dt->data->htab + HINDEX(dt->data->ntab,hsh); @@ -292,7 +292,7 @@ static void* dthash(Dt_t* dt, void* obj, int type) { if(disc->freef) (*disc->freef)(dt,obj,disc); if(disc->link < 0) - (*dt->memoryf)(dt,(void*)r,0,disc); + (*dt->memoryf)(dt, r, 0, disc); return t ? _DTOBJ(t,lk) : NULL; } } @@ -316,7 +316,7 @@ static void* dthash(Dt_t* dt, void* obj, int type) if(disc->freef && (type&DT_DELETE)) (*disc->freef)(dt,obj,disc); if(disc->link < 0) - (*dt->memoryf)(dt,(void*)t,0,disc); + (*dt->memoryf)(dt, t, 0, disc); return obj; } } diff --git a/lib/cdt/dtlist.c b/lib/cdt/dtlist.c index eb0a23b2b..6ec8d526f 100644 --- a/lib/cdt/dtlist.c +++ b/lib/cdt/dtlist.c @@ -39,7 +39,7 @@ static void* dtlist(Dt_t* dt, void* obj, int type) if(disc->freef) (*disc->freef)(dt,_DTOBJ(r,lk),disc); if(disc->link < 0) - (*dt->memoryf)(dt,(void*)r,0,disc); + (*dt->memoryf)(dt, r, 0, disc); } } dt->data->head = dt->data->here = NULL; @@ -156,7 +156,7 @@ static void* dtlist(Dt_t* dt, void* obj, int type) if(disc->freef && (type&DT_DELETE)) (*disc->freef)(dt,obj,disc); if(disc->link < 0) - (*dt->memoryf)(dt,(void*)r,0,disc); + (*dt->memoryf)(dt, r, 0, disc); return obj; } else if(type&DT_NEXT) diff --git a/lib/cdt/dtmethod.c b/lib/cdt/dtmethod.c index 03c912d72..80fa1a10a 100644 --- a/lib/cdt/dtmethod.c +++ b/lib/cdt/dtmethod.c @@ -28,7 +28,7 @@ Dtmethod_t* dtmethod(Dt_t* dt, Dtmethod_t* meth) dt->data->head = NULL; else if(dt->data->type&(DT_SET|DT_BAG) ) { if(dt->data->ntab > 0) - (*dt->memoryf)(dt,(void*)dt->data->htab,0,disc); + (*dt->memoryf)(dt, dt->data->htab, 0, disc); dt->data->ntab = 0; dt->data->htab = NULL; } diff --git a/lib/cdt/dttree.c b/lib/cdt/dttree.c index 645aa6786..77afd74fb 100644 --- a/lib/cdt/dttree.c +++ b/lib/cdt/dttree.c @@ -37,7 +37,7 @@ static void* dttree(Dt_t* dt, void* obj, int type) if(disc->freef) (*disc->freef)(dt,_DTOBJ(root,lk),disc); if(disc->link < 0) - (*dt->memoryf)(dt,(void*)root,0,disc); + (*dt->memoryf)(dt, root, 0, disc); } while((root = t) ); } @@ -261,7 +261,7 @@ static void* dttree(Dt_t* dt, void* obj, int type) if(disc->freef && (type&DT_DELETE)) (*disc->freef)(dt,obj,disc); if(disc->link < 0) - (*dt->memoryf)(dt,(void*)root,0,disc); + (*dt->memoryf)(dt, root, 0, disc); if((dt->data->size -= 1) < 0) dt->data->size = -1; goto no_root; @@ -281,7 +281,7 @@ static void* dttree(Dt_t* dt, void* obj, int type) { if(disc->freef) (*disc->freef)(dt,obj,disc); if(disc->link < 0) - (*dt->memoryf)(dt,(void*)me,0,disc); + (*dt->memoryf)(dt, me, 0, disc); } else { me->left = NULL;