]> granicus.if.org Git - graphviz/commitdiff
cdt: [nfc] remove unnecessary casts of the arguments to 'memoryf'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 20 Feb 2022 23:25:03 +0000 (15:25 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 23 Feb 2022 04:41:47 +0000 (20:41 -0800)
lib/cdt/dtclose.c
lib/cdt/dthash.c
lib/cdt/dtlist.c
lib/cdt/dtmethod.c
lib/cdt/dttree.c

index e6beb82aad598d5fff19dd0fff282a89ad0edd23..e4208f165efd9389f98bda28ddf2d2aae3a369ea 100644 (file)
@@ -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);
index ef8602565249d07c2025741627d63d7df560b4b3..c9ec82819176e92292876a1abc76295a610b8fa7 100644 (file)
@@ -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;
        }
 }
index eb0a23b2b9bc686633bffc12d8e0d95785af91e7..6ec8d526fce6582bfe473552409dbd73888cbd1e 100644 (file)
@@ -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)
index 03c912d729225810fddfd4195ae478e506587071..80fa1a10a0e48f28826c840b3c6367d5267f1741 100644 (file)
@@ -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;
        }
index 645aa67869c01eb0fe020341310ae6afb17b2b35..77afd74fbe3001a003b19d8376fd29335bd64ce8 100644 (file)
@@ -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;