Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-05-21 12:45:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-21 12:45:10 +0400
commit13bde6645bd2373c444279aff270a03ea92eef36 (patch)
tree79b2dd4cee155ec25eb4ed8184a8edc530d2c52b
parentcd6b27f2b58aff46c9431bf7621e19bdb1b0b4c2 (diff)
code cleanup: remove callbacks only added to wrap MEM_freeN
-rw-r--r--source/blender/blenkernel/intern/customdata.c8
-rw-r--r--source/blender/blenlib/intern/BLI_args.c7
-rw-r--r--source/blender/blenlib/intern/BLI_ghash.c2
-rw-r--r--source/blender/editors/curve/editcurve.c10
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c2
-rw-r--r--source/blender/python/intern/bpy_app_translations.c5
6 files changed, 10 insertions, 24 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 75000ec440b..99ee6a803c8 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -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)
diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c
index 6a5952465fe..fdef0d69539 100644
--- a/source/blender/blenlib/intern/BLI_args.c
+++ b/source/blender/blenlib/intern/BLI_args.c
@@ -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);
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index df3bfc7ef1b..b8e3d70ce99 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -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);
}
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 6ef5d3b1385..0bc00206d93 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -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);
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 52a1c09fc5f..3b678624eea 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -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;
}
diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c
index 782a05b68ce..e168bf33eb5 100644
--- a/source/blender/python/intern/bpy_app_translations.c
+++ b/source/blender/python/intern/bpy_app_translations.c
@@ -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 *****/