Commit: f5e7221fbdc3277528b0cd8da4e9b3e0197e334f
Author: Hans Goudey
Date:   Tue Jun 14 17:25:53 2022 +0200
Branches: master
https://developer.blender.org/rBf5e7221fbdc3277528b0cd8da4e9b3e0197e334f

Cleanup: Fix const correctness of attribute search function

Retrieving a mutable custom data layer from a const ID
should not be possible.

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

M       source/blender/blenkernel/BKE_attribute.h
M       source/blender/blenkernel/intern/attribute.cc

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

diff --git a/source/blender/blenkernel/BKE_attribute.h 
b/source/blender/blenkernel/BKE_attribute.h
index 18993546e83..13eefd27bec 100644
--- a/source/blender/blenkernel/BKE_attribute.h
+++ b/source/blender/blenkernel/BKE_attribute.h
@@ -72,7 +72,7 @@ struct CustomDataLayer *BKE_id_attribute_find(const struct ID 
*id,
                                               int type,
                                               eAttrDomain domain);
 
-struct CustomDataLayer *BKE_id_attribute_search(const struct ID *id,
+struct CustomDataLayer *BKE_id_attribute_search(struct ID *id,
                                                 const char *name,
                                                 eCustomDataMask type,
                                                 eAttrDomainMask domain_mask);
diff --git a/source/blender/blenkernel/intern/attribute.cc 
b/source/blender/blenkernel/intern/attribute.cc
index 7bc51881f1f..7c09b4a4ce3 100644
--- a/source/blender/blenkernel/intern/attribute.cc
+++ b/source/blender/blenkernel/intern/attribute.cc
@@ -300,7 +300,7 @@ CustomDataLayer *BKE_id_attribute_find(const ID *id,
   return nullptr;
 }
 
-CustomDataLayer *BKE_id_attribute_search(const ID *id,
+CustomDataLayer *BKE_id_attribute_search(ID *id,
                                          const char *name,
                                          const eCustomDataMask type_mask,
                                          const eAttrDomainMask domain_mask)

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to