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:
authorCampbell Barton <campbell@blender.org>2022-09-25 10:04:52 +0300
committerCampbell Barton <campbell@blender.org>2022-09-25 11:26:27 +0300
commit891949cbb47143420f4324cb60efc05ef5d70b39 (patch)
treefe70a45612ae96f9ce1f37378ef5ff035d3127f5 /source/blender/depsgraph
parentc9e35c2ced92082c86f1ecb9ecd16c6230218c7c (diff)
Cleanup: use 'u' prefixed integer types for brevity & cast style
To use function style cast '(unsigned char)x' can't be replaced by 'unsigned char(x)'.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_physics.cc10
-rw-r--r--source/blender/depsgraph/intern/depsgraph_tag.cc22
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_flush.cc2
3 files changed, 16 insertions, 18 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_physics.cc b/source/blender/depsgraph/intern/depsgraph_physics.cc
index cf5cccac580..d7d03ec3261 100644
--- a/source/blender/depsgraph/intern/depsgraph_physics.cc
+++ b/source/blender/depsgraph/intern/depsgraph_physics.cc
@@ -32,7 +32,7 @@ namespace deg = blender::deg;
/*************************** Evaluation Query API *****************************/
-static ePhysicsRelationType modifier_to_relation_type(unsigned int modifier_type)
+static ePhysicsRelationType modifier_to_relation_type(uint modifier_type)
{
switch (modifier_type) {
case eModifierType_Collision:
@@ -72,7 +72,7 @@ ListBase *DEG_get_effector_relations(const Depsgraph *graph, Collection *collect
ListBase *DEG_get_collision_relations(const Depsgraph *graph,
Collection *collection,
- unsigned int modifier_type)
+ uint modifier_type)
{
const deg::Depsgraph *deg_graph = reinterpret_cast<const deg::Depsgraph *>(graph);
const ePhysicsRelationType type = modifier_to_relation_type(modifier_type);
@@ -91,7 +91,7 @@ ListBase *DEG_get_collision_relations(const Depsgraph *graph,
void DEG_add_collision_relations(DepsNodeHandle *handle,
Object *object,
Collection *collection,
- unsigned int modifier_type,
+ uint modifier_type,
DEG_CollobjFilterFunction filter_function,
const char *name)
{
@@ -178,9 +178,7 @@ ListBase *build_effector_relations(Depsgraph *graph, Collection *collection)
});
}
-ListBase *build_collision_relations(Depsgraph *graph,
- Collection *collection,
- unsigned int modifier_type)
+ListBase *build_collision_relations(Depsgraph *graph, Collection *collection, uint modifier_type)
{
const ePhysicsRelationType type = modifier_to_relation_type(modifier_type);
Map<const ID *, ListBase *> *hash = graph->physics_relations[type];
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index cc742b98866..0c003cf23b2 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -235,7 +235,7 @@ void depsgraph_tag_to_component_opcode(const ID *id,
}
void id_tag_update_ntree_special(
- Main *bmain, Depsgraph *graph, ID *id, unsigned int flags, eUpdateSource update_source)
+ Main *bmain, Depsgraph *graph, ID *id, uint flags, eUpdateSource update_source)
{
bNodeTree *ntree = ntreeFromID(id);
if (ntree == nullptr) {
@@ -418,13 +418,13 @@ string stringify_append_bit(const string &str, IDRecalcFlag tag)
return result;
}
-string stringify_update_bitfield(unsigned int flags)
+string stringify_update_bitfield(uint flags)
{
if (flags == 0) {
return "LEGACY_0";
}
string result;
- unsigned int current_flag = flags;
+ uint current_flag = flags;
/* Special cases to avoid ALL flags form being split into
* individual bits. */
if ((current_flag & ID_RECALC_PSYS_ALL) == ID_RECALC_PSYS_ALL) {
@@ -460,7 +460,7 @@ int deg_recalc_flags_for_legacy_zero()
ID_RECALC_SOURCE | ID_RECALC_EDITORS);
}
-int deg_recalc_flags_effective(Depsgraph *graph, unsigned int flags)
+int deg_recalc_flags_effective(Depsgraph *graph, uint flags)
{
if (graph != nullptr) {
if (!graph->is_active) {
@@ -531,7 +531,7 @@ void graph_tag_ids_for_visible_update(Depsgraph *graph)
* No need bother with it to tag or anything. */
continue;
}
- unsigned int flags = 0;
+ uint flags = 0;
if (!deg::deg_copy_on_write_is_expanded(id_node->id_cow)) {
flags |= ID_RECALC_COPY_ON_WRITE;
if (do_time) {
@@ -625,7 +625,7 @@ NodeType geometry_tag_to_component(const ID *id)
return NodeType::UNDEFINED;
}
-void id_tag_update(Main *bmain, ID *id, unsigned int flags, eUpdateSource update_source)
+void id_tag_update(Main *bmain, ID *id, uint flags, eUpdateSource update_source)
{
graph_id_tag_update(bmain, nullptr, id, flags, update_source);
for (deg::Depsgraph *depsgraph : deg::get_all_registered_graphs(bmain)) {
@@ -638,7 +638,7 @@ void id_tag_update(Main *bmain, ID *id, unsigned int flags, eUpdateSource update
}
void graph_id_tag_update(
- Main *bmain, Depsgraph *graph, ID *id, unsigned int flags, eUpdateSource update_source)
+ Main *bmain, Depsgraph *graph, ID *id, uint flags, eUpdateSource update_source)
{
const int debug_flags = (graph != nullptr) ? DEG_debug_flags_get((::Depsgraph *)graph) : G.debug;
if (graph != nullptr && graph->is_evaluating) {
@@ -676,7 +676,7 @@ void graph_id_tag_update(
if (update_source == DEG_UPDATE_SOURCE_USER_EDIT) {
id->recalc |= deg_recalc_flags_effective(graph, flags);
}
- unsigned int current_flag = flags;
+ uint current_flag = flags;
while (current_flag != 0) {
IDRecalcFlag tag = (IDRecalcFlag)(1 << bitscan_forward_clear_uint(&current_flag));
graph_id_tag_update_single_flag(bmain, graph, id, id_node, tag, update_source);
@@ -770,12 +770,12 @@ const char *DEG_update_tag_as_string(IDRecalcFlag flag)
/* Data-Based Tagging. */
-void DEG_id_tag_update(ID *id, unsigned int flags)
+void DEG_id_tag_update(ID *id, uint flags)
{
DEG_id_tag_update_ex(G.main, id, flags);
}
-void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
+void DEG_id_tag_update_ex(Main *bmain, ID *id, uint flags)
{
if (id == nullptr) {
/* Ideally should not happen, but old depsgraph allowed this. */
@@ -787,7 +787,7 @@ void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
void DEG_graph_id_tag_update(struct Main *bmain,
struct Depsgraph *depsgraph,
struct ID *id,
- unsigned int flags)
+ uint flags)
{
deg::Depsgraph *graph = (deg::Depsgraph *)depsgraph;
deg::graph_id_tag_update(bmain, graph, id, flags, deg::DEG_UPDATE_SOURCE_USER_EDIT);
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
index 09981eb32c5..08ce7bed83b 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
@@ -235,7 +235,7 @@ void flush_editors_id_update(Depsgraph *graph, const DEGEditorUpdateContext *upd
EVAL,
"Accumulated recalc bits for %s: %u\n",
id_orig->name,
- (unsigned int)id_cow->recalc);
+ (uint)id_cow->recalc);
/* Inform editors. Only if the data-block is being evaluated a second
* time, to distinguish between user edits and initial evaluation when