code cleanup: remove callbacks only added to wrap MEM_freeN

This commit is contained in:
Campbell Barton
2013-05-21 08:45:10 +00:00
parent cd6b27f2b5
commit 13bde6645b
6 changed files with 10 additions and 24 deletions

View File

@@ -215,12 +215,6 @@ static void layerFree_bmesh_elem_py_ptr(void *data, int count, int size)
}
}
static void linklist_free_simple(void *link)
{
MEM_freeN(link);
}
static void layerInterp_mdeformvert(void **sources, const float *weights,
const float *UNUSED(sub_weights), int count, void *dest)
{
@@ -281,7 +275,7 @@ static void layerInterp_mdeformvert(void **sources, const float *weights,
else
memset(dvert, 0, sizeof(*dvert));
BLI_linklist_free(dest_dw, linklist_free_simple);
BLI_linklist_free(dest_dw, MEM_freeN);
}
static void layerCopy_tface(const void *source, void *dest, int count)

View File

@@ -129,14 +129,9 @@ bArgs *BLI_argsInit(int argc, const char **argv)
return ba;
}
static void freeItem(void *val)
{
MEM_freeN(val);
}
void BLI_argsFree(struct bArgs *ba)
{
BLI_ghash_free(ba->items, freeItem, freeItem);
BLI_ghash_free(ba->items, MEM_freeN, MEM_freeN);
MEM_freeN(ba->passes);
BLI_freelistN(&ba->docs);
MEM_freeN(ba);

View File

@@ -410,5 +410,5 @@ int BLI_ghashutil_paircmp(const void *a, const void *b)
void BLI_ghashutil_pairfree(void *ptr)
{
MEM_freeN((void *)ptr);
MEM_freeN(ptr);
}

View File

@@ -402,7 +402,7 @@ static void keyIndex_delCV(EditNurb *editnurb, void *cv)
return;
}
BLI_ghash_remove(editnurb->keyindex, cv, NULL, (GHashValFreeFP)MEM_freeN);
BLI_ghash_remove(editnurb->keyindex, cv, NULL, MEM_freeN);
}
static void keyIndex_delBezt(EditNurb *editnurb, BezTriple *bezt)
@@ -428,7 +428,7 @@ static void keyIndex_delNurb(EditNurb *editnurb, Nurb *nu)
a = nu->pntsu;
while (a--) {
BLI_ghash_remove(editnurb->keyindex, bezt, NULL, (GHashValFreeFP)MEM_freeN);
BLI_ghash_remove(editnurb->keyindex, bezt, NULL, MEM_freeN);
bezt++;
}
}
@@ -437,7 +437,7 @@ static void keyIndex_delNurb(EditNurb *editnurb, Nurb *nu)
a = nu->pntsu * nu->pntsv;
while (a--) {
BLI_ghash_remove(editnurb->keyindex, bp, NULL, (GHashValFreeFP)MEM_freeN);
BLI_ghash_remove(editnurb->keyindex, bp, NULL, MEM_freeN);
bp++;
}
}
@@ -6951,7 +6951,7 @@ static void undoCurve_to_editCurve(void *ucu, void *UNUSED(edata), void *cu_v)
BKE_nurbList_free(editbase);
if (undoCurve->undoIndex) {
BLI_ghash_free(editnurb->keyindex, NULL, (GHashValFreeFP)MEM_freeN);
BLI_ghash_free(editnurb->keyindex, NULL, MEM_freeN);
editnurb->keyindex = dupli_keyIndexHash(undoCurve->undoIndex);
}
@@ -7037,7 +7037,7 @@ static void free_undoCurve(void *ucv)
BKE_nurbList_free(&undoCurve->nubase);
if (undoCurve->undoIndex)
BLI_ghash_free(undoCurve->undoIndex, NULL, (GHashValFreeFP)MEM_freeN);
BLI_ghash_free(undoCurve->undoIndex, NULL, MEM_freeN);
free_fcurves(&undoCurve->fcurves);
free_fcurves(&undoCurve->drivers);

View File

@@ -255,7 +255,7 @@ void GPU_codegen_exit(void)
GPU_material_free(&defmaterial);
if (FUNCTION_HASH) {
BLI_ghash_free(FUNCTION_HASH, NULL, (GHashValFreeFP)MEM_freeN);
BLI_ghash_free(FUNCTION_HASH, NULL, MEM_freeN);
FUNCTION_HASH = NULL;
}

View File

@@ -108,10 +108,7 @@ static void _ghashutil_keyfree(void *ptr)
MEM_freeN((void *)key);
}
static void _ghashutil_valfree(void *ptr)
{
MEM_freeN(ptr);
}
#define _ghashutil_valfree MEM_freeN
/***** Python's messages cache *****/