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

index c9ec82819176e92292876a1abc76295a610b8fa7..a36b7301400f811b170a54bec2a4ed6728afc65f 100644 (file)
@@ -47,7 +47,7 @@ static void dthtab(Dt_t* dt)
 
        /* allocate new table */
        olds = dt->data->ntab == 0 ? NULL : dt->data->htab;
-       if(!(s = (Dtlink_t**)(*dt->memoryf)(dt,olds,n*sizeof(Dtlink_t*),dt->disc)) )
+       if(!(s = (*dt->memoryf)(dt, olds, n * sizeof(Dtlink_t*), dt->disc)) )
                return;
        olds = s + dt->data->ntab;
        dt->data->htab = s;
@@ -210,8 +210,7 @@ static void* dthash(Dt_t* dt, void* obj, int type)
                if(lk >= 0)
                        r = _DTLNK(obj,lk);
                else
-               {       r = (Dtlink_t*)(*dt->memoryf)
-                               (dt,NULL,sizeof(Dthold_t),disc);
+               {       r = (*dt->memoryf)(dt, NULL, sizeof(Dthold_t), disc);
                        if(r)
                                ((Dthold_t*)r)->obj = obj;
                        else
index 6ec8d526fce6582bfe473552409dbd73888cbd1e..7476b7020e85594e33c4262f6e45ebc6041dbd8b 100644 (file)
@@ -56,8 +56,7 @@ static void* dtlist(Dt_t* dt, void* obj, int type)
                if(lk >= 0)
                        r = _DTLNK(obj,lk);
                else
-               {       r = (Dtlink_t*)(*dt->memoryf)
-                               (dt,NULL,sizeof(Dthold_t),disc);
+               {       r = (*dt->memoryf)(dt, NULL, sizeof(Dthold_t), disc);
                        if(r)
                                ((Dthold_t*)r)->obj = obj;
                        else
index ebe56a3693bb0c5f71cf8acbf475dbf182d9b6ab..b5cc90ed4222da746a150f347791f571ce61b3a7 100644 (file)
@@ -58,7 +58,7 @@ Dt_t* dtopen(Dtdisc_t* disc, Dtmethod_t* meth)
        }
 
        /* allocate sharable data */
-       if(!(data = (Dtdata_t*)(dt->memoryf)(dt,NULL,sizeof(Dtdata_t),disc)) )
+       if(!(data = (dt->memoryf)(dt, NULL, sizeof(Dtdata_t), disc)) )
        { err_open:
                free(dt);
                return NULL;
index 77afd74fbe3001a003b19d8376fd29335bd64ce8..9b7f8656b5a905e35237612465fc00f3a03382ba 100644 (file)
@@ -317,8 +317,7 @@ static void* dttree(Dt_t* dt, void* obj, int type)
                        {       if(lk >= 0)
                                        root = _DTLNK(obj,lk);
                                else
-                               {       root = (Dtlink_t*)(*dt->memoryf)
-                                               (dt,NULL,sizeof(Dthold_t),disc);
+                               {       root = (*dt->memoryf)(dt, NULL, sizeof(Dthold_t), disc);
                                        if(root)
                                                ((Dthold_t*)root)->obj = obj;
                                        else if(disc->makef && disc->freef &&