diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-02-13 14:56:10 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-02-13 18:23:42 +0300 |
commit | f28bb6992fa9773fb1e7918d569f4c88427f4c96 (patch) | |
tree | e69240c9ab26ba00bf4ca1f54636e4e837b8f465 /source/blender/blenloader | |
parent | 0d750d7c064bbb1e1fb5fe2ae14a8496863a890b (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/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 9 |
1 files changed, 4 insertions, 5 deletions
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. |