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>2020-07-20 13:16:20 +0300
committerJacques Lucke <jacques@blender.org>2020-07-20 13:16:20 +0300
commit8cbbdedaf4dfec9e320e7e2be58b75d256950df1 (patch)
tree496b9620e11ac44e515b0bb4ca52c05834d557f9 /source/blender/functions/intern/multi_function_builder.cc
parent686ab4c9401a90b22fb17e46c992eb513fe4f693 (diff)
Refactor: Update integer type usage
This updates the usage of integer types in code I wrote according to our new style guides. Major changes: * Use signed instead of unsigned integers in many places. * C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`). * Hash values for C++ containers are 64 bit wide now (instead of 32 bit). I do hope that I broke no builds, but it is quite likely that some compiler reports slightly different errors. Please let me know when there are any errors. If the fix is small, feel free to commit it yourself. I compiled successfully on linux with gcc and on windows.
Diffstat (limited to 'source/blender/functions/intern/multi_function_builder.cc')
-rw-r--r--source/blender/functions/intern/multi_function_builder.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/functions/intern/multi_function_builder.cc b/source/blender/functions/intern/multi_function_builder.cc
index 7797c19d563..06084247e66 100644
--- a/source/blender/functions/intern/multi_function_builder.cc
+++ b/source/blender/functions/intern/multi_function_builder.cc
@@ -37,7 +37,7 @@ void CustomMF_GenericConstant::call(IndexMask mask,
type_.fill_uninitialized_indices(value_, output.buffer(), mask);
}
-uint CustomMF_GenericConstant::hash() const
+uint64_t CustomMF_GenericConstant::hash() const
{
return type_.hash(value_);
}
@@ -58,8 +58,8 @@ static std::string gspan_to_string(GSpan array)
{
std::stringstream ss;
ss << "[";
- uint max_amount = 5;
- for (uint i : IndexRange(std::min(max_amount, array.size()))) {
+ const int64_t max_amount = 5;
+ for (int64_t i : IndexRange(std::min(max_amount, array.size()))) {
array.type().debug_print(array[i], ss);
ss << ", ";
}
@@ -82,7 +82,7 @@ void CustomMF_GenericConstantArray::call(IndexMask mask,
MFContext UNUSED(context)) const
{
GVectorArray &vectors = params.vector_output(0);
- for (uint i : mask) {
+ for (int64_t i : mask) {
vectors.extend(i, array_);
}
}
@@ -102,7 +102,7 @@ CustomMF_DefaultOutput::CustomMF_DefaultOutput(StringRef name,
}
void CustomMF_DefaultOutput::call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const
{
- for (uint param_index : this->param_indices()) {
+ for (int param_index : this->param_indices()) {
MFParamType param_type = this->param_type(param_index);
if (!param_type.is_output()) {
continue;