[Bf-blender-cvs] [21ef8c4d44f] master: Cleanup: use const args for depsgraph functions

Campbell Barton noreply at git.blender.org
Wed Apr 29 04:37:01 CEST 2020


Commit: 21ef8c4d44f4a533d20611556adbf8750e3cf849
Author: Campbell Barton
Date:   Wed Apr 29 12:36:33 2020 +1000
Branches: master
https://developer.blender.org/rB21ef8c4d44f4a533d20611556adbf8750e3cf849

Cleanup: use const args for depsgraph functions

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

M	source/blender/depsgraph/DEG_depsgraph.h
M	source/blender/depsgraph/DEG_depsgraph_query.h
M	source/blender/depsgraph/intern/depsgraph.cc
M	source/blender/depsgraph/intern/depsgraph_query.cc

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

diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index c94a8876ab0..d735d3b89bc 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -184,7 +184,7 @@ void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSce
 
 /* Evaluation  ----------------------------------- */
 
-bool DEG_is_evaluating(struct Depsgraph *depsgraph);
+bool DEG_is_evaluating(const struct Depsgraph *depsgraph);
 
 bool DEG_is_active(const struct Depsgraph *depsgraph);
 void DEG_make_active(struct Depsgraph *depsgraph);
diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h b/source/blender/depsgraph/DEG_depsgraph_query.h
index 26b46376a0a..3d570536223 100644
--- a/source/blender/depsgraph/DEG_depsgraph_query.h
+++ b/source/blender/depsgraph/DEG_depsgraph_query.h
@@ -111,14 +111,14 @@ struct ID *DEG_get_original_id(struct ID *id);
  *
  * Original IDs are considered all the IDs which are not covered by copy-on-write system and are
  * not out-of-main localized data-blocks. */
-bool DEG_is_original_id(struct ID *id);
-bool DEG_is_original_object(struct Object *object);
+bool DEG_is_original_id(const struct ID *id);
+bool DEG_is_original_object(const struct Object *object);
 
 /* Opposite of the above.
  *
  * If the data-block is not original it must be evaluated, and vice versa. */
-bool DEG_is_evaluated_id(struct ID *id);
-bool DEG_is_evaluated_object(struct Object *object);
+bool DEG_is_evaluated_id(const struct ID *id);
+bool DEG_is_evaluated_object(const struct Object *object);
 
 /* Check whether depsgraph os fully evaluated. This includes the following checks:
  * - Relations are up-to-date.
diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc
index 5a92b801a86..faf375155b5 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -309,9 +309,9 @@ void DEG_graph_free(Depsgraph *graph)
   OBJECT_GUARDED_DELETE(deg_depsgraph, Depsgraph);
 }
 
-bool DEG_is_evaluating(struct Depsgraph *depsgraph)
+bool DEG_is_evaluating(const struct Depsgraph *depsgraph)
 {
-  DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(depsgraph);
+  const DEG::Depsgraph *deg_graph = reinterpret_cast<const DEG::Depsgraph *>(depsgraph);
   return deg_graph->is_evaluating;
 }
 
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc
index e3bef252da1..b64b6c0e715 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -270,7 +270,7 @@ ID *DEG_get_original_id(ID *id)
   return (ID *)id->orig_id;
 }
 
-bool DEG_is_original_id(ID *id)
+bool DEG_is_original_id(const ID *id)
 {
   /* Some explanation of the logic.
    *
@@ -295,17 +295,17 @@ bool DEG_is_original_id(ID *id)
   return true;
 }
 
-bool DEG_is_original_object(Object *object)
+bool DEG_is_original_object(const Object *object)
 {
   return DEG_is_original_id(&object->id);
 }
 
-bool DEG_is_evaluated_id(ID *id)
+bool DEG_is_evaluated_id(const ID *id)
 {
   return !DEG_is_original_id(id);
 }
 
-bool DEG_is_evaluated_object(Object *object)
+bool DEG_is_evaluated_object(const Object *object)
 {
   return !DEG_is_original_object(object);
 }



More information about the Bf-blender-cvs mailing list