[Bf-blender-cvs] [f19585656f6] master: Fix compile warnings.

Jeroen Bakker noreply at git.blender.org
Fri Feb 11 10:30:28 CET 2022


Commit: f19585656f62935c93c6b85a0778327d0064fa3a
Author: Jeroen Bakker
Date:   Fri Feb 11 10:28:59 2022 +0100
Branches: master
https://developer.blender.org/rBf19585656f62935c93c6b85a0778327d0064fa3a

Fix compile warnings.

We should change the API of ntree so we can check with a const. I added
this as a todo for now and used a const cast.

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

M	source/blender/blenkernel/BKE_anim_data.h
M	source/blender/blenkernel/intern/anim_data.c
M	source/blender/blenkernel/intern/lib_query.c

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

diff --git a/source/blender/blenkernel/BKE_anim_data.h b/source/blender/blenkernel/BKE_anim_data.h
index 5575f0d56c6..ef03c2a78b0 100644
--- a/source/blender/blenkernel/BKE_anim_data.h
+++ b/source/blender/blenkernel/BKE_anim_data.h
@@ -36,7 +36,7 @@ bool id_can_have_animdata(const struct ID *id);
 /**
  * Get #AnimData from the given ID-block.
  */
-struct AnimData *BKE_animdata_from_id(struct ID *id);
+struct AnimData *BKE_animdata_from_id(const struct ID *id);
 
 /**
  * Ensure #AnimData exists in the given ID-block (when supported).
diff --git a/source/blender/blenkernel/intern/anim_data.c b/source/blender/blenkernel/intern/anim_data.c
index 6d9d48816b6..0c9202400ad 100644
--- a/source/blender/blenkernel/intern/anim_data.c
+++ b/source/blender/blenkernel/intern/anim_data.c
@@ -72,7 +72,7 @@ bool id_can_have_animdata(const ID *id)
   return id_type_can_have_animdata(GS(id->name));
 }
 
-AnimData *BKE_animdata_from_id(ID *id)
+AnimData *BKE_animdata_from_id(const ID *id)
 {
   /* In order for this to work, we assume that the #AnimData pointer is stored
    * immediately after the given ID-block in the struct, as per IdAdtTemplate. */
diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c
index 2a532cb0175..ba009072db8 100644
--- a/source/blender/blenkernel/intern/lib_query.c
+++ b/source/blender/blenkernel/intern/lib_query.c
@@ -377,7 +377,10 @@ uint64_t BKE_library_id_can_use_filter_id(const ID *id_owner)
     return FILTER_ID_ALL;
   }
 
-  if (ntreeFromID(id_owner)) {
+  /* Casting to non const.
+   * TODO(jbakker): We should introduce a ntree_id_has_tree function as we are actually not
+   * interested in the result. */
+  if (ntreeFromID((ID *)id_owner)) {
     return FILTER_ID_ALL;
   }
 
@@ -453,7 +456,7 @@ uint64_t BKE_library_id_can_use_filter_id(const ID *id_owner)
     case ID_SIM:
       return FILTER_ID_OB | FILTER_ID_IM;
     case ID_WM:
-      return FILTER_ID_SCE, FILTER_ID_WS;
+      return FILTER_ID_SCE | FILTER_ID_WS;
     case ID_IM:
     case ID_VF:
     case ID_TXT:



More information about the Bf-blender-cvs mailing list