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/blenloader/intern/readfile.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/blender/blenloader/intern') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d9849cfa770..b06571e5f40 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7744,11 +7744,10 @@ static void lib_link_clipboard_restore(struct IDNameLib_Map *id_map) BKE_sequencer_base_recursive_apply(&seqbase_clipboard, lib_link_seq_clipboard_cb, id_map); } -static int lib_link_main_data_restore_cb(void *user_data, - ID *UNUSED(id_self), - ID **id_pointer, - int cb_flag) +static int lib_link_main_data_restore_cb(LibraryIDLinkCallbackData *cb_data) { + const int cb_flag = cb_data->cb_flag; + ID **id_pointer = cb_data->id_pointer; if (cb_flag & IDWALK_CB_PRIVATE || *id_pointer == NULL) { return IDWALK_RET_NOP; } @@ -7763,7 +7762,7 @@ static int lib_link_main_data_restore_cb(void *user_data, } } - struct IDNameLib_Map *id_map = user_data; + struct IDNameLib_Map *id_map = cb_data->user_data; /* Note: Handling of usercount here is really bad, defining its own system... * Will have to be refactored at some point, but that is not top priority task for now. -- cgit v1.2.3