From f28bb6992fa9773fb1e7918d569f4c88427f4c96 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 13 Feb 2020 12:56:10 +0100 Subject: 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. --- source/blender/blenkernel/BKE_lib_query.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/BKE_lib_query.h') diff --git a/source/blender/blenkernel/BKE_lib_query.h b/source/blender/blenkernel/BKE_lib_query.h index 36aa69bf795..4d1b924b0d3 100644 --- a/source/blender/blenkernel/BKE_lib_query.h +++ b/source/blender/blenkernel/BKE_lib_query.h @@ -83,15 +83,19 @@ enum { IDWALK_RET_STOP_RECURSION = 1 << 1, }; +typedef struct LibraryIDLinkCallbackData { + void *user_data; + struct ID *id_self; + struct ID **id_pointer; + int cb_flag; +} LibraryIDLinkCallbackData; + /** * Call a callback for each ID link which the given ID uses. * * \return a set of flags to control further iteration (0 to keep going). */ -typedef int (*LibraryIDLinkCallback)(void *user_data, - struct ID *id_self, - struct ID **id_pointer, - int cb_flag); +typedef int (*LibraryIDLinkCallback)(LibraryIDLinkCallbackData *cb_data); /* Flags for the foreach function itself. */ enum { -- cgit v1.2.3