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:
authorJacques Lucke <jacques@blender.org>2022-09-25 18:39:45 +0300
committerJacques Lucke <jacques@blender.org>2022-09-25 18:39:45 +0300
commitc6e70e7bacf82b38ca7125d6821713a711489c0b (patch)
tree3679590f6254b7fbbd6623080edafe217f20c7b6 /source/blender/functions
parent0419ee871ff960f62e28a2a9fed764f66c616d71 (diff)
Cleanup: follow C++ type cast style guide in some files
https://wiki.blender.org/wiki/Style_Guide/C_Cpp#C.2B.2B_Type_Cast This was discussed in https://devtalk.blender.org/t/rfc-style-guide-for-type-casts-in-c-code/25907.
Diffstat (limited to 'source/blender/functions')
-rw-r--r--source/blender/functions/intern/field.cc2
-rw-r--r--source/blender/functions/intern/multi_function_builder.cc4
-rw-r--r--source/blender/functions/intern/multi_function_procedure_executor.cc9
3 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/functions/intern/field.cc b/source/blender/functions/intern/field.cc
index 8fb56d7aa11..dca12859b72 100644
--- a/source/blender/functions/intern/field.cc
+++ b/source/blender/functions/intern/field.cc
@@ -744,7 +744,7 @@ int FieldEvaluator::add(GField field, GVArray *varray_ptr)
dst_varrays_.append(nullptr);
output_pointer_infos_.append(OutputPointerInfo{
varray_ptr, [](void *dst, const GVArray &varray, ResourceScope &UNUSED(scope)) {
- *(GVArray *)dst = varray;
+ *static_cast<GVArray *>(dst) = varray;
}});
return field_index;
}
diff --git a/source/blender/functions/intern/multi_function_builder.cc b/source/blender/functions/intern/multi_function_builder.cc
index f21de46b74e..8a09ed37e19 100644
--- a/source/blender/functions/intern/multi_function_builder.cc
+++ b/source/blender/functions/intern/multi_function_builder.cc
@@ -27,8 +27,8 @@ CustomMF_GenericConstant::CustomMF_GenericConstant(const CPPType &type,
CustomMF_GenericConstant::~CustomMF_GenericConstant()
{
if (owns_value_) {
- signature_.param_types[0].data_type().single_type().destruct((void *)value_);
- MEM_freeN((void *)value_);
+ signature_.param_types[0].data_type().single_type().destruct(const_cast<void *>(value_));
+ MEM_freeN(const_cast<void *>(value_));
}
}
diff --git a/source/blender/functions/intern/multi_function_procedure_executor.cc b/source/blender/functions/intern/multi_function_procedure_executor.cc
index 554395b91d7..4fe3c27ea27 100644
--- a/source/blender/functions/intern/multi_function_procedure_executor.cc
+++ b/source/blender/functions/intern/multi_function_procedure_executor.cc
@@ -449,7 +449,7 @@ class VariableState : NonCopyable, NonMovable {
}
else {
new_value = value_allocator.obtain_GVectorArray_not_owned(
- *(GVectorArray *)caller_provided_storage_);
+ *static_cast<GVectorArray *>(caller_provided_storage_));
}
if (value_ != nullptr) {
if (value_->type == ValueType::GVVectorArray) {
@@ -780,8 +780,9 @@ class VariableState : NonCopyable, NonMovable {
break;
}
case ValueType::Span: {
- const Span<bool> span((bool *)this->value_as<VariableValue_Span>()->data,
- mask.min_array_size());
+ const Span<bool> span(
+ static_cast<const bool *>(this->value_as<VariableValue_Span>()->data),
+ mask.min_array_size());
for (const int i : mask) {
r_indices[span[i]].append(i);
}
@@ -790,7 +791,7 @@ class VariableState : NonCopyable, NonMovable {
case ValueType::OneSingle: {
auto *value_typed = this->value_as<VariableValue_OneSingle>();
BLI_assert(value_typed->is_initialized);
- const bool condition = *(bool *)value_typed->data;
+ const bool condition = *static_cast<const bool *>(value_typed->data);
r_indices[condition].extend(mask);
break;
}