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:
authorBastien Montagne <b.mont29@gmail.com>2020-02-13 14:56:10 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-02-13 18:23:42 +0300
commitf28bb6992fa9773fb1e7918d569f4c88427f4c96 (patch)
treee69240c9ab26ba00bf4ca1f54636e4e837b8f465 /source/blender/blenkernel/intern/mesh_convert.c
parent0d750d7c064bbb1e1fb5fe2ae14a8496863a890b (diff)
Refactor libquery ID looper callback to take a single parameter.
Using a struct here allows to change given parameters to the callbacks without having to edit all callbacks functions, which is always noisy and time consuming.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_convert.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_convert.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c
index 68d535e6405..014ccdb913e 100644
--- a/source/blender/blenkernel/intern/mesh_convert.c
+++ b/source/blender/blenkernel/intern/mesh_convert.c
@@ -1167,11 +1167,9 @@ Mesh *BKE_mesh_new_from_object(Depsgraph *depsgraph, Object *object, bool preser
return new_mesh;
}
-static int foreach_libblock_make_original_callback(void *UNUSED(user_data_v),
- ID *UNUSED(id_self),
- ID **id_p,
- int UNUSED(cb_flag))
+static int foreach_libblock_make_original_callback(LibraryIDLinkCallbackData *cb_data)
{
+ ID **id_p = cb_data->id_pointer;
if (*id_p == NULL) {
return IDWALK_RET_NOP;
}
@@ -1180,15 +1178,14 @@ static int foreach_libblock_make_original_callback(void *UNUSED(user_data_v),
return IDWALK_RET_NOP;
}
-static int foreach_libblock_make_usercounts_callback(void *UNUSED(user_data_v),
- ID *UNUSED(id_self),
- ID **id_p,
- int cb_flag)
+static int foreach_libblock_make_usercounts_callback(LibraryIDLinkCallbackData *cb_data)
{
+ ID **id_p = cb_data->id_pointer;
if (*id_p == NULL) {
return IDWALK_RET_NOP;
}
+ const int cb_flag = cb_data->cb_flag;
if (cb_flag & IDWALK_CB_USER) {
id_us_plus(*id_p);
}