Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2017-06-14 23:36:30 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-06-14 23:38:11 +0300
commiteeb9e5316a615f0e5052b28eee4966c4e2ed1152 (patch)
tree920a10f887c5249bcf34ddb54180092d8ef0a98e /source/blender/blenkernel/intern/library.c
parent31437b0d4de01dbd8986cb97a019079e473b397f (diff)
Make whole ID copying code use const source pointer.
Noisy change, but safe, and better do it sooner than later if we are to rework copying code. Also, previous commit shows this *is* useful to catch some mistakes.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 75e606bc020..2ea7342ff34 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -307,7 +307,7 @@ void BKE_id_expand_local(Main *bmain, ID *id)
/**
* Ensure new (copied) ID is fully made local.
*/
-void BKE_id_copy_ensure_local(Main *bmain, ID *old_id, ID *new_id)
+void BKE_id_copy_ensure_local(Main *bmain, const ID *old_id, ID *new_id)
{
if (ID_IS_LINKED_DATABLOCK(old_id)) {
BKE_id_expand_local(bmain, new_id);
@@ -488,7 +488,7 @@ bool id_make_local(Main *bmain, ID *id, const bool test, const bool lib_local)
* Invokes the appropriate copy method for the block and returns the result in
* newid, unless test. Returns true if the block can be copied.
*/
-bool id_copy(Main *bmain, ID *id, ID **newid, bool test)
+bool id_copy(Main *bmain, const ID *id, ID **newid, bool test)
{
if (!test) {
*newid = NULL;
@@ -1092,7 +1092,7 @@ void BKE_libblock_copy_data(ID *id, const ID *id_from, const bool do_action)
}
/* used everywhere in blenkernel */
-void *BKE_libblock_copy(Main *bmain, ID *id)
+void *BKE_libblock_copy(Main *bmain, const ID *id)
{
ID *idn;
size_t idn_len;
@@ -1114,7 +1114,7 @@ void *BKE_libblock_copy(Main *bmain, ID *id)
return idn;
}
-void *BKE_libblock_copy_nolib(ID *id, const bool do_action)
+void *BKE_libblock_copy_nolib(const ID *id, const bool do_action)
{
ID *idn;
size_t idn_len;