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.
This commit is contained in:
2022-09-25 17:39:45 +02:00
parent 0419ee871f
commit c6e70e7bac
77 changed files with 247 additions and 275 deletions

View File

@@ -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;
}