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 11:33:28 +0300
committerCampbell Barton <campbell@blender.org>2022-09-25 13:17:08 +0300
commitf68cfd6bb078482c4a779a6e26a56e2734edb5b8 (patch)
tree2878e5b80dba5bdeba186d99661d604eb38879cd /source/blender/functions
parentc7b247a118e302a3afc6473797e53b6af28b69e2 (diff)
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/functions')
-rw-r--r--source/blender/functions/intern/multi_function_builder.cc2
-rw-r--r--source/blender/functions/intern/multi_function_procedure_executor.cc4
-rw-r--r--source/blender/functions/tests/FN_multi_function_test.cc2
3 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/functions/intern/multi_function_builder.cc b/source/blender/functions/intern/multi_function_builder.cc
index 020d6ba0139..f21de46b74e 100644
--- a/source/blender/functions/intern/multi_function_builder.cc
+++ b/source/blender/functions/intern/multi_function_builder.cc
@@ -42,7 +42,7 @@ void CustomMF_GenericConstant::call(IndexMask mask,
uint64_t CustomMF_GenericConstant::hash() const
{
- return type_.hash_or_fallback(value_, (uintptr_t)this);
+ return type_.hash_or_fallback(value_, uintptr_t(this));
}
bool CustomMF_GenericConstant::equals(const MultiFunction &other) const
diff --git a/source/blender/functions/intern/multi_function_procedure_executor.cc b/source/blender/functions/intern/multi_function_procedure_executor.cc
index 7d9b2fcd1f0..554395b91d7 100644
--- a/source/blender/functions/intern/multi_function_procedure_executor.cc
+++ b/source/blender/functions/intern/multi_function_procedure_executor.cc
@@ -289,7 +289,7 @@ class ValueAllocator : NonCopyable, NonMovable {
}
}
- Stack<VariableValue *> &stack = variable_value_free_lists_[(int)value->type];
+ Stack<VariableValue *> &stack = variable_value_free_lists_[int(value->type)];
stack.push(value);
}
@@ -297,7 +297,7 @@ class ValueAllocator : NonCopyable, NonMovable {
template<typename T, typename... Args> T *obtain(Args &&...args)
{
static_assert(std::is_base_of_v<VariableValue, T>);
- Stack<VariableValue *> &stack = variable_value_free_lists_[(int)T::static_type];
+ Stack<VariableValue *> &stack = variable_value_free_lists_[int(T::static_type)];
if (stack.is_empty()) {
void *buffer = linear_allocator_.allocate(sizeof(T), alignof(T));
return new (buffer) T(std::forward<Args>(args)...);
diff --git a/source/blender/functions/tests/FN_multi_function_test.cc b/source/blender/functions/tests/FN_multi_function_test.cc
index 577b09cb014..c82cde2abce 100644
--- a/source/blender/functions/tests/FN_multi_function_test.cc
+++ b/source/blender/functions/tests/FN_multi_function_test.cc
@@ -198,7 +198,7 @@ TEST(multi_function, CustomMF_SI_SI_SI_SO)
{
CustomMF_SI_SI_SI_SO<int, std::string, bool, uint> fn{
"custom",
- [](int a, const std::string &b, bool c) { return (uint)((uint)a + b.size() + (uint)c); }};
+ [](int a, const std::string &b, bool c) { return uint(uint(a) + b.size() + uint(c)); }};
Array<int> values_a = {5, 7, 3, 8};
Array<std::string> values_b = {"hello", "world", "another", "test"};