[Bf-blender-cvs] [06c6492] id-remap: Avoid fexplicit conversion to ID * for remap parameters (use void pointers instead). Also found another missing ID in foreach_id (sound pointer of sequences).

Bastien Montagne noreply at git.blender.org
Wed Oct 7 23:17:47 CEST 2015


Commit: 06c6492d7dfcae6a570ba733e556bade57a4ce66
Author: Bastien Montagne
Date:   Wed Oct 7 21:10:50 2015 +0200
Branches: id-remap
https://developer.blender.org/rB06c6492d7dfcae6a570ba733e556bade57a4ce66

Avoid fexplicit conversion to ID * for remap parameters (use void pointers instead).
Also found another missing ID in foreach_id (sound pointer of sequences).

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

M	source/blender/blenkernel/BKE_library.h
M	source/blender/blenkernel/intern/library.c
M	source/blender/blenkernel/intern/library_query.c
M	source/blender/editors/screen/screen_edit.c
M	source/blender/makesrna/intern/rna_main_api.c

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

diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index daa0799..449358e 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -59,9 +59,9 @@ void  BKE_libblock_copy_data(struct ID *id, const struct ID *id_from, const bool
 
 /* Note: Requiring new_id to be non-null, this *may* not be the case ultimately, but makes things simpler for now. */
 void BKE_libblock_remap_locked(
-        struct Main *bmain, struct ID *old_id, struct ID *new_id, const bool skip_indirect_usage) ATTR_NONNULL(1, 2);
+        struct Main *bmain, void *old_id, void *new_id, const bool skip_indirect_usage) ATTR_NONNULL(1, 2);
 void BKE_libblock_remap(
-        struct Main *bmain, struct ID *old_id, struct ID *new_id, const bool skip_indirect_usage) ATTR_NONNULL(1, 2);
+        struct Main *bmain, void *old_idv, void *new_idv, const bool skip_indirect_usage) ATTR_NONNULL(1, 2);
 
 void BKE_libblock_unlink(struct Main *bmain, void *idv) ATTR_NONNULL();
 
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 69ccb6a..872d159 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1045,8 +1045,10 @@ static bool foreach_libblock_remap_callback(void *user_data, ID **id_p, int cb_f
 }
 
 /** Replace all references in .blend file to \a old_id by \a new_id (if \a new_id is NULL, it unlinks \a old_id). */
-void BKE_libblock_remap_locked(Main *bmain, ID *old_id, ID *new_id, const bool skip_indirect_usage)
+void BKE_libblock_remap_locked(Main *bmain, void *old_idv, void *new_idv, const bool skip_indirect_usage)
 {
+	ID *old_id = old_idv;
+	ID *new_id = new_idv;
 	IDRemap id_remap_data = {(void *)bmain, (void *)old_id, (void *)new_id, NULL};
 	ListBase *lb_array[MAX_LIBARRAY];
 	int skipped;
@@ -1167,11 +1169,11 @@ void BKE_libblock_remap_locked(Main *bmain, ID *old_id, ID *new_id, const bool s
 	DAG_relations_tag_update(bmain);
 }
 
-void BKE_libblock_remap(Main *bmain, ID *old_id, ID *new_id, const bool skip_indirect_usage)
+void BKE_libblock_remap(Main *bmain, void *old_idv, void *new_idv, const bool skip_indirect_usage)
 {
 	BKE_main_lock(bmain);
 
-	BKE_libblock_remap_locked(bmain, old_id, new_id, skip_indirect_usage);
+	BKE_libblock_remap_locked(bmain, old_idv, new_idv, skip_indirect_usage);
 
 	BKE_main_unlock(bmain);
 }
@@ -1181,7 +1183,7 @@ void BKE_libblock_unlink(Main *bmain, void *idv)
 {
 	BKE_main_lock(bmain);
 
-	BKE_libblock_remap_locked(bmain, (ID *)idv, NULL, true);
+	BKE_libblock_remap_locked(bmain, idv, NULL, true);
 
 	BKE_main_unlock(bmain);
 }
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index 0dc770e..1b8883b 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -257,6 +257,7 @@ void BKE_library_foreach_ID_link(ID *id, LibraryIDLinkCallback callback, void *u
 					CALLBACK_INVOKE(seq->scene_camera, IDWALK_NOP);
 					CALLBACK_INVOKE(seq->clip, IDWALK_NOP);
 					CALLBACK_INVOKE(seq->mask, IDWALK_NOP);
+					CALLBACK_INVOKE(seq->sound, IDWALK_NOP);
 				}
 				SEQ_END
 			}
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 9fc78b2..ff2f5de 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1742,7 +1742,7 @@ bool ED_screen_delete_scene(bContext *C, Scene *scene)
 
 	ED_screen_set_scene(C, CTX_wm_screen(C), newscene);
 
-	BKE_libblock_remap(bmain, (ID *)scene, (ID *)newscene, true);
+	BKE_libblock_remap(bmain, scene, newscene, true);
 
 	BKE_libblock_free(bmain, scene);
 
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 2d4a460..2b4ca24 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -160,7 +160,7 @@ static void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports
 
 		}
 
-		BKE_libblock_remap(bmain, (ID *)scene, (ID *)scene_new, true);
+		BKE_libblock_remap(bmain, scene, scene_new, true);
 		BKE_libblock_free(bmain, scene);
 		RNA_POINTER_INVALIDATE(scene_ptr);
 	}




More information about the Bf-blender-cvs mailing list