[Bf-blender-cvs] [8c84a18] master: Cleanup: use func definitions for wm/notifiers/editors ID callbacks.

Bastien Montagne noreply at git.blender.org
Tue Nov 10 20:35:58 CET 2015


Commit: 8c84a1873d8d4ef461bb14bbc9b180cf2d111351
Author: Bastien Montagne
Date:   Tue Nov 10 20:34:59 2015 +0100
Branches: master
https://developer.blender.org/rB8c84a1873d8d4ef461bb14bbc9b180cf2d111351

Cleanup: use func definitions for wm/notifiers/editors ID callbacks.

===================================================================

M	source/blender/blenkernel/BKE_library.h
M	source/blender/blenkernel/intern/library.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index e27198a..9a961ba 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -118,9 +118,13 @@ void BKE_library_make_local(struct Main *bmain, struct Library *lib, bool untagg
 struct ID *BKE_libblock_find_name_ex(struct Main *bmain, const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 struct ID *BKE_libblock_find_name(const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 
-void BKE_library_callback_free_window_manager_set(void (*func)(struct bContext *, struct wmWindowManager *));
-void BKE_library_callback_free_notifier_reference_set(void (*func)(const void *));
-void BKE_library_callback_free_editor_id_reference_set(void (*func)(const struct ID *));
+typedef void (*BKE_library_free_window_manager_cb)(struct bContext *, struct wmWindowManager *);
+typedef void (*BKE_library_free_notifier_reference_cb)(const void *);
+typedef void (*BKE_library_free_editor_id_reference_cb)(const struct ID *);
+
+void BKE_library_callback_free_window_manager_set(BKE_library_free_window_manager_cb func);
+void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb func);
+void BKE_library_callback_free_editor_id_reference_set(BKE_library_free_editor_id_reference_cb func);
 
 /* use when "" is given to new_id() */
 #define ID_FALLBACK_NAME N_("Untitled")
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 1dff424..e8f02ee 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1021,23 +1021,23 @@ static void BKE_library_free(Library *lib)
 		freePackedFile(lib->packedfile);
 }
 
-static void (*free_windowmanager_cb)(bContext *, wmWindowManager *) = NULL;
+static BKE_library_free_window_manager_cb free_windowmanager_cb = NULL;
 
-void BKE_library_callback_free_window_manager_set(void (*func)(bContext *C, wmWindowManager *) )
+void BKE_library_callback_free_window_manager_set(BKE_library_free_window_manager_cb func)
 {
 	free_windowmanager_cb = func;
 }
 
-static void (*free_notifier_reference_cb)(const void *) = NULL;
+static BKE_library_free_notifier_reference_cb free_notifier_reference_cb = NULL;
 
-void BKE_library_callback_free_notifier_reference_set(void (*func)(const void *) )
+void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb func)
 {
 	free_notifier_reference_cb = func;
 }
 
-static void (*free_editor_id_reference_cb)(const ID *) = NULL;
+static BKE_library_free_editor_id_reference_cb free_editor_id_reference_cb = NULL;
 
-void BKE_library_callback_free_editor_id_reference_set(void (*func)(const ID *))
+void BKE_library_callback_free_editor_id_reference_set(BKE_library_free_editor_id_reference_cb func)
 {
 	free_editor_id_reference_cb = func;
 }




More information about the Bf-blender-cvs mailing list